How to force a class to have exactly one of a give

2019-02-25 03:39发布

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.

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

1条回答
时光不老,我们不散
2楼-- · 2019-02-25 03:59

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
查看更多
登录 后发表回答