RDFa or Resource Description Framework in Attributes is a
W3C
The World Wide Web Consortium (W3C) is the main international standards organization for the World Wide Web. Founded in 1994 by Tim Berners-Lee, the consortium is made up of member organizations that maintain full-time staff working together in ...
Recommendation that adds a set of attribute-level extensions to
HTML
Hypertext Markup Language (HTML) is the standard markup language for documents designed to be displayed in a web browser. It defines the content and structure of web content. It is often assisted by technologies such as Cascading Style Sheets ( ...
,
XHTML
Extensible HyperText Markup Language (XHTML) is part of the family of XML markup languages which mirrors or extends versions of the widely used HyperText Markup Language (HTML), the language in which Web pages are formulated.
While HTML, pr ...
and various XML-based document types for embedding rich
metadata
Metadata (or metainformation) is "data that provides information about other data", but not the content of the data itself, such as the text of a message or the image itself. There are many distinct types of metadata, including:
* Descriptive ...
within web documents. The
Resource Description Framework
The Resource Description Framework (RDF) is a method to describe and exchange graph data. It was originally designed as a data model for metadata by the World Wide Web Consortium (W3C). It provides a variety of syntax notations and formats, of whi ...
(RDF) data-model mapping enables the use of RDFs for embedding RDF subject-predicate-object expressions within XHTML documents. RDFa also enables the extraction of RDF model triples by compliant
user agent
On the Web, a user agent is a software agent responsible for retrieving and facilitating end-user interaction with Web content. This includes all web browsers, such as Google Chrome and Safari
A safari (; originally ) is an overland jour ...
s.
The RDFa community runs a
wiki
A wiki ( ) is a form of hypertext publication on the internet which is collaboratively edited and managed by its audience directly through a web browser. A typical wiki contains multiple pages that can either be edited by the public or l ...
website to host tools, examples, and tutorials.
History
RDFa was first proposed by Mark Birbeck in the form of a
W3C
The World Wide Web Consortium (W3C) is the main international standards organization for the World Wide Web. Founded in 1994 by Tim Berners-Lee, the consortium is made up of member organizations that maintain full-time staff working together in ...
note entitled ''XHTML and RDF'', which was then presented to the Semantic Web Interest Group at the W3C's 2004 Technical Plenary. Later that year the work became part of the sixth public Working Draft of XHTML 2.0.
Although it is generally assumed that RDFa was originally intended only for XHTML 2, in fact the purpose of RDFa was always to provide a way to add metadata to ''any'' XML-based language. Indeed, one of the earliest documents bearing the ''RDF/A Syntax'' name has the sub-title ''A collection of attributes for layering RDF on XML languages''. The document was written by Mark Birbeck and Steven Pemberton, and was made available for discussion on October 11, 2004.
In April 2007 the XHTML 2 Working Group produced a module to support RDF annotation within the XHTML 1 family. As an example, it included an extended version of XHTML 1.1 dubbed XHTML+RDFa 1.0. Although described as not representing an intended direction in terms of a formal markup language from the W3C, limited use of the XHTML+RDFa 1.0 DTD did subsequently appear on the public Web.For examples of this, see:
October 2007 saw the first public Working Draft of a document entitled ''RDFa in XHTML: Syntax and Processing''. This superseded and expanded upon the April draft; it contained rules for creating an RDFa parser, as well as guidelines for organizations wishing to make practical use of the technology.
In October 2008 RDFa 1.0 reached recommendation status.
RDFa 1.1 reached recommendation status in June 2012. It differs from RDFa 1.0 in that it no longer relies on the XML-specific namespace mechanism. Therefore, it is possible to use RDFa 1.1 with non-XML document types such as HTML 4 or HTML 5. Details can be found in an appendix to HTML 5.
An additional ''RDFa 1.1 Primer'' document was last updated 17 March 2015. (The first public Working Draft dates back to 10 March 2006.)
Versions and variants
There are some main well-defined variants of the basic concepts, that are used as reference and as abbreviation to the W3C standards.
HTML+RDFa
RDFa was defined in 2008 with the "RDFa in XHTML: Syntax and Processing" Recommendation."RDFa in XHTML: Syntax and Processing - A collection of attributes and processing rules for extending XHTML to support RDF", W3C Recommendation 14 October 2008. http://www.w3.org/TR/2008/REC-rdfa-syntax-20081014/ Its first application was to be a module of XHTML.
The HTML applications remained, ''"a collection of attributes and processing rules for extending XHTML to support RDF"'' expanded to HTML5, are now expressed in a specialized standard, the "HTML+RDFa" (the last is ''"HTML+RDFa 1.1 - Support for RDFa in HTML4 and HTML5"''"HTML+RDFa 1.1 - Support for RDFa in HTML4 and HTML5", W3C Recommendation 22 August 2013. http://www.w3.org/TR/html-rdfa/).
RDFa 1.0
The ''"HTML+RDFa"'' syntax of 2008 was also termed ''"RDFa 1.0"'', so, there is no "RDFa Core 1.0" standard.
In general this 2008's ''RDFa 1.0'' is used with the old
XHTML
Extensible HyperText Markup Language (XHTML) is part of the family of XML markup languages which mirrors or extends versions of the widely used HyperText Markup Language (HTML), the language in which Web pages are formulated.
While HTML, pr ...
standards (as long as ''RDFa 1.1'' is used with XHTML5 and HTML5).
RDFa 1.1
Is the first generic (for HTML and XML) RDFa standard; the "RDFa Core 1.1" is in the Third Edition, since 2015."RDFa Core 1.1 - Third Edition - Syntax and processing rules for embedding RDF through attribute", W3C Recommendation 17 March 2015. https://www.w3.org/TR/2015/REC-rdfa-core-20150317/
RDFa Lite
RDFa Lite is a W3C Recommendation (1.0 and 1.1) since 2009,first draft 1.1 where it is described as follows:"RDFa Lite 1.1, W3C Recommendation 07 June 2012. http://www.w3.org/TR/rdfa-lite/ second edition at 2015
RDFa Lite is minimal subset of RDFa ... consisting of a few attributes that may be used to express
machine-readable data
In communications and computing, a machine-readable medium (or computer-readable medium) is a medium capable of storing data in a format easily readable by a digital computer or a sensor.
It contrasts with ''human-readable'' medium and data ...
in Web documents like HTML, SVG, and XML. While it is not a complete solution for advanced data markup tasks, it does work for most day-to-day needs and can be learned by most Web authors in a day.
RDFa Lite consists of five attributes: vocab, typeof, property, resource, and prefix. RDFa 1.1 Lite is upwards compatible with RDFa 1.1.
In 2009 the W3C was positioned to retain ''RDFa Lite'' as unique and definitive standard alternative to Microdata. The position was confirmed with the publication of the HTML5 Recommendation in 2014.
Essence
The essence of RDFa is to provide a set of attributes that can be used to carry metadata in an XML language (hence the 'a' in RDFa).
These attributes are:
; : a URI or CURIE specifying the resource the metadata is about
; and : specifying a relationship and reverse-relationship with another resource, respectively
; , and : specifying the partner resource
; : specifying a property for the content of an element or the partner resource
; : optional attribute that overrides the content of the element when using the property attribute
; : optional attribute that specifies the
datatype
In computer science and computer programming, a data type (or simply type) is a collection or grouping of data values, usually specified by a set of possible values, a set of allowed operations on these values, and/or a representation of these ...
of text specified for use with the property attribute
; : optional attribute that specifies the RDF type(s) of the subject or the partner resource (the resource that the metadata is about).
Benefits
There are five "principles of interoperable metadata" met by RDFa.
* Publisher Independence – each site can use its own standards
* Data Reuse – data are not duplicated. Separate XML and HTML sections are not required for the same content.
* Self Containment – the HTML and the RDF are separated
* Schema Modularity – the attributes are reusable
Additionally RDFa may benefit
web accessibility
Web accessibility, or eAccessibility,European CommissionCommunication from the Commission to the Council, the European Parliament and the European Economic and Social Committee and the Committee of the Regions: eAccessibility, EC(2005)1095 pu ...
as more information is available to
assistive technology
Assistive technology (AT) is a term for assistive, adaptive, and rehabilitative devices for Disability, people with disabilities and the elderly. Disabled people often have difficulty performing activities of daily living (ADLs) independently, ...
.
Usage
There is a growing number of tools for better usage of RDFa vocabularies and RDFa annotation.
HTML+RDFa statistics
Simplified approaches to semantically annotate information items in webpages were greatly encouraged by the HTML+RDFa (released in 2008) and
microformats
Microformats (μF) are predefined HTML markup (like HTML classes) created to serve as descriptive and consistent metadata about HTML element, elements, designating them as representing a certain type of data (such as address book, contact info ...
(since ~2005) standards.
these standards were encoding events, contact information, products, and so on. Despite the
vCard
vCard, also known as VCF ("Virtual Contact File"), is a file format standard for electronic business cards. vCards can be attached to e-mail messages, sent via Multimedia Messaging Service (MMS), on the World Wide Web, instant messaging, N ...
semantics (only basic items of
person
A person (: people or persons, depending on context) is a being who has certain capacities or attributes such as reason, morality, consciousness or self-consciousness, and being a part of a culturally established form of social relations suc ...
and
organization
An organization or organisation (English in the Commonwealth of Nations, Commonwealth English; American and British English spelling differences#-ise, -ize (-isation, -ization), see spelling differences) is an legal entity, entity—such as ...
annotations) dominance, and some
cloning
Cloning is the process of producing individual organisms with identical genomes, either by natural or artificial means. In nature, some organisms produce clones through asexual reproduction; this reproduction of an organism by itself without ...
of annotations along the same domain, the counting of webpages (URLs) and domains with annotations is an important statistical indicator for ''usage of semantically annotated information'' in the Web.
The statistics of 2017 show that usage of HTML+RDFa is now less than that of Microformats.
RDFa editors
;Web-based RDFa editors: There are already a few RDFa editors available online. RDFaCE (RDFa Content Editor) is a WYSIWYM editor based on TinyMCE to support RDFa content authoring. It supports manual and semi-automatic generation of RDFa with the support of annotation services such as DBpedia Spotlight, OpenCalais, Alchemy API, among others. RDFaCE-Lite is a version of RDFaCE also supporting Microdata and available as a WordPress plugin.
;Desktop RDFa editors: AutôMeta is an environment for semi-automatic (or automatic) annotation of documents for publishing on the Web using RDFa. It also includes an RDFa extraction tool to provide the user with a view of the annotated triples. It is available in both CLI and GUI interfaces.
Examples
The following is an example of adding Dublin Core metadata to an XML element in an XHTML file. Dublin Core data elements are data typically added to a book or article (title, author, subject etc.)
WikinomicsDon Tapscott2006-10-01
Moreover, RDFa allows the passages and words within a text to be associated with semantic markup:
In his latest book
Wikinomics,
Don Tapscott
explains deep changes in technology,
demographics and business.
The book is due to be published in
October 2006.
XHTML + RDFa 1.0
The following is an example of a complete XHTML+RDFa 1.0 document. It uses Dublin Core and FOAF, an ontology for describing people and their relationships with other people and things:
John's Home Page
My favorite
book is the inspiring Weaving the Web by
Tim Berners-Lee.
In the example above, the document URI can be seen as representing an HTML document, but the document URI plus the "#me" string http://example.org/john-d/#me represents the actual person, as distinct from a document about them. The ''foaf:primaryTopic'' in the header tells us the URI of the person the document is about. The ''foaf:nick'' property (in the first span element) contains a nickname for this person, and the ''dc:creator'' property (in the meta element) tells us who created the document. The hyperlink to the Einstürzende Neubauten website contains rel="foaf:interest", suggesting that John Doe is interested in this band. The URI of their website is a resource.
The ''foaf:interest'' inside the second p element is referring to a book by ISBN. The resource attribute defines a resource in a similar way to the href attribute, but without defining a hyperlink. Further into the paragraph, a span element containing an about attribute defines the book as another resource to specify metadata about. The book title and author are defined within the contents of this tag using the ''dc:title'' and ''dc:creator'' properties.
Here are the same triples when the above document is automatically converted to RDF/XML:
Jonathan DoeJohn DTim Berners-LeeWeaving the Web
HTML5 + RDFa 1.1
The above example can be expressed without XML namespaces in
HTML5
HTML5 (Hypertext Markup Language 5) is a markup language used for structuring and presenting hypertext documents on the World Wide Web. It was the fifth and final major HTML version that is now a retired World Wide Web Consortium (W3C) recommend ...
My favorite
book is the inspiring Weaving the Web by
Tim Berners-Lee.
Note how the prefix foaf is still used without declaration. RDFa 1.1 automatically includes prefixes for popular vocabularies such as FOAF.
The minimal document is:
Example Document
That is, it is recommended that all of these attributes are used: vocab, typeof, property; not only one of them.
RDFa Structured Data Example
Person Schema in RDFa.
* GRDDL, a way to extract (annotated) data out of XHTML and
XML
Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing data. It defines a set of rules for encoding electronic document, documents in a format that is both human-readable and Machine-r ...
documents and transform it into an RDF graph
* Microdata - another approach at embedding semantics in HTML using additional attributes
* Microformats, a simplified approach to semantically annotate data in web pages
* Open Graph protocol, a way to use RDFa to integrate web pages into the Facebook social graph
* Schema.org, search-engine supported schemas for structured data markup on web pages that can be expressed as RDFa