Improved double check
This commit is contained in:
parent
8e3a95a0c3
commit
9eef604748
|
@ -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, '.');
|
||||
}
|
||||
|
|
30
package.json
30
package.json
|
@ -1,15 +1,29 @@
|
|||
{
|
||||
"name": “TurtleValidator",
|
||||
"name": "turtle-validator",
|
||||
"version": "0.1.0",
|
||||
"license": "",
|
||||
"bin": {
|
||||
"genmem": "./bin/TurtleValidator"
|
||||
},
|
||||
"description": "This command line tool validates Turtle documents and does XSD datatype checks",
|
||||
"main": "TurtleValidator.js",
|
||||
"dependencies": {
|
||||
"n3": "*"
|
||||
"n3": "~0.2.6"
|
||||
},
|
||||
"devDependencies": {},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/mmlab/N3Validator.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"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue