RE: [ExternalEmail] Media Types URIs - profileneg - lang

Hi all,

Further to this: I’ve added basic language negotiation with one test profile in both English and (bad) Polish:

# a Media Type, default view, HTML, in Polish:
https://w3id.org/mediatype/audio/3gpp?_lang=pl


# 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:

https://w3id.org/mediatype/audio/3gpp?_view=alternates


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.

Cheers,

Nick




From: Car, Nicholas (L&W, Dutton Park) [mailto:Nicholas.Car@csiro.au]
Sent: Tuesday, 19 June 2018 5:53 AM
To: public-dxwg-wg@w3.org
Subject: Re: [ExternalEmail] Media Types URIs - profileneg

Hi all,

Please note also that the tiny API used to deliver the various views and formats for Media Types is also testing profile negotiation viz.:

# 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<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<http://w3id.org/mediatype/text/html/?_format=text/turtle>

Soon to be added will be language negotiation!

Cheers,

Nick



From: Nicholas Car <Nicholas.Car@csiro.au<mailto:Nicholas.Car@csiro.au>>
Date: Tuesday, 19 June 2018 at 3:43 am
To: "public-dxwg-wg@w3.org<mailto:public-dxwg-wg@w3.org>" <public-dxwg-wg@w3.org<mailto:public-dxwg-wg@w3.org>>
Subject: [ExternalEmail] Media Types URIs
Resent-From: <public-dxwg-wg@w3.org<mailto:public-dxwg-wg@w3.org>>
Resent-Date: Tuesday, 19 June 2018 at 3:41 am

Dear DXWG,

I’ve just put up a small API to deliver Media Types via URIs so if you want to quote text/html, you can do so like this: https://w3id.org/mediatype/text/turtle and get a simple web page or this:

@prefix dct: <http://purl.org/dc/terms/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<https://w3id.org/mediatype/text/turtle> a dct:FileFormat ;
    rdfs:label "turtle"^^xsd:string ;
    dct:contributor <https://w3id.org/mediatype/Eric_Prudhommeaux>,
        <https://w3id.org/mediatype/W3C> .

This just replaces a system that did this using purl.org/NET/mediatypes/ but which has been down for years (see https://gist.github.com/stain/4635250).

The reason for doing this now is that we are really using dct:format a lot but don’t have dereferenceable URIs for it.
The register of Media Types is here: https://w3id.org/mediatype/


Consider this tool actively developed so you can raise issues (https://github.com/nicholascar/mediatypes-dataset/issues) or get things changed if they aren’t great!

Cheers,

Nick

Received on Tuesday, 19 June 2018 02:40:44 UTC