Using SQWRL got error: QueryEngineError creating query engine Drools.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Using SQWRL got error: QueryEngineError creating query engine Drools.

lida
This post has NOT been accepted by the mailing list yet.

I download swrlproject, and build them all. The project are as follows:
swrlapi                swrlapi-integration-tests  swrltab
swrlapi-drools-engine  swrlapi-parent             swrltab-plugin
swrlapi-example        swrlapi-project

Adding the jars in my libraries as follows:


I use eclipse to run code.This is my sqwrl code:
OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
OWLOntology ontology = manager.loadOntologyFromOntologyDocument(file);
SQWRLQueryEngine queryEngine = SWRLAPIFactory.createSQWRLQueryEngine(ontology);
SQWRLResult result = queryEngine.runSQWRLQuery("s",
                                         "SecurityRequirement(?s)^hasObject(?s,jd) -> sqwrl:select(?s)");
System.out.println("********** Query result is : "+result.toString());

But I got the error:

Error starting application: Error creating query engine Drools. Exception: java.lang.NoSuchMethodError. Message: org.semanticweb.owlapi.model.OWLDocumentFormat.isPrefixOWLOntologyFormat()Z

When I run swrlapi-example
$ mvn exec:java
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building SWRLAPI Example 2.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- exec-maven-plugin:1.5.0:java (default-cli) @ swrlapi-example ---
Error running SWRL rule or SQWRL query: cannot convert value of type xsd:integer to xsd:int

The environment I used as follows
$ mvn -v
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-04T03:39:06+08:00)
Maven home: /opt/apache-maven-3.5.0
Java version: 1.8.0_91, vendor: Oracle Corporation
Java home: /opt/jdk1.8.0_91/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "linux", version: "3.17.4", arch: "amd64", family: "unix"

Please help me. Thanks advance.