Problem when use any Reasoner

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

Problem when use any Reasoner

Caiubi
Hi !

This is my first topic here.. (and my english is not good, sorry for that );

I was search for material to help me (documentation, websites, this forum and many different places..) but i did not found nothing... so i want to ask here...

I create a simple Ontology, i just put 2 classes, 'Test 1' and 'Test 2' on Protegè. (I tried it with the pizza ontology too, but this not works.. the error is the same)

After it, i create de Python code like that:

1)
from owlready2 import *
onto_path.append("/Users/Caiu/Documents/tcc/TCC 2o Semestre/Ontologias/")
#onto = get_ontology("http://www.lesfleursdunormal.fr/static/_downloads/pizza_onto.owl")
onto = get_ontology("file:///Users/Caiu/Documents/tcc/TCC 2o Semestre/Ontologias/inicio.owl").load()
--- OK, this part of code works very well ---

2)
from owlready2 import *
import owlready2
owlready2.JAVA_EXE = "C:\Program Files (x86)\Common Files\Oracle\Java\javapath\Java.exe"
--- OK, this part of code works very well too ---


3) But here is the problem:

with onto:
    sync_reasoner_pellet(keep_tmp_file = True)
or
with onto:
    sync_reasoner_pellet()
or
with onto:
    sync_reasoner()

THE ERROR:
* Owlready2 * Running Pellet...
    C:\Program Files (x86)\Common Files\Oracle\Java\javapath\Java.exe -Xmx2000M -cp c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\antlr-runtime-3.4.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\aopalliance-1.0.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\aterm-java-1.8.2-p1.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\commons-codec-1.6.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\commons-csv-1.0.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\commons-io-2.4.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\commons-lang3-3.3.2.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\guava-18.0.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\guice-4.0.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\guice-assistedinject-4.0.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\guice-multibindings-4.0.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\javax.inject-1.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\jena-arq-2.13.0.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\jena-core-2.13.0.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\jena-iri-1.1.2.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\jgrapht-jdk1.5-0.7.3.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\jjtraveler-0.6.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\owlapi-distribution-4.1.4.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\pellet-cli-2.4.0-SNAPSHOT.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\pellet-core-2.4.0-SNAPSHOT.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\pellet-explanation-2.4.0-SNAPSHOT.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\pellet-jena-2.4.0-SNAPSHOT.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\pellet-owlapi-2.4.0-SNAPSHOT.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\pellet-pellint-2.4.0-SNAPSHOT.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\pellet-query-2.4.0-SNAPSHOT.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\sesame-model-2.7.16.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\sesame-rio-api-2.7.16.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\sesame-rio-datatypes-2.7.16.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\sesame-rio-languages-2.7.16.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\sesame-rio-nquads-2.7.16.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\sesame-rio-ntriples-2.7.16.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\sesame-rio-turtle-2.7.16.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\sesame-util-2.7.16.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\shared-objects-1.4.9-p1.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\slf4j-api-1.7.5.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\slf4j-simple-1.7.5.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\stringtemplate-3.2.1.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\trove4j-3.0.3.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\xercesImpl-2.11.0.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\xml-apis-1.4.01.jar;c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\pellet\xz-1.5.jar pellet.Pellet realize --ignore-imports C:\Users\Caiu\AppData\Local\Temp\tmp9m7eh3n5
---------------------------------------------------------------------------
CalledProcessError                        Traceback (most recent call last)
c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\reasoning.py in sync_reasoner_pellet(x, infer_property_values, infer_data_property_values, debug, keep_tmp_file)
    238     try:
--> 239       output = subprocess.run(command, stdout = subprocess.PIPE, stderr = subprocess.PIPE, check = True).stdout
    240     except subprocess.CalledProcessError as e:

c:\users\caiu\anaconda3\envs\'mestrado'\lib\subprocess.py in run(input, timeout, check, *popenargs, **kwargs)
    437             raise CalledProcessError(retcode, process.args,
--> 438                                      output=stdout, stderr=stderr)
    439     return CompletedProcess(process.args, retcode, stdout, stderr)

CalledProcessError: Command '['C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath\\Java.exe', '-Xmx2000M', '-cp', "c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\antlr-runtime-3.4.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\aopalliance-1.0.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\aterm-java-1.8.2-p1.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\commons-codec-1.6.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\commons-csv-1.0.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\commons-io-2.4.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\commons-lang3-3.3.2.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\guava-18.0.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\guice-4.0.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\guice-assistedinject-4.0.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\guice-multibindings-4.0.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\javax.inject-1.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\jena-arq-2.13.0.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\jena-core-2.13.0.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\jena-iri-1.1.2.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\jgrapht-jdk1.5-0.7.3.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\jjtraveler-0.6.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\owlapi-distribution-4.1.4.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\pellet-cli-2.4.0-SNAPSHOT.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\pellet-core-2.4.0-SNAPSHOT.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\pellet-explanation-2.4.0-SNAPSHOT.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\pellet-jena-2.4.0-SNAPSHOT.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\pellet-owlapi-2.4.0-SNAPSHOT.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\pellet-pellint-2.4.0-SNAPSHOT.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\pellet-query-2.4.0-SNAPSHOT.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\sesame-model-2.7.16.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\sesame-rio-api-2.7.16.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\sesame-rio-datatypes-2.7.16.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\sesame-rio-languages-2.7.16.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\sesame-rio-nquads-2.7.16.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\sesame-rio-ntriples-2.7.16.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\sesame-rio-turtle-2.7.16.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\sesame-util-2.7.16.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\shared-objects-1.4.9-p1.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\slf4j-api-1.7.5.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\slf4j-simple-1.7.5.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\stringtemplate-3.2.1.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\trove4j-3.0.3.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\xercesImpl-2.11.0.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\xml-apis-1.4.01.jar;c:\\users\\caiu\\anaconda3\\envs\\'mestrado'\\lib\\site-packages\\owlready2\\pellet\\xz-1.5.jar", 'pellet.Pellet', 'realize', '--ignore-imports', 'C:\\Users\\Caiu\\AppData\\Local\\Temp\\tmp9m7eh3n5']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

OwlReadyJavaError                         Traceback (most recent call last)
<ipython-input-3-8edd04b199a3> in <module>
      1 with onto:
----> 2     sync_reasoner_pellet(keep_tmp_file = True)

c:\users\caiu\anaconda3\envs\'mestrado'\lib\site-packages\owlready2\reasoning.py in sync_reasoner_pellet(x, infer_property_values, infer_data_property_values, debug, keep_tmp_file)
    242         raise OwlReadyInconsistentOntologyError()
    243       else:
--> 244         raise OwlReadyJavaError("Java error message is:\n%s" % (e.stderr or b"").decode("utf8"))
    245
    246     output = output.decode("utf8").replace("\r","")

OwlReadyJavaError: Java error message is:




And after it, this code does not make the reasoner. I tried to change:
owlready2.JAVA_EXE = "\\path\\to\\java.exe" , but this not works too.

Someone help me to use this reasoner?  Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Problem when use any Reasoner

Jiba
Administrator
Hi,

Which version of java are you using?

I use the following:

#  java -version
openjdk version "1.8.0_222"
OpenJDK Runtime Environment (build 1.8.0_222-b05)
OpenJDK 64-Bit Server VM (build 25.222-b05, mixed mode)

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: Problem when use any Reasoner

Caiubi
Hi!!

Excelent, it's worked!! thank you Jiba!!

Em ter, 3 de set de 2019 às 06:59, Jiba [via Owlready] <[hidden email]> escreveu:
Hi,

Which version of java are you using?

I use the following:

#  java -version
openjdk version "1.8.0_222"
OpenJDK Runtime Environment (build 1.8.0_222-b05)
OpenJDK 64-Bit Server VM (build 25.222-b05, mixed mode)

Jiba


If you reply to this email, your message will be added to the discussion below:
http://owlready.8326.n8.nabble.com/Problem-when-use-any-Reasoner-tp1331p1334.html
To unsubscribe from Problem when use any Reasoner, click here.
NAML
Reply | Threaded
Open this post in threaded view
|

Re: Problem when use any Reasoner

Caiubi
In reply to this post by Jiba
Hi!!

It's worked!! Thank you Jiba!!