I specified an "isPartOf" object property in Protege, and I asserted that
"Room_1 isPartOf Apartment_1".
Both "Room_1" and "Apartment_1" are individuals. The relevant codes in the OWL file are like the following:
<rdf:RDF xmlns="http://www.xxx.come/example#"
xml:base="http://www.xxx.come/example"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
<!-- http://www.xxx.come/example#isPartOf -->
<owl:ObjectProperty rdf:about="http://www.xxx.come/example#isTemporalPartOf">
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#AsymmetricProperty"/>
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#TransitiveProperty"/>
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ReflexiveProperty"/>
<rdfs:domain rdf:resource="http://www.xxx.come/example#Room"/>
<rdfs:range rdf:resource="http://www.xxx.come/example#Apartment"/>
</owl:ObjectProperty>
<!-- http://www.xxx.come/example#Room_1 -->
<owl:NamedIndividual rdf:about="http://www.xxx.come/example#Room_1">
<rdf:type rdf:resource="http://www.xxx.come/example#Room"/>
<isPartOf rdf:resource="http://http://www.xxx.come/example#Apartment_1"/>
<hasSize rdf:datatype="http://www.w3.org/2001/XMLSchema#double">99.6</hasSize>
<hasSize rdf:datatype="http://www.w3.org/2001/XMLSchema#double">145.5</hasSize>
</owl:NamedIndividual>
</rdf:RDF>
How would you query such a triple using Prolog? I thought it would be something like:
is_part_of(Ind1, Ind2):-
rdf(Ind1,
"http://www.w3.org/1999/02/22-rdf-syntax-ns#isPartOf,
Ind2).
which apparently doesn't work.
I also saw rdf_has(S,P,O,RealP)
from rdf library that looks kindof usable, but the specification is vague.
Following this question, what if the two individuals are classes? What if the object property is a datatype property instead?
I think I'm stuck on an easy problem, but I've searched a long time for an example or similar question but didn't find anything.
Thanks in advance!