Ontology in ROS

classic Classic list List threaded Threaded
24 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Ontology in ROS

Taha Elsenosy
Is there any way to use owlready2 inside ROS (Robotic Operation System) to handle the ontology, if not, then can anyone guide me to find a way to do that?
Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Ontology in ROS

Jiba
Administrator
Hi,

I've never used ROS, but if it has Python, Owlready should be useable on it.

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: Ontology in ROS

Taha
Thanks Jiba, I've worked with owlready in python, and yes ROS having python in it, but the implementation is different in ROS, I'll figure a way to solve it.

Many thanks,
Taha Elsenosy
Reply | Threaded
Open this post in threaded view
|

Re: Ontology in ROS

Hiba
Hello
I think there is a way to integrate an ontology in ROS by using ARMOR but Indeed, I found many difficulties.
Reply | Threaded
Open this post in threaded view
|

Re: Ontology in ROS

Taha Elsenosy
Thanks @Hiba

To be honest, i've worked with ARMOR, it has a lot of functionality to manipulating ontologies, but it still under developing, i found a lot of uncompleted functions related to SPARQL, so i moved to work with rdflib to make SPARQLs to the ontology

since that the owlready2 doesn't works with python 2.7, the version that ROS is already used.

I hope i can finish my task through these libraries.

Many thanks
Reply | Threaded
Open this post in threaded view
|

Re: Ontology in ROS

Hiba
For me, I try to infer SWRL rules but still can't find a way to do it๐Ÿ˜’
Reply | Threaded
Open this post in threaded view
|

Re: Ontology in ROS

Taha Elsenosy
The same problem i face, so i moved to work with rdflib, try it.
Reply | Threaded
Open this post in threaded view
|

Re: Ontology in ROS

Hiba
Okey thanks a lot
Reply | Threaded
Open this post in threaded view
|

Re: Ontology in ROS

Lynsie
In reply to this post by Taha Elsenosy
@Taha how can you infer the swrl rules with rdflib plz?
Reply | Threaded
Open this post in threaded view
|

Re: Ontology in ROS

Taha Elsenosy
Let me explain some staff, i thought that i can infer SWRL with rdflib, but i was wrong,
rdflib is just to querying and it doesn't has Reasoner to infer the ontology, so i was searching about that, then i found that it is possible to make SWRL rules using
pullet reasoner,

read this: https://stackoverflow.com/questions/31500701/how-to-use-swrl-builtin-in-owlapi-with-pellet?rq=1 and this: http://dior.ics.muni.cz/~makub/owl/ ,

for now, i'm still searching, but i think these links may help us.

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Ontology in ROS

Taha
@Lynsie
I found that owlready2 , owlready2 version 2 - 0.15 has a new version which can infer data property values when reasoning with Pellet

Try it.
Reply | Threaded
Open this post in threaded view
|

Re: Ontology in ROS

Lynsie
Actually, i got an error while calling sync_reasoner()
Reply | Threaded
Open this post in threaded view
|

Re: Ontology in ROS

Taha
Let me explain what you have to do to make things work,

First of all you should test the SWALLOW on protege first,
Then save the rule to your ontology
Load the ontology using owlready2 in python,
Notice that the SWRL works with PELLET reasoner,
But sync_reasoner() function runs the HermiT reasoner, so there won't be an inferred objects

Instead of that you should use sync_reasoner_pellet(), the functions  added to the newer version of owlready2, you have to make sure you installed this version

Read this carefully

https://owlready2.readthedocs.io/en/latest/reasoning.html#running-the-reasoner

If you still got errors, post it here.

Regards,
Reply | Threaded
Open this post in threaded view
|

Re: Ontology in ROS

Lynsie
this is the error i got:
RuntimeError: cannot release un-acquired lock
Reply | Threaded
Open this post in threaded view
|

Re: Ontology in ROS

Jiba
Administrator
Hi,

A bug in Owlready causes this error to be raised instead of another, during reasoning.

You can either use Owlready 0.16 (just release) to find the real error, or call the reasoner outside a "with..." block.

The real error is probably that the ontology is inconsistent.

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: Ontology in ROS

Lynsie
Thank you Jiba for your quick reply.
Actually, I have installed Owlready 0.16 but i got OwlReadyJavaError. I tried two versions of java but the problem still persist.
Reply | Threaded
Open this post in threaded view
|

Re: Ontology in ROS

Lynsie
In reply to this post by Jiba
Finally, I noticed that when I remove the SWRL rules from my ontology, the sync_reasoner_pellet() works.
I don't know how to fix this.
Reply | Threaded
Open this post in threaded view
|

Re: Ontology in ROS

Jiba
Administrator
Hi,

The OwlreadyJavaError means that an error occured in the Java reasoner. You need to check the Java error message (it should be displayed on the terminal).

If you send me your ontology, I can look at it.

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: Ontology in ROS

Lynsie
Could you send me your email, please, so that I can send you the ontology.
Reply | Threaded
Open this post in threaded view
|

Re: Ontology in ROS

Jiba
Administrator
My address is jiba (at) lesfleursdunormal.fr
12