zazuko / rdf-validate-shacl

Validate RDF data purely in JavaScript. An implementation of the W3C SHACL specification on top of the RDFJS stack.
MIT License
98 stars 13 forks source link

Wrong pair constraint comparison using lessThan / lessThanOrEquals #83

Closed Tomas2D closed 2 years ago

Tomas2D commented 2 years ago

Using property constraint validation with sh:lessThan or sh:lessThanOrEquals I get wrong result in Zazuko SHACL Plaground (https://s.zazuko.com/d56u3).

From my observation, it looks like only the first digit is being compared. For example, if the value of ex:candidates_active is 65, there is no validation error which is obviously fine, but when I change to 8 or 9, I get a validation error.

Thanks in advance.

martinmaillard commented 2 years ago

I just found this comment in the term comparison function: // TODO: Does not handle numeric or date comparison

It's been in the library from the beginning and somehow got overlooked. I'll label this issue as a bug.