Hello,

I am using the following Sparql query against a TDB store:

SELECT * 
WHERE {
   ?pat a nci:Patient .
   ?pat ec:Has_Id ?patId .
   ?findingProp rdfs:subPropertyOf ec:Has_Finding .
   ?pat ?findingProp ?finding .
   ?finding a ?findingType .
}

 
When I run this query WITHOUT the last triple (the bolded line), it returns the 
correct result within seconds.

But when I run this query WITH the last triple, the query runs a very long 
time. I do not know how long b/c I cancelled it after 1 hour.

This difference in behavior seems unexpected to me since I would assume that 
the query processor already bound ?finding and getting the rdf:type of an 
already known resource should not be a problem.

I assume that the problem actually stems from the 2 triples before, where I 
dynamically define the property (?findingProp). I tried the same query with a 
single property instead of ?findingProp and the query ran fine.

Is it combination of ?findingProp and the last triple that throws the query 
processor of or am I asking for something in the query that I did not intend?

My TDB store contains the NCI thesaurus, my own extensions plus individuals for 
my patient data. Everything is in the default graph.

Thanks for any help!

-Wolfgang



Reply via email to