rdfa: introduction, comparison with microdata and microformats and how to use it

21
RDFa: Resource Description Framework in attributes Hiroshi Leon Navid Mahlouji Jose Luis Lopez Pino

Upload: jose-luis-lopez-pino

Post on 06-May-2015

593 views

Category:

Technology


2 download

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

Page 1: RDFa: introduction, comparison with microdata and microformats and how to use it

RDFa: Resource Description Framework in attributes

Hiroshi Leon

Navid Mahlouji

Jose Luis Lopez Pino

Page 2: RDFa: introduction, comparison with microdata and microformats and how to use it

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

Page 3: RDFa: introduction, comparison with microdata and microformats and how to use it

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

Page 4: RDFa: introduction, comparison with microdata and microformats and how to use it

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

Page 5: RDFa: introduction, comparison with microdata and microformats and how to use it

Target domain

Once the data is structured, it is more useful for the

computer programs, that can use it efficiently.

Page 6: RDFa: introduction, comparison with microdata and microformats and how to use it

<?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

Page 7: RDFa: introduction, comparison with microdata and microformats and how to use it

Attributes

• About

• Rel and rev

• Src, href and resource

• Property

• Content

• Datatype

• Typeof

• Vocab

1

Page 8: RDFa: introduction, comparison with microdata and microformats and how to use it

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>

Page 9: RDFa: introduction, comparison with microdata and microformats and how to use it

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>

Page 10: RDFa: introduction, comparison with microdata and microformats and how to use it

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>

Page 11: RDFa: introduction, comparison with microdata and microformats and how to use it

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>

Page 12: RDFa: introduction, comparison with microdata and microformats and how to use it

Comparing RDFa

RDF

Microformats

Microdata

Page 13: RDFa: introduction, comparison with microdata and microformats and how to use it

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.

Page 14: RDFa: introduction, comparison with microdata and microformats and how to use it

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.

Page 15: RDFa: introduction, comparison with microdata and microformats and how to use it

Using RDFa Agenda

Improving websites

Extracted embedded

data Exercise

Page 16: RDFa: introduction, comparison with microdata and microformats and how to use it

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

Page 17: RDFa: introduction, comparison with microdata and microformats and how to use 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

Page 18: RDFa: introduction, comparison with microdata and microformats and how to use it

Exercise Vocabulary for people

Page 19: RDFa: introduction, comparison with microdata and microformats and how to use it

Exercise Webpage without metadata

Page 20: RDFa: introduction, comparison with microdata and microformats and how to use it

Exercise Solution

Page 21: RDFa: introduction, comparison with microdata and microformats and how to use it

THANK YOU!