Open coret opened 1 year ago
We had some discussion about this in #45 already.
A possible downside of using application/sparql-results+xml
is that there’s also application/sparql-results+json
and even CSV and TSV, so describing a SPARQL endpoint becomes more cumbersome. At the very least, we need to decide whether to prescribe just one or all of the possible result formats.
The default Content-type
of the response of an SPARQL endpoint is not defined in the SPARQL 1.1 Protocol and differs per implementation. Some examples:
text/csv;charset=UTF-8
application/sparql-results+json
application/json; charset=UTF-8
application/sparql-results+xml;charset=utf-8
In a request you can specify the Accept
HTTP header to indicate the desired Content-type
of the response. Some implementations (such as Virtuoso) also allow for a format
parameter in the URL.
This leads to the following conclusion (to be included in the specification):
The
schema:encodingFormat
should indicate the Media type of the response of theschema:contentUrl
when noAccept
header is included in the request. It is recommended to provide an URL of documentation via theschema:usageInfo
property in which the supported encoding formats which can be requested via anAccept
HTTP header are listed.
Downside: it's harder to query for SPARQL-endpoints, you cannot rely on the "Linked Data" encodingFormats (because an SPARQL endpoint may respond with text/csv
) and distinguishing distribution types is not yet defined (see issue #45)
ref: https://twitter.com/markuitheiloo/status/1554838166174965761
In the example, and also SHACL and demonstrator, application/sparql-query is used as an example for a distributions
schema:encodingFormat
. Butapplication/sparql-query
applies to the request type, andscheme:encodingFormat
should describe the response type, for a SPARQL endpoint this isapplication/sparql-results+xml
.TODO: correct requirements, correct SHACL and add to demonstrator iana mediatypes json.