Nov 14 2005

Classes In Embedded RDF

Published by Ian Davis at 3:06 am under Uncategorized

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
    <a href="http://purl.org/NET/iand" rel="foaf-homepage" class="-foaf-Document">here</a>
  </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.

2 Responses to “Classes In Embedded RDF”

  1. eric milleron 15 Nov 2005 at 3:07 pm

    Excellent! IOW: $1 to Ian Davis per our ISWC bet. Well done Ian! :)

  2. iandon 15 Nov 2005 at 5:57 pm

    Cheers Eric. Look forward to buying you a drink with it :)