From what I can tell so far, "exclude" and subqueries will allow you to perform set difference operations, whether it's clear is another problem. Similarly, you can do OPTIONAL queries using only subqueries but once you get to a few layers of subqueries your head explodes. In these cases it's probably better to have syntactic sugar for certain operations - how users express something and what the machinery underneath does to perform it shouldn't be so tightly coupled.
I made a mistake for the allValuesFrom restriction, here's the corrected version:
select $s $p $x subquery (
select $instance $t $x subquery (
select
from <...#testexclude>
where exclude($instance $t $x))
from <...#testexclude>
where $s $p $instance and $t <tucana:#is> <rdf:type>
and exclude($instance $t $x))
from <...#testexclude>
where $r <rdf:type> <owl:Restriction>
and $r <owl:onProperty> $p
and $r <owl:allValuesFrom> $x
and $s $p $o2
order by $s ;
I also recently read a paper, "OWL Lite- Reasoning with Rules", which clears up the difference between range and allValuesFrom: "[it] takes into account not only the property but also the domain of the statement. For example, you can say that Stefan manages Wolf, and Wolf is of type Student entails that Stefan is of class Advisor." That's also missing from the query but that's an intentional omission. :-)
No comments:
Post a Comment