问题
I am using protege 5 for developing ontology. I have created has_composition as object property. In my ontology the same object_property is used for different domains and their respective range, like has_composition of A is B and has_composition of C and D is E and F.
How can I model this mapping??
回答1:
OWL (Ontology Web Language, the ontology that defines ontologies) does not allow to model what you're trying to do.
A workaround I can think of is to use sub-properties. Imagine the following classes:
PizzaTomatoSauceChocolateCakeChocolate
If you want to define relations such as
- A
Pizzahas_compositionTomatoSauce, and - A
ChocolateCakehas_compositionChocolate
then define the following relations:
has_composition: No domain nor range (or a common superclass such asDishandIngredientfor example)has_tomato_sauce: DomainPizza, rangeTomatoSaucehas_chocolate: DomainChocolateCake, rangeChocolate
This will allow the reasoner (the software that computes inferences) to infer that if something has_chocolate a_chocolate, then
somethingrdf:typeChocolate(inferred by the domain ofhas_chocolate);somethinghas_compositiona_chocolate(becausehas_chocolateis a sub-property ofhas_composition).
You can check out this example in this Gist I made.
Download it, open it, and start the reasoner. You will see the inferred statements in yellow.
来源:https://stackoverflow.com/questions/51298192/how-to-create-multiple-relations-with-same-object-property