Suppose I have a class ( cls), an object property ( has_part), and an individual ( ind). An individual is rdf: type'd to be (in manchester syntax) (has_part only cls). Basically, a person is said to be introduced as an anonymous class that has a part cls.
Using stardog as a triple store, how would I write a query that pulled all the faces that are of type (has_part only cls)?
Using OWLIM as a triple store, I was able to write the following:
select ?ind where {
?ind rdf:type ?restriction .
?restriction owl:onProperty has_part .
?restriction owl:allValuesFrom cls
}
This does not work in Stardog, as far as I can tell, no matter what level of reasoning I use. What should this query look like?
Thanks!
EDIT 1
, . , , (clsa and (has_part only clsb)), ?
select ?ind where {
?ind rdf:type ?restriction .
?restriction owl:onProperty has_part .
?restriction owl:allValuesFrom clsB
}
, , , .
2
. , , .
, OWLIM, Stardog. OWLIM . , , , (clsa and (has_part only clsb)), ind , clsa (has_part only clsb). Stardog , , ind (has_part only clsb), , ( ) Stardog , .
Stardog
select ?ind where {
?ind rdf:type ?anon.
?anon owl:intersectionOf ?a .
?a rdf:first clsa .
?a rdf:rest ?b .
?b rdf:first ?restriction .
?b rdf:rest rdf:nil .
?restriction owl:onProperty has_part .
?restriction owl:allValuesFrom clsB
}
, , , , , , clsa, (has_part only clsb), , , , .
Joshua , . ( SPARQL, .)
!
3
:
select ?ind where {
?ind rdf:type [
owl:intersectionOf [
rdf:first clsa ;
rdf:rest [
rdf:rest rdf:nil ;
rdf:first [
owl:onProperty has_part ;
owl:allValuesFrom clsB ;
] ;
] ;
] ;
] ;
}