Hi, I wanted to test the use of the queries below to list named graphs (if any) in wikidata service [a]. I've tried them without success:
1- select distinct ?g { graph ?g {} } 2- select distinct ?g { graph ?g {?s ?p ?o} } 3- select (count(distinct ?g) as ?count) { graph ?g {} }
Are those queries not standard or just taking too much time because of the underlying dataset | time out settings?
In general, is there a way to reduce the time execution of such "useful" query in public endpoints with billions of data
TIA Best, Ghislain PS: I note that there are errors when trying to use DBpedia endpoint for queries #1 and #3. The result of query #2 is a bit strange. [a] https://query.wikidata.org/
Hi!
I wanted to test the use of the queries below to list named graphs (if any) in wikidata service [a]. I've tried them without success:
We do not use any subgraphs in WDQS, so I don't think that query would produce much of a useful result.
Thanks Stas! It's clear that a user might ask any type of query from an endpoint according to her needs. My concern goes further on whether such queries are valid or not in the underlying RDF graph (in this case BLZ) regarding SPARQL 1.1 spec. You agree with me that this query : `select distinct ?g { graph ?g {?s ?p ?o} }` seems to be a valid SPARQL query, but throws an error in WDQS service [1].
Any thoughts on this? Best, Ghislain [1] https://goo.gl/hdJwUk
El jue., 20 abr. 2017 a las 21:54, Stas Malyshev (smalyshev@wikimedia.org) escribió:
Hi!
I wanted to test the use of the queries below to list named graphs (if any) in wikidata service [a]. I've tried them without success:
We do not use any subgraphs in WDQS, so I don't think that query would produce much of a useful result.
-- Stas Malyshev smalyshev@wikimedia.org
Hi!
You agree with me that this query : `select distinct ?g { graph ?g {?s ?p ?o} }` seems to be a valid SPARQL query, but throws an error in WDQS service [1].
It is a valid SPARQL query, but what you're essentially asking is to download whole 1.8b triples in a single query. There's no way we can deliver this in one minute, which is current constraint on queries, neither we want to enable queries like this - they are very resource-intensive and serve little purpose.
If you want to work with huge data sets or import the whole data, you may look either into getting the dump download and processing it with offline tools like Wikidata Toolkit[2], or using our LDF server[1] which is lightweight and allows you to work with the data much more efficiently.
[1] https://www.mediawiki.org/wiki/Wikidata_query_service/User_Manual#Linked_Dat... [2] https://www.mediawiki.org/wiki/Wikidata_Toolkit
Hi Stas,
On 21-04-2017 15:04, Stas Malyshev wrote:
Hi!
You agree with me that this query : `select distinct ?g { graph ?g {?s ?p ?o} }` seems to be a valid SPARQL query, but throws an error in WDQS service [1].
It is a valid SPARQL query, but what you're essentially asking is to download whole 1.8b triples in a single query. There's no way we can deliver this in one minute, which is current constraint on queries, neither we want to enable queries like this - they are very resource-intensive and serve little purpose.
If you want to work with huge data sets or import the whole data, you may look either into getting the dump download and processing it with offline tools like Wikidata Toolkit[2], or using our LDF server[1] which is lightweight and allows you to work with the data much more efficiently.
While not having a strong opinion on the question of whether or not WDQS should support graph queries if it doesn't have named graphs, I disagree on the minor technical point that that query requires streaming all data. It simply asks for a unique list of all named graphs. Typically that will be much smaller than the entire data.
(Of course a naive implementation might stream everything to compute the query, but that's another matter I think.)
Cheers, Aidan