What the asterisk mean in this SPARQL query?
SELECT ?uri ?type
WHERE{
?uri a ?type.
?type rdfs:subClassOf* example:Device.
}
Does it mean "subclass of a subclass"? Can I use it with other predicates?
An asterisk (*) after a path element means “zero or more of this element”.
If there are no other elements in the path, ?a something* ?b
means that ?b
might also just be ?a
directly, with no path elements between them at all.
?item wdt:P31/wdt:P279* ?class.
# means:
?item wdt:P31 ?class
# or
?item wdt:P31/wdt:P279 ?class
# or
?item wdt:P31/wdt:P279/wdt:P279 ?class
# or
?item wdt:P31/wdt:P279/wdt:P279/wdt:P279 ?class
See here for more detailed answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With