Optimization of VALUES

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

Optimization of VALUES

Marek Surek
Hi Sesame developers,
I run into some optimization problem which I've already reported into OWLIM forum (http://answers.ontotext.com/questions/1256/optimization-proposal-dramatic-performance-difference-using-values). They say that Sesame could optimizatize it. I would like to ask whether there are some possible optimizations which could be done in this way.
At the same time I found another (actually much bigger) problem regarding to VALUES and BINDINGS and I dont know where to submit it so I'm going to write it here.

Here are two equal queries, where one uses BINDINGS and one uses VALUES. The performance difference is enormous (BINDINGS is much much faster). More items are in VALUES, the slower it is. The custom function just converts special characters and whitespaces to ASCII and does not make performance difference :

SELECT DISTINCT ?value ?label WHERE { VALUES ?broaderEntity  {   <http://foo.com/0101528595>  <http://foo.com/0102529311>  <http://foo.com/0102529320>  <http://foo.com/0102529338>  <http://foo.com/0103529346>  <http://foo.com/0103529354>  <http://foo.com/0103529362>  <http://foo.com/0104529371>  <http://foo.com/0104529389>  <http://foo.com/0104529397>  <http://foo.com/0105529460>  <http://foo.com/0105529494>  <http://foo.com/0104529419>  <http://foo.com/0104529427>  <http://foo.com/0104529401>  <http://foo.com/0105529435>  <http://foo.com/0105529443>  }  ?value rdf:type gn:Feature . ?value gn:featureClass <http://www.geonames.org/ontology#R> . ?value gn:featureCode <http://www.geonames.org/ontology#R.ST> . ?value gn:name ?label . ?value gn:parentADM4 ?broaderEntity . BIND (df:compareStripString(?label) as ?result) . FILTER ( regex(str(?result),'sometext') || regex('sometext', str(?result)) ) } LIMIT 10


SELECT DISTINCT ?value ?label WHERE { ?value rdf:type gn:Feature . ?value
gn:featureClass <http://www.geonames.org/ontology#R> . ?value gn:featureCode
<http://www.geonames.org/ontology#R.ST> . ?value gn:name ?label . ?value
gn:parentADM4 ?broaderEntity . BIND (df:compareStripString(?label) as ?result) .
FILTER ( regex(str(?result),'sometext') || regex('sometext', str(?result))
) }  
BINDINGS ?broaderEntity  {  ( <http://foo.com/0101528595> ) ( <http://foo.com/0102529311> ) ( <http://foo.com/0102529320> ) ( <http://foo.com/0102529338> ) ( <http://foo.com/0103529346> ) ( <http://foo.com/0103529354> ) ( <http://foo.com/0103529362> ) ( <http://foo.com/0104529371> ) ( <http://foo.com/0104529389> ) ( <http://foo.com/0104529397> ) ( <http://foo.com/0105529460> ) ( <http://foo.com/0105529494> ) ( <http://foo.com/0104529419> ) ( <http://foo.com/0104529427> ) ( <http://foo.com/0104529401> ) ( <http://foo.com/0105529435> ) ( <http://foo.com/0105529443> ) }

Thank you for your time and investigation. If it is problem of OWLIM I will certainly ask them to fix it as performance drops are significant.

Best regards,
Marek