Closed Abrom8 closed 1 year ago
Thank you for reporting.
In your case, the error is in fact correct because the value is a plain literal. The validation sh:datatype
is strict in that it requires a literal to have an exact matching datatype. Compare with other SHACL implementations, all of which yield same result.
If you need your JSON-LD to keep its idiomatic form, you can modify the @context
to have it assert the values of the content
property:
{
"@context": {
"g-framework": "http://localhost:3001/shapes/g-framework#",
"g-validation": "http://localhost:3001/shapes/validation#",
"sh": "http://www.w3.org/ns/shacl#",
- "xsd": "http://www.w3.org/2001/XMLSchema#"
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
+ "g-framework:content": {
+ "@type": "xsd:anyURI"
+ }
},
"@type": "g-framework:Service",
"g-framework:content": "http://example.org/"
}
On a related note, the actual URI is not actually validated for correctness. One might argue that it should (we do that for numeric values and dates) but none of the other implementations available on https://rdfshape.weso.es/shaclValidate do that either...
Thank you! The example with the @context
helped a lot! 👏
Properties with
sh:datatype xsd:anyURI
always produceValue does not have datatype <http://www.w3.org/2001/XMLSchema#anyURI>
error.I created a minimal example for the https://shacl-playground.zazuko.com/ playground.
Shapes Graph:
Data Graph: