[Building Sakai] SPARQL structure/time issue
Cliff, David Graeme
dgcliff at iu.edu
Thu Apr 26 08:02:28 PDT 2012
No it’s not, I meant it for the VIVO mailing list, my mistake.
From: Steve Swinsburg [mailto:steve.swinsburg at gmail.com]
Sent: Thursday, April 26, 2012 10:49 AM
To: Cliff, David Graeme
Cc: sakai-dev at collab.sakaiproject.org
Subject: Re: [Building Sakai] SPARQL structure/time issue
Is this related to Sakai?
Sent from my iPhone
On 26/04/2012, at 23:55, "Cliff, David Graeme" <dgcliff at iu.edu<mailto:dgcliff at iu.edu>> wrote:
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<mailto: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
_______________________________________________
sakai-dev mailing list
sakai-dev at collab.sakaiproject.org<mailto:sakai-dev at collab.sakaiproject.org>
http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org<mailto:sakai-dev-unsubscribe at collab.sakaiproject.org> with a subject of "unsubscribe"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20120426/d22882af/attachment.html
More information about the sakai-dev
mailing list