|
View:
New views
6 Messages
—
Rating Filter:
Alert me
|
|
|
Inverse property on classesHi,
I read in several documentation about RDF/OWL that there is no big difference between classes and individuals. Most of the ontologies published on the internet use only classes. But when I try to use a one to many relationship, it seems to work only with individuals. Here is a very simple example: a pizza has at least one topping and a topping is for exactly one pizza. :Pizza rdf:type owl:Class :Topping rdf:type owl:Class :hasTopping rdf:type owl:ObjectProperty owl:inverseOf :isToppingOf rdfs:domain :Pizza rdfs:range :Topping :isToppingOf rdf:type owl:ObjectProperty owl:inverseOf :hasTopping rdfs:domain :Topping rdfs:range :Pizza :Pizza :hasTopping min 1 :Topping :Topping :isToppingOf exactly 1 :Pizza When I create an individual :Pizza_mozzarella and add a property :hasTopping on :Mozzarella individual, I can work with the inverse property on the topping and I see that :Mozzarella :isToppingOf :Pizza_mozzarella. It works great with individual. But when I try to do the same test with classes: :Pizza_mozzarella_class :hasTopping some :Mozzarella_class But I cannot use the inverse property: :Mozzarella_class does not know anything about :Pizza_mozzarella_class. Is this normal ? Are inverse properties usable only on individuals ? Thanks for your help :-) Cedric |
|
|
Re: Inverse property on classesHello,
Cédric Thiébault wrote: > Hi, > [snip] > > > When I create an individual :Pizza_mozzarella and add a property > :hasTopping on :Mozzarella individual, I can work with the inverse > property on the topping and I see that :Mozzarella :isToppingOf > :Pizza_mozzarella. It works great with individual. > > But when I try to do the same test with classes: > :Pizza_mozzarella_class :hasTopping some :Mozzarella_class > > But I cannot use the inverse property: :Mozzarella_class does not know > anything about :Pizza_mozzarella_class. > > Is this normal ? Yes. Notice that you are not making any claim here about Mozzarella_class in general. You're only saying that all instances of Pizza_mozzarella_class are related to *some* instance of Mozzarella_class. Imagine a model in which there are 10,000 mozarrellas and only one of them is used as a topping on all pizzas (it would be a satisfying model). Would you want to be able to conclude something general about 9,999 mozarellas basing on only one instance? > Are inverse properties usable only on individuals ? Well, it depends on what you mean by "using". For example, you can define a class (and an instance) of pizzas which has *all* instances of Mozzarella as toppings (although it's not that trivial). Then, of course, you'll be able to infer that :Mozzarella_class :isToppingOf some :that_weird_pizza_class. Cheers, Pavel > > Thanks for your help :-) > > Cedric > > |
|
|
Re: Inverse property on classesThanks for your help Pavel :)
So even if I use cardinality, it won't be different? :Pizza_mozzarella_class :hasTopping exactly 1 :Mozzarella_class Would you use allValuesFrom to create this weird pizza class that has all mozzarella as topping? :Pizza_mozzarella_class :hasTopping all :Mozzarella_class Actually, I want to use classes and not individuals because I need to reason on them and it seems that reasoners can only work on classes... But it is a lot simpler to work with properties between instances (at least if we want to use inverse and transitive properties) than between classes. Regards, Cedric On Wed, May 13, 2009 at 4:40 PM, Pavel Klinov <klinovp@...> wrote: Hello, |
|
|
Re: Inverse property on classesCédric Thiébault wrote:
> Thanks for your help Pavel :) > > So even if I use cardinality, it won't be different? > :Pizza_mozzarella_class :hasTopping exactly 1 :Mozzarella_class It won't. You're saying that "each instance of Pizza_mozzarella_class has exactly 1 instance of Mozzarella_class as topping". But there still might be a *lot* more instances of Mozzarella_class then related instances of Pizza_mozzarella_class. So the statement is not really about Mozzarella_class in general, it only says something about some (possibly negligibly small) part of it (which is related to Pizza_mozzarella_class). > > Would you use allValuesFrom > <http://www.w3.org/TR/owl-guide/#owl_allValuesFrom> to create this > weird pizza class that has all mozzarella as topping? > :Pizza_mozzarella_class :hasTopping all :Mozzarella_class No. That's why I said that it wouldn't be that trivial. Here you're saying that "all toppings of Pizza_mozzarella_class's instances are instances of Mozzarella_class". But you need something else: "any instance of Pizza_mozzarella_class has *all* instances of Mozzarella_class as toppings". Do you see the difference? The second does imply that *any* instance of Mozzarella_class is a topping of an instance of the Pizza_mozzarella_class (provided the latter is non-empty) while the first does not. *Disclaimer*: I'm not saying that such weird pizza class would be of any use, I was only trying to give an example of an axiom which claims enough about the Mozzarella_class class. > Actually, I want to use classes and not individuals because I need to > reason on them and it seems that reasoners can only work on classes... I'm not sure what you mean by "it seems that reasoners can only work on classes...". It is often a highly non-trivial modeling decision (to use classes or individuals to model certain things). > But it is a lot simpler to work with properties between instances (at > least if we want to use inverse and transitive properties) than > between classes. Well, when working with classes you should keep in mind that you're dealing with *sets* of objects (possibly very large or even infinite). So the statements that only claim something about some members (or subclasses) of a class are normally too weak to imply anything about the class in general (other than it's non-empty, of course). Hope this helps, Pavel > > Regards, > > Cedric > > > On Wed, May 13, 2009 at 4:40 PM, Pavel Klinov <klinovp@... > <mailto:klinovp@...>> wrote: > > Hello, > > Cédric Thiébault wrote: > > Hi, > > > [snip] > > > > > When I create an individual :Pizza_mozzarella and add a > property :hasTopping on :Mozzarella individual, I can work > with the inverse property on the topping and I see that > :Mozzarella :isToppingOf :Pizza_mozzarella. It works great > with individual. > > But when I try to do the same test with classes: > :Pizza_mozzarella_class :hasTopping some :Mozzarella_class > > But I cannot use the inverse property: :Mozzarella_class does > not know anything about :Pizza_mozzarella_class. > > Is this normal ? > > > Yes. Notice that you are not making any claim here about > Mozzarella_class in general. You're only saying that all instances > of Pizza_mozzarella_class are related to *some* instance of > Mozzarella_class. Imagine a model in which there are 10,000 > mozarrellas and only one of them is used as a topping on all > pizzas (it would be a satisfying model). Would you want to be able > to conclude something general about 9,999 mozarellas basing on > only one instance? > > > Are inverse properties usable only on individuals ? > > > Well, it depends on what you mean by "using". For example, you can > define a class (and an instance) of pizzas which has *all* > instances of Mozzarella as toppings (although it's not that > trivial). Then, of course, you'll be able to infer that > :Mozzarella_class :isToppingOf some :that_weird_pizza_class. > > > Cheers, > Pavel > > > > Thanks for your help :-) > > Cedric > > > > |
|
|
Re: Inverse property on classesWould you use allValuesFrom <http://www.w3.org/TR/owl-guide/#owl_allValuesFrom> to create this weird pizza class that has all mozzarella as topping?No. That's why I said that it wouldn't be that trivial. Here you're saying that "all toppings of Pizza_mozzarella_class's instances are instances of Mozzarella_class". But you need something else: "any instance of Pizza_mozzarella_class has *all* instances of Mozzarella_class as toppings". Do you see the difference? The second does imply that *any* instance of Mozzarella_class is a topping of an instance of the Pizza_mozzarella_class (provided the latter is non-empty) while the first does not. So I need to define both sides of the relation? :Pizza_mozzarella_class :hasTopping all :Mozzarella_class :Mozzarella_class :isToppingOf all :Pizza_mozzarella_class In this case, I don't use anymore the inverse property? I have the feeling that property characteristics like inverse and transitivity are useful on instances, not on classes. If we add an ingredient class to our ontology and a transitive property hasPart that is parent of hasTopping. :Ingredient rdf:type owl:Class :hasPart rdf:type owl:TransitiveProperty :hasTopping rdf:type :hasPart :Cheese_class rdf:type :Ingredient :Pizza_mozzarella_class :hasTopping all :Mozzarella_class :Mozzarella_class :hasPart some :Cheese_class Would it be possible to know if my pizza has some cheese as ingredient?
When I tried to find inferred classes from my instances it did not work... But when I used classes instead of instances, the reasoner created the inferred model. In fact, if I was able to 'navigate' threw my ontology using the inverse and transitive properties on classes, it would be great. But for the moment, I can't. But I can do it easily with instances... that's why I'm stuck with individuals :-( Thanks again Pavel! Cedric
|
|
|
Re: Inverse property on classesOn 15 May 2009, at 16:09, Cédric Thiébault wrote:
if this is what you want to say...? The above second axiom says that each instance of Mozzarella_class can *only* be a topping of Pizza_mozzarella_class...i.e., *if* a mozzarella is the topping of something, then this something is a Pizza_mozzarella....so you - disallow other Pizzas to have mozzarella toppings, and - you still can have mozzarellas that aren't toppings of anything (notice the *if* above)
hm, you use :hasTopping and :isToppingOf , so you should have an axiom saying that :isToppingOf is the inverse of :hasTopping, thus you still use inverse properties...indirectly.
why?! If I say that all children of Turtles only have parents who are Green (assuming that 'hasChild' is the inverse of 'hasParent'), then the class 'Turtle and hasChild some Thing' will be inferred to be a subclass of 'Turtle and Green'...so inverse properties *have effects* of the entailments regarding classes, if this is what you mean by 'are useful'
assuming that you pizza is 'Pizza_mozzarella', no: because you only use :hasTopping *all* :Mozzarella_class
how did you do this?
I don't understand what you mean...what tool do you use? Cheers, Uli
|
| Free embeddable forum powered by Nabble | Forum Help |