The current Rules draft appears to limit Path expressions to those with fixed length, but zero-or-more is not supported.
I wonder how we can then match all instances of a given class and its subclasses, which is usually done using
SELECT ?instance
WHERE {
?instance rdf:type/rdfs:subClassOf* ex:SomeClass .
}
Among other use cases, this is important for scenarios where a property is not sufficient to distinguish class membership. For example, when you want to define a rule on rdfs:label that only applies to instances of some class but not all (although rdfs:label is used everywhere).
This topic also relates to #765.
Maybe there is a need for a construct such as INSTANCEOF, which would address the a/rdfs:subClassOf* use case at least?
RULE { ... }
WHERE {
?instance INSTANCEOF ex:SomeClass .
?instance rdfs:label ?label .
...
}
Other usages of zero-or-more-paths exist are probably less critical than getting the instances.
(FWIW I think something like INSTANCEOF would be nice in SPARQL in general).
The current Rules draft appears to limit Path expressions to those with fixed length, but zero-or-more is not supported.
I wonder how we can then match all instances of a given class and its subclasses, which is usually done using
Among other use cases, this is important for scenarios where a property is not sufficient to distinguish class membership. For example, when you want to define a rule on
rdfs:labelthat only applies to instances of some class but not all (although rdfs:label is used everywhere).This topic also relates to #765.
Maybe there is a need for a construct such as INSTANCEOF, which would address the a/rdfs:subClassOf* use case at least?
Other usages of zero-or-more-paths exist are probably less critical than getting the instances.
(FWIW I think something like INSTANCEOF would be nice in SPARQL in general).