Copyright © 2006-2011 W3C ® ( MIT , ERCIM , Keio ), All Rights Reserved. W3C liability , trademark and document use rules apply.
The
last
couple
of
years
have
witnessed
a
fascinating
evolution:
while
the
Web
was
initially
built
predominantly
for
human
consumption,
web
content
is
increasingly
consumed
by
machines
which
expect
some
amount
of
structured
data.
Facebook
identifies
Sites
have
started
to
identify
a
page’s
title,
datatype,
content
type,
and
preview
image
to
provide
appropriate
information
in
a
user’s
newsfeed
when
she
clicks
the
“Like”
button.
Search
engines
like
Google
have
started
to
provide
richer
search
results
by
extracting
fine-grained
structured
details
from
the
Web
pages
they
crawl.
In
turn,
web
publishers
such
as
Best
Buy
are
producing
increasing
amounts
of
structured
data
within
their
Web
content
to
improve
their
standing
with
search
engines.
A
key
enabling
technology
behind
these
developments
is
HTML
and
RDFa
(Resource
Description
Framework
in
Attributes),
which
provides
a
set
of
HTML
or
XHTML
markup
attributes
to
augment
visual
information
on
the
Web
with
machine-readable
hints.
In
this
Primer,
we
show
how
to
express
data
using
RDFa
in
HTML,
and
in
particular
how
to
turn
mark
up
existing
human-visible
information
into
human-readable
Web
page
content
to
express
machine-readable
data
without
repeating
content.
data.
This
document
provides
only
a
Primer
to
RDFa.
The
normative
complete
specification
of
RDFa,
with
further
examples,
can
be
found
in
[[RDFA-CORE]]
the
RDFa
1.1
Core
specification
[
RDFA-CORE
]
and
in
[[XHTML-RDFA]].
the
XHTML+RDFa
1.1
specification
[
XHTML-RDFA
].
This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.
This document was published by the RDF Web Applications Working Group as a Working Draft. This document is intended to become a W3C Recommendation. If you wish to make comments regarding this document, please send them to public-rdfa-wg@w3.org ( subscribe , archives ). All feedback is welcome.
Publication as a Working Draft does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.
This document was produced by a group operating under the 5 February 2004 W3C Patent Policy . W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy .
The
web
is
a
rich,
distributed
repository
of
interconnected
information
which,
until
information.
Until
recently,
it
was
organized
primarily
for
human
consumption.
On
a
typical
web
page,
an
HTML
author
might
specify
a
headline,
then
a
smaller
sub-headline,
a
block
of
italicized
text,
a
few
paragraphs
of
average-size
text,
and,
finally,
a
few
single-word
links.
Web
browsers
will
follow
these
presentation
instructions
faithfully.
However,
only
the
human
mind
understands
that
what
the
headline
is,
in
fact,
the
expresses
-
a
blog
post
title,
the
title.
The
sub-headline
indicates
the
author,
the
italicized
text
is
the
article's
publication
date,
and
the
single-word
links
are
categorization
labels.
The
subject
categories.
Computers
do
not
understand
the
nuances
between
the
information;
the
gap
between
what
programs
and
humans
understand
is
large.
Figure 1 : On the left, what browsers see. On the right, what humans see. Can we bridge the gap so that browsers see more of what we see?
What if the browser, or any machine consumer such as a Web crawler, received information on the meaning of a web page’s visual elements? A dinner party announced on a blog could be easily copied to the user’s calendar, an author’s complete contact information to the user’s address book. Users could automatically recall previously browsed articles according to categorization labels (i.e., tags). A photo copied and pasted from a web site to a school report would carry with it a link back to the photographer, giving her proper credit. A link shared by a user to his social network contacts would automatically carry additional data pulled from the original web page: a thumbnail, an author, and a specific title. When web data meant for humans is augmented with hints meant for computer programs, these programs become significantly more helpful, because they begin to understand the data's structure.
RDFa allows HTML authors to do just that. Using a few simple HTML attributes, authors can mark up human-readable data with machine-readable indicators for browsers and other programs to interpret. A web page can include markup for items as simple as the title of an article, or as complex as a user's complete social network.
RDFa
benefits
from
the
extensive
power
of
RDF
[[RDF-PRIMER]],
[
RDF-PRIMER
],
the
W3C’s
standard
for
interoperable
machine-readable
data.
However,
readers
of
this
document
are
not
expected
to
understand
RDF.
Readers
are
expected
to
understand
a
basic
level
of
HTML.
Historically,
RDFa
1.0
[[RDFA-SYNTAX]]
[
RDFA-SYNTAX
]
was
specified
only
for
XHTML.
RDFa
1.1
[[RDFA-CORE]],
[
RDFA-CORE
]
is
the
newest
version
we
now
describe,
and
the
one
used
in
this
document.
RDFa
1.1
is
specified
for
both
XHTML
[
XHTML-RDFA
]
and
HTML,
as
well
as
for
any
XML
language
like,
for
example,
SVG [[SVG12]].
This
HTML
[
HTML-RDFA
].
RDFa
also
works
in
a
variety
of
other
XML-based
languages
like
SVG
[
SVG12
],
ePub
and
the
Open
Document
Format.
While
this
document
will
use
uses
XHTML
in
all
of
the
examples.
examples,
RDFa
1.1
works
well
in
HTML4
and
HTML5.
For
simplicity,
we
use
the
term
“HTML”
throughout
this
document.
document
to
refer
to
all
of
the
HTML-family
languages.
RDFa
is
based
on
attributes.
While
some
of
the
HTML
attributes
(e.g.,
href
,
,
rel
)
are
also
used
most
have
been
re-used,
some
of
the
RDFa
1.1
attributes
have
been
specially
defined.
That
also
means
that
are
new.
This
is
important
because
some
of
the
HTML
or
XHTML
validators
may
not
properly
validate
the
HTML
code
until
they
are
updated
for
that
purpose.
However,
that
should
not
be
to
recognize
the
new
RDFa
1.1
attributes.
This
is
rarely
a
problem
in
practice:
practice
since
browsers
simply
ignore
attributes
that
they
do
not
know,
and
none
recognize.
None
of
the
RDFa-specific
attributes
have
an
any
effect
on
the
visual
display
of
the
HTML
content.
Authors
do
not
have
to
worry
about
pages
marked
up
with
RDFa
looking
any
different
to
a
human
being
from
pages
not
marked
up
with
RDFa.
Consider
Alice,
a
blogger
who
publishes
a
mix
of
professional
and
personal
articles
at
http://example.com/alice
.
We
will
construct
markup
examples
to
illustrate
how
Alice
can
use
RDFa.
The
complete
markup
of
these
examples
can
are
available
be
viewed
independently
on
a
dedicated
page
.
RDFa
1.1
offers
a
number
of
additional
means
techniques
to
significantly
simplify
the
markup.
Usage
of
these
facilities
techniques
are
not
required
by
the
author,
because
the
techniques
methods
used
in
previous
sections
cover,
theoretically,
all
cover
most
of
the
needs.
markup
requirements.
However,
when
the
the
RDFa
content
becomes
more
complicated,
these
simplifications
techniques
may
become
very
useful.
help
authors
simplify
their
markup.
In
a
number
of
simple
use
cases,
i.e.,
Facebook’s
such
as
the
Open
Graph
Protocol,
HTML
authors
will
only
use
a
single
vocabulary.
Rather
than
force
the
author
to
reproduce
og:
prefix
on
every
piece
of
metadata,
RDFa
1.1
introduces
the
attribute
to
let
the
author
declare
a
single
vocabulary
for
a
chunk
of
HTML.
Thus,
instead
of:
@vocab
vocab
<html prefix="og: http://ogp.me/ns#"> <head> <title>The Trouble with Bob</title> <meta property="og:title" content="The Trouble with Bob" /> <meta property="og:type" content="text" /> <meta property="og:image" content="http://example.com/alice/bob-ugly.jpg" /> ... </head> ...
Alice can write:
<html> <head vocab="http://ogp.me/ns#"> <title>The Trouble with Bob</title> <meta property="title" content="The Trouble with Bob" /> <meta property="type" content="text" /> <meta property="image" content="http://example.com/alice/bob-ugly.jpg" /> ... </head> ...
Of
course,
it’s
still
a
good
idea
to
mark
up
content
in
the
HTML
body
and
reuse
existing
rendered
text
and
links.
The
use
of
is
compatible
with
RDFa
either
in
the
head
or
body
of
the
HTML
document,
whether
or
not
@vocab
vocab
is
used.
@content
content
As
Alice
continues
to
mark
up
her
page
with
more
RDFa,
she
may
use
more
and
more
terms
from
vocabularies
like
Dublin
Core
[[DC11]],
[
DC11
]
and
FOAF
[[FOAF]].
[
FOAF
].
Alice
would
like
the
short
names
she
uses
to
map
to
different
vocabularies.
Although
she
would
like
to
avoid
prefixes,
the
attribute
@vocab
vocab
does
was
not
designed
to
work
any
more,
because
the
short
names
should
map
on
different
with
multiple
vocabularies.
To
help
solve
both
author
ease-of-use
authoring
simplicity
and
the
ability
to
reconcile
terminology,
RDFa 1.1
RDFa
1.1
introduces
the
idea
of
bundling
vocabularies
into
a
single
profile,
making
profile.
This
technique
makes
it
particularly
easy
for
HTML
authors
to
combine
the
use
of
multiple
vocabularies
with
markup
as
using
simple
as
the
single-vocabulary
use
case.
short-hand
names.
To
implement
this
feature,
publishers
can
publish
an
RDFa
profile
document
,
which
maps
short
names
like
name
to
full
URIs
like
http://xmlns.com/foaf/0.1/name
.
The
specifics
of
how
to
prepare
such
a
profile
document
is
out
of
scope
for
this
simple
introduction.
However,
the
markup
for
authors
who
wish
to
use
a
profile
is
quite
simple:
<div profile="http://example.org/profiles/alice"> <span property="title">The trouble with Bob</span> <span property="name">Alice</span> ... </div>
yielding
The
markup
above
uses
Alice's
profile
to
define
short-hand
meanings
for
both
"title"
and
"name".
The
markup
above
yields
the
expected
triples
information
using
the
Dublin
Core
and
the
FOAF
vocabularies,
respectively.
Profile
documents
can
also
define
prefixes.
What
this
means
is
that
That
is,
the
author
can
use
that
a
profile
which,
implicitly,
which
contains
a
number
of
mappings,
mapping
declarations.
The
mapping
declarations
in
the
profile
document
are
equivalent
to
a
set
of
@prefix
prefix
attributes.
declarations
in
the
blog
post.
For
example,
in
the
following
example:
<div prefix="og: http://ogp.me/ns# dc: http://purl.org/dc/terms/"> <h2 property="og:title">The trouble with Bob</h2> <h3 property="dc:creator">Alice</h3> ... </div>
The
author
could
replace
the
attribute
with
a
profile:
@prefix
prefix
<div profile="http://example.org/profiles/prefixes"> <h2 property="og:title">The trouble with Bob</h2> <h3 property="dc:creator">Alice</h3> ... </div>
(provided,
of
course,
The
example
above
assumes
that
the
profile
http://example.org/profiles/prefixes
profile
contains
the
necessary
prefix
definitions
for
og:
and
dc:
.
While
replacing
two
prefix
definitions
.)
Of
course,
to
replace
by
with
one
profile
reference
does
not
necessarily
help
greatly
reduce
the
authors
too
much
but,
markup
necessary,
in
more
complex
cases,
the
authors
may
have
many
more
prefix
defintions
in
which
case
the
usage
of
a
profile
may
become
very
useful.
Profiles
provide
an
easy
way
to
bundle
prefix
and
term
declarations
in
one
place,
and
they
facilitate
the
authoring
of
RDFa.
place.
However,
the
author
is
still
required
to
refer
to
those
profiles
explicitly.
On
the
other
hand,
there
explicitly
in
their
documents.
There
are
a
number
of
vocabularies
and
their
prefixes
that
are
very
widely
used
by
the
Web
community
(the
-
the
Dublin
Core
vocabulary
is
a
typical
example);
this
means
that
these
prefixes
are
good
example.
These
common
vocabularies
tend
to
be
defined
over
and
over
again.
again,
but
sometimes
Web
page
authors
forget
to
declare
the
prefixes.
To
alleviate
this
issue
further,
issue,
RDFa
1.1
also
defines
the
concept
of
default
profiles
.
These
profiles,
maintained
by
the
W3C,
are
always
implicitly
referred
to
by
any
RDFa 1.1
content;
i.e.,
RDFa
1.1
content.
That
is,
the
RDFa
processor
will
automatically
load
those
these
profiles
first,
for
you.
There
every
page
that
is
processed.
Profile
and
prefix
declarations
in
a
document
always
override
declarations
made
in
a
default
profile,
but
if
a
web
page
author
forgets
to
declare
a
common
vocabulary
such
as
Dublin
Core
or
FOAF,
the
RDFa
Processor
will
fall
back
to
the
declaration
in
the
default
profile.
http://www.w3.org/profile/rdfa-1.1
.
http://www.w3.org/profile/html-rdfa-1.1
.
Authors
can
consult
those
profiles
each
default
profile
to
find
out
which
prefixes
and
terms
are
included
automatically.
Default
profiles
are
used
as
a
mechanism
to
correct
RDFa
documents
where
authors
accidentally
forgot
to
declare
common
prefixes.
While
authors
may
rely
on
these
default
profiles
to
be
available
for
RDFa
1.1
documents,
the
vocabularies
and
prefixes
may
change
over
the
course
of
5-10
years.
The
best
way
to
ensure
that
can
be
used
without
further
declaration.
the
prefixes
that
document
authors
use
always
map
to
the
intent
of
the
author
is
to
use
the
prefix
attribute
to
declare
these
prefixes.
Do
not
depend
on
the
default
profile
to
declare
common
prefixes.
For
example,
the
following
example:
example
does
not
declare
the
dc:
prefix
using
either
the
prefix
or
profile
attribute:
<div> <h2 property="dc:date">2011-03-19</h2> <h3 property="dc:creator">Alice</h3> ... </div>
will
be
automatically
interpreted
by
However,
an
RDFa
tool
by
replacing
processor
will
still
recognize
the
dc:date
and
dc:creator
short
hands
with
their
short-hand
and
expand
the
values
to
the
corresponding
URI-s,
although
there
URI.
The
RDFa
processor
is
no
@prefix
or
@profile
;
able
to
do
this
is
because
the
dc
prefix
is
part
of
the
default
http://www.w3.org/profile/rdfa-1.1
profile.
In
spite
of
the
facilities
offered
by
Since
default
profiles
we
will,
in
what
follows,
continue
are
meant
to
declare
be
a
last-resort
mechanism
to
help
novice
document
authors,
the
markup
above
is
not
recommended.
The
rest
of
this
document
will
utilize
authoring
best
practices
by
declaring
all
prefixes
in
the
examples
order
to
make
them
the
document
author's
intentions
explicit.
In
addition,
Alice
wants
would
also
like
to
make
information
about
herself
(email
herself,
such
as
her
email
address,
phone
number,
etc.)
and
other
details,
easily
available
to
her
friends’
contact
management
software.
This
time,
instead
of
describing
the
properties
of
a
web
page,
she’s
going
to
describe
the
properties
of
a
person:
herself.
To
do
this,
she
adds
deeper
structure,
so
that
she
can
connect
multiple
items
that
themselves
have
properties.
Alice already has contact information displayed on her blog.
<div> <p> Alice Birpemswick </p> <p> Email: <a href="mailto:alice@example.com">alice@example.com</a> </p> <p> Phone: <a href="tel:+1-617-555-7332">+1 617.555.7332</a> </p> </div>
The
Dublin
Core
vocabulary
does
not
provide
property
names
for
describing
contact
information,
but
the
Friend-of-a-Friend
[[FOAF]]
[
FOAF
]
vocabulary
does.
In
RDFa,
it
is
common
and
easy
to
combine
different
vocabularies
in
a
single
page.
Alice
imports
the
FOAF
vocabulary
and
declares
a
foaf:Person
.
For
this
purpose,
Alice
uses
,
an
RDFa
attribute
that
is
specifically
meant
to
declare
a
new
data
item
with
a
certain
type:
@typeof
typeof
<div prefix="foaf: http://xmlns.com/foaf/0.1/" typeof="foaf:Person">
...
Alice
realizes
that
she
only
intends
to
use
the
FOAF
vocabulary
at
this
point,
so
she
uses
the
attribute
to
further
simplify
her
markup.
@vocab
vocab
<div vocab="http://xmlns.com/foaf/0.1/" typeof="Person">
...
Then,
Alice
can
indicate
indicates
which
content
on
the
page
represents
her
full
name,
email
address,
and
phone
number:
<div vocab="http://xmlns.com/foaf/0.1/" typeof="Person"> <p property="name"> Alice Birpemswick </p> <p> Email: <a rel="mbox" href="mailto:alice@example.com">alice@example.com</a> </p> <p> Phone: <a rel="phone" href="tel:+1-617-555-7332">+1 617.555.7332</a> </p> </div>
Note
how
Alice
didn't
did
not
specify
like
she
did
when
adding
blog
entry
metadata.
@about
about
What
If
she
is
not
declaring
what
she
associating
these
properties
with,
then?
is
talking
about,
how
does
the
RDFa
Processor
know
what
she's
identifying?
In
fact,
RDFa,
the
attribute
on
the
enclosing
@typeof
typeof
div
implicitly
sets
the
subject
of
the
properties
marked
up
within
that
div
.
The
That
is,
the
name,
email
address,
and
phone
number
are
associated
with
a
new
node
of
type
foaf:Person
.
This
node
has
no
URI
to
identify
it,
so
it
is
called
a
blank
node
as
shown
on
the
figure:
Figure
6
:
A
Blank
Node:
blank
nodes
are
not
identified
by
URI.
Instead,
many
of
them
have
a
@typeof
an
RDFa
typeof
attribute
that
identifies
the
type
of
data
they
represent.
This
approach—providing
approach
—
providing
no
name
but
adding
a
type—is
type
—
is
particularly
useful
when
listing
a
number
of
items
on
a
page,
page
that
have
no
permanent
URL,
e.g.,
calendar
events,
authors
on
an
article,
friends
on
a
social
network,
etc.
RDF,
the
Resource
Description
Framework,
is
exactly
the
abstract
data
representation
we’ve
we
have
drawn
out
as
graphs
in
the
above
examples.
examples
above.
Each
arrow
in
the
graph
is
represented
as
a
subject-predicate-object
subject-property-object
triple:
the
subject
is
the
node
at
the
start
of
the
arrow,
the
predicate
property
is
the
arrow
itself,
and
the
object
is
the
node
or
literal
at
the
end
of
the
arrow.
A
set
of
such
RDF
triples
is
often
called
an
“RDF
graph”,
and
it
is
typically
stored
in
what
is
often
called
a
“Triple
Store.”
Store”
or
a
“Graph
Store”.
Consider the first example graph:
The
two
RDF
triples
for
this
graph
are
written,
using
the
Turtle
syntax
[[TURTLE]],
[
TURTLE
],
as
follows:
<http://www.example.com/alice/posts/trouble_with_bob> <http://purl.org/dc/elements/1.1/title> "The Trouble with Bob";<http://purl.org/dc/elements/1.1/creator> "Alice" .<http://purl.org/dc/elements/1.1/creator> "Alice" .
Also,
the
TYPE
arrows
we
drew
are
no
different
from
other
arrows,
only
their
label
arrows.
The
TYPE
is
actually
just
another
property
that
happens
to
be
a
core
RDF
property,
rdf:type
.
The
,
where
the
rdf
namespace
vocabulary
is
located
at
.
The
contact
information
example
from
above
should
thus
be
diagrammed
as:
<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
The
point
of
RDF
is
to
provide
a
universal
language
for
expressing
data.
A
unit
of
data
can
have
any
number
of
fields,
and
field
names
properties
that
are
expressed
as
URIs.
These
URIs
which
can
be
reused
by
any
publisher,
much
like
any
web
publisher
can
link
to
any
web
page,
even
ones
they
did
not
create
themselves.
Given
data,
in
the
form
of
RDF
triples,
collected
from
various
locations,
and
using
the
RDF
query
language
SPARQL
[[RDF-SPARQL-QUERY]],
[
RDF-SPARQL-QUERY
],
one
can
search
for
“friends
of
Alice’s
who
created
items
whose
title
contains
the
word
‘Bob’,”
whether
those
items
are
blog
posts,
videos,
calendar
events,
or
other
data
types
we
haven’t
thought
of
yet.
types.
RDF
is
an
abstract,
machine-readable
abstract
data
representation
model
meant
to
maximize
the
reuse
of
vocabularies.
RDFa
is
a
way
to
express
RDF
data
within
HTML,
in
a
way
that
is
machine-readable,
and
by
reusing
the
existing
human-readable
data.
data
in
the
document.
As
Alice
marks
up
her
page
with
RDFa,
she
may
discover
the
need
to
express
data,
e.g.,
such
as
her
favorite
photos,
that
is
not
covered
by
existing
vocabularies
like
Dublin
Core
or
FOAF.
Since
RDFa
is
simply
vocabularies.
If
she
needs
to,
Alice
can
create
a
representation
of
RDF,
the
RDF
schema
mechanism
that
enables
RDF
extensibility
is
the
same
that
enables
RDFa
extensibility.
custom
vocabulary
suited
for
her
needs.
Once
an
RDF
a
vocabulary
is
created,
it
can
be
used
in
RDFa
markup
just
like
existing
vocabularies.
any
other
vocabulary.
The
instructions
on
how
to
create
a
vocabulary,
also
known
as
an
RDF
schema
Schema,
are
available
in
Section
5
of
the
RDF
Primer
[[RDF-SCHEMA]].
[
RDF-SCHEMA
].
At
a
high
level,
the
creation
of
an
RDF
schema
a
vocabulary
for
RDFa
involves:
http://example.com/photos/vocab#
.
Photo
and
Camera
,
as
well
as
the
property
takenWith
that
relates
a
photo
to
the
camera
with
which
it
was
taken.
prefix="photo:
http://example.com/photos/vocab#"
,
and
typeof="photo:Camera"
.
It
is
worth
noting
that
anyone
who
can
publish
a
document
on
the
Web
can
publish
an
RDF
a
vocabulary
and
thus
define
new
data
fields
they
may
wish
to
express.
RDF
and
RDFa
allow
fully
distributed
extensibility
of
vocabularies.
There is a wide variety of tools that can be used to generate or process RDFa data. Good sources for these are the RDFa page of the W3C Semantic Web Wiki , or the RDFa Wiki’s implementation page . The RDFa Wiki also contains further examples and information on how to get involved.
This
section
contains
a
set
of
examples
that
more
advanced
RDFa
examples.
They
are
provided
to
help
in
understanding
some
of
the
reader
understand
a
few
more
RDFa
usage
patterns
of
RDFa.
patterns.
Many
of
these
examples
describe
not
only
how
to
encode
some
data
into
RDF
but
also
what
the
an
application
examples
might
be
try
to
use
that
do
with
the
data.
Note
that
the
implementation
of
those
examples
may
require
a
programmatic
access
to
the
RDFa
content;
this
can
be
achieved
through
a
companion
specification,
namely
content.
Programmatic
access
to
the
data
is
provided
via
the
RDFa
API
[[RDFa-API]].
[
RDFA-API
].
Amy
has
enriched
her
band’s
web-site
to
include
Google
Rich
Snippets
event
information.
Google
Rich
Snippets
are
used
to
mark
up
information
for
the
search
engine
engines
to
use
when
displaying
enhanced
search
results.
Amy
also
uses
some
ECMAScript
JavaScript
code
that
she
found
on
the
web
that
automatically
extracts
the
event
information
from
a
page
and
adds
an
entry
into
a
personal
calendar.
Brian
finds
Amy’s
web-site
through
Google
and
opens
the
band’s
page.
He
decides
that
he
wants
to
go
to
the
next
concert.
Brian
is
able
to
add
the
details
to
his
calendar
by
clicking
on
the
link
that
is
automatically
generated
by
the
Javascript
JavaScript
tool.
The
Javascript
JavaScript
extracts
the
RDFa
from
the
web
page
using
RDFa
API
[[RDFa-API]],
[
RDFA-API
],
and
places
the
event
into
Brian's
personal
calendaring
software—Google
software
—
Google
Calendar.
Amy
also
uses
the
RDFa
API
[[RDFa-API]]
[
RDFA-API
]
to
automatically
extract
the
event
information
from
a
page
and
some
additional
Javascript
JavaScript
code
that
she
found
on
the
web
to
add
an
entry
into
a
her
personal
calendar.
<div prefix="v: http://rdf.data-vocabulary.org/#" typeof="v:Event"> <a rel="v:url" href="http://amyandtheredfoxies.example.com/events" property="v:summary">Tour Info: Amy And The Red Foxies</a> <span rel="v:location"> <a typeof="v:Organization" rel="v:url" href="http://www.kammgarn.de/" property="v:name">Kammgarn</a> </span> <div rel="v:photo"><img src="foxies.jpg"/></div> <span property="v:summary">Hey K-Town, Amy And The Red Foxies will rock Kammgarn in October.</span> When: <span property="v:startDate" content="2009-10-15T19:00">15. Oct., 7:00 pm</span>- <span property="v:endDate" content="2009-10-15T21:00">9:00 pm</span> Category: <span property="v:eventType">concert</span> </div>
Dale
has
a
site
that
contains
a
number
of
images,
showcasing
his
photography.
He
has
already
used
RDFa
to
add
licensing
information
about
the
images
to
his
pages,
pages
by
following
the
instructions
provided
by
Creative
Commons.
Dale
would
like
to
display
the
correct
Creative
Commons
icons
for
each
image
so
that
people
will
be
able
to
quickly
determine
which
licenses
apply
to
each
image.
He
writes
a
few
lines
of
Javascript
code
by
using
the
RDFa
API
[[RDFa-API]]
[
RDFA-API
]
to
extract
the
URI
of
the
applied
license
in
order
from
the
web
page
and
then
uses
it
to
look
up
a
dictionary
load
an
image
for
that
URL
through
the
correct
icon
of
this
license.
Creative
Commons
website.
<div prefix="cc: http://creativecommons.org/ns#"> <img src="http://dale.example.com/images/image1.png" rel="cc:license" resource="http://creativecommons.org/licenses/by/3.0/us/"/> <a rel="cc:attributionURL" rel="cc:attributionURL" href="http://dale.example.com" rel="cc:attributionURL" property="cc:attributionName">Dale</a> </div>
Mary is responsible for keeping the projects section of her company’s home page up-to-date. She wants to display info-boxes that summarize details about the members associated with each project. The information should appear when hovering the mouse over the link to each member's homepage. Since each member’s homepage is annotated with RDFa, Mary writes a script that requests the page’s content and extracts necessary information via the RDFa API.
To
use
unique
identification
for
the
different
interest
areas,
Mary
decides
to
use
unique
identifications
URIs
rather
than
simple
terms.
text.
She
chooses
to
use
the
terms
defined
by
DBpedia
(a
.
DBPedia
is
a
dump
of
Wikipedia
data
in
terms
of
RDF
with
some
extra
links)
that
is
expressed
as
a
vocabulary.
It
is
widely
used
on
the
Semantic
Web
for
that
purpose.
identifying
concepts
in
the
human
world.
She
also
makes
use
of
a
special
RDFa
attribute,
namely
resource
that
plays
the
same
role
as
href
but
does
not
provide
a
clickable
link
to
the
browser
like
href
.
This
allows
her
to
add
a
reference
to
the
human
readable
version
of
the
interest
page
on
Wikipedia.
(In
case
Since
both
the
resource
and
the
href
attributes
may
appear
on
the
same
element,
the
former
takes
precedence,
and
precedence
in
RDFa
while
the
href
attribute
is
ignored
for
RDFa.)
latter
can
be
used
to
re-direct
the
person
viewing
the
page
to
a
human-readable
form
of
the
DBPedia
entry.
Finally
Mary
uses
the
RDFa
API
[[RDFa-API]]
[
RDFA-API
]
to
extract
this
kind
of
information
from
the
HTML
source
in
order
to
populate
the
infoboxes.
<div prefix="dc: http://purl.org/dc/terms/ foaf: http://xmlns.com/foaf/0.1/" about="#me" typeof="foaf:Person"> <span property="foaf:name" content="Bob">My</span> interests are: <ol about="#me" typeof="foaf:Person" rel="foaf:interest"> <li><a resource="http://dbpedia.org/resource/Semantic_Web" href="http://en.wikipedia.org/wiki/Semantic_Web" property="dc:title">Semantic Web</a> </li> <li><a resource="http://dbpedia.org/resource/Facebook" href="http://en.wikipedia.org/wiki/Facebook" property="dc:title">Facebook</a> </li> <li><a resource="http://dbpedia.org/resource/Twitter" href="http://en.wikipedia.org/wiki/Twitter" property="dc:title">Twitter</a> </li> </ol> </div>
Richard has created a site that lists his favourite restaurants and their locations. He doesn’t want to generate code specific to the various mapping services on the Web. Instead of creating specific markup for Yahoo Maps, Google Maps, MapQuest, and Google Earth, he instead adds address information via RDFa to each restaurant entry. This enables him to build a general tool that extracts the address information and access the mapping tool the user wishes.
<div prefix="vc: http://www.w3.org/2006/vcard/ns# foaf: http://xmlns.com/foaf/0.1/" typeof="vcard:VCard"> <span property="vcard:fn">Wong Kei</span> <span property="vcard:street-address">41-43 Wardour Street</span> <span property="vcardlocality">London</span>, <span property="vcard:country-name">United Kingdom</span> <span property="vcard:tel">020 74373071</span> </div>
Marie
is
a
chemist,
researching
the
effects
of
ethanol
on
the
spatial
orientation
of
animals.
She
writes
about
her
research
on
her
blog
and
often
makes
references
to
chemical
compounds.
She
would
like
any
reference
to
these
compounds
to
automatically
have
a
picture
of
the
compound's
structure
shown
as
a
tooltip,
and
a
link
to
the
compound’s
entry
on
the
National
Center
for
Biotechnology
Information [NCBI]
Information
[NCBI]
Web
site.
Similarly,
she
would
like
visitors
to
be
able
to
visualize
the
chemical
compound
in
the
page
using
a
new
HTML5
canvas
widget
she
has
found
on
the
web
that
combines
data
from
different
chemistry
websites.
<div prefix="dbp: http://dbpedia.org/ontology/ fb: http://rdf.freebase.com/rdf/"> My latest study about the effects of <span about="fb:en.ethanol" typeof="dbp:ChemicalCompound" property="fb:chemistry.chemical_compound.pubchem_id" content="702">ethanol</span> on mice's spatial orientation show that ... </div>
Dave is writing a browser plugin that filters product offers in a web page and displays an icon to buy the product or save it to a public wishlist. The plugin searches for any mention of product names, thumbnails, and offered prices. The information is listed in the URL bar as an icon, and upon clicking the icon, displayed in a sidebar in the browser. He can then add each item to a list that is managed by the browser plugin and published on a wishlist website.
Because
many
of
his
pages
make
use
of
the
Good
Relation
ontology,
which
is
widely
used
in
this
area,
to
markup
products,
Dave
decides
to
make
use
of
the
vocab
facility
of
RDFa
to
simplify
his
code.
He
also
relies
on
the
fact
that
forgets
to
declare
the
rdfs
prefix,
but
since
it
is
defined
by
the
RDFa
default
profile,
prefix
i.e.,
it
is
not
strictly
necessary
the
data
that
he
intended
to
define
in
via
a
express
using
the
prefix
rdfs
attribute.
prefix
will
still
be
extracted
by
all
conforming
RDFa
processors.
<div prefix="foaf: http://xmlns.com/foaf/0.1/"> <div vocab="http://purl.org/goodrelations/v1#" about="#offering" typeof="Offering"> <div rel="foaf:page" resource="http://www.amazon.com/Harry-Potter-Deathly-Hallows-Book/dp/0545139708"></div> <div property="rdfs:label">Harry Potter and the Deathly Hallows</div> <div property="rdfs:comment">In this final, seventh installment of the Harry Potter series, J.K. Rowling unveils in spectactular fashion the answers to the many questions that have been so eagerly awaited. The spellbinding, richly woven narrative, which plunges, twists and turns at a breathtaking pace, confirms the author as a mistress of storytelling, whose books will be read, reread and read again.</div> <div rel="foaf:depiction"> <img src="http://ecx.images-amazon.com/images/I/51ynI7I-qnL._SL500_AA300_.jpg" /> </div> <div rel="hasBusinessFunction" resource=http://purl.org/goodrelations/v1#Sell"></div> <div rel="hasPriceSpecification">Buy for <span typeof="UnitPriceSpecification"> <span property="hasCurrency" content="USD">$</span> <span property="hasCurrencyValue">7.49</span> </span> </div> Pay via: <span rel="acceptedPaymentMethods" resource="http://purl.org/goodrelations/v1#PayPal">PayPal</span> <span rel="acceptedPaymentMethods" resource="http://purl.org/goodrelations/v1#MasterCard">MasterCard</span> </div> </div> </div>
At the time of publication, the active members of the RDFa Working Group were:
No normative references.