Search code examples
sparqlgraphdb

Ontotext GraphDB SPARQL Query - No acceptable file format found


Ontotext GraphDB 9.0.0, Free Edition, Ubuntu Workstation Linux 4.15.0-65-generic x86_64

I have a simple SPARQL query that works fine in the Query & Update page and from the web service:

select * where { 
    ?s ?p ?o .
} limit 5

and if I don't provide an Accept: header I get the results back as comma separated values. However, if I provide a file format like this:

$ curl -G -H "Accept: text/turtle" 'http://localhost:7200/repositories/...'
No acceptable file format found.

Is there list of or a REST query for acceptable media types?


Solution

  • A SELECT query does not return an RDF graph (in Turtle or any other synatx)- it returns a SPARQL Result set.

    application/sparql-results+json is one format.

    If you want an RDF graph, use a CONSTRUCT query and you can ask for text/turtle:

    CONSTRUCT { ?s ?p ?o } WHERE { ?s ?p ?o } LIMIT 5 
    

    That particular query can be shortened to:

    CONSTRUCT WHERE { ?s ?p ?o } LIMIT 5