- From: Holger Knublauch <holger@topquadrant.com>
- Date: Fri, 7 Jan 2022 09:30:39 +1000
- To: public-shacl@w3.org
- Message-ID: <69010b7b-df1e-101c-9767-660d74506663@topquadrant.com>
Here is my implementation of Shape.getTargetNodes()
public Set<RDFNode> getTargetNodes(Dataset dataset) {
Set<RDFNode> results = new HashSet<>();
for(Target target : targets) {
target.addTargetNodes(dataset, results);
}
return results;
}
So, it's using a Set which means each target node will only be validated
once even if in multiple targets at the same shape.
I believe this is following the intention of the spec. Does any
implementer here disagree?
Holger
On 2022-01-07 4:58 am, Vladimir Alexiev wrote:
> https://www.w3.org/TR/shacl/#targets: "union of terms produced by the
> individual targets that are declared by the shape".
>
> Say I have a shape with the following targeting:
>
> sh:targetClass :Foo;
> sh:targetSubjectsOf :bar, :baz;
> sh:targetObjectsOf :blor;
>
> Say a node matches all of these conditions:
> will it be selected for validation once and not 4 times?
>
> I.e., is the "union of terms" supposed to be DISTINCT?
> (Union in mathematics is distinct, but not in SPARQL)
>
> --
> Vladimir Alexiev, PhD, PMP
> Chief Data Architect
> Sirma AI, trading as Ontotext: https://www.ontotext.com, LinkedIn
> <https://www.linkedin.com/company-beta/208070>,Twitter
> <https://twitter.com/ontotext>,Rate GraphDB
> <http://www.capterra.com/database-management-software/reviews/157533/Graph%20DB/Ontotext/new>
> Email: vladimir.alexiev@ontotext.com, skype:valexiev1
> Mobile: +359 888 568 132, SMS: 359888568132@sms.mtel.net
> Calendar:
> https://www.google.com/calendar/embed?src=vladimir.alexiev@ontotext.com
> Publications and CV: https://github.com/VladimirAlexiev/my
Received on Thursday, 6 January 2022 23:30:57 UTC