RDFA

From ActiveArchives
Jump to: navigation, search

RDFA is a means of encoding RDF data mixed into HyperText HTML.

http://www.w3.org/TR/xhtml-rdfa-primer/


Example of encoded RDF in HTML using RDFA.

<div class="about_this_review">
    <h2 property="dc:title" class="title">Vaste waarde, grote risico's</h2>
    <div class="authors">
        <a rel="dc:creator" href="/tags/Pieter_T%27Jonck">Pieter T&#39;Jonck</a>
    </div>
 
    <div class="publications">
        <a rel="dc:publisher" href="/tags/De_Tijd">De Tijd</a>
    </div>
    <div class="pubdata">
        <span property="dc:date" content="2002-10-09" datatype="xsd:date">Oct. 9, 2002</span> <span class="language" property="dc:language">Dutch</span>
    </div>
</div>
 
<ul>
<li><a href="/tags/Lilja" rel="sarma:org">Lilja</a></li>
<li rel="sarma:org">
    <span about="http://sarma.be/tags/TAG" typeof="sarma:tag">
        <span property="sarma:tagname">Tag</span>
    </span>
</li>
<div rel="sarma:performance">
    <li><a href="/tags/Weak_Dance%2C_Strong_Questions" typeof="sarma:tag"><span property="sarma:tagname">Weak Dance, Strong Questions</span></a></li>
    <li><a href="/tags/Both_Sitting_Duet" typeof="sarma:tag" property="sarma:tagname">Both Sitting Duet</a></li>
</div>
</ul>

Is parsed as the following RDF (in N3):

<file:///home/murtaugh/wsgi/sarma/test.html> dc:creator <file:///tags/Pieter_T%27Jonck>;
    dc:date "2002-10-09"^^<http://www.w3.org/2001/XMLSchema#date>;
    dc:language "Dutch"@nl;
    dc:publisher <file:///tags/De_Tijd>;
    dc:title "Vaste waarde, grote risico's"@nl;
    sarma:performance <file:///tags/Both_Sitting_Duet>,
        <file:///tags/Weak_Dance%2C_Strong_Questions> .
 
<file:///tags/Both_Sitting_Duet> a <http://sarma.be/terms/tag>;
    sarma:tagname "Both Sitting Duet"@nl .
 
<file:///tags/Weak_Dance%2C_Strong_Questions> a <http://sarma.be/terms/tag>;
    sarma:tagname "Weak Dance, Strong Questions"@nl .
 
<http://sarma.be/tags/TAG> a <http://sarma.be/terms/tag>;
    sarma:tagname "Tag"@nl .

Annotating resources

A minimal example of markup to annotate resources.

<!DOCTYPE html>
<html version="HTML+RDFa 1.1"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:aa="http://activearchives.org/terms/">
    <head>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
        <meta charset="utf-8" />
        <title>active archives</title>
    </head>
 
    <body>
        <article about="http://repo.sarma.be/Lisa%20Nelson/Lisa-Nelson-26-jan-2003-Paris-edit.ogg" rel="aa:hasAnnotation">
            <section typeof="aa:annotation" data-begin="00:00:00" data-end="00:00:12">
                <time property="aa:begin">00:00:00</time>
                <time property="aa:end">00:00:12</time>
                <div property="aa:body"  datatype="rdf:XMLLiteral">speaking to <span property="foaf:person">Lisa Nelson</span> in Café Beaubourg</div>
            </section>
        </article>
    </body>
</html>
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix : <http://www.w3.org/1999/xhtml> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix aa: <http://activearchives.org/terms/> .
 
<http://repo.sarma.be/Lisa%20Nelson/Lisa-Nelson-26-jan-2003-Paris-edit.ogg>
    aa:hasAnnotation [
        aa:begin "00:00:00" ;
        aa:body "speaking to <span xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:aa=\"http://activearchives.org/terms/\" xmlns:foaf=\"http://xmlns.com/foaf/0.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" property=\"foaf:person\">Lisa Nelson</span> in Café Beaubourg"^^rdf:XMLLiteral ;
        aa:end "00:00:12" ;
        a aa:annotation ;
        foaf:person "Lisa Nelson"
    ] .

What links here

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox