Problem with version > 0.11, handling OwlReadyInconsistentOntologyError()

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

Problem with version > 0.11, handling OwlReadyInconsistentOntologyError()

Demian
Hi Jiba,
First of all i want to thank you for your work.

Now with the main topic of this post:

I ' m working on a small project trying to implement Reasoning in ALC + TP
We have created Abox, Tbox (equivalent) and other stuff working with version 0.11 and everything is fine
but i can't upgrade properly because of this error


Probably is our fault in some way, i'm currently extending my colleague work and trying to improve it.
Any help would be appreciated!

Demian
Demian
Reply | Threaded
Open this post in threaded view
|

Re: Problem with version > 0.11, handling OwlReadyInconsistentOntologyError()

Jiba
Administrator
Hi,

The main problem here is that your ontology is inconsistent. Thus, the reasoner cannot perform any reasoning on it.

The last error (about the lock) is (indirectly) caused by the inconsistent ontology error. I'm going to see how I can remove it.

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: Problem with version > 0.11, handling OwlReadyInconsistentOntologyError()

Demian
Hi again,

Thanks for the reply.

I know that ontology is inconsistent, i'm creating different scenarios using a query
 and sometimes some result aren't Logical Consequence thus the ontology is inconsistent;

but till version 0.11 i' ve handled the exception just fine like this:

def consistency(self):
        try:
            with self.onto:
                sync_reasoner(self.my_world)
                return "The ontology is consistent"
        except OwlReadyInconsistentOntologyError:
            return "The ontology is inconsistent"

If you want i could send you the whole project.

Best Regards,
Demian


Demian
Reply | Threaded
Open this post in threaded view
|

Re: Problem with version > 0.11, handling OwlReadyInconsistentOntologyError()

Jiba
Administrator
Hi,

Yes, there is a bug in version 0.15 that causes the wrong Error to be raised on inconsistent ontology, when the reasoner is executed inside a with...: block.

I fixed the bug in the development version (on Mercurial).

As a workaround, you can also use just "except:" instead of "OwlReadyInconsistentOntologyError:".

Best regards,
Jiba
Reply | Threaded
Open this post in threaded view
|

Re: Problem with version > 0.11, handling OwlReadyInconsistentOntologyError()

Demian
Hi,

Thanks! the workaround worked !

Can i ask you if there are some example of using different worlds ?
I want to load several version of the same ontology before and after reasoning but I'm struggling to get it right.

I 'm creating the onto reading from a file and i would like to save it and then creating different scenarios from it(same onto with new classes and/or properties)

Best regards,
Demian
Demian
Reply | Threaded
Open this post in threaded view
|

Re: Problem with version > 0.11, handling OwlReadyInconsistentOntologyError()

Jiba
Administrator
Hi,

Using world is easy: you can create a world using the World() class.

Then, use world.get_ontology() for loading the ontology, world.search() for searching, world.get_namespace() for namespace, and sync_reasoner(world) for reasoning.

Jiba