On 28/01/15 18:34, Milorad Tosic wrote:
Hi Laurent,
I would give a try to a different sequencing in the query. For example:
PREFIX base:<http://www.telemis.com/>PREFIX rdf:
<http://www.w3.org/1999/02/22-rdf-syntax-ns#>PREFIX XMLS:
<http://www.w3.org/2001/XMLSchema#>
SELECT ?x{ ?image base:sopInstanceUID
"1.2.840.113564.10656621.201302121438403281.1003000225002"^^XMLS:string .
?image a base:Image . ?seq ?p ?image . ?x base:images ?seq .
?x a base:ImageAnnotation ; base:deleted false .
}
Though, it may or may not help.
Regards,Milorad
From: Laurent Rucquoy <[email protected]>
To: [email protected]
Sent: Wednesday, January 28, 2015 6:13 PM
Subject: Very slow SPARQL query on TDB
Hello,
I have a Java application which implements an object model persisted through
JenaBean in my Jena TDB (see the attached image of the classes diagram).
The request to retrieve an ImageAnnotation resource from the ID of a linked
Image is very slow.Here is a typical SPARQL query used (more than 40s to get
the result):
PREFIX base:<http://www.telemis.com/>PREFIX rdf:
<http://www.w3.org/1999/02/22-rdf-syntax-ns#>PREFIX XMLS:
<http://www.w3.org/2001/XMLSchema#>
SELECT ?x{ ?x a base:ImageAnnotation ; base:deleted false ; base:images ?seq . ?seq ?p
?image . ?image a base:Image . ?image base:sopInstanceUID
"1.2.840.113564.10656621.201302121438403281.1003000225002"^^XMLS:string .}
Can you help me to find what I'm doing wrong ?
Thank you in advance.
Sincerely,Laurent
Which version of TDB? 2.11.2 had possibly related fixes.
https://issues.apache.org/jira/browse/JENA-685
If you do take Milorad suggestion, also put in a "none.opt" file to stop
TDB reordering your improved order into a worse one.
http://jena.apache.org/documentation/tdb/optimizer.html#choosing-the-optimizer-strategy
Andy
PS Attachments don't come through this list.