Copyright
©
2010
2010-2011
W3C
®
(
MIT
,
ERCIM
,
Keio
),
All
Rights
Reserved.
W3C
liability
,
trademark
and
document
use
rules
apply.
RDFa [ RDFA-CORE ] enables authors to publish structured information that is both human- and machine-readable. Concepts that have traditionally been difficult for machines to detect, like people, places, events, music, movies, and recipes, are now easily marked up in Web documents. While publishing this data is vital to the growth of Linked Data , using the information to improve the collective utility of the Web for humankind is the true goal. To accomplish this goal, it must be simple for Web developers to extract and utilize structured information from a Web document. This document details such a mechanism; an RDFa Application Programming Interface (RDFa API) that allows simple extraction and usage of structured information from a Web document.
This section is non-normative.
This document is a detailed specification for an RDFa API . The document is primarily intended for the following audiences:
For those looking for an introduction to the use of RDFa, or some real-world examples, please consult the RDFa Primer [ RDFA-PRIMER ].
If you are not familiar with RDF, you should read about the Resource Description Framework (RDF) [ RDF-CONCEPTS ] before reading this document. The [ RDF-CONCEPTS ] document outlines the core data model that is used by RDFa to express information.
If you are not familiar with RDFa, you should read and understand the [ RDFA-CORE ] specification. It describes how data is encoded in host languages using RDFa. A solid understanding of concepts in RDFa Core will inevitably help you understand how the RDFa API works in concert with how the data is expressed in a host language.
If you are not familiar with the RDF API, you should read about the Resource Description Framework Application Programming Interface [ RDF-API ] which is the base specification for this document. The [ RDF-API ] specification outlines fundamental programming concepts for working with Web-based data.
If you are a Web developer and are already familiar with RDF and RDFa, and you want to programatically extract RDFa content from documents, then you will find the Concept Diagram and Developing with the API sections of most interest. It contains a handful of ECMAScript examples on how to use the RDFa API .
Readers who are not familiar with the Terse RDF Triple Language [ TURTLE ] may want to read the specification in order to understand the short-hand RDF notation used in some of the examples.
This document uses the Web Interface Definition Language [ WEBIDL ] to specify all language bindings. If you intend to implement the RDFa API you should be familiar with the Web IDL language [ WEBIDL ].
Examples may contain references to existing vocabularies and use abbreviations in CURIEs and source code. The following is a list of all vocabularies and their abbreviations, as used in this document:
rdf
,
e.g.,
rdf:type
)
xsd
,
e.g.,
xsd:integer
)
rdfs
,
e.g.,
rdfs:label
)
foaf
,
e.g.,
foaf:name
)
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/.
The following changes have been made since the First Public Working Draft:
This document was published by the RDFa 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 .
This section is non-normative.
RDFa
provides
a
means
to
attach
properties
to
elements
enable
machine-readable
markup
of
structured
data
in
XML
and
HTML
human-readable
Web
documents.
Since
the
purpose
of
these
additional
properties
Structured
data
that
is
to
provide
information
about
real-world
items,
contained
in
documents,
such
as
people,
films,
companies,
events,
and
so
on,
properties
are
grouped
into
objects
called
PropertyGroup
s.
can
provide
an
added
layer
of
information
to
Web
Applications.
The
RDFa
API
provides
a
set
of
interfaces
that
make
it
easy
to
manipulate
DOM
objects
that
contain
information
that
is
also
part
of
a
PropertyGroup
.
This
specification
defines
these
interfaces.
access
structured
data
in
Web
documents.
A document that contains RDFa effectively provides two data layers. The first layer is the information about the document itself, such as the relationship between the elements, the value of its attributes, the origin of the document, and so on, and this information is usually provided by the Document Object Model, or DOM [ DOM-LEVEL-1 ].
The second data layer comprises information provided by embedded metadata, such as company names, film titles, ratings, and so on, and this is usually provided by RDFa [ RDFA-CORE ], Microformats [ MICROFORMATS ], DC-HTML, GRDDL, or Microdata.
Whilst
this
embedded
information
could
be
accessed
via
the
usual
DOM
interfaces
--
for
example,
by
iterating
through
child
elements
and
checking
attribute
values
--
the
potentially
complex
interrelationships
between
the
data
mean
that
it
is
more
efficient
for
developers
if
they
have
direct
access
to
the
data
after
it
has
been
interpreted.
extracted.
For
example,
a
document
may
contain
the
name
of
a
person
in
one
section
and
the
phone
number
of
the
same
person
in
another;
whilst
the
basic
DOM
interfaces
provide
access
to
these
two
pieces
of
information
through
normal
navigation,
it
is
more
convenient
for
authors
to
have
these
two
pieces
of
information
available
in
one
property
collection,
reflecting
the
final
PropertyGroup
.
object.
All
of
this
is
achieved
through
This
specification
defines
the
RDFa
API.
There
are
many
scenarios
in
API,
which
the
RDFa
API
can
may
be
used
to
extract
information
from
a
Web
document.
The
following
sections
describe
a
few
of
these
scenarios.
1.1
Importing
Data
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
to
use
when
displaying
enhanced
search
results.
Amy
also
uses
some
ECMAScript
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
ECMAScript
tool.
The
ECMAScript
extracts
the
RDFa
from
the
web
page
and
places
the
event
into
Brian's
personal
calendaring
software
-
Google
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>
</span>
Category: <span property="v:eventType">concert</span>
</div>
1.2
Enhanced
Browser
Interfaces
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
developers
and
published
on
a
wishlist
website.
<div prefix="rdfs: http://www.w3.org/2000/01/rdf-schema#
foaf: http://xmlns.com/foaf/0.1/
gr: http://purl.org/goodrelations/v1#
xsd: http://www.w3.org/2001/XMLSchema#" xml:lang="en">
<div about="#offering" typeof="gr: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="gr:hasBusinessFunction" resource="http://purl.org/goodrelations/v1#Sell"></div>
<div rel="gr:hasPriceSpecification">Buy for
<span typeof="gr:UnitPriceSpecification">
<span property="gr:hasCurrency" content="USD" datatype="xsd:string">$</span>
<span property="gr:hasCurrencyValue" datatype="xsd:float">7.49</span>
</span>
</div> Pay via:
<span rel="gr:acceptedPaymentMethods" resource="http://purl.org/goodrelations/v1#PayPal">PayPal</span>
<span rel="gr:acceptedPaymentMethods" resource="http://purl.org/goodrelations/v1#MasterCard">MasterCard</span>
</div>
</div>
</div>
1.3
Data-based
Web
Page
Modification
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,
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.
<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 href="http://dale.example.com" property="cc:attributionName"
rel="cc:attributionURL">Dale</a>
</div>
1.4
Automatic
Summaries
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.
<div prefix="dc: http://purl.org/dc/terms/ foaf: http://xmlns.com/foaf/0.1/">
<div about="#me" property="foaf:name" content="Bob">My<span> interests are:
<ol about="#me" typeof="foaf:Person">
<li rel="foaf:interests">
<a href="facebook" rel="tag" property="dc:title">facebook</a>
</li>
<li rel="foaf:interests">
<a href="opengraph" rel="tag" property="dc:title">opengraph</a>
</li>
<li rel="foaf:interests">
<a href="semanticweb" rel="tag" property="dc:title">semanticweb</a>
</li>
</ol>
<p>Please follow me on Twitter:
<span about="#me" rel="foaf:account">
@<a typeof="foaf:OnlineAccount" property="foaf:accountName"
href="http://twitter.com/bob">bob</a>.
</span>
</p>
</div>
1.5
Data
Visualization
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
Applications
to
build
on
top
of
the
access
structured
data
contained
in
the
page
as
well
as
letting
visitors
to
the
site
use
the
same
data
to
create
innovative
new
applications
based
on
the
address
information
in
the
page.
<div prefix="vc: http://www.w3.org/2006/vcard/ns# foaf: http://xmlns.com/foaf/0.1/" typeof="vc:VCard">
<span property="vc:fn">Wong Kei</span>
<span property="vc:street-address">41-43 Wardour Street</span>
<span property="vc:locality">London</span>, <span property="vc:country-name">United Kingdom</span>
<span property="vc:tel">020 74373071</span>
</div>
1.6
Linked
Data
Mashups
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]
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.
documents.
This section is non-normative.
RDFa 1.0 [ RDFA-SYNTAX ] has seen substantial growth since it became an official W3C Recommendation in October 2008. It has seen wide adoption among search companies, e-commerce sites, governments, and content management systems. There are numerous interoperable implementations and growth is expected to continue to rise with the latest releases of RDFa 1.1 [ RDFA-CORE ], XHTML+RDFa 1.1 [ XHTML-RDFA ], and HTML+RDFa 1.1 [ HTML-RDFA ].
In
an
effort
to
ensure
that
Web
applications
are
able
to
fully
utilize
RDFa,
this
specification
outlines
an
API
and
a
set
of
interfaces
that
extract
RDF
Triples
data
from
Web
documents
or
and
other
document
formats
that
utilize
RDFa.
The
RDFa
API
is
designed
with
maximum
code
expressiveness
and
ease
of
use
in
mind.
Furthermore,
a
deep
understanding
of
RDF
and
RDFa
is
not
necessary
in
order
to
extract
and
utilize
the
structured
data
embedded
in
RDFa
documents.
Since there are many Web browsers and programming environments for the Web, the rapid adoption of RDFa requires an interoperable API that Web document designers can count on being available in all Web browsers. The RDFa API provides a uniform and developer-friendly interface for extracting RDFa from Web documents.
Since most browser-based applications and browser extensions that utilize Web documents are written in ECMAScript [ ECMA-262 ], the implementation of the RDFa API is primarily concerned with ensuring that concepts covered in this document are easily utilized in ECMAScript.
While
ECMAScript
is
of
primary
concern,
the
RDFa
API
specification
is
language
independent
and
is
designed
such
that
DOM
tool
developers
may
implement
it
in
many
of
the
other
common
Web
programming
languages
such
as
Python,
Java,
Perl,
and
Ruby.
Objects
that
are
defined
by
the
RDFA
RDFa
API
are
designed
to
work
as
seamlessly
as
possible
with
language-native
types,
operators,
and
program
flow
constructs.
The design goals that drove the creation of the APIs that are described in this document are:
document.getElementsBySubject()
,
which
roughly
mirrors
the
document.getElementsById()
document.getElementsByClassName()
functionality
that
is
a
part
of
[
DOM-LEVEL-1
].
The following diagram describes the relationship between all concepts discussed in this document.
Diagram
of
Concept
Stack
for
the
RDFa
API
Concepts
and
RDF
API
The
lowest
layer
of
the
RDFa
API
defines
the
basic
structures
that
are
used
to
store
information;
IRI
,
PlainLiteral
,
TypedLiteral
,
BlankNode
and
finally
the
RDFTriple
.
The
next
layer
is
layered
on
top
of
concepts
defined
by
the
API,
the
DataStore
,
supports
the
storage
of
information.
RDF
API.
The
DataParser
lowest
level
concepts
are
Triples,
Graphs
and
DataQuery
interfaces
directly
interact
with
the
DataStore
.
The
DataParser
is
used
to
extract
information
from
the
Document
Projections.
Triples,
Graphs
and
store
the
result
in
a
DataStore
.
The
DataQuery
interface
is
Projections
are
data
structures
used
by
Web
Developers
to
extract
different
views
of
work
with
data
from
the
DataStore
.
The
PropertyGroup
is
an
abstract,
easily
manipulable
view
of
this
information
for
developers.
While
PropertyGroup
objects
can
address
most
use
cases,
a
developer
also
has
access
to
the
information
expressed
in
RDF
languages.
Working
directly
with
the
DataStore
data
structures
can
be
cumbersome
at
a
basic
level.
Access
times,
such
as
the
requirement
to
use
absolute
URIs
when
accessing
properties,
thus
Profiles
are
provided
to
support
accessing
the
raw
data
allows
developers
using
compact
URIs
(CURIEs).
Data
Parsers
and
Data
Serializers
provide
mechanisms
to
create
new
views
both
read
and
ways
of
directly
manipulating
the
write
RDF
data
in
a
DataStore
.
variety
of
RDF
languages.
All
of
these
concepts
are
provided
via
a
high-level
interface
called
the
RDF
Environment.
The
highest
layer
to
the
API
is
implementers
should
note
that
only
the
Document
object
and
is
what
most
web
developers
will
use
portions
of
the
RDF
API
that
are
directly
used
by
this
API
need
to
retrieve
PropertyGroup
s
created
be
implemented
for
a
conforming
RDFa
API
implementation.
That
is,
only
Projections
are
required
to
be
implemented
from
the
RDF
API
for
a
fully
conformant
RDFa
API
implementation.
The
higher-level
RDFa
API
provides
two
interfaces
for
accessing
data
stored
in
the
document.
Simple
queries
for
DOM
data
may
be
performed
using
the
Document
interface,
while
more
complex
queries
for
structured
data
may
be
performed
using
the
Document
Data
interface.
This section is non-normative.
The following section provides an overview of the basic RDFa API that developers may find most useful in day-to-day programming exercises. An overview of the more advanced RDFa API is also provided, which may help developers when tackling some of the more complex RDFa programming tasks.
This section is non-normative.
This API provides a number of interfaces to enable:
The
RDFa
API
has
a
number
of
advanced
methods
that
can
be
used
to
access
the
DataStore
,
DataParser
and
DataQuery
mechanisms.
Most
Many
web
developers
will
not
need
to
use
find
that
the
advanced
methods
-
most
will
only
require
basic
functionality
provided
by
the
following
interfaces
RDFa
API
is
sufficient
for
most
of
their
day-to-day
development
activities.
programming
tasks.
Since
developers
typically
work
with
object-oriented
data
structures,
the
basic
API
is
geared
toward
building
language-native
objects
called
Projection
s
and
returning
them
to
the
developer.
document.getItemsByType(type)
document.data.getSubjects(optional
property,
optional
value)
PropertyGroup
document.data.getProperties(optional
subject)
document.getItemBySubject(type)
document.data.getValues(optional
subject,
optional
property)
PropertyGroup
document.data.getProjection(subject,
optional
template)
http://example.org/people#bob
document.data.getProjection("http://example.com/people#bob")
.
document.getItemsByProperty(property,
document.data.getProjections(optional
property,
optional
value)
value,
optional
template)
PropertyGroup
foaf:name
document.data.getProjections("foaf:name")
.
document.getElementsByType(type)
rdf:type
expressed
in
the
DOM
Node.
The
type
foaf:Person
.
typeof
,
rel
,
rev
or
the
property
attribute.
document.getElementsBySubject(type)
document.getElementsBySubject(subject)
http://example.org/people#bob
.
about
,
href
,
src
,
or
resource
attribute.
document.getElementsByProperty(property,
optional
value)
typeof
,
rel
,
rev
or
property
attribute.
document.data.context.setMapping(prefix,
document.data.setMapping(mapping,
iri)
foaf:Person
foaf
to
be
mapped
to
a
longer
IRI,
for
example:
http://xmlns.com/foaf/0.1/Person
http://xmlns.com/foaf/0.1/
.
This
mapping
ensures
that
when
a
developer
specifies
a
compact
URI
like
foaf:Person
,
that
it
is
expanded
to
http://xmlns.com/foaf/0.1/Person
before
it
is
used
by
the
underlying
API.
document.data.query.select(query,
document.data.rdfa.query(query,
optional
template)
The
following
section
uses
the
markup
shown
below
to
demonstrate
how
to
extract
and
use
PropertyGroup
subject,
properties,
values
and
Projection
s
using
the
RDFa
API.
The
following
markup
is
used
for
the
examples
in
this
section
and
is
assumed
to
be
served
from
a
document
located
at
http://example.org/people
.
<div prefix="foaf: http://xmlns.com/foaf/0.1/" about="#albert" typeof="foaf:Person"> <span property="foaf:name">Albert Einstein</span> </div>
Often, developers must determine whether or not a document contains the type of data that they are interested in processing. The RDFa API provides a simple mechanism to extract things like subjects, properties and values from the current document. The return types for subjects and properties are always sequences of strings. Values are typically converted into language-native types. Strings and language-native types are used in order to make processing the data easier on the developer.
For example to get all of the subjects expressed in a document, one can use the following call:var subjects = document.data.getSubjects();
To get the list of properties for each subject retrieved above, a developer could process each subject in a loop, like so:
for(var i = 0; i < subjects.length; i++) { var subject = subjects[i]; var properties = document.data.getProperties(subject); // ... process the properties ... }
To retrieve only subjects containing a particular property, such as a name property, a developer could do the following:
var subjectsWithNames = document.data.getSubjects("http://xmlns.com/0.1/foaf/name");
Once the subjects containing a particular property are known, queries can be done on each subject to retrieve the values of properties:
var namedSubject = subjectsWithNames[0]; var names = document.data.getValues(namedSubject, "http://xmlns.com/0.1/foaf/name");
To retrieve all values for a particular property, such as all of the names listed in the document, the following code could be executed:
var allNames = document.data.getValues(null, "http://xmlns.com/0.1/foaf/name");
There are many more combinations of arguments passed to the basic getter methods for subjects, properties and values that allow high-level querying of data in the document. While this method of working with data may be useful to many developers, others may want to construct this data into a more object-oriented view of the data. In order to support this scenario, the RDFa API introduces Projection s in the next section.
You
can
retrieve
the
object
A
Projection
is
an
object-oriented
view
of
a
particular
subject
that
is
described
above
by
doing
expressed
in
the
document.
For
example,
to
get
all
projections
that
express
people
in
a
document,
a
developer
can
do
the
following:
var people =document.getItemsByType("http://xmlns.com/foaf/0.1/Person");document.data.getProjections("http://www.w3.org/1999/02/22-rdf-syntax-ns#type", "http://xmlns.com/foaf/0.1/Person");
document.data.context.setMapping("foaf", "http://xmlns.com/foaf/0.1/");document.data.setMapping("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#type"); document.data.setMapping("foaf", "http://xmlns.com/foaf/0.1/"); var people =document.getItemsByType("foaf:Person");document.data.getProjections("rdf:type", "foaf:Person");
You
can
also
get
a
PropertyGroup
Projection
by
its
subject:
var albert =document.getItemBySubject("http://example.org/people#albert");document.data.getProjection("http://example.org/people#albert");
You can also specify a relative IRI and the document IRI will be automatically pre-pended:
var albert =document.getItemBySubject("#albert");document.data.getProjection("#albert");
You
can
get
a
list
of
PropertyGroup
Projection
s
by
their
properties:
varpeopleNamedAlbertEinsteinpeopleNamedAlbert =document.getItemByProperty("foaf:name",document.data.getProjections("foaf:name", "Albert Einstein");
You
can
retrieve
property
values
from
PropertyGroup
Projection
s
like
so:
var albert = document.getItemBySubject("#albert");var albert = document.data.getProjection("#albert"); var name = albert.get("foaf:name");
You
can
also
specify
values
that
you
would
like
to
map
to
PropertyGroup
attributes:
a
Projection
:
var albert = document.getItemBySubject("#albert", {"foaf:name": "name"});var albert = document.data.getProjection("#albert", {"name": "foaf:name"}); var name = albert.name;
You can retrieve the DOM Element that is described above by doing the following:
var elements = document.getElementsByType("http://xmlns.com/foaf/0.1/Person");or you can specify a short-cut to use when specifying the IRI:
document.data.context.setMapping("foaf", "http://xmlns.com/foaf/0.1/");document.data.setMapping("foaf", "http://xmlns.com/foaf/0.1/"); var elements = document.getElementsByType("foaf:Person");
You can also get a list of Elements by the subject of the data:
var elements = document.getElementsBySubject("http://example.org/people#albert");
You can also specify a relative IRI and the document IRI will be automatically pre-pended:
var elements = document.getElementsBySubject("#albert");
You can get a list of Elements by the properties and values that they declare:
var elements = document.getElementsByProperty("foaf:name", "Albert Einstein");
You can modify elements that are returned just like any other DOM Node, for example:
var elements = document.getElementsByProperty("foaf:name", "Bob"); for(i = 0; i <= elements.length; i++) { var e = elements[i]; e.style.setProperty('color', '#00cc00', null); }
The code above would change the color of all the areas of the page where the item's name is "Bob" to green.
This
section
covers
a
number
of
concepts
that
go
beyond
basic
everyday
day-to-day
usage
of
the
RDFa
API.
The
interfaces
to
the
API
allow
you
to
work
with
data
at
an
abstract
level,
or
query
structured
data
and
override
key
parts
of
the
software
stack
in
order
to
extend
the
functionality
that
the
API
provides.
Perhaps
the
most
basic
task
is
to
select
PropertyGroup
Projection
s
of
a
particular
type.
The
type
of
a
PropertyGroup
Projection
is
set
in
RDFa
via
the
special
attribute
.
For
example,
the
following
markup
expresses
a
@typeof
typeof
PropertyGroup
Projection
of
type
Person
in
the
Friend-of-a-Friend
vocabulary:
<div typeof="foaf:Person"> <span property="foaf:name">Albert Einstein</span> </div>
To
locate
all
PropertyGroup
Projection
s
that
are
people,
we
could
use
the
method:
document.getItemsByType()
document.getProjections()
or we could do the same using thedocument.getItemsByType("http://xmlns.com/foaf/0.1/Person");document.data.getProjections("rdf:type", "foaf:Person");
var query = document.data.createQuery("rdfa", store); var people = query.select( { "rdf:type": "foaf:Person" } );var people = document.data.rdfa.query({"rdf:type": "foaf:Person"}, {"name": "foaf:name", "age": "foaf:age"});
While
the
query
interface
is
more
verbose
for
simple
queries,
it
becomes
necessary
for
more
complex
queries
as
demonstrated
later
in
this
section.
Note
that
the
Query
object
has
access
to
the
mappings
provided
via
the
document.data.context
document.data
object,
so
they
can
also
be
used
in
queries.
It
is
also
possible
to
write
the
same
query
in
a
way
that
is
independent
of
any
prefix-mappings:
var people = query.select(var people = document.data.rdfa.query( { "http://www.w3.org/1999/02/22-rdf-syntax-ns#type": "http://xmlns.com/foaf/0.1/Person" }, {"http://www.w3.org/1999/02/22-rdf-syntax-ns#type": "http://xmlns.com/foaf/0.1/Person" } );"name": "http://xmlns.com/foaf/0.1/name", "age": "http://xmlns.com/foaf/0.1/age" });
The
previous
query
selected
all
PropertyGroup
Projection
s
of
a
certain
type,
but
it
did
so
by
indicating
that
the
property
rdf:type
should
have
a
specific
value.
Queries
can
also
specify
other
properties.
For
example,
given
the
following
mark-up:
<div typeof="foaf:Person"> <span property="foaf:name">Albert Einstein</span> - <span property="foaf:myersBriggs">INTP</span> <a rel="foaf:workInfoHomepage" href="http://en.wikipedia.org/wiki/Albert_Einstein">More...</span> </div> <div typeof="foaf:Person"> <span property="foaf:name">Mother Teresa</span> - <span property="foaf:myersBriggs">ISFJ</span> <a rel="foaf:workInfoHomepage" href="http://en.wikipedia.org/wiki/Mother_Teresa">More...</span> </div> <div typeof="foaf:Person"> <span property="foaf:name">Marie Curie</span> - <span property="foaf:myersBriggs">INTP</span> <a rel="foaf:workInfoHomepage" href="http://en.wikipedia.org/wiki/Marie_Curie">More...</span> </div>
The
following
query
demonstrates
how
a
developer
would
select
and
use
all
PropertyGroup
Projection
s
of
type
Person
that
also
have
a
Myers
Brigg's
personality
type
of
"INTP"
(aka:
The
Architect):
var architects = query.select( {var architects = document.data.rdfa.query({ "http://www.w3.org/1999/02/22-rdf-syntax-ns#type": "http://xmlns.com/foaf/0.1/Person","http://xmlns.com/foaf/0.1/myersBriggs": "INTP" } );"http://xmlns.com/foaf/0.1/myersBriggs": "INTP" }, { "name": "http://xmlns.com/foaf/0.1/name" }); var name =architects[0].get("http://xmlns.com/foaf/0.1/name");architects[0].name;
As before, prefix-mappings can also be used:
var architects = query.select( {"rdf:type": "foaf:Person", "foaf:myersBriggs": "INTP"} );var architects = document.data.rdfa.query( { "rdf:type": "foaf:Person", "foaf:myersBriggs": "INTP" }, { "name": "foaf:name" }); var name =architects[0].get("foaf:name");architects[0].name;
var architects = query.select( {"rdf:type": "foaf:Person", "foaf:myersBriggs": "INTP"}, {"foaf:name": "name", "foaf:workInfoHomepage", "webpage"} );var architects = document.data.rdfa.query( { "rdf:type": "foaf:Person", "foaf:myersBriggs": "INTP" }, { "name": "foaf:name", "webpage": "foaf:workInfoHomepage" }); var name = architects[0].name; var infoWebpage = architects[0].webpage;
The
RDFa
API
allows
a
developer
Developers
may
find
that
they
need
to
not
only
query
the
DataStore
be
able
to
build
custom,
language-native
objects
to
use
with
their
code.
These
specialized
language-native
objects
are
called
at
via
the
DataQuery
mechanism,
it
also
allows
There
has
been
a
developer
to
get
to
the
underlying
data
structures
complaint
that
represent
the
structured
data
at
the
"atomic
level".
this
section
comes
from
out
of
nowhere.
The
filter
interface
is
a
part
purpose
of
the
DataStore
and
enables
a
developer
this
section
is
to
filter
a
series
of
triples
out
of
describe
that
Projections
can
be
mapped
to
native
language
objects
to
ease
development.
We
may
need
to
elaborate
more
on
this
at
this
point
in
the
DataStore
.
For
example,
document
to
extract
all
triples
about
a
particular
subject,
help
integrate
this
section
with
the
developer
could
do
flow
of
the
following:
document.
Developers
could
also
combine
subject-property
filters
by
doing
For
example,
assume
our
source
document
contains
the
following:
following
event,
marked
up
using
the
Data
Vocabulary
Event
format:
var names = document.data.store.filter( {"subject:", "http://example.org/people#benjamin", "property": "foaf:nick"} );<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="20091015T19:00">15. Oct., 7:00 pm</span>- <span property="v:endDate" content="20091015T21:00">9:00 pm</span> </span> Category: <span property="v:eventType">concert</span> </div>
The
To
query
above
would
extract
all
known
nicknames
for
the
subject
as
triples.
A
developer
may
also
retrieve
all
triples
in
the
DataStore
Event
Projection
by
specifying
no
filter
parameters:
s
we
know
that
we
can
do
this:
varallTriplesevents =document.data.store.filter();document.data.getProjections("rdf:type", "http://rdf.data-vocabulary.org/#Event");
However,
to
not
implement
build
a
special
Projection
that
contains
the
interface
summary,
start
date
and
wait
for
the
next
revision
of
this
specification.
end
date,
we
can
also
do
this:
var events = document.data.rdfa.query( { "rdf:type": "http://rdf.data-vocabulary.org/#Event" }, { "type": "rdf:type", "summary": "v:summary", "start": "v:startDate", "end": "v:endDate" } );
The
iterate
interface
can
be
used
second
parameter
is
a
Projection
Template.
Each
key-value
pair
specifies
a
Projection
property
to
process
triples
in
URI
mapping.
That
is,
the
document
as
they
are
discovered.
This
interface
key
is
most
useful
for
processing
large
amounts
the
name
of
data
the
property
to
create
in
low-memory
environments.
var iter = document.data.parser.iterate( {"subject": "http://example.org/people#mark"} );
for(var triple = iter.next(); triple != null; triple = iter.next())
{
}
3.2.4
Overriding
the
Defaults
Projection
object.
The
sub-modules
value
must
exist
in
a
triple,
specifically
as
a
property
of
the
RDFa
API
are
meant
to
be
overridden
by
developers
triple,
in
order
to
extend
basic
functionality
as
well
as
innovate
new
interfaces
for
the
RDFa
API.
Overriding
the
DataStore
The
API
is
designed
such
that
a
developer
may
override
copy
the
default
data
store
provided
by
the
browser
by
providing
their
own.
This
is
useful,
for
instance,
if
object
value
of
the
developer
wanted
triple
over
to
create
a
permanent
site-specific
data
store
using
Local
Storage
features
in
the
browser,
or
allowing
provenance
information
to
be
stored
with
each
triple.
var mydatastore = new MyCustomDataStore();
document.data.store
=
mydatastore;
Overriding
value
of
the
Data
Parser
Projection
object's
property.
Developers
may
create
and
specify
different
parsers
for
parsing
structured
data
from
the
document
that
builds
upon
RDFa,
or
parses
other
languages
not
related
to
RDFa.
For
example,
Microformats-specific
parsers
could
be
created
to
extract
structured
hCard
data
more
detailed
information
about
queries
and
store
it
in
an
object
that
is
compatible
with
Projection
s
see
the
interface.
DataStore
DocumentData
The
following
section
contains
all
of
the
interfaces
that
developers
RDFa
API
implementers
are
expected
to
implement
provide
as
well
as
implementation
guidance.
guidance
to
ensure
that
implementations
are
conformant.
As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this specification are non-normative. Everything else in this specification is normative.
The key words must , must not , required , should , should not , recommended , may , and optional in this specification are to be interpreted as described in [ RFC2119 ].
Conformance
requirements
phrased
as
algorithms
or
specific
steps
may
be
implemented
in
any
manner,
so
long
as
the
end
result
is
equivalent.
In
particular,
the
algorithms
defined
in
this
specification
are
intended
to
be
easy
to
follow,
follow
and
are
not
necessarily
intended
to
be
performant.
User
agents
Agents
may
impose
implementation-specific
limits
on
otherwise
unconstrained
inputs,
e.g.
to
prevent
denial
of
service
attacks,
to
guard
against
running
out
of
memory,
or
to
work
around
platform-specific
limitations.
Implementations
that
use
ECMAScript
or
Java
to
implement
the
APIs
defined
in
this
specification
must
implement
them
in
a
manner
consistent
with
the
respective
ECMAScript
or
Java
Bindings
defined
in
the
Web
IDL
specification,
as
this
specification
uses
that
specification's
terminology.
[
WEBIDL
]
],
as
this
specification
uses
that
specification's
terminology.
Implementations
that
use
any
other
language
to
implement
the
APIs
defined
in
this
specification
that
do
not
have
bindings
defined
in
the
Web
IDL
specification
should
attempt
to
map
the
API
as
closely
as
possible
to
the
implementation
language's
native
mechanisms
and
datatypes.
Developers
are
encouraged
to
work
with
other
developers
who
are
providing
the
RDFa
API
in
the
same
langauge
to
ensure
that
RDFa
Processors
API
implementations
are
modular
and
easily
exchangable.
replaceable.
RDFa
is
a
syntax
for
expressing
the
RDF
Data
Model
[
RDF-CONCEPTS
]
in
Web
documents.
The
RDFa
API
is
designed
to
extract
the
RDF
Data
Model
from
Web
documents.
The
following
RDF
Resources
are
utilized
in
this
specification:
PlainLiteral
s,
TypedLiteral
s,
IRI
References
(as
defined
in
[
IRI
])
and
BlankNode
s.
The
interfaces
for
each
of
these
RDF
Resources
are
detailed
in
this
section.
The
types
as
exposed
by
the
RDFa
API
conform
to
the
same
data
and
comparison
restrictions
as
specified
in
the
RDF
concepts
specification
[
RDF-CONCEPTS
]
and
the
[
IRI
]
specification.
Each
RDF
Projection
interface
provides
access
to
both
the
extracted
RDFa
value
and
the
DOM
Node
from
which
the
value
was
extracted.
This
allows
developers
to
extract
and
use
RDF
triples
from
a
host
language
and
also
manipulate
the
DOM
based
on
the
associated
DOM
Node.
For
example,
an
agent
could
highlight
all
strings
that
are
marked
up
as
foaf:name
properties
in
a
Web
document.
The
basic
RDF
Resource
types
used
in
the
RDFa
API
are:
IRI
Reference
—
A
reference
to
a
resource
as
defined
in
International
Resource
Identifier
[
IRI
].
Example:
http://www.w3.org/2001/XMLSchema#string
.
PlainLiteral
—
A
string
value
with
optional
information
about
the
language
of
its
content.
Example:
"Harry
Potter
and
the
Half-Blood
Prince"@en
is
a
plain
literal
expressed
in
the
English
language.
Typed
Literal
—
A
typed
string
value
with
information
about
the
datatype
of
its
content.
Example:
"7"^^xsd:integer
is
a
typed
literal
with
a
value
of
type
xsd:integer
.
Blank
Node
—
A
blank
node
is
a
reference
to
a
resource
that
does
not
have
a
corresponding
IRI.
Examples
of
BlankNode
s
include
_:me
,
and
_:42
.
RDF
Triple
—
Triples
are
the
basic
data
structure
utilized
by
RDF
used
to
express
logical
statements.
An
RDF
triple
is
a
3-item
ordered
set
consisting
of
a
subject
,
a
property
,
and
an
object
.
Example:
<http://example.org/hp>
rdfs:label
"Harry
Potter"
.
Diagram
of
RDF
Classes,
Attributes,
Methods
and
linkages.
An
RDFa
API
implementer
must
provide
the
basic
types
as
described
in
this
specification.
An
implementer
may
provide
additional
types
and/or
a
deeper
type
or
class
hierarchy
that
includes
these
basic
types.
4.2.1
RDFNode
and
RDFResource
An
RDFNode
is
an
anything
build
language-native
objects
that
can
be
an
object
of
an
RDFTriple
.
It
is
also
the
base
class
of
PlainLiteral
,
and
TypedLiteral
.
]
interface {
};
Attributes
value
of
type
stringifier
DOMString
,
readonly
The
value
of
an
RDFNode
is
either
a
literal's
lexical
value
or
a
lexical
identifier
of
an
IRI
or
BlankNode
.
Note
that
the
value
attribute
is
marked
with
accessed
in
a
stringifier
decorator.
In
[
WEBIDL
],
this
means
way
that
the
value
is
used
as
the
return
value
if
toString()
is
called
on
an
object
that
inherits
from
this
type.
The
stringifier
can
be
overridden
by
the
re-specification
of
natural
for
the
toString()
method
on
a
subclass
of
this
type.
No
exceptions.
An
RDFResource
is
an
anything
that
can
be
a
subject
of
an
RDFTriple
.
implementation
language.
] interface {[NoInterfaceObject] interface Projection { DOMString[] getProperties (); DOMString getSubject (); any getter get (in DOMString uriOrCurie); any[] getAll (in DOMString uriOrCurie); };
value
get
Parameter | Type | Nullable | Optional | Description |
---|---|---|---|---|
uriOrCurie |
|
✘ | ✘ |
The
|
any
getter
value
getAll
Parameter | Type | Nullable | Optional | Description |
---|---|---|---|---|
|
|
✘ | ✘ | The name of the property to retrieve. The argument can be either a full URI or a CURIE that will be resolved using the default document mapping. |
getter
RDFNode
any
[]
toString
getProperties
stringifier
DOMString
[]
size
getSubject
RDFTriple
DOMString
object.
The
creation
of
the
triple
uses
the
foaf:name
A
number
of
convenience
objects
and
methods
are
provided
by
the
The
RDFa
DOM
API
is
designed
to
help
developers
manipulate
RDF
Resources
more
easily
when
writing
Web
applications.
The
basic
RDF
interface
types
described
earlier
in
this
document
are
utilized
by
the
following
Structured
Data
Interfaces:
DataContext
—
A
mechanism
that
greatly
reduces
the
amount
provide
a
small,
powerful
set
of
code
document-based
interfaces
that
a
developer
must
write
may
use
to
express
IRIs
and
convert
data.
DataStore
retrieve
Projection
—
An
store
containing
s
from
a
set
of
RDFTriple
objects.
Web
document.
This
section
focuses
on
the
extensions
necessary
to
the
DOM
environment.
These
extensions
are
separated
into
four
interfaces:
Processing
RDF
data
involves
the
frequent
use
of
unwieldy
IRI
references
and
frequent
type
conversion.
The
DataContext
interface
is
provided
in
order
to
simplify
contextual
operations
such
as
shortening
IRIs
and
converting
RDF
data
into
native
language
datatypes.
It
is
assumed
that
this
interface
is
created
and
available
before
a
document
is
parsed
for
RDFa
data.
For
example,
while
operating
within
a
Browser
Context,
it
is
assumed
that
the
following
lines
section
describes
all
of
code
the
extensions
that
are
executed
before
a
developer
has
access
necessary
to
the
RDFa
API
methods
on
the
document
object:
document.data.context = new DataContext();
document.data.context.setMapping("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#");
document.data.context.setMapping("xsd",
"http://www.w3.org/2001/XMLSchema-datatypes#");
In
general,
when
a
CURIE
is
resolved
by
the
RDFa
API
or
enable
manipulation
of
structured
data
within
a
TypedLiteral
Web
Document.
Documentis converted to a native language type, the currentimplements
DataContextDataDocumentstored in the;DocumentData
DocumentData
DataDocument
The
following
DataDocument
interface
allows
IRI
mappings
provides
necessary
extensions
to
be
easily
created
the
core
DOM
Document
interface
to
enable
the
processing
and
used
by
Web
Developers
at
run-time.
It
also
allows
for
conversion
storage
of
RDF
data
into
native
language
datatypes.
structured
data.
{[Supplemental, NoInterfaceObject] interface DataDocument { readonly attributeDocumentData
data; NodeList getElementsByType (in DOMString type); NodeList getElementsBySubject (in DOMString subject); NodeList getElementsByProperty (in DOMString property, in optional DOMString? value); };
convertType
data
xsd:string
DocumentData
TypedLiteralConverter
DocumentData
interface
is
useful
for
extracting
and
storing
data
that
is
associated
with
the
registerTypeConversion
getElementsByProperty
Parameter | Type | Nullable | Optional | Description |
---|---|---|---|---|
|
DOMString
|
✘ | ✘ |
A
|
|
|
✔ | ✔ |
|
void
NodeList
resolveCurie
getElementsBySubject
Parameter | Type | Nullable | Optional | Description |
---|---|---|---|---|
|
DOMString
|
✘ | ✘ |
A
DOMString
representing
an
IRI-based
subject.
The
|
IRI
NodeList
setMapping
getElementsByType
Parameter | Type | Nullable | Optional | Description |
---|---|---|---|---|
|
DOMString
|
✘ | ✘ |
to
select
against.
|
void
NodeList
The
following
examples
demonstrate
how
mappings
are
created
and
used
via
If
the
RDFa
API.
document.data.context.setMapping("foaf", "http://xmlns.com/foaf/0.1/");
var people = document.getItemsByType("foaf:Person");
var
people2
=
document.getItemsByType("http://xmlns.com/foaf/0.1/Person");
In
the
example
above,
the
CURIE
"
foaf:Person
"
API
is
expanded
to
an
IRI
with
the
value
"
http://xmlns.com/foaf/0.1/Person
"
in
the
getItemsByType
method.
IRI
mappings
for
all
terms
implemented
in
the
following
vocabularies
must
be
included:
rdf
and
xsd
.
Automatic
Type
Conversion
TypedLiteralConverter
is
a
callable
interface
that
transforms
the
value
of
DOM
environment
and
a
interface
is
TypedLiteral
into
a
native
language
type
in
the
current
programming
language.
The
type
IRI
of
the
TypedLiteral
DOMImplementation
used
to
determine
provided,
the
best
mapping
to
following
additional
requirements
for
the
native
language
type.
Specifing
Typed
Literal
Converters
A
TypedLiteralConverter
hasFeature()
may
method
must
be
implemented
as
a
class,
or
as
a
language-native
callback
in
languages
like
ECMAScript.
met:
] interface {interface DOMImplementation { boolean hasFeature (in DOMString feature, in DOMString version); };
convert
hasFeature
true
for
a
feature
string
of
"
RDFaAPI
"
and
a
1.1
".
Parameter | Type | Nullable | Optional | Description |
---|---|---|---|---|
|
DOMString
|
✘ | ✘ |
The
|
|
DOMString
|
✘ | ✘ |
|
any
boolean
The
interface
is
DataStore
DocumentData
a
set
of
RDFTriple
objects.
It
provides
a
basic
getter
as
well
as
an
indexed
getter
for
retrieving
individual
items
from
the
store.
The
DataStore
can
be
used
to
create
primitive
types
as
well
as
store
collections
of
them
in
access
the
form
of
RDFTriple
s.
The
forEach
method
is
not
properly
defined
structured
data
in
WebIDL
-
need
to
get
input
from
the
WebApps
Working
Group
on
how
best
to
author
this
interface.
document.
] interface { ][NoInterfaceObject] interface DocumentData { attribute optional RDFEnvironment rdf; attributeRDFaEnvironment
rdfa;Projection
getProjection (in DOMString subject, in optional object template); SequencegetProjections (in optional object template); Sequence getProjections (in optional DOMString property, in optional DOMString? value, in optional object template); Sequence getProperties (in optional DOMString? subject); Sequence getSubjects (in optional DOMString? property, in optional DOMString? value); Sequence getValues (in optional DOMString? subject, in optional DOMString? property); DOMString setMapping (in in DOMString mapping, in in DOMString uri); };
size
rdf
of
type
DOMString
rdfa
BlankNode
RDFaEnvironment
createPlainLiteral
getProjection
TypedLiteral
null
Parameter | Type | Nullable | Optional | Description |
---|---|---|---|---|
|
DOMString
|
✘ | ✘ |
The
.
|
|
|
✘ | ✔ |
|
void
Projection
get
getProjections
Parameter | Type | Nullable | Optional | Description |
---|---|---|---|---|
|
|
✘ | ✔ |
The
|
boolean
Sequence
process
getProjections
Parameter | Type | Nullable | Optional | Description |
---|---|---|---|---|
|
|
✘ | ✔ |
The
,
the
|
|
|
✔ | ✔ |
,
the
|
|
|
✘ | ✔ |
|
DataIterator
Sequence
parse
getProperties
Parameter | Type | Nullable | Optional | Description |
---|---|---|---|---|
|
|
✔ | ✔ |
The
,
the
|
RDFTriple
Sequence
info
getSubjects
Parameter | Type | Nullable | Optional | Description |
---|---|---|---|---|
property |
DOMString
|
✔ | ✔ |
,
the
|
|
|
✔ | ✔ |
,
the
|
NodeList
Sequence
getElementsBySubject
getValues
Parameter | Type | Nullable | Optional | Description |
---|---|---|---|---|
subject |
DOMString
|
✔ | ✔ |
,
the
|
property |
DOMString
|
✔ | ✔ |
,
the
match
is
always
positive.
|
Sequence<PropertyGroup>
Document
implements
RDFaDocument
;
Sequence
All
instances
of
the
DOM
Document
interface
must
implement
RDFaDocument
hasFeature
setMapping
Parameter | Type | Nullable | Optional | Description |
---|---|---|---|---|
|
in
DOMString
|
✘ | ✘ |
The
|
|
in
DOMString
|
✘ | ✘ |
|
boolean
DOMString
The
DocumentData
RDFaEnvironment
interface
is
used
to
create
structured-data
related
context,
storage,
parsing
and
query
objects.
perform
RDFa-specific
actions.
{[NoInterfaceObject] interface RDFaEnvironment { Sequencequery (in optional object? query, in optional object template); };
createParser
query
Parameter | Type | Nullable | Optional | Description |
---|---|---|---|---|
|
|
✔ | ✔ |
|
|
|
✘ | ✔ |
|
boolean
Sequence
The RDFa API must be initialized before the Web developer has access to any of the methods that are defined in this specification. To initialize the API environment in a Browser-based environment, an implementor must do the following:
document.data.store
window.location.toString()
.
This section is non-normative.
The
current
version
of
the
RDFa
API
focuses
on
filtering
RDF
triples.
It
also
provides
methods
for
filtering
DOM
Nodes
that
contain
certain
types
of
RDF
triples.
The
RDFa
Working
Group
is
currently
discussing
whether
or
not
to
include
the
following
advanced
functionality:
At the time of publication, the members of the RDFa Working Group were: