swrlapi-drools-engine icon indicating copy to clipboard operation
swrlapi-drools-engine copied to clipboard

Take too much time to create SQWRL Query Engine

Open vanlot opened this issue 8 years ago • 3 comments

Hi friends,

I have a problem with creating query engine object. It takes too much time to generate an object of query engine (around 1 minute). My code is below: .... String path = "C:/Ontology/Test/Heart.owl";
try { // Create OWLOntology instances using the OWLAPI ontologyManager = OWLManager.createOWLOntologyManager();
File file = new File(path); ontology = ontologyManager.loadOntologyFromOntologyDocument(file);
queryEngine = SWRLAPIFactory.createSQWRLQueryEngine(ontology);
} catch (OWLOntologyCreationException e) { e.printStackTrace(); } It take more than one minute to execute the code: queryEngine = SWRLAPIFactory.createSQWRLQueryEngine(ontology);

Are there any solutions to make it run faster?

Thank you,

Van

vanlot avatar Sep 27 '16 08:09 vanlot

How large is the ontology? (Can you post it here if possible?)

How much memory have you allocated to the JVM?

cedaradmin avatar Sep 27 '16 20:09 cedaradmin

It is not big, with around 66 classes (see the attached file). I also allocate -Xmx2048m in JMV in Java EE Eclipse. Note:

  • The ontology is created using Protege 3.5. It has around 20 SWRL rules.
  • in my java code, I use the libaries of swrlapi 1.1.2, swrlapi-drools-engine 1.1.2, owlapi-distribution 4.2.6

File: Sample.zip

Thanks Van

vanlot avatar Sep 27 '16 23:09 vanlot

I am having the exact same issue . The ontology is pretty small with 2 SWRL rules , but it still takes longer time to load .

OWLOntologyManager owlManager = OWLManager.createOWLOntologyManager(); OWLOntology ontology = owlManager .loadOntologyFromOntologyDocument(fileStorageService.loadFileAsResource("test.owl").getFile()); // The below line takes long time to load although the file is pretty small. return SWRLAPIFactory.createSQWRLQueryEngine(ontology);

jars used

swrlapi-2.0.8.jar swrlapi-drools-engine-2.0.8.jar

ashishiter avatar May 07 '20 12:05 ashishiter