http://www.w3.org/TR/grddl-primer/
]class
es,
au sens des CSS.CustomRdfDialects
.http://www.w3.org/2002/12/cal/glean-hcal
http://research.talis.com/2005/erdf/extract-rdf.xsl
http://ns.inria.fr/grddl/rdfa/2008/09/03/RDFa2RDFXML.xsl
http://www.w3.org/2007/08/grddl/
.<link rel="transformation".
href="l'adresse"/>
.<link rel="transformation" href="http://www.w3.org/2002/12/cal/glean-hcal"/>
"transformation"
.<head>
:<head profile="http://www.w3.org/2003/g/data-view">
.Transformation
: an InformationResource
that specifies a transformation from a set of XML documents to RDF
graphs.profileTransformation
).<link
rel="transformation" href="l'adresse"/>.
"http://purl.org/NET/erdf/profile".
Voici le contenu de ce fichier :<html
xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://www.w3.org/2003/g/data-view">
<title>Embedded RDF HTML
Profile</title>
<link rel="transformation" href="http://www.w3.org/2003/g/glean-profile"
/>
</head>
<body>
<p>
<a
rel="profileTransformation"
href="http://purl.org/NET/erdf/extract-rdf.xsl">GRDDL
transform</a>
</p>
</body>
</html>
http://ns.inria.fr/grddl/rdfa/
".<a rel="profileTransformation" href="2008/09/03/RDFa2RDFXML.xsl">2008/09/03/RDFa2RDFXML.xsl</a>
http://purl.org/NET/erdf/profile
hCalendar
.
<ol class="schedule">
<li>2007
<ol>
<li class="vevent"><strong class="summary">Web Design Conference</strong> in
<span class="location">Edinburgh, UK</span>:
<abbr class="dtstart" title="2007-01-08">Jan 8</abbr> to
<abbr class="dtend" title="2007-01-11">10</abbr>
</li>
<li class="vevent"><strong class="summary">Board Review</strong> in
<span class="location">New York, USA</span>:
<abbr class="dtstart" title="2007-02-23">Feb 23</abbr> to
<abbr class="dtend" title="2007-02-25">24</abbr>
</li>
</ol>
</li>
</ol>
"2007-02-25"^^<http://www.w3.org/2001/XMLSchema#date>
"2007-02-25"
,
qui est réputée conforme au datatype "date
"
défini par XML-Schémas.@prefix
ns0:
<http://www.w3.org/2002/12/cal/icaltzd#> .
@prefix rdf:
<http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
<http://example.org/>
a
ns0:Vcalendar ;
ns0:component
[ a
ns0:Vevent ;
ns0:dtend
"2007-02-25"^^<http://www.w3.org/2001/XMLSchema#date> ;
ns0:dtstart
"2007-02-23"^^<http://www.w3.org/2001/XMLSchema#date> ;
ns0:location "New York, USA"@en ;
ns0:summary "Board Review"@en ;
ns0:url <http://example.org/>
] ;
ns0:component
[ a
ns0:Vevent ;
ns0:dtend
"2007-01-11"^^<http://www.w3.org/2001/XMLSchema#date> ;
ns0:dtstart
"2007-01-08"^^<http://www.w3.org/2001/XMLSchema#date> ;
ns0:location "Edinburgh, UK"@en ;
ns0:summary "Web Design Conference"@en ;
ns0:url <http://example.org/>
] ;
ns0:prodid
"-//connolly.w3.org//RDF Calendar $Date: 2007/06/30 19:05:32 $
(BETA)//EN" ;
ns0:version "2.0" .
http://www.w3.org/2007/08/grddl/
.<head>
et en donnant l'adresse du transformateur XSLT dans un <link>
.<head
profile="http://www.w3.org/2003/g/data-view">
<meta http-equiv="content-type" content="text/html;
charset=UTF-8" />
<title>Robin's Schedule</title>
<link rel="transformation"
href="http://www.w3.org/2002/12/cal/glean-hcal"
/>
</head>
<?xml version="1.0"
encoding="utf-8"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description
rdf:about="http://example.org/">
<rdf:type
rdf:resource="http://www.w3.org/2002/12/cal/icaltzd#Vcalendar"/>
</rdf:Description>
<rdf:Description
rdf:about="http://example.org/">
<ns0:prodid
xmlns:ns0="http://www.w3.org/2002/12/cal/icaltzd#">-//connolly.w3.org//RDF
Calendar $Date: 2007/06/30 19:05:32 $
(BETA)//EN</ns0:prodid>
</rdf:Description>
<rdf:Description
rdf:about="http://example.org/">
<ns0:version
xmlns:ns0="http://www.w3.org/2002/12/cal/icaltzd#">2.0</ns0:version>
</rdf:Description>
<rdf:Description
rdf:nodeID="r1259674159r19622r2">
<rdf:type
rdf:resource="http://www.w3.org/2002/12/cal/icaltzd#Vevent"/>
</rdf:Description>
<rdf:Description
rdf:nodeID="r1259674159r19622r2">
<ns0:summary
xmlns:ns0="http://www.w3.org/2002/12/cal/icaltzd#"
xml:lang="en">Web Design Conference</ns0:summary>
</rdf:Description>
<rdf:Description
rdf:nodeID="r1259674159r19622r2">
<ns0:dtstart
xmlns:ns0="http://www.w3.org/2002/12/cal/icaltzd#"
rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2007-01-08</ns0:dtstart>
</rdf:Description>
<rdf:Description
rdf:nodeID="r1259674159r19622r2">
<ns0:dtend
xmlns:ns0="http://www.w3.org/2002/12/cal/icaltzd#"
rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2007-01-11</ns0:dtend>
</rdf:Description>
<rdf:Description
rdf:nodeID="r1259674159r19622r2">
<ns0:url
xmlns:ns0="http://www.w3.org/2002/12/cal/icaltzd#"
rdf:resource="http://example.org/"/>
</rdf:Description>
<rdf:Description
rdf:nodeID="r1259674159r19622r2">
<ns0:location
xmlns:ns0="http://www.w3.org/2002/12/cal/icaltzd#"
xml:lang="en">Edinburgh, UK</ns0:location>
</rdf:Description>
<rdf:Description
rdf:about="http://example.org/">
<ns0:component
xmlns:ns0="http://www.w3.org/2002/12/cal/icaltzd#"
rdf:nodeID="r1259674159r19622r2"/>
</rdf:Description>
<rdf:Description
rdf:nodeID="r1259674159r19622r3">
<rdf:type
rdf:resource="http://www.w3.org/2002/12/cal/icaltzd#Vevent"/>
</rdf:Description>
<rdf:Description
rdf:nodeID="r1259674159r19622r3">
<ns0:summary
xmlns:ns0="http://www.w3.org/2002/12/cal/icaltzd#"
xml:lang="en">Board Review</ns0:summary>
</rdf:Description>
<rdf:Description
rdf:nodeID="r1259674159r19622r3">
<ns0:dtstart
xmlns:ns0="http://www.w3.org/2002/12/cal/icaltzd#"
rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2007-02-23</ns0:dtstart>
</rdf:Description>
<rdf:Description
rdf:nodeID="r1259674159r19622r3">
<ns0:dtend
xmlns:ns0="http://www.w3.org/2002/12/cal/icaltzd#"
rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2007-02-25</ns0:dtend>
</rdf:Description>
<rdf:Description
rdf:nodeID="r1259674159r19622r3">
<ns0:url
xmlns:ns0="http://www.w3.org/2002/12/cal/icaltzd#"
rdf:resource="http://example.org/"/>
</rdf:Description>
<rdf:Description
rdf:nodeID="r1259674159r19622r3">
<ns0:location
xmlns:ns0="http://www.w3.org/2002/12/cal/icaltzd#"
xml:lang="en">New York, USA</ns0:location>
</rdf:Description>
<rdf:Description
rdf:about="http://example.org/">
<ns0:component
xmlns:ns0="http://www.w3.org/2002/12/cal/icaltzd#"
rdf:nodeID="r1259674159r19622r3"/>
</rdf:Description>
</rdf:RDF>
<!-- Extracted from pasted markup by
http://www.w3.org/2007/08/grddl/ -->
hCalendar
, à base de
classes CSS. <p class="-cal-Vevent"
id="tiddlywinks">
From <span class="cal-dtstart"
title="2006-10-07">7 October, 2006</span>
to <span class="cal-dtend"
title="2006-10-13">12 October, 2006</span>
I will be attending
the
<span class="cal-summary">National
Tiddlywinks Championship</span> in
<span class="cal-location">Bognor
Regis, UK</span>.
</p>
<p class="-cal-Vevent"
id="holiday">
Then I'm
<span class="cal-summary">on
holiday</span> in the
<span class="cal-location">Cayman
Islands</span> between
<span class="cal-dtstart"
title="2006-11-14">14 November, 2006</span>
and <span class="cal-dtend"
title="2007-01-02">1 January, 2007</span>.
</p>
<p class="-cal-Vevent"
id="award">
I then visit
Scotland on
<span class="cal-dtstart"
title="2007-01-08">the 8th January</span> to
<span class="cal-summary">pick
up a lifetime achievement award from the Web Design
Conference</span>.
This time the ceremony is in
<span class="cal-location">Edinburgh,
UK</span>.
I'll be taking the train home on the
<span class="cal-dtend"
title="2007-01-11">10th</span>.
</p>
cal-
".@prefix
ns0:
<http://www.w3.org/2002/12/cal/icaltzd#> .
@prefix rdf:
<http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
<http://www.w3.org/TR/grddl-primer/david-erdf.html#award>
a
ns0:Vevent ;
ns0:dtend
"2007-01-11" ;
ns0:dtstart
"2007-01-08" ;
ns0:location
"Edinburgh, UK" ;
ns0:summary """pick
up a lifetime
achievement award
from the Web Design Conference""" .
<http://www.w3.org/TR/grddl-primer/david-erdf.html#tiddlywinks>
a
ns0:Vevent ;
ns0:dtend
"2006-10-13" ;
ns0:dtstart
"2006-10-07" ;
ns0:location "Bognor
Regis, UK" ;
ns0:summary
"""National Tiddlywinks
Championship""" .
<http://www.w3.org/TR/grddl-primer/david-erdf.html#holiday>
a
ns0:Vevent ;
ns0:dtend
"2007-01-02" ;
ns0:dtstart
"2006-11-14" ;
ns0:location "Cayman
Islands" ;
ns0:summary "on
holiday" .
<http://www.w3.org/TR/grddl-primer/david-erdf.html>
<http://webns.net/mvcb/generatorAgent>
<http://purl.org/NET/erdf/extract> .
id
" qui
donne des URIs pour désigner les 3 "Vevent
s"
qui étaient ci-dessus des ressources anonymes.
<link>
ne dirige plus vers la transformation,cal-
". <head profile="http://purl.org/NET/erdf/profile">
<title>Where Am
I</title>
<link rel="schema.cal"
href="http://www.w3.org/2002/12/cal/icaltzd#" />
</head>
<?xml version="1.0"
encoding="utf-8"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description
rdf:about="http://www.w3.org/TR/grddl-primer/david-erdf.html">
<ns0:generatorAgent
xmlns:ns0="http://webns.net/mvcb/"
rdf:resource="http://purl.org/NET/erdf/extract"/>
</rdf:Description>
<rdf:Description
rdf:about="http://www.w3.org/TR/grddl-primer/david-erdf.html#tiddlywinks">
<rdf:type
rdf:resource="http://www.w3.org/2002/12/cal/icaltzd#Vevent"/>
</rdf:Description>
<rdf:Description
rdf:about="http://www.w3.org/TR/grddl-primer/david-erdf.html#tiddlywinks">
<ns0:dtstart
xmlns:ns0="http://www.w3.org/2002/12/cal/icaltzd#">2006-10-07</ns0:dtstart>
</rdf:Description>
<rdf:Description
rdf:about="http://www.w3.org/TR/grddl-primer/david-erdf.html#tiddlywinks">
<ns0:dtend
xmlns:ns0="http://www.w3.org/2002/12/cal/icaltzd#">2006-10-13</ns0:dtend>
</rdf:Description>
<rdf:Description
rdf:about="http://www.w3.org/TR/grddl-primer/david-erdf.html#tiddlywinks">
<ns0:summary
xmlns:ns0="http://www.w3.org/2002/12/cal/icaltzd#">National
Tiddlywinks
Championship</ns0:summary>
</rdf:Description>
<rdf:Description
rdf:about="http://www.w3.org/TR/grddl-primer/david-erdf.html#tiddlywinks">
<ns0:location
xmlns:ns0="http://www.w3.org/2002/12/cal/icaltzd#">Bognor Regis,
UK</ns0:location>
</rdf:Description>
<rdf:Description
rdf:about="http://www.w3.org/TR/grddl-primer/david-erdf.html#holiday">
<rdf:type
rdf:resource="http://www.w3.org/2002/12/cal/icaltzd#Vevent"/>
</rdf:Description>
<rdf:Description
rdf:about="http://www.w3.org/TR/grddl-primer/david-erdf.html#holiday">
<ns0:summary
xmlns:ns0="http://www.w3.org/2002/12/cal/icaltzd#">on
holiday</ns0:summary>
</rdf:Description>
<rdf:Description
rdf:about="http://www.w3.org/TR/grddl-primer/david-erdf.html#holiday">
<ns0:location
xmlns:ns0="http://www.w3.org/2002/12/cal/icaltzd#">Cayman
Islands</ns0:location>
</rdf:Description>
<rdf:Description
rdf:about="http://www.w3.org/TR/grddl-primer/david-erdf.html#holiday">
<ns0:dtstart
xmlns:ns0="http://www.w3.org/2002/12/cal/icaltzd#">2006-11-14</ns0:dtstart>
</rdf:Description>
<rdf:Description
rdf:about="http://www.w3.org/TR/grddl-primer/david-erdf.html#holiday">
<ns0:dtend
xmlns:ns0="http://www.w3.org/2002/12/cal/icaltzd#">2007-01-02</ns0:dtend>
</rdf:Description>
<rdf:Description
rdf:about="http://www.w3.org/TR/grddl-primer/david-erdf.html#award">
<rdf:type
rdf:resource="http://www.w3.org/2002/12/cal/icaltzd#Vevent"/>
</rdf:Description>
<rdf:Description
rdf:about="http://www.w3.org/TR/grddl-primer/david-erdf.html#award">
<ns0:dtstart
xmlns:ns0="http://www.w3.org/2002/12/cal/icaltzd#">2007-01-08</ns0:dtstart>
</rdf:Description>
<rdf:Description
rdf:about="http://www.w3.org/TR/grddl-primer/david-erdf.html#award">
<ns0:summary
xmlns:ns0="http://www.w3.org/2002/12/cal/icaltzd#">pick up a
lifetime
achievement award
from the Web Design Conference</ns0:summary>
</rdf:Description>
<rdf:Description
rdf:about="http://www.w3.org/TR/grddl-primer/david-erdf.html#award">
<ns0:location
xmlns:ns0="http://www.w3.org/2002/12/cal/icaltzd#">Edinburgh,
UK</ns0:location>
</rdf:Description>
<rdf:Description
rdf:about="http://www.w3.org/TR/grddl-primer/david-erdf.html#award">
<ns0:dtend
xmlns:ns0="http://www.w3.org/2002/12/cal/icaltzd#">2007-01-11</ns0:dtend>
</rdf:Description>
</rdf:RDF>
<!-- Extracted from
http://www.w3.org/TR/grddl-primer/david-erdf.html by
http://www.w3.org/2007/08/grddl/ at
http://www.w3.org/2007/08/grddl/?docAddr=http://www.w3.org/TR/grddl-primer/david-erdf.html
-->
RDFa utilise pour partie la syntaxe HTML existante :[Wikipédia]
RDFa ajoute ses propres éléments, les attributs :
- l'attribut class - permettant de spécifier le type de l'objet
- l'attribut id - indirectement, servant à définir l'URI d'un objet dans la page
- les attributs rel, rev et href - spécifiant une relation avec une autre ressource
- about - une URI spécifiant la ressource décrite par les métadonnées ; en son absence, il s'agit du document en cours
- property - spécifiant une propriété pour le contenu d'un élément
- content - attribut optionnel qui remplace le contenu d'un élément quand on utilise l'attribut de propriété
- datatype - attribut optionnel qui spécifie le type de donnée du contenu.
N.B. Aujourd'huiclass
est sorti de l'usage, il est tremplacé partypeof
.
http://ns.inria.fr/grddl/rdfa/2008/09/03/RDFa2RDFXML.xsl
http://ns.inria.fr/grddl/rdfa/
.<?xml version="1.0"
encoding='UTF-8'?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN"
"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<!-- L'exemple de namespace réécrit en RDFa -->
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xdc="http://www.xml.com/books#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#">
<head profile="http://ns.inria.fr/grddl/rdfa/">
<title>Book
Review</title>
<base
href="http://www.xml.com/books/reviews" />
</head>
<body>
<div about="#2009-11-30"
typeof="xdc:bookreview">
<h1 property="xdc:title"
style="font-family: sans-serif;">XML: A Primer</h1>
<table border="3">
<tr align="center">
<td>Author</td><td>Price</td>
<td>Pages</td><td>Date</td>
</tr>
<tr align="left">
<td property="xdc:author">Simon
St. Laurent</td>
<td property="xdc:price"
datatype="xsd:float"
>31.98</td>
<td property="xdc:pages">352</td>
<td property="xdc:date"
datatype="xsd:date">1998-01-15</td>
</tr>
</table>
</div>
</body>
</html>
<?xml version="1.0"
encoding="utf-8"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description
rdf:about="http://www.xml.com/books/reviews#2009-11-30">
<rdf:type
rdf:resource="http://www.xml.com/books#bookreview"/>
</rdf:Description>
<rdf:Description
rdf:about="http://www.xml.com/books/reviews#2009-11-30">
<ns0:title
xmlns:ns0="http://www.xml.com/books#">XML: A
Primer</ns0:title>
</rdf:Description>
<rdf:Description
rdf:about="http://www.xml.com/books/reviews#2009-11-30">
<ns0:author
xmlns:ns0="http://www.xml.com/books#">Simon St.
Laurent</ns0:author>
</rdf:Description>
<rdf:Description
rdf:about="http://www.xml.com/books/reviews#2009-11-30">
<ns0:price
xmlns:ns0="http://www.xml.com/books#"
rdf:datatype="http://www.w3.org/2001/XMLSchema#float">31.98</ns0:price>
</rdf:Description>
<rdf:Description
rdf:about="http://www.xml.com/books/reviews#2009-11-30">
<ns0:pages
xmlns:ns0="http://www.xml.com/books#">352</ns0:pages>
</rdf:Description>
<rdf:Description
rdf:about="http://www.xml.com/books/reviews#2009-11-30">
<ns0:date
xmlns:ns0="http://www.xml.com/books#"
rdf:datatype="http://www.w3.org/2001/XMLSchema#date">1998-01-15</ns0:date>
</rdf:Description>
</rdf:RDF>
<!-- Extracted from pasted markup by
http://www.w3.org/2007/08/grddl/ -->
@prefix
ns0:
<http://www.xml.com/books#> .
@prefix rdf:
<http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
<http://www.xml.com/books/reviews#2009-11-30>
a
ns0:bookreview ;
ns0:author "Simon
St. Laurent" ;
ns0:date
"1998-01-15"^^<http://www.w3.org/2001/XMLSchema#date> ;
ns0:pages "352" ;
ns0:price
"31.98"^^<http://www.w3.org/2001/XMLSchema#float> ;
ns0:title "XML: A
Primer" .
<base>
introduit une URL qui va préfixer les URLs apparaissant de la le
fichier,#2009-11-30
" de la
relation introduit par about
(qui doit
être une URL !).typeof
se
traduit en RDF-XML par "rdf:type
", nous en
reparlerons longuement plus tard.rdf:type
" devient
simplement l'article indéfini "a
", abréviation
de "is-a
".datatype
" en
RDFa se traduit en RDF-XML par "rdf:datatype
",
^^
".alice-example.html
.Alice.html
(en gras les éléments RDFa, italique pour les nouveautés)
<?xml version="1.0"
encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN"
"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:foaf="http://xmlns.com/foaf/0.1/">
<head profile="http://ns.inria.fr/grddl/rdfa/">
<title>Alice rêve de
sémantique</title>
<base
href="http://example.com/alice"></base>
<link rel="stylesheet"
type="text/css"
href="http://www.w3.org/TR/2008/NOTE-xhtml-rdfa-primer-20081014/style.css"
/>
</head>
<body>
<h1>Alice's blog</h1>
<div about="/posts/2008-09-15">
<h2 property="dc:title">L'ennui avec
Bob</h2>
<h3 property="dc:creator">Alice</h3>
<p>L'ennui avec Bob, c'est qu'il fait de meilleures
photos que moi :</p>
<div class="imgbox" about="http://www.w3.org/TR/2008/NOTE-xhtml-rdfa-primer-20081014/sunset.jpg">
<img
src="http://www.w3.org/TR/2008/NOTE-xhtml-rdfa-primer-20081014/sunset.jpg"
alt="sunset" />
<div>
<span property="dc:title">Beautiful
Sunset</span>
by
<span property="dc:creator">Bob</span>.
</div>
</div>
</div>
<div about="/posts/2008-10-07">
<h2 property="dc:title">La
soirée chez Jo</h2>
<h3 property="dc:creator">Eve</h3>
<p>C'était génial !</p>
</div>
<div class="socialnet" about="#me"
typeof="foaf:Person">
<p
property="foaf:name">Alice
Birpemswick</p>
<p>Email: <a rel="foaf:mbox"
href="mailto:alice@example.com">alice@example.com</a></p>
<p>Phone: <a rel="foaf:phone"
href="tel:+1-617-555-7332">+1
617.555.7332</a></p>
<p>Mes
potes:</p>
<ul rel="foaf:knows">
<li typeof="foaf:Person">
<a property="foaf:name"
rel="foaf:homepage"
href="http://example.com/bob">Bob</a>
</li>
<li typeof="foaf:Person">
<a property="foaf:name"
rel="foaf:homepage"
href="http://example.com/eve">Eve</a>
</li>
<li typeof="foaf:Person">
<a property="foaf:name"
rel="foaf:homepage"
href="http://example.com/manu">Manu</a>
</li>
</ul>
</div>
<div id="footer">
<p>The content on this site is licensed under
<a rel="license"
href="http://creativecommons.org/licenses/by/3.0/">
a
Creative Commons License
</a>.
</p>
<div class="validrdfa">
<a
href="http://validator.w3.org/check?uri=referer">
<img src="http://www.w3.org/Icons/valid-xhtml-rdfa" alt="Valid
XHTML+RDFa"/>
</a>
</div>
</div>
</body>
</html>
@prefix
ns0:
<http://www.w3.org/1999/xhtml/vocab#> .
@prefix rdf:
<http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
<http://example.com/posts/2008-09-15>
<http://purl.org/dc/elements/1.1/creator>
"Alice" ;
<http://purl.org/dc/elements/1.1/title>
"L'ennui avec Bob" .
<http://example.com/alice#me>
a
<http://xmlns.com/foaf/0.1/Person> ;
<http://xmlns.com/foaf/0.1/knows>
[ a
<http://xmlns.com/foaf/0.1/Person> ;
<http://xmlns.com/foaf/0.1/homepage>
<http://example.com/manu> ;
<http://xmlns.com/foaf/0.1/name>
"Manu"
] ;
<http://xmlns.com/foaf/0.1/knows>
[ a
<http://xmlns.com/foaf/0.1/Person> ;
<http://xmlns.com/foaf/0.1/homepage>
<http://example.com/eve> ;
<http://xmlns.com/foaf/0.1/name>
"Eve"
] ;
<http://xmlns.com/foaf/0.1/knows>
[ a
<http://xmlns.com/foaf/0.1/Person> ;
<http://xmlns.com/foaf/0.1/homepage>
<http://example.com/bob> ;
<http://xmlns.com/foaf/0.1/name>
"Bob"
] ;
<http://xmlns.com/foaf/0.1/mbox>
<mailto:alice@example.com> ;
<http://xmlns.com/foaf/0.1/name>
"Alice Birpemswick" ;
<http://xmlns.com/foaf/0.1/phone>
<tel:+1-617-555-7332> .
<http://example.com/posts/2008-10-07>
<http://purl.org/dc/elements/1.1/creator>
"Eve" ;
<http://purl.org/dc/elements/1.1/title>
"La soirée chez Jo" .
<http://www.w3.org/TR/2008/NOTE-xhtml-rdfa-primer-20081014/sunset.jpg>
<http://purl.org/dc/elements/1.1/creator>
"Bob" ;
<http://purl.org/dc/elements/1.1/title>
"Beautiful Sunset" .
<http://example.com/alice>
ns0:license
<http://creativecommons.org/licenses/by/3.0/> ;
ns0:stylesheet
<http://www.w3.org/TR/2008/NOTE-xhtml-rdfa-primer-20081014/style.css>
.
about
,
typeof
suffit pour faire naître un
sujet de relation comme ressource anonyme.foaf:Person
amies d'Alice.rel
", avec comme valeur une
relation.property
"
est employé lorsque l'objet de la relation est une chaîne
littérale,<h2 property="dc:title">L'ennui avec
Bob</h2>
rel
" au
contraire s'emploie lorsque l'objet est une ressource
:href
.<a property="foaf:name"
rel="foaf:homepage"
href="http://example.com/bob">Bob</a>
la valeur de foaf:name
est
"Bob
", et celle de foaf:homepage
est "http://example.com/bob"
<a rel="foaf:mbox" href="mailto:alice@example.com">
,mailto:...
" est une URI !<a rel="foaf:phone"
href="tel:+1-617-555-7332">
, "tel:+1..."
est aussi une
URI. <ul
rel="foaf:knows">
va se distribuer sur les 3
ressources anonymes <li>
par les attributs typeof
qui y figurent.rel
"
possède un certain nombre de valeurs prédéfinies, qui font partie du
"vocabulaire XHTML"http://www.w3.org/1999/xhtml/vocab
.stylesheet
et pour license
.about
ou suggéré par typeof
, le sujet par défaut<base>
du
document elle-même, comme illustré par les 3 dernières lignes du
fichier N3 ci-dessus.http://www.w3.org/TR/grddl-primer/janeschedule.html
class
, qui
ne fonctionnent plus, sont remplacées par typeof
.<?xml version="1.0" encoding='UTF-8'?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN"
"http://www.w3.org/MarkUp/DTD/xhtml+rdfa-1.dtd">
<html xmlns:cal="http://www.w3.org/2002/12/cal/icaltzd#"
xmlns:xs="http://www.w3.org/2001/XMLSchema#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.w3.org/1999/xhtml"
>
<head profile="http://www.w3.org/2003/g/data-view">
<title>Jane's Blog</title>
<link
rel="transformation"
href="http://ns.inria.fr/grddl/rdfa/2008/09/03/RDFa2RDFXML.xsl"/>
</head>
<body>
<p about="#event1" typeof="cal:Vevent">
<b
property="cal:summary">Weekend off in
Iona</b>:
<span
property="cal:dtstart" content="2006-10-21"
datatype="xs:date">Oct
21st</span>
to <span
property="cal:dtend" content="2006-10-21"
datatype="xs:date">Oct 23rd</span>.
See <a
rel="cal:url"
href="http://freetime.example.org/">FreeTime.Example.org</a>
for
info on <span
property="cal:location">Iona,
UK</span>.
</p>
<p about="#event2" typeof="cal:Vevent">
<b
property="cal:summary">Holiday in Ireland</b>:
<span
property="cal:dtstart" content="2006-12-23"
datatype="xs:date">Dec 23rd</span>
to <span
property="cal:dtend" content="2006-12-27"
datatype="xs:date">Dec 27th</span>.
See <a
rel="cal:url"
href="http://vacation.example.org/">Vacation.Example.org</a>
for
info on <span
property="cal:location">Belfast, Ireland</span>.
</p>
<p><b>New
Years!</b> Now it's 2007...</p>
<p about="#event3" typeof="cal:Vevent">
<b
property="cal:summary">Web Conference</b>:
<span
property="cal:dtstart" content="2007-01-08"
datatype="xs:date">Jan 8th</span>
to <span
property="cal:dtend" content="2007-01-11"
datatype="xs:date">Jan 11th</span>.
See <a
rel="cal:url"
href="http://webconf.example.org/">webconf.example.org</a>
for
info on <span
property="cal:location">Edinburgh, UK</span>.
</p>
</body>
</html>
@prefix
ns0:
<http://www.w3.org/2002/12/cal/icaltzd#> .
@prefix rdf:
<http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
<http://example.org/#event1>
a
ns0:Vevent ;
ns0:dtend
"2006-10-21"^^<http://www.w3.org/2001/XMLSchema#date> ;
ns0:dtstart
"2006-10-21"^^<http://www.w3.org/2001/XMLSchema#date> ;
ns0:location "Iona,
UK" ;
ns0:summary "Weekend
off in Iona" ;
ns0:url
<http://freetime.example.org/> .
<http://example.org/#event3>
a
ns0:Vevent ;
ns0:dtend
"2007-01-11"^^<http://www.w3.org/2001/XMLSchema#date> ;
ns0:dtstart
"2007-01-08"^^<http://www.w3.org/2001/XMLSchema#date> ;
ns0:location
"Edinburgh, UK" ;
ns0:summary "Web
Conference" ;
ns0:url
<http://webconf.example.org/> .
<http://example.org/#event2>
a
ns0:Vevent ;
ns0:dtend
"2006-12-27"^^<http://www.w3.org/2001/XMLSchema#date> ;
ns0:dtstart
"2006-12-23"^^<http://www.w3.org/2001/XMLSchema#date> ;
ns0:location
"Belfast, Ireland" ;
ns0:summary "Holiday
in Ireland" ;
ns0:url
<http://vacation.example.org/> .
content
conjointement avec property
, qui permet de property
la
valeur de content
au lieu du contenu
textuel de l'élément en cours.PREFIX ical:
<http://www.w3.org/2002/12/cal/icaltzd#>
PREFIX xs: <http://www.w3.org/2001/XMLSchema#>
SELECT ?start1 ?stop1 ?loc1 ?summ1 ?summ2 ?summ3
FROM
<http://pagesperso-systeme.lip6.fr/Jean-Francois.Perrot/inalco/XML/RDF/MicroFormats/ExRDFa/Jane/Jane.xml>
FROM
<http://pagesperso-systeme.lip6.fr/Jean-Francois.Perrot/inalco/XML/RDF/MicroFormats/EmbedRDF/David.xml>
FROM
<http://pagesperso-systeme.lip6.fr/Jean-Francois.Perrot/inalco/XML/RDF/MicroFormats/hCalendar/Robin.xml>
WHERE
{
?event1 a ical:Vevent;
ical:summary ?summ1 ;
ical:dtstart ?start1
;
ical:dtend ?stop1 ;
ical:location ?loc1.
?event2 a ical:Vevent;
ical:summary ?summ2 ;
ical:dtstart ?start2;
ical:dtend ?stop2;
ical:location ?loc2.
?event3 a ical:Vevent;
ical:summary ?summ3 ;
ical:dtstart ?start3;
ical:dtend ?stop3;
ical:location ?loc3.
FILTER (
?event1 != ?event2 && ?event2 !=
?event3 && ?event1 !=
?event3 ) .
FILTER (
xs:string(?start1) = xs:string(?start2) ).
FILTER (
xs:string(?stop1) = xs:string(?stop2) ).
FILTER (
xs:string(?loc1) = xs:string(?loc2) ).
FILTER (
xs:string(?start1) = xs:string(?start3) ).
FILTER (
xs:string(?stop1) = xs:string(?stop3) ).
FILTER (
xs:string(?loc1) = xs:string(?loc3) ).
FILTER (
xs:string(?start3) = xs:string(?start2) ).
FILTER (
xs:string(?stop3) = xs:string(?stop2) ).
FILTER (
xs:string(?loc3) = xs:string(?loc2) ).
FILTER (
xs:string(?summ1) <= xs:string(?summ2) ).
FILTER (
xs:string(?summ2) <= xs:string(?summ3) ).
}
SELECT
line determines which variable will appear in the results, here one of
the start dates, one of the stop dates, a location and a summary. FROM
lines identify the data
sources to use in the query, in this case the RDF/XML derived from
Jane, David and Robin's original documents. WHERE
section provides a pattern
which can match three events. FILTER
s match up
identical start and stop dates as well as locations between the three
events. FILTER
lines are
idiomatic expressions which prevent multiple results returning due to
the interchangeability of the variables.--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
start1
|
stop1
|
loc1
|
summ1
|
summ2
|
summ3
|
==================================================================================================================================================================================================
| "2007-01-08"^^xs:date | "2007-01-11"^^xs:date | "Edinburgh, UK" |
"Web Conference" | "Web Design Conference"@en | "pick up a
lifetime\n
achievement award from the Web Design Conference" |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------