我在eclipse 3.4中使用OWL Api 4.0和Protege 4中的簡單本體論。我有兩個「Ward」和「Gaurdian」類。這些類的個體通過對象屬性isWardOf關聯。我怎樣才能找回有關同一個人Gaurdian類的病房的個人。考慮如下圖所示: -使用OWL API 4.0檢索具有相同對象屬性的OWL個體
我要檢索的事實,彼得和Allice相關或兄弟姐妹,因爲它們都連接到傑克。關於如何使用OWL API 4.0來實現這個任何粗略的線索。
我的完整的貓頭鷹文件貼: -
<?xml version="1.0"?>
<!DOCTYPE Ontology [
<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
<!ENTITY xml "http://www.w3.org/XML/1998/namespace" >
<!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
<!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
]>
<Ontology xmlns="http://www.w3.org/2002/07/owl#"
xml:base="http://www.semanticweb.org/antonio/ontologies/2014/11/untitled-ontology-46"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
ontologyIRI="http://www.semanticweb.org/antonio/ontologies/2014/11/untitled-ontology-
46">
<Prefix name="rdf" IRI="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
<Prefix name="rdfs" IRI="http://www.w3.org/2000/01/rdf-schema#"/>
<Prefix name="xsd" IRI="http://www.w3.org/2001/XMLSchema#"/>
<Prefix name="owl" IRI="http://www.w3.org/2002/07/owl#"/>
<Declaration>
<Class IRI="#Gaurdian"/>
</Declaration>
<Declaration>
<Class IRI="#Ward"/>
</Declaration>
<Declaration>
<ObjectProperty IRI="#isWardOf"/>
</Declaration>
<Declaration>
<NamedIndividual IRI="#Allice"/>
</Declaration>
<Declaration>
<NamedIndividual IRI="#Amber"/>
</Declaration>
<Declaration>
<NamedIndividual IRI="#Jack"/>
</Declaration>
<Declaration>
<NamedIndividual IRI="#Paul"/>
</Declaration>
<Declaration>
<NamedIndividual IRI="#Peter"/>
</Declaration>
<ClassAssertion>
<Class IRI="#Ward"/>
<NamedIndividual IRI="#Allice"/>
</ClassAssertion>
<ClassAssertion>
<Class IRI="#Gaurdian"/>
<NamedIndividual IRI="#Amber"/>
</ClassAssertion>
<ClassAssertion>
<Class IRI="#Gaurdian"/>
<NamedIndividual IRI="#Jack"/>
</ClassAssertion>
<ClassAssertion>
<Class IRI="#Ward"/>
<NamedIndividual IRI="#Paul"/>
</ClassAssertion>
<ClassAssertion>
<Class IRI="#Ward"/>
<NamedIndividual IRI="#Peter"/>
</ClassAssertion>
<ObjectPropertyAssertion>
<ObjectProperty IRI="#isWardOf"/>
<NamedIndividual IRI="#Allice"/>
<NamedIndividual IRI="#Jack"/>
</ObjectPropertyAssertion>
<ObjectPropertyAssertion>
<ObjectProperty IRI="#isWardOf"/>
<NamedIndividual IRI="#Amber"/>
<NamedIndividual IRI="#Jack"/>
</ObjectPropertyAssertion>
<ObjectPropertyAssertion>
<ObjectProperty IRI="#isWardOf"/>
<NamedIndividual IRI="#Paul"/>
<NamedIndividual IRI="#Amber"/>
</ObjectPropertyAssertion>
<ObjectPropertyDomain>
<ObjectProperty IRI="#isWardOf"/>
<Class IRI="#Ward"/>
</ObjectPropertyDomain>
<ObjectPropertyRange>
<ObjectProperty IRI="#isWardOf"/>
<Class IRI="#Gaurdian"/>
</ObjectPropertyRange>
</Ontology> >
我已經實施了您建議的已刪除跟蹤版本。本體很大。它確實很昂貴,但因爲沒有其他建議。現在我會走這個。 – jaykio77