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

Superfluous validation error when target node doesn't exist in data graph #66

Closed ivan-kovatchev closed 2 years ago

ivan-kovatchev commented 3 years ago

What's the issue?

A violation is raised when a node that doesn't exist in the data graph is used as an object of sh:targetNode.

What's expected?

I expected the validation report to conform, as the target node doesn't exist in the data graph. This is based off this part of the SHACL spec:

RDF terms produced by targets are not required to exist as nodes in the data graph.

Playground example

In my first example id:c exists as a node in the data graph, while in the second one id:d doesn't.