Classes In Embedded RDF

I updated the embedded RDF extractor stylesheet to support the two constructs I wrote about a couple of days ago, namely using cite to generate subject URIs and hyphen prefixed class names to denote RDF classes.

I'll update the main documentation shortly but in the meantime here's some info on the embedded Class support.

For tags with an id attribute and for anchors any token beginning with a hypen in the class attribute are considered to be RDF class names. So the following XHTML:

<p id="ian" class="-foaf-Person">I am a person</p>

generates the following triple:

<#ian> rdf:type foaf:Person .

A more complex example:

<p id="ian" class="-foaf-Person">
    <span class="foaf-name">Ian Davis</span> has a homepage
    here
  </p>

Generates these triples:

<#ian> rdf:type foaf:Person .
<#ian> foaf:name "Ian Davis" .
<#ian> foaf:homepage <http://purl.org/NET/iand> .
<http://purl.org/NET/iand> rdf:type foaf:Document .

Or one with mixed properties and classes in the class attribute:

<p id="ian" class="-foaf-Person">
   Ian is owed $1 by <span class="foaf-knows -foaf-Person" id="eric">Eric Miller</span>
  </p>

Which embeds the following triples:

<#ian> rdf:type foaf:Person .
<#ian> foaf:knows <#eric> .
<#eric> rdf:type foaf:Person .

As a final test, I've augmented my homepage with classes, added a meta link to the embedded RDF extraction service and confirmed that Piggy Bank picks up the types. Works a treat.

Permalink: http://blog.iandavis.com/2005/11/classes-in-embedded-rdf/

Other posts tagged as erdf, rdf

Earlier Posts