问题
Let's say for example:
-Food(class
-Bread(instance of Food!
-Species(class
-Animal(class
- Horse(class
-Unicorn(instance
Now I need to be able to set Bread -> eatableBy -> Horse. But I can't make a object property assertion to a class. So I could set it eatable by and add all the instances of Horse, but I have a lot of instances so that would be a bit redundant. Does anybody know a good efficient way to do achieve the same effect?
E.g. If I need to know what Horses can eat it needs to return Bread also. If I want to know all the food an Unicorn can eat, it needs to return Bread (because it's a horse and all horses eat bread). If I need to know what the subclasses of Animal eat, it also has to return Bread.
回答1:
If I understand you correctly, you have an instance Bread and want to ensure that it is eatable by every instance of the class Horse. OWL has value restrictions which let you describe the set of individuals that stand in some relation to some particular value. E.g., the expression
likes value Pizza
is the class of all individuals that like pizza. OWL also lets you use the inverse of properties, so that the expression
inverse(likes) value Joe
is the class of all things that Joe likes. These class expressions can be used in axioms, including subclass axioms. In particular, you could say that
Horse SubClassOf canEat value Bread
to say that every individual of type Horse can eat the individual Bread. Rather than a canEat property, though, you've got an eatableBy property. That's just the inverse of canEat, though, so you can say that every individual of type Horse can eat the individual Bread with the axiom:
Horse SubClassOf inverse(eatableBy) value Bread
In Protégé, that looks like:
来源:https://stackoverflow.com/questions/29276563/object-property-instance-on-class