Pellet reasoner in owlready2 does not accept some characters (SOLVED)

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

Pellet reasoner in owlready2 does not accept some characters (SOLVED)

Xavier
This post was updated on .
Hello Owlreaders

Jiba, very good job with this framework and your book.

But with Pellet reasoner in owlready2 (version 0.20), i have some problems.
This component does not accept accented characters in a class name (ie. Obèse) and in a data property (ie. if i define property test with xsd:string and i assert "à la bonne heure").

When i load the owl file, no problem; but when i launch reasoner, an error is raised:

Traceback (most recent call last):

  File "<ipython-input-2-424673f8e151>", line 1, in <module>
    sync_reasoner_pellet(infer_property_values = True, infer_data_property_values = True)

  File "C:\...\Continuum\anaconda3\lib\site-packages\owlready2\reasoning.py", line 246, in sync_reasoner_pellet
    output = output.decode("utf8").replace("\r","")

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 1374: invalid continuation byte

With Protégé 5.5.0 and associated reasoner (Pellet Reasoner Plug-in version 2.2.0) , no problem with same owl file when i start the reasoner.

Thanks and best regards.
Reply | Threaded
Open this post in threaded view
|

Re: Pellet reasoner in owlready2 does not accept some characters

Xavier
Hello list,

If I upgrade Owlready2 with version 0.21 (because: "Use Pellet 2.3.1 (same version as Protégé) instead of 2.4 "), I have same problems with Pellet reasoner.

I continue to investigate but if anyone has already met these problems, help me.

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

Re: Pellet reasoner in owlready2 does not accept some characters

William
I have a problem about pellet, when using pyinstaller
Reply | Threaded
Open this post in threaded view
|

Re: Pellet reasoner in owlready2 does not accept some characters

Jiba
Administrator
In reply to this post by Xavier
Hi,

Accentuated characters work well on my computer, but it might be related to the fact that my computer is configurated in French by default, with Unicode locale...

I've added "latin" encoding as a failback for Pellet in the development version of Owlready 2 on Bitbucket. Could you try it please?

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: Pellet reasoner in owlready2 does not accept some characters

Xavier
Hi Jiba,

I try and I have the following error now:

Traceback (most recent call last):

  File "<ipython-input-3-424673f8e151>", line 1, in <module>
    sync_reasoner_pellet(infer_property_values = True, infer_data_property_values = True)

  File "C:\Users\xavier.goblet\Continuum\anaconda3\lib\site-packages\owlready2\reasoning.py", line 328, in sync_reasoner_pellet
    _apply_reasoning_results(world, ontology, debug, new_parents, new_equivs, entity_2_type)

  File "C:\Users\xavier.goblet\Continuum\anaconda3\lib\site-packages\owlready2\reasoning.py", line 381, in _apply_reasoning_results
    old = set(parent for parent in child.is_a if not isinstance(parent, Construct))

  File "C:\Users\...\Continuum\anaconda3\lib\site-packages\owlready2\reasoning.py", line 381, in <genexpr>
    old = set(parent for parent in child.is_a if not isinstance(parent, Construct))

NameError: name 'Construct' is not defined

I may have forgotten an update in the code?

Thanks, Xavier
Reply | Threaded
Open this post in threaded view
|

Re: Pellet reasoner in owlready2 does not accept some characters

Jiba
Administrator
Hi,

Construct is defined in class_construct.py, which is imported by reasoning.py.

However, Construct was named ClassConstruct until recently. Did you update Owlready 2 entirely, or only one file (= reasoning.py) ? You need to update all files.

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: Pellet reasoner in owlready2 does not accept some characters

Xavier
Hi,

Normally, a massive update with "pip3 install --upgrade" command (the last version known of PyPI is 0.22) and a manual update of reasoning.py file inside development branch.
I check again asap...

Thanks to you
Xavier
Reply | Threaded
Open this post in threaded view
|

Re: Pellet reasoner in owlready2 does not accept some characters

Jiba
Administrator
Hi,

You need to take the entir edevelopment branch (not just reasoning.py).

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: Pellet reasoner in owlready2 does not accept some characters (SOLVED)

Xavier
Hello Jiba,

I tested this morning with all dev branch and the above problems are solved.

Thanks for your work.