These slides explain (1) the motivation for using RDFa, for embedding structured data on web pages, (2) RDF as the foundation of RDFa, and (3) RDFa through examples.
PART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFE
RDFa: putting RDF on the Web
1. Digital Enterprise Research Institute www.deri.ie
RDFa:
putting RDF on the Web
Benjamin.Heitmann@deri.org
Chapter 1
Copyright 2007 Digital Enterprise Research Institute. All rights reserved. www.deri.org
2. Overview
Digital Enterprise Research Institute www.deri.ie
Part 1: Motivation
Use case for embedding RDF on XHTML pages
Bonus: Explaining “what do I do?” at a Christmas party
Part 2: The foundation: RDF in a nutshell
data model
formal semantics
Part 3: RDFa with examples
the RDFa attributes
visible and invisible embedding
handle with care: CURIEs and implicit blank nodes
tools for consuming and publishing RDFa
2 of 28 Benjamin Heitmann
3. About me
Digital Enterprise Research Institute www.deri.ie
Research interest:
bringing the Semantic Web to the IT mainstream by
applying software engineering methodologies
currently looking for a PhD Thesis topic
Master thesis topic:
Transitioning web application frameworks
towards the Semantic Web
worked with Eyal Oren (ActiveRDF) and Max Völkel
(RDF2Go, RDFReactor)
Student research topic: simplifying RDF semantics
3 of 28 Benjamin Heitmann
4. Digital Enterprise Research Institute www.deri.ie
Motivation
Chapter 4
Copyright 2007 Digital Enterprise Research Institute. All rights reserved. www.deri.org
5. Publishing structured content
Digital Enterprise Research Institute www.deri.ie
Current Web: written for humans (mostly)
Interesting information for machine agents exists
Example: music events in Galway (date, performer, venue)
Problem:
web page mark-up does not explicitly encode information
scraping of web pages is expensive:
webpage may change without warning
human intervention is necessary
5 of 28 Part 1: Motivation Benjamin Heitmann
8. Possible solution
Digital Enterprise Research Institute www.deri.ie
Embed machine readable data on the same web page
Benefits:
write and publish once
readableby humans and machine agents
easy maintenance for publisher
easy consuming of data after discovery
Two approaches:
Microformats:
– fixed vocabulary, not extendable and customisable
RDFa
– all the benefits of RDF: flexible and customisable
– all the overhead of RDF: data model and formal semantics
8 of 28 Part 1: Motivation Benjamin Heitmann
9. A side note: Explaining “what do you
do?” at a party
Digital Enterprise Research Institute www.deri.ie
Quicker use case
suitable for explaining “what do you actually do?”
like, lets say, for the Christmas holidays
What can Google do today?
List Restaurants in Dublin
Can Google also give you this information?
Restaurants in Dublin, open on Thursday late, serving
Pepperoni Pizza for under 15 Euro
RDFa (and the Semantic Web) could make this
possible!
9 of 28 Benjamin Heitmann
10. Digital Enterprise Research Institute www.deri.ie
The foundation: RDF in a nutshell
Chapter 10
Copyright 2007 Digital Enterprise Research Institute. All rights reserved. www.deri.org
11. Show of hands
Digital Enterprise Research Institute www.deri.ie
Who can answer these questions:
1.What is the RDF data model?
2.What is the formal semantics of RDF?
11 of 28 Part 2: RDF Foundation Benjamin Heitmann
12. RDF data model: A graph
Digital Enterprise Research Institute www.deri.ie
Graph with nodes and
directed arcs
Graph consists of triples
Each triple has a
subject, predicate and
object
Contrast with other data
models:
SQL: tables and relations
XML: tree of nodes with
attributes
12 of 28 Part 2: RDF Foundation Benjamin Heitmann
13. RDF data model: node types
Digital Enterprise Research Institute www.deri.ie
1.Uniform Resource
Blank
Identifier (URI): URI Literal
Node
basically like in the
browser location field
globally unique Subject X X
2.Literal
like a string
can optionally have either
a data type or a language
Predicate X
tag
3.Blank Node
place holder Object X X X
only locally unique
13 of 28 Part 2: RDF Foundation Benjamin Heitmann
14. An example with all three types
Digital Enterprise Research Institute www.deri.ie
14 of 28 Part 2: RDF Foundation Benjamin Heitmann
15. RDF formal semantics
Digital Enterprise Research Institute www.deri.ie
uses “model theory” to provide
“a globally coherent notion of meaning”
provides basis for inference rules
specifies the semantics of RDF
Fundamental property:
open world semantics and monotonic reasoning
Facts: I go to work from Monday to Friday.
Question: Will I go to work on the weekend?
Closed world semantics: no facts about the weekend ->
answer: no.
Open world semantics: answer not possible
Monotonic reasoning: adding new data always possible
15 of 28 Part 2: RDF Foundation Benjamin Heitmann
16. Model theory example
Digital Enterprise Research Institute www.deri.ie
Three triples:
<ex:a> <ex:b> <ex:c> .
<ex:c> <ex:a> <ex:a> .
<ex:c> <ex:b> <ex:a> .
True with this
interpretation:
16 of 28 Part 2: RDF Foundation Benjamin Heitmann
17. What to remember about RDF
Digital Enterprise Research Institute www.deri.ie
RDF is the foundation of
the Semantic Web
defines the data model
provides base layer
semantics
other standards extend
these semantics (like RDF
Schema and OWL)
domain ontologies
provide domain specific
semantics (like FOAF) on
top of RDF Schema
17 of 28 Part 2: RDF Foundation Benjamin Heitmann
18. Digital Enterprise Research Institute www.deri.ie
RDFa with examples
Chapter 18
Copyright 2007 Digital Enterprise Research Institute. All rights reserved. www.deri.org
19. What is RDFa?
Digital Enterprise Research Institute www.deri.ie
syntax for embedding an RDF graph in an XHTML
document
uses XHTML attributes for expressing RDF properties
properties about
same page
or external URI
properties can reuse visible page content or be
invisible
XHTML documents with RDFa are backwards
compatible
GRDDL transformation to extract RDF exists
19 of 28 Part 3: RDFa Benjamin Heitmann
20. RDFa Example: Graph
Digital Enterprise Research Institute www.deri.ie
20 of 28 Part 3: RDFa Benjamin Heitmann
21. RDFa Example: Source
Digital Enterprise Research Institute www.deri.ie
<div xmlns:foaf=quot;http://xmlns.com/foaf/0.1/quot; about=quot;#mequot; rel=quot;foaf:knowsquot;>
<ul>
<li typeof=quot;foaf:Personquot;>
<a property=quot;foaf:namequot; rel=quot;foaf:homepagequot; href=quot;http://example.com/bobquot;>Bob</a>
</li>
<li typeof=quot;foaf:Personquot;>
<a property=quot;foaf:namequot; rel=quot;foaf:homepagequot; href=quot;http://example.com/evequot;>Eve</a>
</li>
<li typeof=quot;foaf:Personquot;>
<a property=quot;foaf:namequot; rel=quot;foaf:homepagequot; href=quot;http://example.com/manuquot;>Manu</a>
</li>
</ul>
</div>
21 of 28 Part 3: RDFa Benjamin Heitmann
22. What just happened?
Digital Enterprise Research Institute www.deri.ie
RDFa works a little bit like RDF/XML
xmlns:foaf declares the FOAF namespace
about=”#me” defines the subject of a triple
rel=”foaf:knows” defines the predicate
typeof=”foaf:Person” defines a resource type
typeof without explicit URLs leads to blank nodes
property=”foaf:name” uses the literal “Bob”
rel=”foaf:homepage” uses the href
That’s 12 triples for just 8 XML nodes
22 of 28 Part 3: RDFa Benjamin Heitmann
23. CURIEs versus URIs
Digital Enterprise Research Institute www.deri.ie
Notall of the 10 RDFa attributes can use URIs
CURIE (Compact URI )
example: foaf:Person
curie := [ [ prefix ] ':' ] reference
prefix is either a defined name space or the default
namespace
URI (like http://dbpedia.org/resource/London)
SafeCURIE
CURIE in square brackets, example: [wiki:Biome]
prevents ambiguities between URIs and CURIEs
Idea: Subject and Object can be external, use URIs.
Predicate should be internal, so use CURIE.
23 of 28 Part 3: RDFa Benjamin Heitmann
24. Attributes for subjects
Digital Enterprise Research Institute www.deri.ie
@about : URI or SafeCURIE
define a subject of a triple
@src : URI
a not clickable resource object, like a picture or multimedia
object
24 of 28 Part 3: RDFa Benjamin Heitmann
25. Attributes for predicates
Digital Enterprise Research Institute www.deri.ie
@rel : CURIEs
express relationship between resources
@rev : CURIEs
express reverse relationship between resources
@property : CURIEs
express relationship between a subject and a literal
25 of 28 Part 3: RDFa Benjamin Heitmann
26. Attributes for objects
Digital Enterprise Research Institute www.deri.ie
@resource : URI or SafeCURIE
an invisible resource object, that is not clickable
@href : URI
a resource object that is clickable like a link
@content : string
invisible literal object for a triple
@datatype : XML data for a literal
@typeof : specify class of a subject
26 of 28 Part 3: RDFa Benjamin Heitmann
27. Another RDFa example
Digital Enterprise Research Institute www.deri.ie
<html xmlns=quot;http://www.w3.org/1999/xhtmlquot;
xmlns:cal=quot;http://www.w3.org/2002/12/cal/ical#quot;
xmlns:xsd=quot;http://www.w3.org/2001/XMLSchemaquot; >
<head><title>Jo's Friends and Family Blog</title></head>
<body>
<p typeof=quot;cal:Veventquot;>
I'm holding
<span property=quot;cal:summaryquot;>
one last summer Barbecue
</span>,
on
<span property=quot;cal:dtstartquot; content=quot;2007-09-16T16:00:00-05:00quot;
datatype=quot;xsd:dateTimequot;>
September 16th at 4pm
</span>.
</p>
</body>
</html>
27 of 28 Part 3: RDFa Benjamin Heitmann
28. Publishing and consuming RDFa
Digital Enterprise Research Institute www.deri.ie
Publishing RDFa
use any CMS that has custom templates
Drupal
Wordpress (use pods plugin for wp 2.7)
Consuming RDFa
use GRDDL to convert any web page with RDFa to RDF/XML
Operator Plug-in for Firefox
Take a look at http://rdfa.info/wiki/Tools for more
28 of 28 Part 3: RDFa Benjamin Heitmann
29. Summary
Digital Enterprise Research Institute www.deri.ie
RDF provides the data model and formal semantics
for the Semantic Web
RDFa embeds the data model in XHTML pages
very flexible, can express any RDF graph
lotsof nested tags
can reuse existing visible content
or can be completely invisible
beware of the difference between URIs and CURIEs
watch out for implicit blank nodes
generic tools for publishing and consuming exist
29 of 28 Benjamin Heitmann