protegeproject / swrlapi-drools-engine

Drools implementation of a SWRLAPI-based OWL 2 RL reasoner and SWRL rule engine
Other
26 stars 12 forks source link

Take too much time to create SQWRL Query Engine #6

Open vanlot opened 8 years ago

vanlot commented 8 years ago

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

cedaradmin commented 8 years ago

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

How much memory have you allocated to the JVM?

vanlot commented 8 years ago

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

File: Sample.zip

Thanks Van

ashishiter commented 4 years ago

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