Generating RDF from Movable Type keywords

December 30th, 2002  |  Published in perl, rdf

Having created RDF summaries for each Movable Type entry, I wanted a way to add extra triples to that RDF. For a first go, it seems reasonable to make any triple that can be added to an entry have that entry as its subject, so I used a shorthand (no subject, namespace-abbreviated) syntax inspired by N-Triples and wrote an MT global filter plugin (src) to transform it into RDF/XML.

As an example, in this entry, I put this in my keywords:

<dc:identifier> "some unique id" .
<rdfs:seeAlso> <> .

and two extra triples get created in the RDF for this entry.

It’s used in the MT RDF template by putting <$MTEntryKeywords ntriples="1"$>. Of course any namespace prefix used in the Keywords field must be declared in the RDF template beforehand. Apart from that it should be pretty resilient against breaking because it ignores any line that doesn’t match the syntax exactly.

Comments are closed.