Abbreviation | RDFa |
---|---|
Status | Published |
Year started | 2004 |
Editors | Ben Adida, Mark Birbeck |
Base standards | RDF |
Related standards | RDF Schema, OWL |
Domain | Semantic Web |
Website | www |
RDFa or Resource Description Framework in Attributes [1] is a W3C Recommendation that adds a set of attribute-level extensions to HTML, XHTML and various XML-based document types for embedding rich metadata within Web documents. The Resource Description Framework (RDF) data-model mapping enables its use for embedding RDF subject-predicate-object expressions within XHTML documents. It also enables the extraction of RDF model triples by compliant user agents.
The RDFa community runs a wiki website to host tools, examples, and tutorials. [2]
RDFa was first proposed by Mark Birbeck in the form of a W3C note entitled XHTML and RDF, [3] which was then presented to the Semantic Web Interest Group [4] at the W3C's 2004 Technical Plenary. [5] Later that year the work became part of the sixth public Working Draft of XHTML 2.0. [6] [7] 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 a 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. [8] 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. [9] 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. [10]
October 2007 saw the first public Working Draft of a document entitled RDFa in XHTML: Syntax and Processing. [11] 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. [12]
RDFa 1.1 reached recommendation status in June 2012. [13] 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. [14]
An additional RDFa 1.1 Primer document was last updated 17 March 2015. [1] (The first public Working Draft dates back to 10 March 2006. [15] )
There are some main well-defined variants of the basic concepts, that are used as reference and as abbreviation to the W3C standards.
RDFa was defined in 2008 with the "RDFa in XHTML: Syntax and Processing" Recommendation. [16] 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" [17] ).
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 standards (as long as RDFa 1.1 is used with XHTML5 and HTML5).
Is the first generic (for HTML and XML) RDFa standard; the "RDFa Core 1.1" is in the Third Edition, since 2015. [18]
RDFa Lite is a W3C Recommendation (1.0 and 1.1) since 2009, [19] where it is described as follows: [20]
RDFa Lite is minimal subset of RDFa ... consisting of a few attributes that may be used to express machine-readable 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. [20] RDFa 1.1 Lite is upwards compatible with RDFa 1.1. [20]
In 2009 the W3C was positioned [21] to retain RDFa Lite as unique and definitive standard alternative to Microdata. [22] The position was confirmed with the publication of the HTML5 Recommendation in 2014.
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:
There are five "principles of interoperable metadata" met by RDFa. [23]
Additionally RDFa may benefit web accessibility as more information is available to assistive technology. [24]
There is a growing number of tools for better usage of RDFa vocabularies and RDFa annotation.
Simplified approaches to semantically annotate information items in webpages were greatly encouraged by the HTML+RDFa (released in 2008) and microformats (since ~2005) standards.
As of 2013 [update] these standards were encoding events, contact information, products, and so on. Despite the vCard semantics (only basic items of person and organization annotations) dominance, [25] and some cloning 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 [26] of HTML+RDFa is now less than that of Microformats.
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.)
<divxmlns:dc="http://purl.org/dc/elements/1.1/"about="http://www.example.com/books/wikinomics"><spanproperty="dc:title">Wikinomics</span><spanproperty="dc:creator">DonTapscott</span><spanproperty="dc:date">2006-10-01</span></div>
Moreover, RDFa allows the passages and words within a text to be associated with semantic markup:
<divxmlns:dc="http://purl.org/dc/elements/1.1/"about="http://www.example.com/books/wikinomics">Inhislatestbook <spanproperty="dc:title">Wikinomics</span>, <spanproperty="dc:creator">DonTapscott</span>explainsdeepchangesintechnology, demographicsandbusiness. Thebookisduetobepublishedin <spanproperty="dc:date"content="2006-10-01">October2006</span>. </div>
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:
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"xmlns:foaf="http://xmlns.com/foaf/0.1/"xmlns:dc="http://purl.org/dc/elements/1.1/"version="XHTML+RDFa 1.0"xml:lang="en"><head><title>John'sHomePage</title><basehref="http://example.org/john-d/"/><metaproperty="dc:creator"content="Jonathan Doe"/><linkrel="foaf:primaryTopic"href="http://example.org/john-d/#me"/></head><bodyabout="http://example.org/john-d/#me"><h1>John'sHomePage</h1><p>Mynameis<spanproperty="foaf:nick">JohnD</span>andIlike <ahref="http://www.neubauten.org/"rel="foaf:interest"xml:lang="de">EinstürzendeNeubauten</a>. </p><p>My<spanrel="foaf:interest"resource="urn:ISBN:0752820907">favorite bookistheinspiring<spanabout="urn:ISBN:0752820907"><citeproperty="dc:title">WeavingtheWeb</cite>by <spanproperty="dc:creator">TimBerners-Lee</span></span></span>. </p></body></html>
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 a 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:
<?xml version="1.0" encoding="UTF-8"?><rdf:RDFxmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"xmlns:foaf="http://xmlns.com/foaf/0.1/"xmlns:dc="http://purl.org/dc/elements/1.1/"><rdf:Descriptionrdf:about="http://example.org/john-d/"><dc:creatorxml:lang="en">JonathanDoe</dc:creator><foaf:primaryTopic><rdf:Descriptionrdf:about="http://example.org/john-d/#me"><foaf:nickxml:lang="en">JohnD</foaf:nick><foaf:interestrdf:resource="http://www.neubauten.org/"/><foaf:interest><rdf:Descriptionrdf:about="urn:ISBN:0752820907"><dc:creatorxml:lang="en">TimBerners-Lee</dc:creator><dc:titlexml:lang="en">WeavingtheWeb</dc:title></rdf:Description></foaf:interest></rdf:Description></foaf:primaryTopic></rdf:Description></rdf:RDF>
The above example can be expressed without XML namespaces in HTML5:
<htmlprefix="dc: http://purl.org/dc/elements/1.1/"lang="en"><head><title>John's Home Page</title><linkrel="profile"href="http://www.w3.org/1999/xhtml/vocab"/><basehref="http://example.org/john-d/"/><metaproperty="dc:creator"content="Jonathan Doe"/><linkrel="foaf:primaryTopic"href="http://example.org/john-d/#me"/></head><bodyabout="http://example.org/john-d/#me"><h1>John's Home Page</h1><p>My name is <spanproperty="foaf:nick">John D</span> and I like <ahref="http://www.neubauten.org/"rel="foaf:interest"lang="de">Einstürzende Neubauten</a>. </p><p> My <spanrel="foaf:interest"resource="urn:ISBN:0752820907">favorite book is the inspiring <spanabout="urn:ISBN:0752820907"><citeproperty="dc:title">Weaving the Web</cite> by <spanproperty="dc:creator">Tim Berners-Lee</span></span></span>. </p></body></html>
Note how the prefix foaf is still used without declaration. RDFa 1.1 automatically includes prefixes for popular vocabularies such as FOAF. [30]
The minimal [31] document is:
<htmllang="en"><head><title>Example Document</title></head><bodyvocab="http://schema.org/"><ptypeof="Blog"> Welcome to my <aproperty="url"href="http://example.org/">blog</a>. </p></body></html>
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. [32]
<divvocab="http://schema.org/"typeof="Person"><aproperty="image"href="http://manu.sporny.org/images/manu.png"><spanproperty="name">Manu Sporny</span></a>, <spanproperty="jobTitle">Founder/CEO</span><div> Phone: <spanproperty="telephone">(540) 961-4469</span></div><div> E-mail: <aproperty="email"href="mailto:(your emailid)">msporny@digitalbazaar(.)com</a></div><div> Links: <aproperty="url"href="http://manu.sporny.org/">Manu's homepage</a></div></div>
The Semantic Web, sometimes known as Web 3.0, is an extension of the World Wide Web through standards set by the World Wide Web Consortium (W3C). The goal of the Semantic Web is to make Internet data machine-readable.
The Resource Description Framework (RDF) is a World Wide Web Consortium (W3C) standard originally designed as a data model for metadata. It has come to be used as a general method for description and exchange of graph data. RDF provides a variety of syntax notations and data serialization formats, with Turtle currently being the most widely used notation.
XML Linking Language, or XLink, is an XML markup language and W3C specification that provides methods for creating internal and external links within XML documents, and associating metadata with those links.
RDF Schema (Resource Description Framework Schema, variously abbreviated as RDFS, RDF(S), RDF-S, or RDF/S) is a set of classes with certain properties using the RDF extensible knowledge representation data model, providing basic elements for the description of ontologies. It uses various forms of RDF vocabularies, intended to structure RDF resources. RDF and RDFS can be saved in a triplestore, then one can extract some knowledge from them using a query language, like SPARQL.
SPARQL is an RDF query language—that is, a semantic query language for databases—able to retrieve and manipulate data stored in Resource Description Framework (RDF) format. It was made a standard by the RDF Data Access Working Group (DAWG) of the World Wide Web Consortium, and is recognized as one of the key technologies of the semantic web. On 15 January 2008, SPARQL 1.0 was acknowledged by W3C as an official recommendation, and SPARQL 1.1 in March, 2013.
FOAF is a machine-readable ontology describing persons, their activities and their relations to other people and objects. Anyone can use FOAF to describe themselves. FOAF allows groups of people to describe social networks without the need for a centralised database.
GRDDL is a markup format for Gleaning Resource Descriptions from Dialects of Languages. It is a W3C Recommendation, and enables users to obtain RDF triples out of XML documents, including XHTML. The GRDDL specification shows examples using XSLT, however it was intended to be abstract enough to allow for other implementations as well. It became a Recommendation on September 11, 2007.
In computer science and web development, XML Events is a W3C standard for handling events that occur in an XML document. These events are typically caused by users interacting with the web page using a device, such as a web browser on a personal computer or mobile phone.
In RDF, a blank node is a node in an RDF graph representing a resource for which a URI or literal is not given. The resource represented by a blank node is also called an anonymous resource. According to the RDF standard a blank node can only be used as subject or object of an RDF triple.
In computing, a CURIE defines a generic, abbreviated syntax for expressing Uniform Resource Identifiers (URIs). It is an abbreviated URI expressed in a compact syntax, and may be found in both XML and non-XML grammars. A CURIE may be considered a datatype.
Embedded RDF (eRDF) is a syntax for writing HTML in such a way that the information in the HTML document can be extracted into Resource Description Framework (RDF). This can be of great use for searching within data.
N-Triples is a format for storing and transmitting data. It is a line-based, plain text serialisation format for RDF graphs, and a subset of the Turtle format. N-Triples should not be confused with Notation3 which is a superset of Turtle. N-Triples was primarily developed by Dave Beckett at the University of Bristol and Art Barstow at the World Wide Web Consortium (W3C).
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.
EPUB is an e-book file format that uses the ".epub" file extension. The term is short for electronic publication and is sometimes stylized as ePub. EPUB is supported by many e-readers, and compatible software is available for most smartphones, tablets, and computers. EPUB is a technical standard published by the International Digital Publishing Forum (IDPF). It became an official standard of the IDPF in September 2007, superseding the older Open eBook (OEB) standard.
Microdata is a WHATWG HTML specification used to nest metadata within existing content on web pages. Search engines, web crawlers, and browsers can extract and process Microdata from a web page and use it to provide a richer browsing experience for users. Search engines benefit greatly from direct access to Microdata because it allows them to understand the information on web pages and provide more relevant results to users. Microdata uses a supporting vocabulary to describe an item and name-value pairs to assign values to its properties. Microdata is an attempt to provide a simpler way of annotating HTML elements with machine-readable tags than the similar approaches of using RDFa and microformats.
XHTML+RDFa is an extended version of the XHTML markup language for supporting RDF through a collection of attributes and processing rules in the form of well-formed XML documents. XHTML+RDFa is one of the techniques used to develop Semantic Web content by embedding rich semantic markup. Version 1.1 of the language is a superset of XHTML 1.1, integrating the attributes according to RDFa Core 1.1. In other words, it is an RDFa support through XHTML Modularization.
Schema.org is a reference website that publishes documentation and guidelines for using structured data mark-up on web-pages. Its main objective is to standardize HTML tags to be used by webmasters for creating rich results about a certain topic of interest. It is a part of the semantic web project, which aims to make document mark-up codes more readable and meaningful to both humans and machines.
JSON-LD is a method of encoding linked data using JSON. One goal for JSON-LD was to require as little effort as possible from developers to transform their existing JSON to JSON-LD. JSON-LD allows data to be serialized in a way that is similar to traditional JSON. It was initially developed by the JSON for Linking Data Community Group before being transferred to the RDF Working Group for review, improvement, and standardization, and is currently maintained by the JSON-LD Working Group. JSON-LD is a World Wide Web Consortium Recommendation.
A document type declaration, or DOCTYPE, is an instruction that associates a particular XML or SGML document with a document type definition (DTD). In the serialized form of the document, it manifests as a short string of markup that conforms to a particular syntax.
GoodRelations is a Web Ontology Language-compliant ontology for Semantic Web online data, dealing with business-related goods and services. It handles the individual relationships between a buyer, a seller and the products and services offered. In November 2012, it was integrated into the Schema.org ontology.