eclipse-rdf4j / rdf4j

Eclipse RDF4J: scalable RDF for Java
https://rdf4j.org/
BSD 3-Clause "New" or "Revised" License
357 stars 162 forks source link

ShaclSail should not split shapes by their targets #3584

Open hmottestad opened 2 years ago

hmottestad commented 2 years ago

Current Behavior

We split shapes by both target and constraint component. We should only split per constraint component because the specification says that we should consider the set of all nodes that match the targets of a shape.

We should also double check what happens if we have multiple target class declarations where a node matches more than one. Do we then produce more than one validation result for that node?

Even though the specification says that we should consider the set of nodes, we can instead consider the bag of nodes and then dedupe validation results instead. However, this might not work correctly for things like sh:or and sh:not. Worth investigating.

Expected Behavior

-

Steps To Reproduce

No response

Version

all

Are you interested in contributing a solution yourself?

Yes

Anything else?

No response

VladimirAlexiev commented 2 years ago

Related to https://github.com/w3c/data-shapes/issues/143 that gives example of the same node selected multiple times as target of the same shape

So it's a tradeoff (pro: distinct union of targets; cons: split targets and process independently):