Skip to content

Instantly share code, notes, and snippets.

@stain
Last active June 18, 2018 17:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stain/4635250 to your computer and use it in GitHub Desktop.
Save stain/4635250 to your computer and use it in GitHub Desktop.
How to define Internet Media Type in RDF - is there a namespace? Yes - but not an official one. See http://answers.semanticweb.com/questions/639/is-there-a-namespace-to-describe-mimetypes-and-encodings and http://mediatypes.appspot.com/
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix dcam: <http://purl.org/dc/dcam/> .
<http://example.com/page.html> dcterms:format <http://purl.org/NET/mediatypes/text/html> .
<http://purl.org/NET/mediatypes/text/html> a dcterms:FileFormat ;
dcam:memberOf dcterms:IMT ;
rdf:value "text/html" ;
rdfs:isDefinedBy <http://mediatypes.appspot.com/dump.rdf> ;
rdfs:label "HTML document" .
@stain
Copy link
Author

stain commented Jan 25, 2013

This is a hybrid - it provides the dcterms details of the media type directly - but uses the namespaces of http://purl.org/NET/mediatypes/ rather than anonymous nodes.

Sadly the mediatypes URLs don't resolve properly to RDF - and the RDF at http://mediatypes.appspot.com/dump.rdf is also quite sparse - it has no such statements as above, for instance.

@zednis
Copy link

zednis commented Apr 13, 2016

http://mediatypes.appspot.com/ appears to be down :-(

@nicholascar
Copy link

This is now up: http://13.236.122.60/dataset/mediatypes/ with PIDs like this: http://w3id.org/mediatype/text/turtle. Very happy for suggestions as to how to make it great at https://github.com/nicholascar/mediatypes-dataset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment