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