[Building Sakai] SPARQL structure/time issue
Cliff, David Graeme
dgcliff at iu.edu
Thu Apr 26 06:44:31 PDT 2012
Hi all,
I get the sneaking suspicion that the SPARQL I'm running could be better structured, as it takes a long time to return, and was wondering if anyone had any ideas how I might reorganize it.
SELECT (COUNT(DISTINCT ?pirole) AS ?count)
WHERE
{
?pirole a <http://vivoweb.org/ontology/core#PrincipalInvestigatorRole> ;
?a ?b .
NOT EXISTS {?pirole <http://vivoweb.org/ontology/core#principalInvestigatorRoleOf> ?x}
}
That query takes almost 10 minutes to return, and the result is 22529. If I drop the ?a ?b (obviously not needed for a count) it comes back in reasonable time. However that's not really an option for the CONSTRUCT query I run, and its this that the server has a very hard time dealing with.
CONSTRUCT
{
?pirole ?a ?b .
}
WHERE
{
?pirole a <http://vivoweb.org/ontology/core#PrincipalInvestigatorRole> ;
?a ?b .
NOT EXISTS {?pirole <http://vivoweb.org/ontology/core#principalInvestigatorRoleOf> ?x}
}
Any ideas?
- David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20120426/4ddb2349/attachment.html
More information about the sakai-dev
mailing list