A Bulletin Board Thread in eRDF

From GetSemantic

Jump to: navigation, search

[edit] embedding RDF in HTML with eRDF - a bulletin board thread

eRDF is simply HTML that uses attributes in a specific way, so that triple statements can be generated from it. To write eRDF-enhanced HTML, first we add a profile attribute to the opening head tag:

<head profile="http://purl.org/NET/erdf/profile">

This is a signal to an eRDF parser that it’s got some eRDF on its hands.

Next, we declare what vocabularies we want to use, using the link elements in the head:

<link rel="schema.dc" href="http://purl.org/dc/elements/1.1/" />
<link rel="schema.foaf" href="http://xmlns.com/foaf/0.1/" />
<link rel="schema.sioc" href="http://rdfs.org/sioc/ns/" />
<link rel="schema.sioct" href="http://rdfs.org/sioc/types" />

The sioct namespace is for the SIOC types module. We're not actually using it here, but it has a few more genre specific terms that you might find useful.

<div id="thread" class="-sioc-Thread">
   <h1 class="dc-title">Opinions on foo?</h1>

	<div id="post-1" class="sioc-container_of -sioc-Post">
	    <a rel="sioc-has_creator" href="/users/bboy2000">bboy2000</a> says:
	    <div class="sioc-content">
	        Hey everyone, what do you think of foo?
	    </div>
	    <strong class="dc-subject">foo</strong>
	    Last modified at: 
	    <span class="dc-modified">
	        19:30, 9th of April, 2007
	    </span>
	</div>

	<div id="post-2" class="sioc-container_of -sioc-Post">
	    <a rel="sioc-has_creator" href="/users/optimusprime">optimusprime</a> says:
	    <div class="sioc=content">
	        Foo is pretty good.
	    </div>
	    (in response to 
	    <a rel="sioc-reply_of" href="#post-1">
	        bboy2000's post about <strong>foo</strong>
	    </a>)
	    Last modified at:
	    <span class="dc-modified">
	        19:33, 9th of April, 2007
	    </span>
	</div>
</div>
Personal tools