Sample Page

GRDDL (pronounced “griddle“) 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.[1] 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.[2]

Mechanism

XHTML and transformations

A document specifies associated transformations, using one of a number of ways.

For instance, an XHTML document may contain the following markup:

<head profile="http://www.w3.org/2003/g/data-view
		http://dublincore.org/documents/dcq-html/
		http://gmpg.org/xfn/11">

<link rel="transformation" href="grokXFN.xsl" />

Document consumers are informed that there are GRDDL transformations available in this page, by including the following URI in the profile attribute of the head element:[3]

http://www.w3.org/2003/g/data-view

The available transformations are revealed through one or more link elements:

<link rel="transformation" href="grokXFN.xsl" />

This code is valid for XHTML 1.x only. The profile attribute has been dropped in HTML5, including its XML serialisation.

Microformats and profile transformations

If an XHTML page contains Microformats, there is usually a specific profile.

For instance, a document with hcard information should have:

<head profile="http://www.w3.org/2003/g/data-view http://www.w3.org/2006/03/hcard">

When fetched http://www.w3.org/2006/03/hcard has:

<head profile="http://www.w3.org/2003/g/data-view">

and

<p>Use of this profile licenses RDF data extracted by
   <a rel="profileTransformation" href="../vcard/hcard2rdf.xsl">hcard2rdf.xsl</a>
    from <a href="http://www.w3.org/2006/vcard/ns">the 2006 vCard/RDF work</a>.
</p>

The GRDDL aware agent can then use that profileTransformation to extract all hcard data from pages that reference that link.

XML and transformations

In a similar fashion to XHTML, GRDDL transformations can be attached to XML documents.

Explicitly linking to transformations

GRDDL specifies a grddl:transform attribute that can be appended to the root element, which can be used to link to one or more transformations.[4]

<foo xmlns:grddl="http://www.w3.org/2003/g/data-view#"
     grddl:transformation="glean_authors.xsl">
   <!-- document content here -->
</foo>

This allows the GRDDL transformation employed to be specified on a per-resource basis.

XML namespace transformations

Just like a profileTransformation, an XML namespace can have a transformation associated with it.

This allows entire XML dialects (for instance, KML or Atom) to provide meaningful RDF.

An XML document simply points to a namespace

<foo xmlns="http://example.com/1.0/">
   <!-- document content here -->
</foo>

and when fetched, http://example.com/1.0/ points to a namespaceTransformation.

This also allows very large amounts of the existing XML data in the wild to become RDF/XML with minimal effort from the namespace author.

Output

Once a document has been transformed, there is an RDF representation of that data.

This output is generally put into a database and queried via SPARQL.

Implementations

GRDDL consumers (also known as GRDDL aware agents)

See also

  • Microformats – a simplified approach to semantically annotate data in websites
  • RDFa – a W3C Recommendation for annotating websites with RDF data

References

  1. ^ Kerner, Sean Michael (October 26, 2006). “W3C Looks to GRDDL For Semantic Web Sense”. internetnews.com. Archived from the original on March 10, 2007.
  2. ^ “W3C Completes Bridge Between HTML/Microformats and Semantic Web” (Press release). W3C. 11 September 2007.
  3. ^ Adida, B.; Birbeck, M.; Herman, I. (2011). “Semantic Annotation and Retrieval: Web of Hypertext – RDFa and Microformats”. In Domingue, J.; Fensel, D.; Hendler, J. A. (eds.). Handbook of Semantic Web Technologies. Berlin: Springer. pp. 157–190. doi:10.1007/978-3-540-92913-0_5. ISBN 978-3-540-92913-0.
  4. ^ Akhtar, W.; Kopecký, J.; Krennwallner, T.; Polleres, A. (2008). “XSPARQL: Traveling between the XML and RDF Worlds – and Avoiding the XSLT Pilgrimage”. In Bechhofer, S.; Hauswirth, M.; Hoffmann, J.; Koubarakis, M. (eds.). The Semantic Web: Research and Applications. ESWC 2008. Lecture Notes in Computer Science. Vol. 5021. Springer. doi:10.1007/978-3-540-68234-9_33. ISBN 978-3-540-68234-9.