Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Take too much time to create SQWRL Query Engine #6

Open
vanlot opened this issue Sep 27, 2016 · 3 comments
Open

Take too much time to create SQWRL Query Engine #6

vanlot opened this issue Sep 27, 2016 · 3 comments

Comments

@vanlot
Copy link

vanlot commented Sep 27, 2016

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
Copy link

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

How much memory have you allocated to the JVM?

@vanlot
Copy link
Author

vanlot commented Sep 27, 2016

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

@ashishiter
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants