Problem when use HermiT reasoner

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

Problem when use HermiT reasoner

fengbozheng
Hi,

I'm using Anaconda (python 3.7) on a Mac to deal with the ontology of SNOMED CT. I think it's ready for reasoning and I have trIed it on Protege, it was running well. But when I try to use the HermiT reasoner in owlready2, it pops an error. I found one similar problem in previous post: http://owlready.8326.n8.nabble.com/Error-using-sync-reasoner-td19.html

I tried the solution suggested in that post,
import owlready2
from owlready2 import *
owlready2.JAVA_EXE = "/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/bin/java"
(for the path of java executable path, I tried both the one under /bin and the one under /jre/bin)

but it didn't work for me. The error message is still shown as follow:

* Owlready2 * Running HermiT...
    /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/bin/java -Xmx2000M -cp /Users/fengbozheng/anaconda3/lib/python3.7/site-packages/owlready2/hermit:/Users/fengbozheng/anaconda3/lib/python3.7/site-packages/owlready2/hermit/HermiT.jar org.semanticweb.HermiT.cli.CommandLine -c -O -D -I file:////var/folders/70/z2jgs93x45zb_yrd6y3_4dth0000gv/T/tmpxry015f2
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "/Users/fengbozheng/anaconda3/lib/python3.7/site-packages/owlready2/reasoning.py", line 88, in sync_reasoner
    output = subprocess.check_output(command, stderr = subprocess.STDOUT)
  File "/Users/fengbozheng/anaconda3/lib/python3.7/subprocess.py", line 376, in check_output
    **kwargs).stdout
  File "/Users/fengbozheng/anaconda3/lib/python3.7/subprocess.py", line 468, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/bin/java', '-Xmx2000M', '-cp', '/Users/fengbozheng/anaconda3/lib/python3.7/site-packages/owlready2/hermit:/Users/fengbozheng/anaconda3/lib/python3.7/site-packages/owlready2/hermit/HermiT.jar', 'org.semanticweb.HermiT.cli.CommandLine', '-c', '-O', '-D', '-I', 'file:////var/folders/70/z2jgs93x45zb_yrd6y3_4dth0000gv/T/tmpxry015f2']' returned non-zero exit status 1.


Could you help me with this?

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

Re: Problem when use HermiT reasoner

Jiba
Administrator
Hello,

You should try to run the reasoner manually, as follows:

1) run it with Owlready with the keep_tmp_file = True parameter :

        sync_reasoner(keep_tmp_file = True)

With this option, Owlready will not remove the temporary file.

2) try to the run the reasoner manually in a terminal, using the command line shown by Python, something like:

        /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/bin/java -Xmx2000M -cp /Users/fengbozheng/anaconda3/lib/python3.7/site-packages/owlready2/hermit:/Users/fengbozheng/anaconda3/lib/python3.7/site-packages/owlready2/hermit/HermiT.jar org.semanticweb.HermiT.cli.CommandLine -c -O -D -I file:////var/folders/70/z2jgs93x45zb_yrd6y3_4dth0000gv/T/tmpxry015f2

The exact name of temporary file will vary, of course.

You should get additional information in the terminal.

Best regards,
Jean-Baptiste Lamy
MCF HDR, Laboratoire LIMICS, Université Paris 13