rdfa: introduction, comparison with microdata and microformats and how to use it
DESCRIPTION
Presentation for the course 'XML and Web Technologies' of the IT4BI Erasmus Mundus Master's Programme. Introduction, motivation, target domain, schema, attributes, comparing RDFa with RDF, comparing RDFa with Microformats, comparing RDFa with Microdata, how to use RDFa to improve websites, how to extract metadata defined with RDFa, GRDDL and a simple exercise.TRANSCRIPT
RDFa: Resource Description Framework in attributes
Hiroshi Leon
Navid Mahlouji
Jose Luis Lopez Pino
Agenda
Introduction
This is an example text. Go ahead and replace it
Using RDFa
Target domain
Comparing RDFa
6
5
4
3
2
1
Schema
Attributes
o Internet grows fast
o (X)HTML is a good standard to present
data for human
o We need machine-readable data
o Solution: user attributes in XML
o Semantic web: gives a structure to the
massive data available on Internet.
Introduction
Introduction
• Use attributes in
XML.
• Semantic web:
gives a structure to
the massive data
available on Internet
Solution
• Internet grows fast
• (X)HTML is a good
standard to present
data for humans.
• But we need
machine-readable
data
Problem
1 2
Target domain
Once the data is structured, it is more useful for the
computer programs, that can use it efficiently.
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
version="XHTML+RDFa 1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=“http://www.w3.org/1999/xhtml
http://www.w3.org/MarkUp/SCHEMA/xhtml-rdfa-2.xsd"
lang="en"
xml:lang="en">
<head>
<title>Virtual Library</title>
</head>
<body>
<p>Moved to <a href="http://example.org/">example.org</a>.</p>
</body>
</html>
Templates
1
2
Schema Validation
Attributes
• About
• Rel and rev
• Src, href and resource
• Property
• Content
• Datatype
• Typeof
• Vocab
1
Attributes: property
1
<html>
<head>
...
</head>
<body>
...
<h2 property="http://purl.org/dc/terms/title">The Trouble with Bob</h2>
<p>Date: <span property="http://purl.org/dc/terms/created">2011- 09-
10</span>
</p>
...
</body>
Attributes: vocab
1
<html>
<head>
...
</head>
<body vocab="http://purl.org/dc/terms/">
...
<h2 property="title">The Trouble with Bob</h2>
<p>Date: <span property="created">2011-09-10</span></p>
...
<p>All content on this site is licensed under
<a property="http://creativecommons.org/ns#license"
href="http://creativecommons.org/licenses/by/3.0/"> a Creative
Commons License</a>. ©2011 Alice Birpemswick.</p>
</body>
</html>
Attributes: resource
1
<body vocab="http://purl.org/dc/terms/">
...
<div resource="/alice/posts/trouble_with_bob">
<h2 property="title">The trouble with Bob</h2>
<p>Date: <span property="created">2011-09-10</span></p>
<h3 property="creator">Alice</h3>
...
</div>
...
<div resource="/alice/posts/jos_barbecue">
<h2 property="title">Jo's Barbecue</h2>
<p>Date: <span property="created">2011-09-14</span></p>
<h3 property="creator">Eve</h3>
...
</div>
...
</body>
Attributes: typeof
1
<div vocab="http://xmlns.com/foaf/0.1/" typeof="Person">
<p>
<span property="name">Alice Birpemswick</span>,
Email: <a property="mbox"
href="mailto:[email protected]">[email protected]</a>,
Phone: <a property="phone" href="tel:+1-617-555-7332">+1 617.555.7332</a>
</p>
<ul>
<li property="knows" typeof="Person">
<a property="homepage" href="http://example.com/bob/"><span
property="name">Bob</span>
</a>
</li>
<li property="knows" typeof="Person">
<a property="homepage" href="http://example.com/eve/"><span
property="name">Eve</span>
</a>
</li>
<li property="knows" typeof="Person">
<a property="homepage" href="http://example.com/manu/"><span
property="name">Manu</span>
</a></li>
</ul></div>
Comparing RDFa
RDF
Microformats
Microdata
Comparing RDFa with RDF
RDF
Triple
- Abstract
representation of
the data.
- Subject-
predicate-object.
- It can be shown
as a graph.
RDFa express
RDF data within
XHTML.
Comparing RDFa
- Very popular.
- Predefined.
- Limitations:
• Identifying
resources.
• Typed literal
properties.
• More than one
type per
resource.
Microformats RDF Microdata
Same purpose: make the webpages
readable for computers.
In the same way: using tags in the HTML
document.
- Abstract
representation of
the data.
- Subject-
predicate-object.
- It can be shown
as a graph.
RDFa express
RDF data within
XHTML.
- Custom
vocabularies.
- Simpler than
RDFa.
- Lack of support,
features and
evolution.
Using RDFa Agenda
Improving websites
Extracted embedded
data Exercise
Other examples:
• Central Office of Information of the UK: job vacancies
• GoodRelations: e-commerce
Improving websites
Define
metadata with
RDFa
Rich search
results
Google index it
Browser
Example Parsing RDFa
• RDFa available for BBC programmes
• Parse it with rdfquery
• Use it to stream music from Spotify
GRDDL
• Extract data compatible
with RDF.
• Define transformations in a
stylesheet.
Extracting RDFa
Exercise Vocabulary for people
Exercise Webpage without metadata
Exercise Solution
THANK YOU!