Inferring knowledge in OWL by counting properties

坚强是说给别人听的谎言 提交于 2019-12-02 16:29:15

问题


I have an ontology with Person and City classes. People travel to cities and this travel is represented in the traveledTo object property. I'd like to add a WorldTraveler class. People are world travelers if they have traveled to 2 or more cities. How can I do this in my ontology?

@prefix : <http://www.semanticweb.org/chris/ontologies/2017/9/untitled-ontology-64#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@base <http://www.semanticweb.org/chris/ontologies/2017/9/untitled-ontology-64> .

<http://www.semanticweb.org/chris/ontologies/2017/9/untitled-ontology-64> rdf:type owl:Ontology .

:traveledTo rdf:type owl:ObjectProperty ;
            rdfs:domain :Person ;
            rdfs:range :City .

:City rdf:type owl:Class .

:Person rdf:type owl:Class .

:Bob rdf:type owl:NamedIndividual ,
              :Person ;
     :traveledTo :London ,
                 :Ottawa ,
                 :Paris .

:Brussels rdf:type owl:NamedIndividual ,
                   :City .

:London rdf:type owl:NamedIndividual ,
                 :City .

:Ottawa rdf:type owl:NamedIndividual ,
                 :City .

:Paris rdf:type owl:NamedIndividual ,
                :City .

:Ralph rdf:type owl:NamedIndividual ,
                :Person ;
       :traveledTo :Rome .

:Rome rdf:type owl:NamedIndividual ,
               :City .

:Washington rdf:type owl:NamedIndividual ,
                     :City .

I tried adding the following Class but it didn't seem to work:

:WorldTraveler rdf:type owl:Class ;
               owl:equivalentClass [ owl:intersectionOf ( :Person
                                                          [ rdf:type owl:Restriction ;
                                                            owl:onProperty :traveledTo ;
                                                            owl:minQualifiedCardinality "2"^^xsd:nonNegativeInteger ;
                                                            owl:onClass :City
                                                          ]
                                                        ) ;
                                     rdf:type owl:Class
                                   ] .

I believe that my reasoner may not be able to infer that Ralph is not a WorldTraveler because of the open world assumption. However, it should be able to infer that Bob is a WorldTraveler because he has traveled to 3 cities.

Thanks for your help.

Chris


回答1:


In addition to the open world assumption (OWA), there exists the unique name assumption (UNA). OWL does make the former (OWA) and does not make the latter (UNA).

You should explicitely make individuals different.

In the Turtle syntax, it should look like this:

:London owl:differentFrom :Paris .

or

[ rdf:type owl:AllDifferent ;
  owl:distinctMembers ( :Brussels :London :Ottawa :Paris :Rome :Washington )
] .


来源:https://stackoverflow.com/questions/46656880/inferring-knowledge-in-owl-by-counting-properties

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!