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.

About Ian Davis

British entrepreneur and CEO of Kasabi. Primary interests are open data, the semantic web and decentralization.
This entry was posted in Uncategorized and tagged , . Bookmark the permalink.

2 Responses to Classes In Embedded RDF

  1. eric miller says:

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

  2. iand says:

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s