Hi,
I am trying to customize a SWP script for the first time (7.2.4) and I am struggling a little bit.
We have an existing script that does almost exactly what I want based on this:
SELECT DISTINCT ?a ?b ?c
WHERE { ?a ?b c?.
?b a <URI_of_class> .
}.
So a function is called if ?b is a specific class (specified by it's URI)
I wanted to change this so it uses that class' children instead of the class itself and found rdfs:subClassOf.
I tried the following versions, none of which work.
A)
SELECT DISTINCT ?a ?b ?c
WHERE { ?a ?b c?.
?b rdfs:subClassOf <URI_of_class> .
}.
B)
SELECT DISTINCT ?a ?b ?c
WHERE { ?a ?b c?.
?b (rdfs:subClassOf)* <URI_of_class> .
}.
C)
SELECT DISTINCT ?a ?b ?c
WHERE { ?a ?b c?.
?b (rdfs:subClassOf)+ <URI_of_class> .
}.
I double checked if rdfs:subClassOf (including * and +) works on its own using a SPARQL endpoint and it gives me the expected instances.
I am guessing I still simply use the wrong syntax for swp scripts or don't understand what rdfs:subClassOf actually means.
Any advice?
Cheers
Julia