netwerk-digitaal-erfgoed / requirements-datasets

Requirements for datasets
https://netwerk-digitaal-erfgoed.github.io/requirements-datasets/
1 stars 0 forks source link

schema:encodingFormat SPARQL #67

Open coret opened 1 year ago

coret commented 1 year ago

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. But application/sparql-query applies to the request type, and scheme:encodingFormat should describe the response type, for a SPARQL endpoint this is application/sparql-results+xml.

TODO: correct requirements, correct SHACL and add to demonstrator iana mediatypes json.

ddeboer commented 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.

coret commented 1 year ago

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:

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 the schema:contentUrl when no Accept header is included in the request. It is recommended to provide an URL of documentation via the schema:usageInfo property in which the supported encoding formats which can be requested via an Accept 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)