It seems that with the stricter enforcement of the user agent policy we are blocking legitimate SPARQL requests. These are requests where people are writing federated SPARQL queries on another SPARQL endpoint and as part of that federate with Wikidata Query Service. Setting a compliant user agent doesn't seem to be possible with some (even most?) query backends unfortunately.
The ability to write federated SPARQL queries that include data from Wikidata is pretty core to our work on building out the Wikibase Ecosystem and taking off load from Wikidata. Is there any solution we can find here?
Here is a request that is blocked but that we believe should be allowed:
curl 'https://sparql.fornpunkt.se/query' -X POST -H 'Accept: application/sparql-results+json,*/*;q=0.9' --data-raw 'query=PREFIX+schema%3A+%3Chttp%3A%2F%2Fschema.org%2F%3E%0APREFIX+oa%3A+%3Chttp%3A%2F%2Fwww.w3.org%2Fns%2Foa%23%3E%0A%0ASELECT+%3Fwikidata+WHERE+%7B%0A++%3Fannotation+oa%3AhasTarget+%3Chttp%3A%2F%2Fkulturarvsdata.se%2Fraa%2Flamning%2F401055fc-e795-4e2c-8e34-c45dfde18e61%3E+%3B%0A++++++++++++++oa%3AhasBody+%3Fbody+.%0A++%3Fbody+schema%3AsubjectOf+%3Ftarget+.%0A%0A++SERVICE+%3Chttps%3A%2F%2Fquery.wikidata.org%2Fsparql%3E+%7B%0A++++%3Ftarget+schema%3Aabout+%3Fwikidata+.%0A++%7D%0A%7D%0A'
Upstream issues for adding User-Agent support:
- Fuseki: apache/jena#3148 (fix shipped in Jena 5.5.0 – sends something like ApacheJena/5.5.0, no customization supported yet)
- Oxigraph: oxigraph/oxigraph#1456 (Oxigraph currently sends Oxigraph/0.5.0, which is enough to make the request go through; upstream issue is for allowing further customization, but not strictly necessary at the moment)
- WDQS: N/A, sends User-Agent: Wikidata Query Service; https://query.wikidata.org/ by default which may be rejected in future but can be overridden via the $USER_AGENT environment variable. To fix this for Wikibase Suite - T405233
- Virtuoso: TBD?
- …