通过计算属性来推断OWL的知识 [英] Inferring knowledge in OWL by counting properties

查看:75
本文介绍了通过计算属性来推断OWL的知识的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个关于Person和City类的本体.人们前往城市旅行,并且此旅行在traveledTo对象属性中表示.我想添加一个WorldTraveler类.如果人们去过2个或更多城市,那么他们就是世界旅行者.我该如何在本体中做到这一点?

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

我认为,由于开放世界的假设,我的推理者可能无法推断拉尔夫不是世界旅行者.但是,应该可以推断出鲍勃是世界旅行者,因为他已经去过3个城市.

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.

感谢您的帮助.

克里斯

推荐答案

除了开放世界假设(OWA)外,还存在唯一名称假设(UNA). OWL确实制作了前者(OWA),而没有制作了前者(UNA).

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.

在Turtle语法中,它应如下所示:

In the Turtle syntax, it should look like this:

:London owl:differentFrom :Paris .

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

这篇关于通过计算属性来推断OWL的知识的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆