Create a gist now

Instantly share code, notes, and snippets.

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
Owner

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

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

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