SPARQL query

191 views
Skip to first unread message

Laurent Capelli

unread,
Jan 29, 2013, 1:11:36 PM1/29/13
to arc...@googlegroups.com
Dear all,

I'm trying to query a 3store with ARC2 php class and I always get this error. Could someone known this issue?

---

SELECT ?subject ?label ?nbdoc WHERE { ?subject <http://www.w3.org/2004/02/skos/core#prefLabel> ?label. { SELECT ?subject (count(?s) AS ?nbdoc) WHERE {?s <http://purl.org/dc/terms/subject> <http://rechercheisidore.fr/hdl:10670/1.06l45i>. ?s <http://purl.org/dc/terms/subject> ?subject.} } FILTER (?nbdoc>10) } ORDER BY DESC(?nbdoc) LIMIT 1000

---

The error is: Incomplete or invalid Group Graph pattern. Could not handle " SELECT ?subject count(?s) AS"

Thanks for helping!


Regards,

Laurent


René Verheij

unread,
Jan 29, 2013, 1:28:08 PM1/29/13
to arc...@googlegroups.com
looks like 3store does not support subqueries? ... (but don't take my word on that cause I honestly don't know).

Wouldnt you be able to do this with one query?

something like

SELECT ?subject ?label (count(?s) AS ?nbdoc) WHERE { ?subject <http://www.w3.org/2004/02/skos/core#prefLabel> ?label. ?s <http://purl.org/dc/terms/subject> <http://rechercheisidore.fr/hdl:10670/1.06l45i>. ?s <http://purl.org/dc/terms/subject> ?subject. } FILTER (?nbdoc>10) } ORDER BY DESC(?nbdoc) LIMIT 1000


2013/1/29 Laurent Capelli <laurent...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "arc-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to arc-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Laurent Capelli

unread,
Jan 29, 2013, 2:04:13 PM1/29/13
to arc...@googlegroups.com
thanks
3store is virtuoso.
no problem with this subquery on the virtuoso sparql endpoint page.
this error comes from the ARC2 sparql Parser...


Le mardi 29 janvier 2013 19:28:08 UTC+1, Flyon a écrit :
looks like 3store does not support subqueries? ... (but don't take my word on that cause I honestly don't know).

Wouldnt you be able to do this with one query?

something like

SELECT ?subject ?label (count(?s) AS ?nbdoc) WHERE { ?subject <http://www.w3.org/2004/02/skos/core#prefLabel> ?label. ?s <http://purl.org/dc/terms/subject> <http://rechercheisidore.fr/hdl:10670/1.06l45i>. ?s <http://purl.org/dc/terms/subject> ?subject. } FILTER (?nbdoc>10) } ORDER BY DESC(?nbdoc) LIMIT 1000

because without the subquery, virtuoso is too long!

SELECT ?subject ?label ?nbdoc WHERE { ?subject <http://www.w3.org/2004/02/skos/core#prefLabel> ?label. { SELECT distinct ?subject (count(?s) AS ?nbdoc) WHERE {?s <http://purl.org/dc/terms/subject> <http://rechercheisidore.fr/hdl:10670/1.06l45i>. ?s <http://purl.org/dc/terms/subject> ?subject.} } FILTER (?nbdoc>10) } ORDER BY DESC(?nbdoc) LIMIT 1000

René Verheij

unread,
Jan 29, 2013, 2:20:55 PM1/29/13
to arc...@googlegroups.com
Ah right..  Well I'm pretty sure ARC2 does not support subqueries, which is a SPARQL 1.1 feature isn't it? .. 
Someone saying that here too :
http://stackoverflow.com/questions/10162052/rdfcollection-in-sparql


2013/1/29 Laurent Capelli <laurent...@gmail.com>

Barry Norton

unread,
Jan 29, 2013, 2:18:51 PM1/29/13
to arc...@googlegroups.com
... oh, and aggregates (COUNT).

Barry


On Tue, Jan 29, 2013 at 7:18 PM, Barry Norton <barry...@gmail.com> wrote:
Both the AS syntax, and subqueries in general, are SPARQL 1.1 Query features, which are not supported in arc2.

Barry

Barry Norton

unread,
Jan 29, 2013, 2:18:32 PM1/29/13
to arc...@googlegroups.com
Both the AS syntax, and subqueries in general, are SPARQL 1.1 Query features, which are not supported in arc2.

Barry
On Tue, Jan 29, 2013 at 7:04 PM, Laurent Capelli <laurent...@gmail.com> wrote:

René Verheij

unread,
Jan 29, 2013, 4:26:32 PM1/29/13
to arc...@googlegroups.com
Actually AS and COUNT do work Barry... this works for me using only ARC2:

SELECT COUNT(?s) AS ?count WHERE { ?s rdf:type ?o }

2013/1/29 Barry Norton <barry...@gmail.com>

Barry Norton

unread,
Jan 29, 2013, 4:37:57 PM1/29/13
to arc...@googlegroups.com
Sorry, yes, there's a pre-standardised/1.1 SPARQL extension for queries in the parser. I don't think the list of aggregates are fully coincident, but I guess COUNT was an obvious one (from SQL)
Reply all
Reply to author
Forward
0 new messages