[Building Sakai] SPARQL structure/time issue
Cliff, David Graeme
dgcliff at iu.edu
Thu Apr 26 06:55:26 PDT 2012
Never mind, I've managed to get decent return times by breaking up my queries. The below CONSTRUCT actually works quite well, it was my combined PI, CO-PI CONSTRUCT statement that made the server stumble around.
Cheers,
David
From: Cliff, David Graeme
Sent: Thursday, April 26, 2012 9:45 AM
To: 'sakai-dev at collab.sakaiproject.org'
Subject: SPARQL structure/time issue
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/e7fef686/attachment.html
More information about the sakai-dev
mailing list