我正在尝试组建一个小型本体(类HP,类HEWLETT_PACKARD通过对称属性链接在一起)。猫头鹰在下面。我想要做的是在Protege中查询“equal_symmetric only hp”或“equal_symmetric only hewlett_packard”并获得对方公司。基本上我想获得每个公司名称的同义词。
<owl:ObjectProperty rdf:about="ontologies/2014/1/untitled-ontology-2#equal_symmetric">
<rdf:type rdf:resource="&owl;SymmetricProperty"/>
</owl:ObjectProperty>
<owl:Class rdf:about="ontologies/2014/1/untitled-ontology-2#hewlett_packard">
<owl:equivalentClass>
<owl:Restriction>
<owl:onProperty rdf:resource="ontologies/2014/1/untitled-ontology-2#equal_symmetric"/>
<owl:allValuesFrom rdf:resource="ontologies/2014/1/untitled-ontology-2#hp"/>
</owl:Restriction>
</owl:equivalentClass>
</owl:Class>
<owl:Class rdf:about="ontologies/2014/1/untitled-ontology-2#hp">
<rdfs:subClassOf rdf:resource="ontologies/2014/1/untitled-ontology-2#brand"/>
</owl:Class>
答案 0 :(得分:3)
如果你有两个课程并且你试图说它们是相同的,那么你应该只使用一个等价的类公理。在Protégé和RDF / XML中,它看起来像这样:
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://stackoverflow.com/q/22047101/1281433/ontology#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
<owl:Ontology rdf:about="http://stackoverflow.com/q/22047101/1281433/ontology"/>
<owl:Class rdf:about="http://stackoverflow.com/q/22047101/1281433/ontology#HEWLETT_PACKARD">
<owl:equivalentClass>
<owl:Class rdf:about="http://stackoverflow.com/q/22047101/1281433/ontology#HP"/>
</owl:equivalentClass>
</owl:Class>
</rdf:RDF>
如果使用DL查询,则可以看到等效的类: