W3C home > Mailing lists > Public > public-dxwg-wg@w3.org > June 2018

Re: [dxwg] Profile negotiation [RPFN]

From: Nicholas Car via GitHub <sysbot+gh@w3.org>
Date: Tue, 19 Jun 2018 02:45:53 +0000
To: public-dxwg-wg@w3.org
Message-ID: <issue_comment.created-398257176-1529376353-sysbot+gh@w3.org>
The test implementation of the Media Types Linked Data API I just set up implements both QSA & HTTP format & language negotiation within QSA & HTTP profile negotiation, e.g.:

Entry for https://w3id.org/mediatype/text/csv in RDF (turtle), default profile:  
`curl -L -H "Accept: text/turtle" http://w3id.org/mediatype/text/csv`

Entry for https://w3id.org/mediatype/text/csv in HTML, ‘alternates’ profile (‘view’ as the API calls it) requested using the URI https://promsns.org/def/alt:
`curl -L -H "Accept-Profile: <https://promsns.org/def/alt>" https://w3id.org/mediatype/text/csv`

As above but in RDF (JSON-LD):  
`curl -L -H "Accept-Profile: <https://promsns.org/def/alt>" -H "Accept: application/rdf+json" https://w3id.org/mediatype/text/csv`

Demo of weighted profile neg with not available view being ignored (not receiving HTTP 406):  
`curl -L -H "Accept-Profile: <http://example.org/notavailable>, <https://promsns.org/def/alt>; q=0.5" -H "Accept: application/rdf+json" https://w3id.org/mediatype/text/csv`

Entry for https://w3id.org/mediatype/text/csv, alternates’ profile indicated by QSA using token & Media Type also indicated by QSA:  
`curl -L http://w3id.org/mediatype/text/html\?_view=alternates\&_format=application/rdf+xml`

Entry for https://w3id.org/mediatype/text/csv default profile with format indicated by QSA using token overriding HTTP Accept header:  
`curl -L -H "Accept: application/rdf+xml" http://w3id.org/mediatype/text/html\?_format=text/turtle`

A Media Type, default view, HTML, in Polish:  

A Media Type, default view, HTML, in Polish (preferred), using HTTP headers  
`curl -L -H "Accept: text/html" -H "Accept-Language: pl, en" https://w3id.org/mediatype/audio/3gpp`

In this configuration, both the *format* and *language* dimensions of the resource are dependent on (configured for a particular) *profile*. The alternates view of a Media Type shows all the options:  


Note that the alternates view itself is only available in English and that the non-HTML serialisations of the “mt” view, while supposedly bing in Polish actually are not. This is an error for the dataset implementer (me) to fix with RDF lang mappings but the API is operating correctly now with both format & lang within profile QSA and HTTP-based negotiation.

GitHub Notification of comment by nicholascar
Please view or discuss this issue at https://github.com/w3c/dxwg/issues/74#issuecomment-398257176 using your GitHub account
Received on Tuesday, 19 June 2018 02:45:57 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:42:04 UTC