diff --git a/TurtleValidator.js b/TurtleValidator.js index 6b96621..9d51218 100644 --- a/TurtleValidator.js +++ b/TurtleValidator.js @@ -29,13 +29,13 @@ parser.parse(turtleStream, function (error, triple, prefixes){ switch(type) { case 'float': case 'double': - if (!value.match(/[-+]?\d*[.]\d+/)){ + if (!(/[-+]?\d*[.]\d+/.test(value))){ console.log('WARNING: datatype does not validate for value ' + value); console.log(triple.subject, triple.predicate, triple.object, '.'); } break; case 'int': - if (!value.match(/[-+]?\d*/)){ + if (!(/^\+?(0|[1-9]\d*)$/.test(value))){ console.log('WARNING: int does not validate for value ' + value); console.log(triple.subject, triple.predicate, triple.object, '.'); } diff --git a/package.json b/package.json index 198fca0..1581d1a 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,29 @@ { - "name": “TurtleValidator", - "version": "0.1.0", - "license": "", - "bin": { - "genmem": "./bin/TurtleValidator" - }, - "dependencies": { - "n3": "*" - }, - "repository": { - "type": "git", - "url": "https://github.com/mmlab/N3Validator.git" - } + "name": "turtle-validator", + "version": "0.1.0", + "description": "This command line tool validates Turtle documents and does XSD datatype checks", + "main": "TurtleValidator.js", + "dependencies": { + "n3": "~0.2.6" + }, + "devDependencies": {}, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git://github.com/mmlab/TurtleValidator.git" + }, + "keywords": [ + "Turtle", + "RDF", + "Semantic", + "Web" + ], + "author": "Miel Vander Sande", + "license": "MIT", + "bugs": { + "url": "https://github.com/mmlab/TurtleValidator/issues" + }, + "homepage": "https://github.com/mmlab/TurtleValidator" }