- From: Car, Nicholas (L&W, Dutton Park) <Nicholas.Car@csiro.au>
- Date: Mon, 18 Jun 2018 19:53:19 +0000
- To: "public-dxwg-wg@w3.org" <public-dxwg-wg@w3.org>
- Message-ID: <AFAEF17B-F156-4577-9F7E-00727F0E8E9C@csiro.au>
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
# 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
Soon to be added will be language negotiation!
Cheers,
Nick
From: Nicholas Car <Nicholas.Car@csiro.au>
Date: Tuesday, 19 June 2018 at 3:43 am
To: "public-dxwg-wg@w3.org" <public-dxwg-wg@w3.org>
Subject: [ExternalEmail] Media Types URIs
Resent-From: <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 Monday, 18 June 2018 19:53:47 UTC