RDFa

from Wikipedia, the free encyclopedia

RDFa (for RDF in Attributes) is a W3C recommendation that allows RDF statements to be embedded in HTML , XHTML and a number of XML dialects. Together with microformats and microdata, it is one of the most common methods of upgrading (X) HTML pages with machine-readable additional information. RDFa is one of the technologies of the Semantic Web .

history

RDFa as a module of XHTML

As early as 2004, Mark Birbeck presented a concept in his publication XHTML and RDF , which forms the basis for RDFa. (The term RDFa does not appear in this document, however.) In 2007, these ideas found their way into the W3C draft XHTML RDFa Modules .

RDFa 1.0

In October 2008, RDFa 1.0 became the official W3C recommendation. From the history of its origins, it relied heavily on the proven expansion mechanisms of the XML world, in particular XML namespaces . As a result, RDFa 1.0 only worked in XHTML and could not be combined with classic HTML.

RDFa 1.1 and RDFa Lite

The current version, RDFa 1.1, was raised to the rank of W3C recommendation in June 2012. The main difference to RDFa 1.0 is the lack of XML-specific peculiarities. RDFa can now be used in XML dialects (such as Atom and SVG ) as well as in HTML, especially HTML 5 . RDFa Lite was created at the same time as RDFa 1.1. RDFa Lite is not a variant of its own, but a subset of RDFa that significantly reduces complexity, especially for beginners.

Basics

From RDF's point of view, RDFa is one of several ways to list RDF. In contrast to pure RDF notations such as RDF / XML or Turtle, RDFa embeds the RDF expressions in an existing document markup language (such as HTML). Information does not have to be maintained twice and kept up to date. The information written for people on a web page can be supplemented by means of RDFa in such a way that computer programs (e.g. search engines) also capture their semantic meaning.

From the point of view of HTML, RDFa is, in addition to microformats and microdata, another way of structuring the content of a website and making it understandable for machines. RDFa can draw on a large number of tried and tested standard vocabularies ( FOAF , SKOS , Dublin Core , SIOC, schema.org), but also enables new terms to be defined.

To achieve this, RDFa adds the following attributes to the so-called guest languages ​​in the simplest case (subset RDFa Lite ):

vocab
defines a standard namespace, i.e. the vocabulary used (replacement for the XML namespace mechanism)
prefix
defines several other namespaces with their prefixes if required (replacement for the XML namespace mechanism)
resource
can denote the subject or object of the RDF statement
property
determines the predicate of the statement
typeof
determines the type of subject

Almost all RDF expressions can be modeled with the attributes listed above. In addition, the complete RDFa 1.1 specification knows the following attributes for advanced applications:

about
is required in individual cases instead of resource to define the subject
content
specifies content that may differ from the readable content in the guest language (e.g. formatted time instead of five o'clock )
datatype
indicates a unique data type for a value
inlist
creates RDF list items
rel
determines the predicate
rev
determines the predicate (if the subject is in the order after the object)

Finally, the following two HTML attributes are evaluated by RDFa processors according to fixed rules and are part of the RDF statements generated:

src
Source of an image file becomes an object at RDFa
href
Hyperlink to another web address becomes an object at RDFa

Examples

The following example uses the schema.org vocabulary created by major search engines and the simplified RDFa-Lite syntax:

1 <div vocab="http://schema.org/" typeof="Product">
2   <p>Kaufen Sie den
3      <span property="name">Staubsauger XF704</span>
4      jetzt im Sonderangebot!
5      <img property="image" src="acmeXF704.jpg" />
6   </p>
7 </div>

The specification of vocab="http://schema.org/"in line 1 means that all RDF identifiers can be found in the following tree in the namespace schema.org. The attribute typeof="Product"immediately after it indicates that in the following a subject of the type product is spoken of and that all further information relates to it. Line 3 also property="name"indicates that the product name now follows. property="image"in line 5 reveals that the following image file is the product image.

The example can be expanded:

 1 <div vocab="http://schema.org/" typeof="Product">
 2   <p>Kaufen Sie den
 3      <span property="name">Staubsauger XF704</span>
 4      jetzt im Sonderangebot!
 5      <img property="image" src="acmeXF704.jpg" />
 6   </p>
 7   <p prefix="dc: http://purl.org/dc/elements/1.1/" resource="acmeXF704.jpg">
 8      (Produktabbildung: Foto
 9 <span property="dc:title">Sauberkeit</span>“ von
10      <span property="dc:creator">Max Mustermann</span>,
11      <span property="dc:rights">freigegeben zur weiteren Verwendung
12      ohne Einschränkung</span>)
13   </p>
14 </div>

In line 7 a new namespace, a new vocabulary is included. Also in line 7 it indicates resource="acmeXF704.jpg"that the further information relates to the image acmeXF704.jpg. property="dc:title", property="dc:creator"and property="dc:rights"finally in lines 9–11 with the expressions of the Dublin Core vocabulary you will find more information on the title, copyright and exploitation rights of this image.

Dissemination and practical applications

According to WebDataCommons.org, 12.7% of the HTML pages examined used some form of structured markup in February 2012:

format Contained in URLs
Microformats 49.77%
RDFa 35.96%
Microdata 14.26%
in 188 million URLs with microdata

In November 2013, the distribution shifted significantly in favor of the W3C formats (RDFa and Microdata), but there are also more sites that use multiple formats:

format Contained in URLs
RDFa 50.53%
Microdata 47.17%
Microformats 26.44%
in 585 million URLs with microdata

Significant examples of practical application are:

  • Schema.org is a joint initiative of search engines (Google, Yahoo !, Bing, Yandex) to create a basic vocabulary for the semantic enrichment of websites. Since November 11, 2011, schema.org officially supports RDFa.
  • Google supports RDFa with its rich snippets .
  • Facebook uses RDFa in the Open Graph Protocol .
  • Drupal is a content management system (CMS) that has had RDFa built in since version 7.
  • Wordpress , also a CMS, supports RDFa via plugins.

Tools

Alternatives

Microformats

Microformats dispense with new attributes and only use the familiar HTML attributes class , rel and rev . This means that there are no problems with the integration of microformats, even with HTML editors that check the validity of the code on the basis of a specific HTML version.

Different microformats are each limited to a single topic: There are special microformats for recipes, for résumés, for social networks and so on. This simplifies the application as long as it is precisely these topics. Extensions are not possible at any time, but must be approved by the community. A linking of the data in the sense of linked data is not possible with microformats.

Microdata

Microdata was created together with HTML 5. The specification is very similar to RDFa. The real differences are in the data model on which the two specifications are based. RDFa was created with the express goal of implementing the existing RDF concept in (X) HTML. Accordingly, the mapping between RDF and RDFa also works well. Microdata was created with different requirements. The exchange with RDF sources does not work clearly in every constellation.

Web links

Individual evidence

  1. a b Web Data Commons Extraction Report - February 2012 Corpus . Web Data Commons. March 22, 2012. Retrieved June 24, 2012.
  2. a b Web Data Commons Extraction Report - November 2013 Corpus . Web Data Commons. November 1, 2013. Retrieved April 28, 2014.
  3. XHTML and RDF W3C Note 14 February 2004 . World Wide Web Consortium . February 14, 2004. Retrieved June 23, 2012.
  4. XHTML RDFa Modules, Modules to support RDF annotation of elements, W3C Editor's Draft April 2, 2007 . World Wide Web Consortium . April 2, 2007. Retrieved June 23, 2012.
  5. RDFa in XHTML: Syntax and Processing, A collection of attributes and processing rules for extending XHTML to support RDF, W3C Recommendation 14 October 2008 . World Wide Web Consortium . October 14, 2008. Retrieved June 23, 2012.
  6. RDFa Core 1.1, Syntax and processing rules for embedding RDF through attributes, W3C Recommendation 07 June 2012 . World Wide Web Consortium . June 7, 2012. Retrieved June 23, 2012.
  7. ^ Dan Brickley: Using RDFa 1.1 Lite with Schema.org . November 11, 2011. Retrieved June 23, 2012.
  8. What is Schema.org? schema.org.
  9. ^ Tantek Çelik: The microformats process . April 25, 2012. Retrieved June 24, 2012.
  10. Microdata to RDF: Background . World Wide Web Consortium . January 12, 2012. Retrieved June 23, 2012.