Strange query behaviour in OWL!

2020-04-11 18:17发布

问题:

In OWL this query works fine

"person and hasChild min 3"

it works fine and it gives me all persons who have more than 3 children

but this one does not work

"person and hasChild max 3"

it should give me all persons who have less than 3 children however it does not work

does any one have an idea about this??

why "min" works while "max" does not give any results!??

Thanks

回答1:

The reason why the 2nd query "does not work" is Open World Assumption, and possibly also (the lack of) Unique Name Assumption.

Say you state:

John lives in Paris.
Mary lives in Paris.

The following questions are answered in the following way by an OWL reasoner.

Who lives in Paris?  John, Mary
Does at least one thing live in Paris?  YES
Do at least two things live in Paris?  Maybe
Is Paris a person?  Maybe
Is John and Mary the same thing?  Maybe
Is Paris and Mary the same thing?  Maybe
Does at most one thing live in Paris?  Maybe

Whenever the OWL reasoner comes back with a Maybe, the user interface (such as Protege) tends to show nothing.

In order to get the answers that you probably want, you need to add a lot more information to the knowledge base, e.g.

Mary is not John.
Everybody who lives in Paris is either John or Mary.

Hope this helps. Looking at how few views your recent questions have received on Stack Overflow, I'd say it's better to ask these questions on the Protege mailing list for the time being. Or even better, look at the mailing list archives. The Open World Assumption related questions come up at least once a week there.



回答2:

To add to Kaarel's points and comment on your example query, a reasoner will look at the asserted triples you have and ask, "could there be other asserted triples, which I don't have at the moment, that assert this person has additional children which will put them over the 'three child' limit?" Since the answer to this question is "maybe", the reasoner will be unable to infer (as a fact) that the person in your example has a maximum of three children.

Negative assertions are quite hard for a reasoner to prove due to the open world assumption. Your "person must not have more than three children" query bumps into this issue. To achieve what you're looking for you could assert that the person types a class of parents who have three children or less. Then again, if you did that you probably wouldn't need the query in the first place.