If you send an Accept header for Turtle, the server returns Turtle:
$ curl -H 'Accept: text/turtle' --data-urlencode query='CONSTRUCT {
?item a <http://example.com/Human>. } WHERE { ?item wdt:P31 wd:Q5. }
LIMIT 10'
https://query.wikidata.org/sparql
@prefix wd: <http://www.wikidata.org/entity/> .
# ...
wd:Q260 a <http://example.com/Human> .
# ...
Unfortunately, specifying an analogous N-Triples header doesn’t work.
I’m not sure why – perhaps BlazeGraph just doesn’t support it directly.
Cheers,
Lucas
On 20.07.2018 04:22, Peter F. Patel-Schneider wrote:
Hi:
How can I control the form of CONSTRUCT results from the wikidata query
service?
On the web interface I can get the results in various formats (but not
something that can be read into SPARQL, I don't think). Using curl all I get
is XML/RDF.
What I really want is n-triples so that I can concatenate several results, but
Turtle would be better than RDF/XML.
peter
_______________________________________________
Wikidata-tech mailing list
Wikidata-tech(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-tech