API call: get results in the same format for DESCRIBE and SELECT including language of literals

Hello community,

when calling STARDOGs API with a POST request using Postman, when sending a SELECT query, I get the result in XML format:

but when a DESCRIBE query is thrown at it, it responds with what looks like TURTLE syntax:

Is there a way to get a consistent response?

Thank you!

Hi Jasper,

the difference in the result format is caused by the query type that you are using (i.e., SELECT vs DESCRIBE). Simply speaking: SELECT returns a set of mappings from variables to RDF terms and DESCRIBE returns an RDF graph (set of RDF triples).

See also the specification for details on Describe:
"The DESCRIBE form returns a single result RDF graph containing RDF data about resources."
And for Select:
"The SELECT form of results returns variables and their bindings directly. " They can be encoded in different formats: SPARQL 1.1 Query Results JSON Format, SPARQL Query Results XML Format or SPARQL 1.1 Query Results CSV and TSV Formats.

I hope this clarifies the difference.
Best regards


1 Like

Hi @Lars_Heling,
thanks for the quick reply!

That makes sense.

So to just get all the infos provided by DESCRIBE in the same format,
I would basically have to run a simple select * where{?s ?p ?o .} query
on the RDF graph resulting from the DESCRIBE <myIRI>, right?

(or just go ahead and run SELECT * WHERE {<myIRI> ?p ?o .} on my original data in the first place,
though this also returns all the blank nodes)

Hi @JasBo,

yes, as you suggested you can also use the SELECT * WHERE {<myIRI> ?p ?o .} query to get the same result. This returns all outgoing edges of <myIRI>. See also details in the documentation.

Best regards

1 Like