Error in sync_reasoner()

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

Error in sync_reasoner()

Rizwan
which version of java works for using hermit reasoner, I am getting called process error while running hermit reasoner in owlready2.
Reply | Threaded
Open this post in threaded view
|

Re: Error in sync_reasoner()

Jiba
Administrator
Hi,

I'm using the following version:

openjdk version "1.8.0_192"
OpenJDK Runtime Environment (build 1.8.0_192-b26)
OpenJDK 64-Bit Server VM (build 25.192-b26, mixed mode)

It works with both HermiT and Pellet.

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: Error in sync_reasoner()

Rizwan
Thanks jiba

I am using the same version but i am getting the following error.
when i am using the sync_reasoner(onto) command.
* Owlready2 * Running HermiT...
    C:\Java\jre1.8.0_191\bin\java.exe -Xmx2000M -cp E:\anaconda\lib\site-packages\owlready2\hermit;E:\anaconda\lib\site-packages\owlready2\hermit\HermiT.jar org.semanticweb.HermiT.cli.CommandLine -c -O -D -I file:///C:/Users/rizwank/AppData/Local/Temp/tmpz8pqz8vd
Traceback (most recent call last):

  File "<ipython-input-7-877f9afc8990>", line 1, in <module>
    sync_reasoner(onto)

  File "E:\anaconda\lib\site-packages\owlready2\reasoning.py", line 88, in sync_reasoner
    output = subprocess.check_output(command, stderr = subprocess.STDOUT)

  File "E:\anaconda\lib\subprocess.py", line 376, in check_output
    **kwargs).stdout

  File "E:\anaconda\lib\subprocess.py", line 468, in run
    output=stdout, stderr=stderr)

CalledProcessError: Command '['C:\\Java\\jre1.8.0_191\\bin\\java.exe', '-Xmx2000M', '-cp', 'E:\\anaconda\\lib\\site-packages\\owlready2\\hermit;E:\\anaconda\\lib\\site-packages\\owlready2\\hermit\\HermiT.jar', 'org.semanticweb.HermiT.cli.CommandLine', '-c', '-O', '-D', '-I', 'file:///C:/Users/rizwank/AppData/Local/Temp/tmpz8pqz8vd']' returned non-zero exit status 1.
Reply | Threaded
Open this post in threaded view
|

Re: Error in sync_reasoner()

Rizwan
This is my script while performing reasoning.
import owlready2
from owlready2 import *
owlready2.JAVA_EXE="C:\\Java\\jre1.8.0_191\\bin\java.exe"
sync_reasoner()
Reply | Threaded
Open this post in threaded view
|

Re: Error in sync_reasoner()

Jiba
Administrator
Hi,

Can you give me the reasoner output ? You can obtain it as follows:

1) Run sync_reasoner(keep_tmp_file) in Python

2) Execute manually the reasoner, using the same command-line as Owlready (you can copy paste the command-line in a terminal or a DOS prompt).

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

Re: Error in sync_reasoner()

Rizwan
tmp33rzd9bq.tmp33rzd9bq


How to run reasoner in command line i didn't understood that, currently i am running python by using spyder anaconda. I have attached the temp file
Reply | Threaded
Open this post in threaded view
|

Re: Error in sync_reasoner()

Jiba
Administrator
Hi,

I tested the file on my computer, and it worked well.

To run the reasoner in command line, you can use a DOS prompt, or maybe the Python os.system() function :

import os
os.system("""java -Xmx2000M -cp /home/jiba/tmp/owlready2/hermit:/home/jiba/tmp/owlready2/hermit/HermiT.jar org.semanticweb.HermiT.cli.CommandLine -c -O -D -I file:////tmp/tmpy8fkg8lq""")

(replace the """java...""" command line by the one printed by Owlready).
Reply | Threaded
Open this post in threaded view
|

Re: Error in sync_reasoner()

Rizwan



Hi Jiba

I have run the given command in anaconda prompt and i am getting an error.
is there any issue with the path i have given for java?
Reply | Threaded
Open this post in threaded view
|

Re: Error in sync_reasoner()

Jiba
Administrator
Hi,

It seems that Java does not start at all. Are you sure that the Java.exe filename is OK ?

You can check it in Python with:

open("C:\\Java\...", "r")

Best regards,
Jiba