owlcollab / owltools

OWLTools
BSD 3-Clause "New" or "Revised" License
108 stars 33 forks source link

Object properties as outgoing edges from an owl class #201

Open fanavarro opened 7 years ago

fanavarro commented 7 years ago

Hi, I'm trying to implement a shortest path algorithm between owl classes through their object properties by using owltools graph facilities. I'm using the function getOutgoingEdges(owlClass) from OWLGraphWrapper class, but this are returning edges that only contain hierarchichal relations (subclass of). Is it possible to include the object properties defined in the ontology?

Thanks in advance, Fran.

cmungall commented 7 years ago

Hi there, not sure exactly what you mean, there isn't such a thing as a hierarchical relation in OWL terminology.

It should traverse subclassOf axioms where the parent is a named class or an existential restriction (R some D), I assume this is what you mean by including object properties? Of course, object properties can't connect classes directly (if you try and do this it induces punning).

See https://owlcollab.github.io/owltools/api/index.html

Can you send a section of your ontology?

fanavarro commented 7 years ago

Hi @cmungall , thanks for your answer. I'll try to show an example. Imagine the next ontology:

diagrama1 It has the classes Pizza, PizzaBase, PizzaTopping and Food. Pizza, PizzaBase and PizzaTopping are subclasses of Food and there exist the following object properties between them: isToppingOf, whose domain is PizzaTopping and whose range is Pizza. hasBase, whose domain is Pizza and whose range is PizzaBase.

What I mean is that when I use getOutgoingEdges functions on PizzaTopping, for example, I'm expecting both subclass-of and isToppingOf edges, but the function only returns the subclass-of edge. So is there any way to traverse the ontology through the object proterties and subclass-of relations?

I hope my question is more understandable with this little example.

Thanks again, Fran.