AKSW / Xturtle

An eclipse editor for turtle files (RDF serialisation) based on Xtext2
http://aksw.org/Projects/Xturtle
23 stars 9 forks source link

Literal value validation #25

Closed seebi closed 11 years ago

seebi commented 11 years ago

Depending on the xsd datatype which is chosen for a literal, a value is valid or not. It would be great to have a validation of Literal values depending on this assertion.

"-10" # -> valid
"-10"^^xsd:string # -> valid
"-10"^^xsd:integer # -> valid
"-10"^^xsd:nonNegativeInteger # -> not valid
nittka commented 11 years ago

see also http://www.w3.org/TR/2001/REC-xmlschema-2-20010502

simple validation implemented for normalizedString, boolean, decimal, float, double, integer, positiveInteger, nonPositiveInteger, negativeInteger, nonNegativeInteger, long, int, short, byte, unsignedLong, unsignedInt, unsignedShort, unsignedByte, dateTime, time, date, gYearMonth, gYear, gMonthDay, gDay, hexBinary, base64Binary

no validation implemented for string, token, language, anyURI

For validation not meeting the expectation, open an issue with examples (that can be used in unit tests).

seebi commented 11 years ago

sounds awesome :)

can you push your changes please? (maybe including a zip in the repo branch)