'NoneType' object while Reasoning

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

'NoneType' object while Reasoning

Elena
Hello everyone,

I am running a reasoner and having the following Error messages:
     
     child = world._entities.get(concept_storids[0])
     AttributeError: 'NoneType' object has no attribute 'get'
 
However, when I run the same request in the terminal everything  is working and I have the results.

I thought maybe it is because i have blank nodes, but after deleting the them i still have the same mistake :

    child = world._entities.get(concept_storids[0])
    AttributeError: 'NoneType' object has no attribute 'get'

Did someone have the same issue? How can it be solved?


Thank you for your help
Reply | Threaded
Open this post in threaded view
|

Re: 'NoneType' object while Reasoning

Jiba
Administrator
Hello,

This is surprising, because world._entities is just a cache and it should not be changed.

Can you send me an example program that reproduces the  problem ?

Best regards,
Jean-baptiste
Reply | Threaded
Open this post in threaded view
|

Re: 'NoneType' object while Reasoning

Elena
I am just calling the reasoner.

  onto = get_ontology("test").load()
  sync_reasoner(onto)

In the command line everything works.

Do you need the ontology file?

All the best,
Elena
Reply | Threaded
Open this post in threaded view
|

Re: 'NoneType' object while Reasoning

Jiba
Administrator
Yes please.

Jean-Baptiste
Reply | Threaded
Open this post in threaded view
|

Re: 'NoneType' object while Reasoning

Elena
Reply | Threaded
Open this post in threaded view
|

Re: 'NoneType' object while Reasoning

Jiba
Administrator
Hello,

It seems that the parameters for sync_reasoner was not clearly defined ; it expect a world and not an ontology.

I fixed the problem and made it accepts both world and ontology in the development version.

As a workaround, you can call sync_reasoner(world) if you create your own world, or simply sync_reasoner() if you use the default world.

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: 'NoneType' object while Reasoning

Elena
Thanks a lot for your help!

Elena
Reply | Threaded
Open this post in threaded view
|

Re: 'NoneType' object while Reasoning

Ashutosh
In reply to this post by Jiba
Hi Jiba,
while using Owlready2 0.11 ,sync_reasoner(onto) and sync_reasoner_pellet(onto) are giving empty temp files.But it was not the same with version 2 - 0.9


Thanks
Reply | Threaded
Open this post in threaded view
|

Re: 'NoneType' object while Reasoning

Jiba
Administrator
Hi,

By "empty temp files", you are speaking about the files generated by sync_reasoner() with keep_tmp_file = 1, right ?
Do you have the same problem if you call sync_reasoner with no ontology argument?
If so, could you send me a small example to reproduce the problem?

Best regards,
Jiba