Inferring knowledge in OWL by counting properties

2019-03-06 09:34发布

问题:

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 )
] .