如何强制一个类完全具有给定属性中的一个 [英] How to force a class to have exactly one of a given property

查看:89
本文介绍了如何强制一个类完全具有给定属性中的一个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Person类,和一组数据属性:First_Name,Surname,Gender,DoB,Country_of_Birth.数据属性的域"设置为人".我想在本体中设置的一条规则规定,每个人必须都必须具有这些属性中的每一个恰好1个.

I have a class Person, and a set of data properties: First_Name, Surname, Gender, DoB, Country_of_Birth. The data properties have their Domains set to Person. What i would like to set up in my ontology is a rule which states that every Person must have exactly 1 of each of these properties.

因此在Protege中,我将Person设置为"First_Name精确为1 xsd:string","Surname精确为1 xsd:string"的子类,依此类推.然后,我用个人姓氏设置了一个个人,但没有名字,性别等.

So in Protege, I set up Person as a subclass of "First_Name exactly 1 xsd:string", "Surname exactly 1 xsd:string" and so on. I then set up an Individual with a Surname, but no First_Name, Gender etc.

然后我运行推理机.我希望它能够解决不一致问题(将姓氏分配给不符合成为人的要求的个人),但是不,推理者会推断出该个人是人,尽管事实没有所需的属性.

I then run the reasoner. What I would expect is for it to throw a fit about inconsistency (Surname is being assigned to an individual which does not conform to the requirements to be a Person) but no, the reasoner infers that the Individual is a Person despite the fact that it does not have the required properties.

这是正确的行为吗?如何使本体以我希望的方式运行?因为我想要的是使本体对于不完整的数据具有鲁棒性(例如,您不能添加没有名字的人).

Is this proper behaviour? How do I make the ontology behave in the way that I want it to? Because what I want is for the ontology to be robust against incomplete data (so you can't add a person with no name, for example).

推荐答案

是的,这是Protege使用开放世界假设而不是封闭世界假设导致的正确行为>例如关系数据库.在开放世界的假设下,不能假设没有明确陈述或不能从明确已知的信息中得出任何信息.当您创建未为其分配任何First_Name的个人(可能是Person类型的个人)时,在开放世界假设下,推理程序仅假设First_Name未知,而不是它不存在(因为封闭世界假设的情况).因此,即使推理者推断出该个人必须为Person类型,其推理也不会产生任何不一致的原因.要获得不一致,您必须声明已知该个人既是Person又没有First_Name.对于单个john,可以通过断言来实现:

Yes, that is proper behavior due to Protege using the open world assumption rather than the closed world assumption of for example relational databases. Under the open world assumption nothing can be assumed that is not stated explicitly or can be derived from explicitly known information. When you create an individual (possibly of type Person) for which you assigned no First_Name, under the open world assumption the reasoner merely assumes that the First_Name is not known, not that it does not exist (as is the case for the closed world assumption). Hence, the reason why the reasoner gives no inconsistency even though it infers that the individual must be of type Person. To get an inconsistency you have to state that it is known that the individual is both a Person and does not have a First_Name. This can be achieved for an individual john by asserting:

john Type Person
john Type First_Name max 0 xsd:string

这篇关于如何强制一个类完全具有给定属性中的一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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