protegeproject / sparql-query-plugin

Protege Desktop plug-in that provides support for writing and executing SPARQL queries.
12 stars 11 forks source link

SPARQL query very slow #6

Closed csnyulas closed 7 years ago

csnyulas commented 8 years ago

I loaded the Wine ontology (https://www.w3.org/TR/2003/PR-owl-guide-20031215/wine) into Protege. This is a small ontology with 1046 axioms (file size 78.2 kB).

When I executed in the "SPARQL Query" tab the following basic query:

SELECT ?subject ?p ?object
    WHERE { ?subject ?p ?object }

I had to wait at about 40 seconds (on a very fast machine) to get back the results. In the mean time I was constantly getting this message repeated on the console:

dumping remaining triples 
done dumping remaining triples 

sometime spiced with messages like this:

dumping remaining triples 
_:BNodenode1aa2smhrlx746 -> http://www.w3.org/1999/02/22-rdf-syntax-ns#type -> http://www.w3.org/2002/07/owl#AllDifferent 
done dumping remaining triples 
csnyulas commented 8 years ago

I am wondering if this may be related to protegeproject/rdf-library#2

rsgoncalves commented 8 years ago

The bottleneck may lie here: https://github.com/protegeproject/rdf-library/blob/master/src/main/java/org/protege/owl/rdf/impl/OwlTripleStoreImpl.java#L296, where an OWLOntologyManager and an OWLOntology instance are created (seemingly) for each axiom. The OWLOntology is created so it can be passed onto OWLRDFConsumer, which is outputting the "dumping triples" and blank node messages.

rsgoncalves commented 7 years ago

The messages posted are coming from the OWL API's OWLRDFConsumer. The execution performance doesn't look abnormal for the query, so I'm closing this.