CINXE.COM
RDFa Core 1.1 - Second Edition
<!DOCTYPE html> <html lang="en" dir="ltr" typeof="bibo:Document w3p:REC" about="" property="dcterms:language" content="en"> <head> <title>RDFa Core 1.1 - Second Edition</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <!-- === NOTA BENE === For the three scripts below, if your spec resides on dev.w3 you can check them out in the same tree and use relative links so that they'll work offline, --> <style type="text/css"> code { font-family: monospace; } span.hilite { color: red; /* font-weight: bold */ } li p { margin-top: 0.3em; margin-bottom: 0.3em; } div.explanation { background-color: #ADD8E6; width: 80%; margin: 12px; padding: 8px; } div.explanation li { margin-top: 8px; } div.explanation dd { margin: 4px; } .adef { font-family: monospace; font-weight: bold; color: #ff4500 !important; } .aref { font-family: monospace; font-weight: bold; color: #ff4500 !important; } span.entity { color: red; } span.element { color: green; } </style> <!-- <script src="https://www.w3.org/Tools/respec/respec-w3c-common" class="remove"></script> --> <style type="text/css"></style><style>/***************************************************************** * ReSpec 3 CSS * Robin Berjon - http://berjon.com/ *****************************************************************/ /* --- INLINES --- */ em.rfc2119 { text-transform: lowercase; font-variant: small-caps; font-style: normal; color: #900; } h1 acronym, h2 acronym, h3 acronym, h4 acronym, h5 acronym, h6 acronym, a acronym, h1 abbr, h2 abbr, h3 abbr, h4 abbr, h5 abbr, h6 abbr, a abbr { border: none; } dfn { font-weight: bold; } a.internalDFN { color: inherit; border-bottom: 1px solid #99c; text-decoration: none; } a.externalDFN { color: inherit; border-bottom: 1px dotted #ccc; text-decoration: none; } a.bibref { text-decoration: none; } cite .bibref { font-style: normal; } code { color: #ff4500; } /* --- TOC --- */ .toc a, .tof a { text-decoration: none; } a .secno, a .figno { color: #000; } ul.tof, ol.tof { list-style: none outside none; } .caption { margin-top: 0.5em; font-style: italic; } /* --- TABLE --- */ table.simple { border-spacing: 0; border-collapse: collapse; border-bottom: 3px solid #005a9c; } .simple th { background: #005a9c; color: #fff; padding: 3px 5px; text-align: left; } .simple th[scope="row"] { background: inherit; color: inherit; border-top: 1px solid #ddd; } .simple td { padding: 3px 10px; border-top: 1px solid #ddd; } .simple tr:nth-child(even) { background: #f0f6ff; } /* --- DL --- */ .section dd > p:first-child { margin-top: 0; } .section dd > p:last-child { margin-bottom: 0; } .section dd { margin-bottom: 1em; } .section dl.attrs dd, .section dl.eldef dd { margin-bottom: 0; } </style><style>/* --- EXAMPLES --- */ div.example-title { min-width: 7.5em; color: #b9ab2d; } div.example-title span { text-transform: uppercase; } aside.example, div.example, div.illegal-example { padding: 0.5em; margin: 1em 0; position: relative; clear: both; } div.illegal-example { color: red } div.illegal-example p { color: black } aside.example, div.example { padding: .5em; border-left-width: .5em; border-left-style: solid; border-color: #e0cb52; background: #fcfaee; } aside.example div.example { border-left-width: .1em; border-color: #999; background: #fff; } aside.example div.example div.example-title { color: #999; } </style><style>/* --- ISSUES/NOTES --- */ div.issue-title, div.note-title { padding-right: 1em; min-width: 7.5em; color: #b9ab2d; } div.issue-title { color: #e05252; } div.note-title { color: #2b2; } div.issue-title span, div.note-title span { text-transform: uppercase; } div.note, div.issue { margin-top: 1em; margin-bottom: 1em; } .note > p:first-child, .issue > p:first-child { margin-top: 0 } .issue, .note { padding: .5em; border-left-width: .5em; border-left-style: solid; } div.issue, div.note { padding: 1em 1.2em 0.5em; margin: 1em 0; position: relative; clear: both; } span.note, span.issue { padding: .1em .5em .15em; } .issue { border-color: #e05252; background: #fbe9e9; } .note { border-color: #52e052; background: #e9fbe9; } </style><link rel="stylesheet" href="https://www.w3.org/StyleSheets/TR/W3C-REC"><!--[if lt IE 9]><script src='https://www.w3.org/2008/site/js/html5shiv.js'></script><![endif]--></head> <body class="h-entry" role="document" id="respecDocument"><div class="head" role="contentinfo" id="respecHeader"> <p> <a href="https://www.w3.org/"><img width="72" height="48" src="https://www.w3.org/Icons/w3c_home" alt="W3C"></a> </p> <h1 class="title p-name" id="title" property="dcterms:title">RDFa Core 1.1 - Second Edition</h1> <h2 property="bibo:subtitle" id="subtitle">Syntax and processing rules for embedding RDF through attributes</h2> <h2 property="dcterms:issued" datatype="xsd:dateTime" content="2013-08-22T05:00:00.000Z" id="w3c-recommendation-22-august-2013"><abbr title="World Wide Web Consortium">W3C</abbr> Recommendation <time class="dt-published" datetime="2013-08-22">22 August 2013</time></h2> <dl> <dt>This version:</dt> <dd><a class="u-url" href="https://www.w3.org/TR/2013/REC-rdfa-core-20130822/">http://www.w3.org/TR/2013/REC-rdfa-core-20130822/</a></dd> <dt>Latest version:</dt> <dd><a href="https://www.w3.org/TR/rdfa-core/">http://www.w3.org/TR/rdfa-core/</a></dd> <dt>Previous version:</dt> <dd><a rel="dcterms:replaces" href="https://www.w3.org/TR/2013/PER-rdfa-core-20130625/">http://www.w3.org/TR/2013/PER-rdfa-core-20130625/</a></dd> <dt>Previous recommendation:</dt> <dd><a href="https://www.w3.org/TR/2012/REC-rdfa-core-20120607/">http://www.w3.org/TR/2012/REC-rdfa-core-20120607/</a></dd> <dt>Editors:</dt> <dd class="p-author h-card vcard" rel="bibo:editor" inlist=""><span typeof="foaf:Person"><span property="foaf:name" class="p-name fn">Ben Adida</span>, Creative Commons, <span class="ed_mailto"><a class="u-email email" rel="foaf:mbox" href="mailto:ben@adida.net">ben@adida.net</a></span></span> </dd> <dd class="p-author h-card vcard" rel="bibo:editor" inlist=""><span typeof="foaf:Person"><span property="foaf:name" class="p-name fn">Mark Birbeck</span>, webBackplane, <span class="ed_mailto"><a class="u-email email" rel="foaf:mbox" href="mailto:mark.birbeck@webBackplane.com">mark.birbeck@webBackplane.com</a></span></span> </dd> <dd class="p-author h-card vcard" rel="bibo:editor" inlist=""><span typeof="foaf:Person"><a class="u-url url p-name fn" rel="foaf:homepage" property="foaf:name" content="Shane McCarron" href="http://blog.halindrome.com">Shane McCarron</a>, Applied Testing and Technology, Inc., <span class="ed_mailto"><a class="u-email email" rel="foaf:mbox" href="mailto:shane@aptest.com">shane@aptest.com</a></span></span> </dd> <dd class="p-author h-card vcard" rel="bibo:editor" inlist=""><span typeof="foaf:Person"><a class="u-url url p-name fn" rel="foaf:homepage" property="foaf:name" content="Ivan Herman" href="https://www.w3.org/People/Ivan/">Ivan Herman</a>, <abbr title="World Wide Web Consortium">W3C</abbr>, <span class="ed_mailto"><a class="u-email email" rel="foaf:mbox" href="mailto:ivan@w3.org">ivan@w3.org</a></span></span> </dd> </dl> <p> Please refer to the <a href="https://www.w3.org/2010/02/rdfa/errata.html"><strong>errata</strong></a> for this document, which may include some normative corrections. </p> <p> This document is also available in these non-normative formats: <a rel="alternate" href="rdfa-core-diff.html">Diff from Previous Recommendation</a>, <a rel="alternate" href="rdfa-core.ps">PostScript version</a>, and <a rel="alternate" href="rdfa-core.pdf">PDF version</a> </p> <p> The English version of this specification is the only normative version. Non-normative <a href="https://www.w3.org/Consortium/Translation/">translations</a> may also be available. </p> <p class="copyright"> <a href="https://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 2007-2013 <a href="https://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href="http://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href="http://www.keio.ac.jp/">Keio</a>, <a href="http://ev.buaa.edu.cn/">Beihang</a>), All Rights Reserved. <abbr title="World Wide Web Consortium">W3C</abbr> <a href="https://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="https://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="https://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply. </p> <hr> </div> <section id="abstract" class="introductory" property="dcterms:abstract" datatype="" typeof="bibo:Chapter" resource="#abstract" rel="bibo:chapter"><h2 aria-level="1" role="heading" id="h2_abstract">Abstract</h2> <p>The current Web is primarily made up of an enormous number of documents that have been created using HTML. These documents contain significant amounts of structured data, which is largely unavailable to tools and applications. When publishers can express this data more completely, and when tools can read it, a new world of user functionality becomes available, letting users transfer structured data between applications and web sites, and allowing browsing applications to improve the user experience: an event on a web page can be directly imported into a user's desktop calendar; a license on a document can be detected so that users can be informed of their rights automatically; a photo's creator, camera setting information, resolution, location and topic can be published as easily as the original photo itself, enabling structured search and sharing.</p> <p>RDFa Core is a specification for attributes to express structured data in any markup language. The embedded data already available in the markup language (e.g., HTML) can often be reused by the RDFa markup, so that publishers don't need to repeat significant data in the document content. The underlying abstract representation is RDF [<cite><a class="bibref" href="#bib-RDF-PRIMER">RDF-PRIMER</a></cite>], which lets publishers build their own vocabulary, extend others, and evolve their vocabulary with maximal interoperability over time. The expressed structure is closely tied to the data, so that rendered data can be copied and pasted along with its relevant structure.</p> <p>The rules for interpreting the data are generic, so that there is no need for different rules for different formats; this allows authors and publishers of data to define their own formats without having to update software, register formats via a central authority, or worry that two formats may interfere with each other.</p> <p>RDFa shares some of the same goals with microformats [<cite><a class="bibref" href="#bib-MICROFORMATS">MICROFORMATS</a></cite>]. Whereas microformats specify both a syntax for embedding structured data into HTML documents and a vocabulary of specific terms for each microformat, RDFa specifies only a syntax and relies on independent specification of terms (often called vocabularies or taxonomies) by others. RDFa allows terms from multiple independently-developed vocabularies to be freely intermixed and is designed such that the language can be parsed without knowledge of the specific vocabulary being used. </p> <p>This document is a detailed syntax specification for RDFa, aimed at:</p> <ul> <li>those looking to create an RDFa Processor, and who therefore need a detailed description of the parsing rules;</li> <li>those looking to integrate RDFa into a new markup language;</li> <li>those looking to recommend the use of RDFa within their organization, and who would like to create some guidelines for their users;</li> <li>anyone familiar with RDF, and who wants to understand more about what is happening 'under the hood', when an RDFa Processor runs.</li> </ul> <p> For those looking for an introduction to the use of RDFa and some real-world examples, please consult the [<cite><a class="bibref" href="#bib-RDFA-PRIMER">RDFA-PRIMER</a></cite>].</p> <section> <h3 id="how-to-read-this-document" aria-level="2" role="heading">How to Read this Document</h3> <p>First, if you are not familiar with either RDFa <em>or</em> RDF, and simply want to add RDFa to your documents, then you may find the RDFa Primer [<cite><a class="bibref" href="#bib-RDFA-PRIMER">RDFA-PRIMER</a></cite>] to be a better introduction.</p> <p>If you are already familiar with RDFa, and you want to examine the processing rules — perhaps to create an RDFa Processor — then you'll find the <a href="#s_model">Processing Model</a> section of most interest. It contains an overview of each of the processing steps, followed by more detailed sections, one for each rule.</p> <p>If you are not familiar with RDFa, but you <em>are</em> familiar with RDF, then you might find reading the <a href="#s_Syntax_overview">Syntax Overview</a> useful, before looking at the <a href="#s_model">Processing Model</a> since it gives a range of examples of markup that use RDFa. Seeing some examples first should make reading the processing rules easier.</p> <p>If you are not familiar with RDF, then you might want to take a look at the section on <a href="#s_rdfterminology">RDF Terminology</a> before trying to do too much with RDFa. Although RDFa is designed to be easy to author — and authors don't need to understand RDF to use it — anyone writing applications that <em>consume</em> RDFa will need to understand RDF. There is a lot of material about RDF on the web, and a growing range of tools that support RDFa. This document only contains enough background on RDF to make the goals of RDFa more clear.</p> <div class="note"><div class="note-title" aria-level="3" role="heading" id="h_note_1"><span>Note</span></div><p class="">RDFa is a way of expressing <em>RDF</em>-style relationships using simple attributes in existing markup languages such as HTML. RDF is fully internationalized, and permits the use of Internationalized Resource Identifiers, or IRIs. You will see the term 'IRI' used throughout this specification. Even if you are not familiar with the term IRI, you probably have seen the term 'URI' or 'URL'. IRIs are an extension of URIs that permits the use of characters outside those of plain ASCII. RDF allows the use of these characters, and so does RDFa. This specification has been careful to use the correct term, IRI, to make it clear that this is the case.</p></div> <div class="note"><div class="note-title" aria-level="3" role="heading" id="h_note_2"><span>Note</span></div><p class="">Even though this specification exclusively references IRIs, it is possible that a Host Language will restrict the syntax for its attributes to a subset of IRIs (e.g., <a class="aref" href="#A-href" title="href">@href</a> in HTML5). Regardless of validation constraints in Host Languages, an RDFa Processor is capable of processing IRIs.</p></div> </section> </section><section id="sotd" class="introductory" typeof="bibo:Chapter" resource="#sotd" rel="bibo:chapter"><h2 aria-level="1" role="heading" id="h2_sotd">Status of This Document</h2> <p> <em>This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current <abbr title="World Wide Web Consortium">W3C</abbr> publications and the latest revision of this technical report can be found in the <a href="https://www.w3.org/TR/"><abbr title="World Wide Web Consortium">W3C</abbr> technical reports index</a> at http://www.w3.org/TR/.</em> </p> <p>This document has been reviewed by <abbr title="World Wide Web Consortium">W3C</abbr> Members, by software developers, and by other <abbr title="World Wide Web Consortium">W3C</abbr> groups and interested parties, and is endorsed by the Director as a <abbr title="World Wide Web Consortium">W3C</abbr> Recommendation. It is a stable document and may be used as reference material or cited from another document. <abbr title="World Wide Web Consortium">W3C</abbr>'s role in making the Recommendation is to draw attention to the specification and to promote its widespread deployment. This enhances the functionality and interoperability of the Web.</p> <p>This version reflects changes made as a result of comments received since the Recommendation was first published. These changes are mostly editorial. In particular, there are minor editorial changes to the Processing Sequence <a href="#s_sequence">section 7.5</a>.</p> <p>This is a revision of RDFa Syntax 1.0 [<cite><a class="bibref" href="#bib-RDFA-SYNTAX">RDFA-SYNTAX</a></cite>]. This document supersedes the <a href="https://www.w3.org/TR/2008/REC-rdfa-syntax-20081014">previous Recommendation</a>. There are a number of substantive differences between this version and its predecessor, including:</p> <ol> <li>The removal of the specific rules for XHTML - these are now defined in XHTML+RDFa [<cite><a class="bibref" href="#bib-XHTML-RDFA">XHTML-RDFA</a></cite>].</li> <li>An expansion of the datatypes of some RDFa attributes so that they can contain Terms, CURIES, or Absolute IRIs.</li> <li>Host languages are permitted to define collections of default terms, default prefix mappings, and a default vocabulary.</li> <li>The ability to define a default vocabulary to use for Terms that are undefined.</li> <li>Terms are required to be compared in a case-insensitive manner.</li> <li>A richer behavior of the @property attribute, that can replace, in many cases the @rel attribute.</li> <li>A slightly different handling of @typeof, making it better adapted to practical usage.</li> </ol> <p>There is a more thorough list of changes in <a href="#a_history">Changes</a>.</p> <p>A <a href="http://rdfa.info/test-suite/">sample test harness</a> is available. This set of tests is not intended to be exhaustive. Users may find the tests to be useful examples of RDFa usage. <!-- An <a href="http://www.w3.org/2006/07/SWD/RDFa/implementation-report/">implementation report</a> lists several implementationsof this specification tested during the Candidate Recommendationperiod. A community-maintained <a href="http://rdfa.info/rdfa-implementations/">Wiki page</a> includes subsequent updates.--> </p> <p>The <a href="https://www.w3.org/2010/02/rdfa/wiki/CR-ImplementationReport">implementation report</a> used by the director to transition to Recommendation has been made available. There have been no formal objections to the publication of this document.</p> <!-- <p>The <a href="http://www.w3.org/2010/02/rdfa/wiki/CR-ImplementationReport">implementation report</a> used by the director to transition to Proposed Recommendation has been made available. There have been no formal objections to the publication of this document. The end of the Proposed Recommendation period is 07 June 2012. No changes are expected during the PR period except for minor editorial fixes to the grammar and prose of the document. </p>--> <p> This document was published by the <a href="https://www.w3.org/2010/02/rdfa">RDF Web Applications Working Group</a> as a Recommendation. If you wish to make comments regarding this document, please send them to <a href="mailto:public-rdfa@w3.org">public-rdfa@w3.org</a> (<a href="mailto:public-rdfa-request@w3.org?subject=subscribe">subscribe</a>, <a href="http://lists.w3.org/Archives/Public/public-rdfa/">archives</a>). All comments are welcome.</p> <p> This document was produced by a group operating under the <a id="sotd_patent" about="" rel="w3p:patentRules" href="https://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 <abbr title="World Wide Web Consortium">W3C</abbr> Patent Policy</a>. <abbr title="World Wide Web Consortium">W3C</abbr> maintains a <a href="https://www.w3.org/2004/01/pp-impl/44350/status" rel="disclosure">public list of any patent disclosures</a> 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 <a href="https://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</a> must disclose the information in accordance with <a href="https://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of the <abbr title="World Wide Web Consortium">W3C</abbr> Patent Policy</a>. </p> </section><section id="toc"><h2 class="introductory" aria-level="1" role="heading" id="h2_toc">Table of Contents</h2><ul class="toc" role="directory" id="respecContents"><li class="tocline"><a href="#s_motivation" class="tocxref"><span class="secno">1. </span>Motivation</a></li><li class="tocline"><a href="#s_Syntax_overview" class="tocxref"><span class="secno">2. </span>Syntax Overview</a><ul class="toc"><li class="tocline"><a href="#rdfa-attributes" class="tocxref"><span class="secno">2.1 </span>The RDFa Attributes</a></li><li class="tocline"><a href="#examples" class="tocxref"><span class="secno">2.2 </span>Examples</a></li></ul></li><li class="tocline"><a href="#s_rdfterminology" class="tocxref"><span class="secno">3. </span>RDF Terminology</a><ul class="toc"><li class="tocline"><a href="#statements" class="tocxref"><span class="secno">3.1 </span>Statements</a></li><li class="tocline"><a href="#triples" class="tocxref"><span class="secno">3.2 </span>Triples</a></li><li class="tocline"><a href="#T-IRI-reference" class="tocxref"><span class="secno">3.3 </span>IRI References</a></li><li class="tocline"><a href="#plain-literals" class="tocxref"><span class="secno">3.4 </span>Plain Literals</a></li><li class="tocline"><a href="#typed-literals" class="tocxref"><span class="secno">3.5 </span>Typed Literals</a></li><li class="tocline"><a href="#turtle" class="tocxref"><span class="secno">3.6 </span>Turtle</a></li><li class="tocline"><a href="#graphs" class="tocxref"><span class="secno">3.7 </span>Graphs</a></li><li class="tocline"><a href="#compact-uri-expressions" class="tocxref"><span class="secno">3.8 </span>Compact URI Expressions</a></li><li class="tocline"><a href="#markup-fragments-and-rdfa" class="tocxref"><span class="secno">3.9 </span>Markup Fragments and RDFa</a></li><li class="tocline"><a href="#a-description-of-rdfa-in-rdf-terms" class="tocxref"><span class="secno">3.10 </span>A Description of RDFa in RDF Terms</a></li></ul></li><li class="tocline"><a href="#conformance" class="tocxref"><span class="secno">4. </span>Conformance</a><ul class="toc"><li class="tocline"><a href="#processorconf" class="tocxref"><span class="secno">4.1 </span>RDFa Processor Conformance</a></li><li class="tocline"><a href="#hostlangconf" class="tocxref"><span class="secno">4.2 </span>RDFa Host Language Conformance</a></li><li class="tocline"><a href="#xmlrdfaconformance" class="tocxref"><span class="secno">4.3 </span>XML+RDFa Document Conformance</a></li></ul></li><li class="tocline"><a href="#s_syntax" class="tocxref"><span class="secno">5. </span>Attributes and Syntax</a><ul class="toc"><li class="tocline"><a href="#attribute_roles" class="tocxref"><span class="secno">5.1 </span>Roles of attributes</a></li><li class="tocline"><a href="#white_space" class="tocxref"><span class="secno">5.2 </span>White space within attribute values</a></li></ul></li><li class="tocline"><a href="#s_curies" class="tocxref"><span class="secno">6. </span>CURIE Syntax Definition</a><ul class="toc"><li class="tocline"><a href="#why-curies-and-not-qnames" class="tocxref"><span class="secno">6.1 </span>Why CURIEs and not QNames?</a></li></ul></li><li class="tocline"><a href="#s_model" class="tocxref"><span class="secno">7. </span>Processing Model</a><ul class="toc"><li class="tocline"><a href="#overview" class="tocxref"><span class="secno">7.1 </span>Overview</a></li><li class="tocline"><a href="#evaluation-context" class="tocxref"><span class="secno">7.2 </span>Evaluation Context</a></li><li class="tocline"><a href="#s_chaining" class="tocxref"><span class="secno">7.3 </span>Chaining</a></li><li class="tocline"><a href="#s_curieprocessing" class="tocxref"><span class="secno">7.4 </span>CURIE and IRI Processing</a><ul class="toc"><li class="tocline"><a href="#scoping-of-prefix-mappings" class="tocxref"><span class="secno">7.4.1 </span>Scoping of Prefix Mappings</a></li><li class="tocline"><a href="#general-use-of-curies-in-attributes" class="tocxref"><span class="secno">7.4.2 </span>General Use of CURIEs in Attributes</a></li><li class="tocline"><a href="#s_terms" class="tocxref"><span class="secno">7.4.3 </span>General Use of Terms in Attributes</a></li><li class="tocline"><a href="#use-of-curies-in-specific-attributes" class="tocxref"><span class="secno">7.4.4 </span>Use of CURIEs in Specific Attributes</a></li><li class="tocline"><a href="#s_blankNodes" class="tocxref"><span class="secno">7.4.5 </span>Referencing Blank Nodes</a></li></ul></li><li class="tocline"><a href="#s_sequence" class="tocxref"><span class="secno">7.5 </span>Sequence</a></li><li class="tocline"><a href="#processor-status" class="tocxref"><span class="secno">7.6 </span>Processor Status</a><ul class="toc"><li class="tocline"><a href="#accessing-the-processor-graph" class="tocxref"><span class="secno">7.6.1 </span>Accessing the Processor Graph</a></li><li class="tocline"><a href="#processor-graph-terms" class="tocxref"><span class="secno">7.6.2 </span>Processor Graph Terms</a></li></ul></li><li class="tocline"><a href="#vocabulary-expansion" class="tocxref"><span class="secno">7.7 </span>Vocabulary Expansion</a></li></ul></li><li class="tocline"><a href="#s_rdfaindetail" class="tocxref"><span class="secno">8. </span>RDFa Processing in detail</a><ul class="toc"><li class="tocline"><a href="#changing-the-evaluation-context" class="tocxref"><span class="secno">8.1 </span>Changing the Evaluation Context</a><ul class="toc"><li class="tocline"><a href="#setting-the-current-subject" class="tocxref"><span class="secno">8.1.1 </span>Setting the current subject</a><ul class="toc"><li class="tocline"><a href="#the-current-document" class="tocxref"><span class="secno">8.1.1.1 </span>The current document</a></li><li class="tocline"><a href="#using-about" class="tocxref"><span class="secno">8.1.1.2 </span>Using <span class="formerLink" title="about">@about</span></a></li><li class="tocline"><a href="#typing-resources-with-typeof" class="tocxref"><span class="secno">8.1.1.3 </span>Typing resources with <span class="formerLink" title="typeof">@typeof</span></a><ul class="toc"><li class="tocline"><a href="#chaining-with-property-and-typeof" class="tocxref"><span class="secno">8.1.1.3.1 </span>Chaining with <span class="formerLink" title="property">@property</span> and <span class="formerLink" title="typeof">@typeof</span></a></li></ul></li><li class="tocline"><a href="#determining-the-subject-with-neither-about-nor-typeof" class="tocxref"><span class="secno">8.1.1.4 </span>Determining the subject with neither <span class="formerLink" title="about">@about</span> nor <span class="formerLink" title="typeof">@typeof</span></a><ul class="toc"><li class="tocline"><a href="#inheriting-subject-from-resource" class="tocxref"><span class="secno">8.1.1.4.1 </span>Inheriting subject from <span class="formerLink" title="resource">@resource</span></a></li><li class="tocline"><a href="#inheriting-an-anonymous-subject" class="tocxref"><span class="secno">8.1.1.4.2 </span>Inheriting an anonymous subject</a></li></ul></li></ul></li></ul></li><li class="tocline"><a href="#s_Completing_Incomplete_Triples" class="tocxref"><span class="secno">8.2 </span>Completing incomplete triples</a></li><li class="tocline"><a href="#object-resolution" class="tocxref"><span class="secno">8.3 </span>Object resolution</a><ul class="toc"><li class="tocline"><a href="#object-resolution-for-the-property-attribute" class="tocxref"><span class="secno">8.3.1 </span>Object resolution for the <span class="formerLink" title="property">@property</span> attribute</a><ul class="toc"><li class="tocline"><a href="#plain-literals-1" class="tocxref"><span class="secno">8.3.1.1 </span>Plain Literals</a><ul class="toc"><li class="tocline"><a href="#language-tags" class="tocxref"><span class="secno">8.3.1.1.1 </span>Language Tags</a></li></ul></li><li class="tocline"><a href="#typed-literals-1" class="tocxref"><span class="secno">8.3.1.2 </span>Typed Literals</a></li><li class="tocline"><a href="#s-xml-literals" class="tocxref"><span class="secno">8.3.1.3 </span><span title="xml-literals">XML Literals</span></a></li></ul></li><li class="tocline"><a href="#iri-object-resolution" class="tocxref"><span class="secno">8.3.2 </span>IRI object resolution</a><ul class="toc"><li class="tocline"><a href="#using-resource-to-set-the-object" class="tocxref"><span class="secno">8.3.2.1 </span>Using <span class="formerLink" title="resource">@resource</span> to set the object</a></li><li class="tocline"><a href="#using-href-or-src-to-set-the-object" class="tocxref"><span class="secno">8.3.2.2 </span>Using <span class="formerLink" title="href">@href</span> or <span class="formerLink" title="src">@src</span> to set the object</a></li><li class="tocline"><a href="#incomplete-triples" class="tocxref"><span class="secno">8.3.2.3 </span>Incomplete triples</a></li></ul></li></ul></li><li class="tocline"><a href="#list-generation" class="tocxref"><span class="secno">8.4 </span>List Generation</a></li></ul></li><li class="tocline"><a href="#s_initialcontexts" class="tocxref"><span class="secno">9. </span>RDFa Initial Contexts</a></li><li class="tocline"><a href="#s_vocab_expansion" class="tocxref"><span class="secno">10. </span>RDFa Vocabulary Expansion</a><ul class="toc"><li class="tocline"><a href="#s_vocab_expansion_details" class="tocxref"><span class="secno">10.1 </span>Details of the RDFa Vocabulary Expansion</a><ul class="toc"><li class="tocline"><a href="#s_vocab_entailment" class="tocxref"><span class="secno">10.1.1 </span><span>RDFa Vocabulary Entailment</span></a></li></ul></li><li class="tocline"><a href="#s_expansion_control" class="tocxref"><span class="secno">10.2 </span>Vocabulary Expansion Control of RDFa Processors</a><ul class="toc"><li class="tocline"><a href="#s_vocab_guidelines" class="tocxref"><span class="secno">10.2.1 </span>Notes to RDFa Vocabulary Implementations and Publishing</a></li></ul></li></ul></li><li class="tocline"><a href="#s_datatypes" class="tocxref"><span class="secno">A. </span>CURIE Datatypes</a><ul class="toc"><li class="tocline"><a href="#xml-schema-definition" class="tocxref"><span class="secno">A.1 </span>XML Schema Definition</a></li><li class="tocline"><a href="#xml-dtd-definition" class="tocxref"><span class="secno">A.2 </span>XML DTD Definition</a></li></ul></li><li class="tocline"><a href="#vocabulary" class="tocxref"><span class="secno">B. </span>The RDFa Vocabulary</a><ul class="toc"><li class="tocline"><a href="#term-prefix-definitions-vocabulary" class="tocxref"><span class="secno">B.1 </span>Term and Prefix Assignments</a></li><li class="tocline"><a href="#processor-graph-reporting" class="tocxref"><span class="secno">B.2 </span>Processor Graph Reporting</a></li><li class="tocline"><a href="#vocabulary-relationship" class="tocxref"><span class="secno">B.3 </span>Term for vocabulary expansion</a></li></ul></li><li class="tocline"><a href="#a_history" class="tocxref"><span class="secno">C. </span>Changes</a><ul class="toc"><li class="tocline"><a href="#major-differences-with-rdfa-syntax-1.0" class="tocxref"><span class="secno">C.1 </span>Major differences with RDFa Syntax 1.0</a></li></ul></li><li class="tocline"><a href="#a_acks" class="tocxref"><span class="secno">D. </span>Acknowledgments</a></li><li class="tocline"><a href="#references" class="tocxref"><span class="secno">E. </span>References</a><ul class="toc"><li class="tocline"><a href="#normative-references" class="tocxref"><span class="secno">E.1 </span>Normative references</a></li><li class="tocline"><a href="#informative-references" class="tocxref"><span class="secno">E.2 </span>Informative references</a></li></ul></li></ul></section> <section class="informative" id="s_motivation" typeof="bibo:Chapter" resource="#s_motivation" rel="bibo:chapter"> <!--OddPage--><h2 aria-level="1" role="heading" id="h2_s_motivation"><span class="secno">1. </span>Motivation</h2><p><em>This section is non-normative.</em></p> <p>RDF/XML [<cite><a class="bibref" href="#bib-RDF-SYNTAX">RDF-SYNTAX</a></cite>] provides sufficient flexibility to represent all of the abstract concepts in RDF. However, it presents a number of challenges; first it is difficult or impossible to validate documents that contain RDF/XML using XML Schemas or DTDs, which therefore makes it difficult to import RDF/XML into other markup languages. Whilst newer schema languages such as RELAX NG [<cite><a class="bibref" href="#bib-RELAXNG-SCHEMA">RELAXNG-SCHEMA</a></cite>] do provide a way to validate documents that contain arbitrary RDF/XML, it will be a while before they gain wide support.</p> <p>Second, even if one could add RDF/XML directly into an XML dialect like XHTML, there would be significant data duplication between the rendered data and the RDF/XML structured data. It would be far better to add RDF to a document without repeating the document's existing data. For example, an XHTML document that explicitly renders its author's name in the text — perhaps as a byline on a news site — should not need to repeat this name for the RDF expression of the same concept: it should be possible to supplement the existing markup in such a way that it can also be interpreted as RDF.</p> <p>Another reason for aligning the rendered data with the structured data is that it is highly beneficial to express the web data's structure 'in context'; as users often want to transfer structured data from one application to another, sometimes to or from a non-web-based application, the user experience can be enhanced. For example, information about specific rendered data could be presented to the user via 'right-clicks' on an item of interest. Moreover, organizations that generate a lot of content (e.g., news outlets) find it easier to embed the semantic data inline than to maintain it separately.</p> <p>In the past, many attributes were 'hard-wired' directly into the markup language to represent specific concepts. For example, in XHTML 1.1 [<cite><a class="bibref" href="#bib-XHTML11">XHTML11</a></cite>] and HTML [<cite><a class="bibref" href="#bib-HTML401">HTML401</a></cite>] there is <span class="aref">@cite</span>; the attribute allows an author to add information to a document which is used to indicate the origin of a quote.</p> <p>However, these 'hard-wired' attributes make it difficult to define a generic process for extracting metadata from any document since an RDFa Processor would need to know about each of the special attributes. One motivation for RDFa has been to devise a means by which documents can be augmented with metadata in a general, rather than hard-wired, manner. This has been achieved by creating a fixed set of attributes and parsing rules, but allowing those attributes to contain properties from any of a number of the growing range of available RDF vocabularies. In most cases the <em>values</em> of those properties are the information that is already in an author's document.</p> <p>RDFa alleviates the pressure on markup language designers to anticipate all the structural requirements users of their language might have, by outlining a new syntax for RDF that relies only on attributes. By adhering to the concepts and rules in this specification, language designers can import RDFa into their environment with a minimum of hassle and be confident that semantic data will be extractable from their documents by conforming processors. </p> </section> <section class="informative" id="s_Syntax_overview" typeof="bibo:Chapter" resource="#s_Syntax_overview" rel="bibo:chapter"> <!--OddPage--><h2 aria-level="1" role="heading" id="h2_s_Syntax_overview"><span class="secno">2. </span>Syntax Overview</h2><p><em>This section is non-normative.</em></p> <p>The following examples are intended to help readers who are not familiar with RDFa to quickly get a sense of how it works. For a more thorough introduction, please read the RDFa Primer [<cite><a class="bibref" href="#bib-RDFA-PRIMER">RDFA-PRIMER</a></cite>].</p> <p>In RDF, it is common for people to shorten vocabulary terms via abbreviated IRIs that use a 'prefix' and a 'reference'. This mechanism is explained in detail in the section titled <a>Compact URI Expressions</a>. The examples throughout this document assume that the following vocabulary <a class="tref" title="prefix" href="#T-prefix">prefixes</a> have been defined:</p> <table> <tbody> <tr> <td rowspan="1" colspan="1">bibo:</td> <td rowspan="1" colspan="1">http://purl.org/ontology/bibo/</td> </tr> <tr> <td rowspan="1" colspan="1">cc:</td> <td rowspan="1" colspan="1">http://creativecommons.org/ns#</td> </tr> <tr> <td rowspan="1" colspan="1">dbp:</td> <td rowspan="1" colspan="1">http://dbpedia.org/property/</td> </tr> <tr> <td rowspan="1" colspan="1">dbp-owl:</td> <td rowspan="1" colspan="1">http://dbpedia.org/ontology/</td> </tr> <tr> <td rowspan="1" colspan="1">dbr:</td> <td rowspan="1" colspan="1">http://dbpedia.org/resource/</td> </tr> <tr> <td rowspan="1" colspan="1">dc:</td> <td rowspan="1" colspan="1">http://purl.org/dc/terms/</td> </tr> <tr> <td rowspan="1" colspan="1">ex:</td> <td rowspan="1" colspan="1">http://example.org/</td> </tr> <tr> <td rowspan="1" colspan="1">foaf:</td> <td rowspan="1" colspan="1">http://xmlns.com/foaf/0.1/</td> </tr> <tr> <td rowspan="1" colspan="1">owl:</td> <td rowspan="1" colspan="1">http://www.w3.org/2002/07/owl#</td> </tr> <tr> <td rowspan="1" colspan="1">rdf:</td> <td rowspan="1" colspan="1"> http://www.w3.org/1999/02/22-rdf-syntax-ns#</td> </tr> <tr> <td rowspan="1" colspan="1">rdfa:</td> <td rowspan="1" colspan="1"> http://www.w3.org/ns/rdfa#</td> </tr> <tr> <td rowspan="1" colspan="1">rdfs:</td> <td rowspan="1" colspan="1"> http://www.w3.org/2000/01/rdf-schema#</td> </tr> <!-- <tr> <td rowspan="1" colspan="1">taxo:</td> <td rowspan="1" colspan="1">http://purl.org/rss/1.0/modules/taxonomy/</td> </tr>--> <tr> <td rowspan="1" colspan="1">xhv:</td> <td rowspan="1" colspan="1">http://www.w3.org/1999/xhtml/vocab#</td> </tr> <tr> <td rowspan="1" colspan="1">xsd:</td> <td rowspan="1" colspan="1">http://www.w3.org/2001/XMLSchema#</td> </tr> </tbody> </table> <div class="note"><div class="note-title" aria-level="2" role="heading" id="h_note_3"><span>Note</span></div><p class="">In some of the examples below we have used IRIs with fragment identifiers that are local to the document containing the RDFa fragment identifiers shown (e.g., '<code>about="#me"</code>'). This idiom, which is also used in RDF/XML [<cite><a class="bibref" href="#bib-RDF-SYNTAX-GRAMMAR">RDF-SYNTAX-GRAMMAR</a></cite>] and other RDF serializations, gives a simple way to 'mint' new IRIs for entities described by RDFa and therefore contributes considerably to the expressive power of RDFa. The precise meaning of IRIs which include fragment identifiers when they appear in RDF graphs is given in Section 7 of [<cite><a class="bibref" href="#bib-RDF-SYNTAX">RDF-SYNTAX</a></cite>]. To ensure that such fragment identifiers can be interpreted correctly, media type registrations for markup languages that incorporate RDFa should directly or indirectly reference this specification.</p></div> <section id="rdfa-attributes" typeof="bibo:Chapter" resource="#rdfa-attributes" rel="bibo:chapter"> <h3 aria-level="2" role="heading" id="h3_rdfa-attributes"><span class="secno">2.1 </span>The RDFa Attributes</h3><p><em>This section is non-normative.</em></p> <p>RDFa makes use of a number of commonly found attributes, as well as providing a few new ones. Attributes that already exist in widely deployed languages (e.g., HTML) have the same meaning they always did, although their syntax has been slightly modified in some cases. For example, in (X)HTML there is no clear way to add new <a class="aref" href="#A-rel" title="rel">@rel</a> values; RDFa sets out to explicitly solve this problem, and does so by allowing IRIs as values. It also introduces the concepts of <a class="tref" title="term" href="#T-term">terms</a> and '<a class="tref" title="curie" href="#T-curie">compact URI expressions</a>' — referred to as CURIEs in this document — which allow a full IRI value to be expressed succinctly. For a complete list of RDFa attribute names and syntax, see <a href="#s_syntax">Attributes and Syntax</a>.</p> </section> <section id="examples"> <h3 aria-level="2" role="heading" id="h3_examples"><span class="secno">2.2 </span>Examples</h3> <p>In (X)HTML, authors can include metadata and relationships concerning the current document by using the <code>meta</code> and <code>link</code> elements (in these examples, XHTML+RDFa [<cite><a class="bibref" href="#bib-XHTML-RDFA">XHTML-RDFA</a></cite>] is used). For example, the author of the page along with the pages preceding and following the current page can be expressed using the link and meta elements:</p> <div class="example"><div class="example-title"><span>Example 1</span></div><pre class="example"><html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Page 7</title> <span class="hilite"><meta name="author" content="Mark Birbeck" /></span> <span class="hilite"><link rel="prev" href="page6.html" /></span> <span class="hilite"><link rel="next" href="page8.html" /></span> </head> <body>...</body> </html></pre></div> <p>RDFa makes use of this concept, enhancing it with the ability to make use of other vocabularies by using full IRIs:</p> <div class="example"><div class="example-title"><span>Example 2</span></div><pre class="example"><html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>My home-page</title> <meta property="<span class="hilite">http://purl.org/dc/terms/creator</span>" content="Mark Birbeck" /> <link rel="<span class="hilite">http://xmlns.com/foaf/0.1/topic</span>" href="http://www.example.com/#us" /> </head> <body>...</body> </html></pre></div> <p>Because using full IRIs like those above can be cumbersome, RDFa also permits the use of <a class="datatype internalDFN" title="CURIE" href="#dfn-curie">compact URI expressions</a> so an author can use a shorthand to reference terms in multiple vocabularies:</p> <div class="example"><div class="example-title"><span>Example 3</span></div><pre class="example"><html xmlns="http://www.w3.org/1999/xhtml" <span class="hilite">prefix="foaf: http://xmlns.com/foaf/0.1/</span> <span class="hilite">dc: http://purl.org/dc/terms/"</span> > <head> <title>My home-page</title> <meta property="<span class="hilite">dc:creator</span>" content="Mark Birbeck" /> <link rel="<span class="hilite">foaf:topic</span>" href="http://www.example.com/#us" /> </head> <body>...</body> </html></pre></div> <p>RDFa supports the use of <a class="aref" href="#A-rel" title="rel">@rel</a> and <a class="aref" href="#A-rev" title="rev">@rev</a> on any element. This is even more useful with the addition of support for different vocabularies:</p> <div class="example"><div class="example-title"><span>Example 4</span></div><pre id="ccLicense" class="example">This document is licensed under the <a <span class="hilite">prefix="cc: http://creativecommons.org/ns#"</span> <span class="hilite">rel="cc:license"</span> href="http://creativecommons.org/licenses/by-nc-nd/3.0/" >Creative Commons By-NC-ND License</a>.</pre></div> <p>Not only can IRIs in the document be re-used to provide metadata, but so can inline text when used with <a class="aref" href="#A-property" title="property">@property</a>:</p> <div class="example"><div class="example-title"><span>Example 5</span></div><pre class="example"><html xmlns="http://www.w3.org/1999/xhtml" <span class="hilite">prefix="dc: http://purl.org/dc/terms/"</span> > <head><title>My Home Page</title></head> <body> <h1 <span class="hilite">property="dc:title"</span>>My home-page</h1> <p>Last modified: 16 September 2015</p> </body> </html></pre></div> <p>If some displayed text is different from the actual 'value' it represents, a more precise value can be added using <a class="aref" href="#A-content" title="content">@content</a>. A value can also optionally be typed using <a class="aref" href="#A-datatype" title="datatype">@datatype</a>:</p> <div class="example"><div class="example-title"><span>Example 6</span></div><pre class="example"><html xmlns="http://www.w3.org/1999/xhtml" <span class="hilite">prefix="xsd: http://www.w3.org/2001/XMLSchema#</span> <span class="hilite">dc: http://purl.org/dc/terms/"</span> > <head><title>My Home Page</title></head> <body> <h1 property="dc:title">My home-page</h1> <p>Last modified: <span property="dc:modified" <span class="hilite">content="2015-09-16T16:00:00-05:00"</span> <span class="hilite">datatype="xsd:dateTime"</span>>16 September 2015</span>.</p> </body> </html></pre></div> <p>RDFa allows the document to contain metadata information about other documents and resources:</p> <div class="example"><div class="example-title"><span>Example 7</span></div><pre class="example"><html xmlns="http://www.w3.org/1999/xhtml" prefix="bibo: http://purl.org/ontology/bibo/ dc: http://purl.org/dc/terms/" > <head> <title>Books by Marco Pierre White</title> </head> <body> I think White's book '<span <span class="hilite">about="urn:ISBN:0091808189"</span> <span class="hilite">property="dc:title"</span>>Canteen Cuisine</span>' is well worth getting since although it's quite advanced stuff, he makes it pretty easy to follow. You might also like <span <span class="hilite">about="urn:ISBN:1596913614"</span> <span class="hilite">property="dc:description"</span> >White's autobiography</span>. </body> </html></pre></div> <p>In many cases a block of markup will contain a number of properties that relate to the same item. It's possible with RDFa to indicate the type of that item using <a class="aref" href="#A-typeof" title="typeof">@typeof</a>:</p> <div class="example"><div class="example-title"><span>Example 8</span></div><pre class="example"><html xmlns="http://www.w3.org/1999/xhtml" prefix="bibo: http://purl.org/ontology/bibo/ dc: http://purl.org/dc/terms/" > <head> <title>Books by Marco Pierre White</title> </head> <body> I think White's book '<span about="urn:ISBN:0091808189" <span class="hilite">typeof="bibo:Book"</span> property="dc:title">Canteen Cuisine</span>' is well worth getting since although it's quite advanced stuff, he makes it pretty easy to follow. You might also like <span about="urn:ISBN:1596913614" <span class="hilite">typeof="bibo:Book"</span> property="dc:description" >White's autobiography</span>. </body> </html></pre></div> <p> When dealing with small amounts of markup, it is sometimes easier to use full IRIs, rather than CURIEs. The previous example can also be written as follows:</p> <div class="example"><div class="example-title"><span>Example 9</span></div><pre class="example"><html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Books by Marco Pierre White</title> </head> <body> I think White's book '<span <span class="hilite">about="urn:ISBN:0091808189"</span> <span class="hilite">typeof="http://purl.org/ontology/bibo/Book"</span> <span class="hilite">property="http://purl.org/dc/terms/title"</span> >Canteen Cuisine</span>' is well worth getting since although it's quite advanced stuff, he makes it pretty easy to follow. You might also like <span <span class="hilite">about="urn:ISBN:1596913614"</span> <span class="hilite">typeof="http://purl.org/ontology/bibo/Book"</span> <span class="hilite">property="http://purl.org/dc/terms/description"</span> >White's autobiography</span>. </body> </html></pre></div> <p>A simple way of defining a portion of a document using terms from a specific vocabulary is to use <a class="aref" href="#A-vocab" title="vocab">@vocab</a> to define a default vocabulary IRI. For example, to use FOAF terms:</p> <div class="example"><div class="example-title"><span>Example 10</span></div><pre class="example"><div <span class="hilite">vocab="http://xmlns.com/foaf/0.1/"</span> about="#me"> My name is <span <span class="hilite">property="name"</span>>John Doe</span> and my blog is called <a <span class="hilite">rel="homepage"</span> href="http://example.org/blog/">Understanding Semantics</a>. </div></pre></div> <p>The example above will produce the following triples, expressed here in <a href="#turtle">Turtle</a> syntax:</p> <div class="example"><div class="example-title"><span>Example 11</span></div><pre class="example">@prefix foaf: <http://xmlns.com/foaf/0.1/> . <#me> <span class="hilite">foaf:name</span> "John Doe" ; <span class="hilite">foaf:homepage</span> <http://example.org/blog/> .</pre></div> <p>In simple cases the <a class="aref" href="#A-property" title="property">@property</a> property can also be used in place of <a class="aref" href="#A-rel" title="rel">@rel</a>. Indeed, in case when the element does not contain <a class="aref" href="#A-rel" title="rel">@rel</a>, <a class="aref" href="#A-datatype" title="datatype">@datatype</a>, or <a class="aref" href="#A-content" title="content">@content</a>, but there is, for example, a <a class="aref" href="#A-href" title="href">@href</a>, the effect of <a class="aref" href="#A-property" title="property">@property</a> is analogous to the role of <a class="aref" href="#A-rel" title="rel">@rel</a>. For example, the previous example could have been written:</p> <div class="example"><div class="example-title"><span>Example 12</span></div><pre class="example"><div <span class="hilite">vocab="http://xmlns.com/foaf/0.1/"</span> about="#me"> My name is <span <span class="hilite">property="name"</span>>John Doe</span> and my blog is called <a <span class="hilite">property="homepage"</span> href="http://example.org/blog/">Understanding Semantics</a>. </div></pre></div> </section> </section> <section class="informative" id="s_rdfterminology" typeof="bibo:Chapter" resource="#s_rdfterminology" rel="bibo:chapter"> <!--OddPage--><h2 aria-level="1" role="heading" id="h2_s_rdfterminology"><span class="secno">3. </span>RDF Terminology</h2><p><em>This section is non-normative.</em></p> <p> The previous section gave examples of typical markup in order to illustrate the structure of RDFa markup. RDFa is short for "RDF in Attributes". In order to author RDFa you do not need to understand RDF, although it would certainly help. However, if you are building a system that consumes the RDF output of a language that supports RDFa you will almost certainly need to understand RDF. This section introduces the basic concepts and terminology of RDF. For a more thorough explanation of RDF, please refer to the RDF Concepts document [<cite><a class="bibref" href="#bib-RDF-SYNTAX">RDF-SYNTAX</a></cite>] and the RDF Syntax Document [<cite><a class="bibref" href="#bib-RDF-SYNTAX">RDF-SYNTAX</a></cite>]. </p> <section id="statements"> <h3 aria-level="2" role="heading" id="h3_statements"><span class="secno">3.1 </span>Statements</h3><p><em>This section is non-normative.</em></p> <p> The structured data that RDFa provides access to is a collection of <em>statements</em>. A statement is a basic unit of information that has been constructed in a specific format to make it easier to process. In turn, by breaking large sets of information down into a collection of statements, even very complex metadata can be processed using simple rules. </p> <p> To illustrate, suppose we have the following set of facts:</p> <div class="example"><div class="example-title"><span>Example 13</span></div><pre class="example">Albert was born on March 14, 1879, in the German Empire. There is a picture of him at the web address, http://en.wikipedia.org/wiki/Image:Albert_Einstein_Head.jpg.</pre></div> <p>This would be quite difficult for a machine to interpret, and it is certainly not in a format that could be passed from one data application to another. However, if we convert the information to a set of statements it begins to be more manageable. The same information could therefore be represented by the following shorter 'statements':</p> <div class="example"><div class="example-title"><span>Example 14</span></div><pre class="example">Albert was born on March 14, 1879. Albert was born in the German Empire. Albert has a picture at http://en.wikipedia.org/wiki/Image:Albert_Einstein_Head.jpg.</pre></div> </section> <section id="triples"> <h3 aria-level="2" role="heading" id="h3_triples"><span class="secno">3.2 </span>Triples</h3> <p> To make this information machine-processable, RDF defines a structure for these statements. A statement is formally called a <dfn title="triple" id="T-triple"><em>triple</em></dfn>, meaning that it is made up of three components. The first is the <em>subject</em> of the triple, and is what we are making our statement <em>about</em>. In all of these examples the subject is 'Albert'. </p> <p> The second part of a triple is the <em>property</em> of the subject that we want to define. In the examples here, the properties would be 'was born on', 'was born in', and 'has a picture at'. These properties are typically called <em>predicates</em> in RDF. </p> <!-- <p class='note'>A commentor indicated that the use of the term predicate is confusing even though it is correct. They asked that we change the term to 'property' throughout the document. The working group is considering this change, but believes it to be completely editorial.</p> --> <p> The final part of a triple is called the <em>object</em>. In the examples here the three objects have the values 'March 14, 1879', 'the German Empire', and 'http://en.wikipedia.org/wiki/Image:Albert_Einstein_Head.jpg'. </p> <div class="note"><div class="note-title" aria-level="3" role="heading" id="h_note_4"><span>Note</span></div><p class="">RDFa supports internationalized characters in the subject, 'predicate', and the object.</p></div> </section> <section id="T-IRI-reference" typeof="bibo:Chapter" resource="#T-IRI-reference" rel="bibo:chapter"> <h3 aria-level="2" role="heading" id="h3_T-IRI-reference"><span class="secno">3.3 </span>IRI References</h3> <p> Breaking complex information into manageable units helps us be specific about our data, but there is still some ambiguity. For example, which 'Albert' are we talking about? If another system has more facts about 'Albert', how could we know whether they are about the same person, and so add them to the list of things we know about that person? If we wanted to find people born in the German Empire, how could we know that the predicate 'was born in' has the same purpose as the predicate 'birthplace' that might exist in some other system? RDF solves this problem by replacing our vague terms with <dfn title="iri-reference" id="T-iri-reference">IRI references</dfn>. </p> <p> IRIs are most commonly used to identify web pages, but RDF makes use of them as a way to provide unique identifiers for concepts. For example, we could identify the subject of all of our statements (the first part of each triple) by using the DBPedia [<a href="http://dbpedia.org">http://dbpedia.org</a>] IRI for Albert Einstein, instead of the ambiguous string 'Albert':</p> <div class="example"><div class="example-title"><span>Example 15</span></div><pre class="example"><span class="hilite"><http://dbpedia.org/resource/Albert_Einstein></span> has the name Albert Einstein. <span class="hilite"><http://dbpedia.org/resource/Albert_Einstein></span> was born on March 14, 1879. <span class="hilite"><http://dbpedia.org/resource/Albert_Einstein></span> was born in the German Empire. <span class="hilite"><http://dbpedia.org/resource/Albert_Einstein></span> has a picture at http://en.wikipedia.org/wiki/Image:Albert_Einstein_Head.jpg.</pre></div> <p> IRI references are also used to uniquely identify the objects in metadata statements (the third part of each triple). The picture of Einstein is already an IRI, but we could also use an IRI to uniquely identify the country 'German Empire'. At the same time we'll indicate that the name and date of birth really are literals (and not IRIs), by putting quotes around them:</p> <div class="example"><div class="example-title"><span>Example 16</span></div><pre class="example"><http://dbpedia.org/resource/Albert_Einstein> has the name <span class="hilite">"</span>Albert Einstein<span class="hilite">"</span>. <http://dbpedia.org/resource/Albert_Einstein> was born on <span class="hilite">"</span>March 14, 1879<span class="hilite">"</span>. <http://dbpedia.org/resource/Albert_Einstein> was born in <span class="hilite"><http://dbpedia.org/resource/German_Empire></span>. <http://dbpedia.org/resource/Albert_Einstein> has a picture at <span class="hilite"><</span>http://en.wikipedia.org/wiki/Image:Albert_Einstein_Head.jpg<span class="hilite">></span>.</pre></div> <p> IRI references are also used to ensure that predicates are unambiguous; now we can be sure that 'birthplace', 'place of birth', 'Lieu de naissance' and so on, all mean the same thing:</p> <div class="example"><div class="example-title"><span>Example 17</span></div><pre class="example"><http://dbpedia.org/resource/Albert_Einstein> <span class="hilite"><http://xmlns.com/foaf/0.1/name></span> "Albert Einstein". <http://dbpedia.org/resource/Albert_Einstein> <span class="hilite"><http://dbpedia.org/property/dateOfBirth></span> "March 14, 1879". <http://dbpedia.org/resource/Albert_Einstein> <span class="hilite"><http://dbpedia.org/property/birthPlace></span> <http://dbpedia.org/resource/German_Empire>. <http://dbpedia.org/resource/Albert_Einstein> <span class="hilite"><http://xmlns.com/foaf/0.1/depiction></span> <http://en.wikipedia.org/wiki/Image:Albert_Einstein_Head.jpg>.</pre></div> </section> <section id="plain-literals"> <h3 aria-level="2" role="heading" id="h3_plain-literals"><span class="secno">3.4 </span>Plain Literals</h3> <p>Although IRI resources are always used for subjects and predicates, the object part of a triple can be either an IRI or a <dfn title="literal" id="T-literal"><em>literal</em></dfn>. In the example triples, Einstein's name is represented by a <dfn title="plain-literal" id="T-plain-literal"><em>plain literal</em></dfn>, specifically a basic string with no type or language information:</p> <div class="example"><div class="example-title"><span>Example 18</span></div><pre class="example"><http://dbpedia.org/resource/Albert_Einstein> <http://xmlns.com/foaf/0.1/name> <span class="hilite">"Albert Einstein"</span>.</pre></div> <p>A plain literal can also be given a language tag, to capture plain text in a natural language. For example, Einstein's birthplace has different names in English and German:</p> <div class="example"><div class="example-title"><span>Example 19</span></div><pre class="example"><http://dbpedia.org/resource/German_Empire> rdfs:label "German Empire"@en; rdfs:label "Deutsches Kaiserreich"@de .</pre></div> </section> <section id="typed-literals"> <h3 aria-level="2" role="heading" id="h3_typed-literals"><span class="secno">3.5 </span>Typed Literals</h3> <p> Some literals, such as dates and numbers, have very specific meanings, so RDF provides a mechanism for indicating the type of a literal. A <dfn title="typed-literal" id="T-typed-literal"><em>typed literal</em></dfn> is indicated by attaching an IRI to the end of a <a class="tref" title="plain-literal" href="#T-plain-literal">plain literal</a>, and this IRI indicates the literal's datatype. This IRI is usually based on datatypes defined in the XML Schema Datatypes specification [<cite><a class="bibref" href="#bib-XMLSCHEMA11-2">XMLSCHEMA11-2</a></cite>]. The following syntax would be used to unambiguously express Einstein's date of birth as a literal of type <code>http://www.w3.org/2001/XMLSchema#date</code>:</p> <div class="example"><div class="example-title"><span>Example 20</span></div><pre class="example"><http://dbpedia.org/resource/Albert_Einstein> <http://dbpedia.org/property/dateOfBirth> "1879-03-14"<span class="hilite">^^<http://www.w3.org/2001/XMLSchema#date></span>.</pre></div> </section> <section id="turtle"> <h3 aria-level="2" role="heading" id="h3_turtle"><span class="secno">3.6 </span>Turtle</h3> <p> RDF itself does not have one set way to express triples, since the key ideas of RDF are the triple and the use of IRIs, and <em>not</em> any particular syntax. However, there are a number of mechanisms for expressing triples, such as RDF/XML [<cite><a class="bibref" href="#bib-RDF-SYNTAX-GRAMMAR">RDF-SYNTAX-GRAMMAR</a></cite>], Turtle [<cite><a class="bibref" href="#bib-TURTLE">TURTLE</a></cite>], and of course RDFa. Many discussions of RDF make use of the <em>Turtle</em> syntax to explain their ideas, since it is quite compact. The examples we have just seen are already using this syntax, and we'll continue to use it throughout this document when we need to talk about the RDF that could be generated from some RDFa. Turtle allows long IRIs to be abbreviated by using an IRI mapping, which can be used to express a compact IRI expression as follows:</p> <div class="example"><div class="example-title"><span>Example 21</span></div><pre class="example"><span class="hilite">@prefix dbp: <http://dbpedia.org/property/> .</span> <span class="hilite">@prefix foaf: <http://xmlns.com/foaf/0.1/> .</span> <http://dbpedia.org/resource/Albert_Einstein> <span class="hilite">foaf:name</span> "Albert Einstein" . <http://dbpedia.org/resource/Albert_Einstein> <span class="hilite">dbp:birthPlace</span> <http://dbpedia.org/resource/German_Empire> .</pre></div> <p>Here 'dbp:' has been mapped to the IRI for DBPedia and 'foaf:' has been mapped to the IRI for the 'Friend of a Friend' vocabulary.</p> <p>Any IRI in Turtle could be abbreviated in this way. This means that we could also have used the same technique to abbreviate the identifier for Einstein, as well as the datatype indicator:</p> <div class="example"><div class="example-title"><span>Example 22</span></div><pre class="example">@prefix dbp: <http://dbpedia.org/property/> . <span class="hilite">@prefix dbr: <http://dbpedia.org/resource/> .</span> @prefix foaf: <http://xmlns.com/foaf/0.1/> . <span class="hilite">@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .</span> <span class="hilite">@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .</span> <span class="hilite">dbr:Albert_Einstein</span> foaf:name "Albert Einstein"; dbp:birthPlace dbr:German_Empire; dbp:dateOfBirth "1879-03-14"^^xsd:date; foaf:depiction <http://en.wikipedia.org/wiki/Image:Albert_Einstein_Head.jpg> . <span class="hilite">dbr:German_Empire</span> <span class="hilite">rdfs:label</span> "German Empire"@en; <span class="hilite">rdfs:label</span> "Deutsches Kaiserreich"@de .</pre></div> <p> When writing examples, you will often see the following IRI in the Turtle representation:</p> <div class="example"><div class="example-title"><span>Example 23</span></div><pre class="example"><></pre></div> <p> This indicates the 'current document', i.e., the document being processed. In the end there will always be a full IRI based on the document's location, but this abbreviation serves to make examples more compact. Note in particular that the whole technique of abbreviation is merely a way to make examples more compact, and the actual triples generated would always use the full IRIs.</p> </section> <section id="graphs"> <h3 aria-level="2" role="heading" id="h3_graphs"><span class="secno">3.7 </span>Graphs</h3> <p> A collection of triples is called a <em>graph</em>. All of the triples that are defined by this specification are contained in the <a class="tref" title="output-graph" href="#T-output-graph">output graph</a> by an RDFa Processor. For more information on graphs and other RDF concepts, see [<cite><a class="bibref" href="#bib-RDF-SYNTAX">RDF-SYNTAX</a></cite>]. </p> </section> <section id="compact-uri-expressions"> <h3 aria-level="2" role="heading" id="h3_compact-uri-expressions"><span class="secno">3.8 </span>Compact URI Expressions</h3> <p>In order to allow for the compact expression of RDF statements, RDFa allows the contraction of most <a class="tref" title="iri-reference" href="#T-iri-reference">IRI reference</a>s into a form called a 'compact URI expression', or <a class="datatype internalDFN" title="CURIE" href="#dfn-curie">CURIE</a>. A detailed discussion of this mechanism is in the section <a href="#s_curieprocessing">CURIE and IRI Processing</a>.</p> <p>Note that CURIEs are only used in the markup and Turtle examples, and will never appear in the generated <a class="tref" title="triple" href="#T-triple">triple</a>s, which are defined by RDF to use <a class="tref" title="iri-reference" href="#T-iri-reference">IRI reference</a>s.</p> </section> <section id="markup-fragments-and-rdfa"> <h3 aria-level="2" role="heading" id="h3_markup-fragments-and-rdfa"><span class="secno">3.9 </span>Markup Fragments and RDFa</h3> <p>A growing use of embedded metadata is to take fragments of markup and move them from one document to another. This may happen through the use of tools, such as drag-and-drop in a browser, or through snippets of code provided to authors for inclusion in their documents. A good example of the latter is the <a href="#ccLicense">licensing fragment provided by Creative Commons</a>.</p> <p>However, those involved in creating fragments (either by building tools, or authoring snippets), should be aware that this specification does not say how fragments are processed. Specifically, the processing of a fragment 'outside' of a complete document is undefined because RDFa processing is largely about context. Future versions of this or related specifications may do more to define this behavior.</p> <p>Developers of tools that process fragments, or authors of fragments for manual inclusion, should also bear in mind what will happen to their fragment once it is included in a complete document. They should carefully consider the amount of 'context' information that will be needed in order to ensure a correct interpretation of their fragment.</p> </section> <section id="a-description-of-rdfa-in-rdf-terms"> <h3 aria-level="2" role="heading" id="h3_a-description-of-rdfa-in-rdf-terms"><span class="secno">3.10 </span>A Description of RDFa in RDF Terms</h3> <p> The following is a brief description of RDFa in terms of the RDF terminology introduced here. It may be useful to readers with an RDF background: </p> <p>An <dfn title="rdf-graph" id="T-rdf-graph">RDF graph</dfn> comprises <dfn title="node" id="T-node">node</dfn>s linked by relationships. The aim of RDFa is to allow a single <a class="tref" title="rdf-graph" href="#T-rdf-graph">RDF graph</a> to be carried in various types of document markup. The basic unit of an <a class="tref" title="rdf-graph" href="#T-rdf-graph">RDF graph</a> is a <a class="tref" title="triple" href="#T-triple">triple</a>, in which a subject <a class="tref" title="node" href="#T-node">node</a> is linked to an object <a class="tref" title="node" href="#T-node">node</a> via a <a class="tref" title="predicate" href="#T-predicate">predicate</a>. The <dfn title="subject" id="T-subject">subject</dfn> <a class="tref" title="node" href="#T-node">node</a> is always either a <a class="tref" title="iri-reference" href="#T-iri-reference">IRI reference</a> or a <dfn title="bnode" id="T-bnode">blank node (or bnode)</dfn>, the <dfn title="predicate" id="T-predicate">predicate</dfn> is <em>always</em> a <a class="tref" title="iri-reference" href="#T-iri-reference">IRI reference</a>, and the object of a statement can be a <a class="tref" title="iri-reference" href="#T-iri-reference">IRI reference</a>, a <a class="tref" title="literal" href="#T-literal">literal</a>, or a <a class="tref" title="bnode" href="#T-bnode">bnode</a>.</p> <p>In RDFa, a subject <a class="tref" title="iri-reference" href="#T-iri-reference">IRI reference</a> is generally indicated using <a class="aref" href="#A-about" title="about">@about</a> and predicates are represented using one of <a class="aref" href="#A-property" title="property">@property</a>, <a class="aref" href="#A-rel" title="rel">@rel</a>, or <a class="aref" href="#A-rev" title="rev">@rev</a>. Objects which are <a class="tref" title="iri-reference" href="#T-iri-reference">IRI reference</a>s are represented using <a class="aref" href="#A-resource" title="resource">@resource</a>, <a class="aref" href="#A-src" title="src">@src</a>, or <a class="aref" href="#A-href" title="href">@href</a>, whilst objects that are <a class="tref" title="literal" href="#T-literal">literal</a>s are represented either with <a class="aref" href="#A-content" title="content">@content</a> or the content of the element in question (with an optional datatype expressed using <a class="aref" href="#A-datatype" title="datatype">@datatype</a>, and an optional language expressed using a Host Language-defined mechanism such as <span class="aref">@xml:lang</span>).</p> </section> </section> <section id="conformance" class="normative" typeof="bibo:Chapter" resource="#conformance" rel="bibo:chapter"><!--OddPage--><h2 aria-level="1" role="heading" id="h2_conformance"><span class="secno">4. </span>Conformance</h2> <p> 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. </p> <p> The key words <em class="rfc2119" title="MUST">MUST</em>, <em class="rfc2119" title="MUST NOT">MUST NOT</em>, <em class="rfc2119" title="REQUIRED">REQUIRED</em>, <em class="rfc2119" title="SHOULD">SHOULD</em>, <em class="rfc2119" title="SHOULD NOT">SHOULD NOT</em>, <em class="rfc2119" title="RECOMMENDED">RECOMMENDED</em>, <em class="rfc2119" title="MAY">MAY</em>, and <em class="rfc2119" title="OPTIONAL">OPTIONAL</em> in this specification are to be interpreted as described in [<cite><a class="bibref" href="#bib-RFC2119">RFC2119</a></cite>]. </p> <section id="processorconf" typeof="bibo:Chapter" resource="#processorconf" rel="bibo:chapter"> <h3 aria-level="2" role="heading" id="h3_processorconf"><span class="secno">4.1 </span>RDFa Processor Conformance</h3> <p> This specification uses the term <dfn title="output-graph" id="T-output-graph">output graph</dfn> to mean all of the triples asserted by a document according to the <a href="#s_model">Processing Model</a> section. A conforming RDFa Processor <em class="rfc2119" title="MUST">MUST</em> make available to a consuming application a single <a class="tref" title="rdf-graph" href="#T-rdf-graph">RDF graph</a> containing all possible triples generated by using the rules in the <a href="#s_model">Processing Model</a> section. The term <dfn title="processor-graph" id="T-processor-graph">processor graph</dfn> is used to denote the collection of all informational, warning, and error triples that <em class="rfc2119" title="MAY">MAY</em> be generated by the RDFa Processor to <a href="#processor-status">report its status</a>. The <a class="tref" title="output-graph" href="#T-output-graph">output graph</a> and the <a class="tref" title="processor-graph" href="#T-processor-graph">processor graph</a> are separate graphs and <em class="rfc2119" title="MUST NOT">MUST NOT</em> be stored in the same graph by the RDFa Processor. </p> <p>A conforming RDFa Processor <em class="rfc2119" title="MAY">MAY</em> make available additional triples that have been generated using rules not described here, but these triples <em class="rfc2119" title="MUST NOT">MUST NOT</em> be made available in the <a class="tref" title="output-graph" href="#T-output-graph">output graph</a>. (Whether these additional triples are made available in one or more additional <a class="tref" title="rdf-graph" href="#T-rdf-graph">RDF graph</a>s is implementation-specific, and therefore not defined here.)</p> <p>A conforming RDFa Processor <em class="rfc2119" title="MUST">MUST</em> preserve white space in both <a class="tref" title="plain-literal" href="#T-plain-literal">plain literal</a>s and <a class="tref" title="xml-literals" href="#T-xml-literals">XML literals</a>. However, it may be the case that the architecture in which a processor operates has made changes to the white space in a document before that document ever reaches the RDFa Processor (e.g., [<cite><a class="bibref" href="#bib-XMLSCHEMA11-1">XMLSCHEMA11-1</a></cite>] processors are permitted to 'normalize' white space in attribute values - see section 3.1.4). To ensure maximum consistency between processing environments, authors <em class="rfc2119" title="SHOULD">SHOULD</em> remove any unnecessary white space in their plain and XML Literal content.</p> <p>A conforming RDFa Processor <em class="rfc2119" title="MUST">MUST</em> examine the media type of a document it is processing to determine the document's Host Language. If the RDFa Processor is unable to determine the media type, or does not support the media type, the RDFa Processor <em class="rfc2119" title="MUST">MUST</em> process the document as if it were media type <code>application/xml</code>. See <a href="#xmlrdfaconformance">XML+RDFa Document Conformance</a>. A Host Language <em class="rfc2119" title="MAY">MAY</em> specify additional announcement mechanisms.</p> <div class="note"><div class="note-title" aria-level="3" role="heading" id="h_note_5"><span>Note</span></div><p class="">A conforming RDFa Processor <em class="rfc2119" title="MAY">MAY</em> use additional mechanisms (e.g., the DOCTYPE, a file extension, the root element, an overriding user-defined parameter) to attempt to determine the Host Language if the media type is unavailable. These mechanisms are unspecified.</p></div> </section> <section id="hostlangconf" typeof="bibo:Chapter" resource="#hostlangconf" rel="bibo:chapter"> <h3 aria-level="2" role="heading" id="h3_hostlangconf"><span class="secno">4.2 </span>RDFa Host Language Conformance</h3> <p>Host Languages that incorporate RDFa must adhere to the following:</p> <ul> <li>All of the facilities required in this specification <em class="rfc2119" title="MUST">MUST</em> be included in the Host Language.</li> <li>The required attributes defined in this specification <em class="rfc2119" title="MUST">MUST</em> be included in the content model of the Host Language. <div class="note"><div class="note-title" aria-level="3" role="heading" id="h_note_6"><span>Note</span></div><p class="">For the avoidance of doubt, there is no requirement that attributes such as <a class="aref" href="#A-href" title="href">@href</a> and <a class="aref" href="#A-src" title="src">@src</a> are used in a conforming Host Language. Nor is there any requirement that all required attributes are incorporated into the content model of all elements. The working group recommends that Host Language designers ensure that the required attributes are incorporated into the content model of elements that are commonly used throughout the content model of the Host Language.</p></div> </li> <li>If the Host Language uses XML Namespaces [<cite><a class="bibref" href="#bib-XML-NAMES">XML-NAMES</a></cite>], the attributes in this specification <em class="rfc2119" title="SHOULD">SHOULD</em> be defined in 'no namespace' (e.g., when the attributes are used on elements in the Host Language's namespace, they can be used with no qualifying prefix: <code><myml:myElement property="license"></code>). When a Host Language does not use the attributes in 'no namespace', they <em class="rfc2119" title="MUST">MUST</em> be referenced via the XHTML Namespace (<code>http://www.w3.org/1999/xhtml</code>).</li> <li>If the Host Language has its own definition for any attribute defined in this specification, that definition <em class="rfc2119" title="MUST">MUST</em> be such that the processing required by this specification remains possible when the attribute is used in a way consistent with the requirements herein.</li> <li>The Host Language <em class="rfc2119" title="MAY">MAY</em> specify an <a class="tref" title="initial-context" href="#T-initial-context">initial context</a> (e.g., IRI mappings and/or a definition of terms or a default vocabulary IRI). Such an <a class="tref" title="initial-context" href="#T-initial-context">initial context</a> <em class="rfc2119" title="SHOULD">SHOULD</em> be defined using the conventions defined in <a href="#s_initialcontexts">RDFa Initial Contexts</a>.</li> </ul> </section> <section id="xmlrdfaconformance" typeof="bibo:Chapter" resource="#xmlrdfaconformance" rel="bibo:chapter"> <h3 aria-level="2" role="heading" id="h3_xmlrdfaconformance"><span class="secno">4.3 </span>XML+RDFa Document Conformance</h3> <p>This specification does not define a stand-alone document type. The attributes herein are intended to be integrated into other host languages (e.g., HTML+RDFa or XHTML+RDFa). However, this specification <strong>does</strong> define processing rules for generic XML documents - that is, those documents delivered as media types <code>text/xml</code> or <code>application/xml</code>. Such documents must meet all of the following criteria:</p> <ol> <li>The document <em class="rfc2119" title="MUST">MUST</em> be well-formed as defined in [<cite><a class="bibref" href="#bib-XML10-4e">XML10-4e</a></cite>]. </li> <li>The document <em class="rfc2119" title="SHOULD">SHOULD</em> use the attributes defined in this specification in 'no namespace' (e.g., when the attributes are used on elements they are used with no qualifying prefix: <code><myml:myElement property="license"></code>). <div class="note"><div class="note-title" aria-level="3" role="heading" id="h_note_7"><span>Note</span></div><p class="">It is possible that an XML grammar will have native attributes that conflict with attributes in this specification. This could result in an RDFa processor generating unexpected triples.</p></div> </li> </ol> <p>When an RDFa Processor processes an XML+RDFa document, it does so via the following <a class="tref" title="initial-context" href="#T-initial-context">initial context</a>:</p> <ol> <li>There are default terms (e.g., <code>describedby</code>, <code>license</code>, and <code>role</code>), defined in <a href="https://www.w3.org/2011/rdfa-context/rdfa-1.1"><code>http://www.w3.org/2011/rdfa-context/rdfa-1.1</code></a>.</li> <li>There are default prefix mappings (e.g., <code>dc</code>), defined in <a href="https://www.w3.org/2011/rdfa-context/rdfa-1.1"><code>http://www.w3.org/2011/rdfa-context/rdfa-1.1</code></a>.</li> <li>There is no default vocabulary IRI.</li> <li>The <a class="tref" title="base" href="#T-base">base</a> can be set using the <span class="aref">@xml:base</span> attribute as defined in [<cite><a class="bibref" href="#bib-XML10-4e">XML10-4e</a></cite>].</li> <li>The <a class="tref" title="current-language" href="#T-current-language">current language</a> can be set using <span class="aref">@xml:lang</span> attribute. </li> </ol> </section> </section> <section class="normative" id="s_syntax" typeof="bibo:Chapter" resource="#s_syntax" rel="bibo:chapter"> <!--OddPage--><h2 aria-level="1" role="heading" id="h2_s_syntax"><span class="secno">5. </span>Attributes and Syntax</h2> <p>This specification defines a number of attributes and the way in which the values of those attributes are to be interpreted when generating RDF triples. This section defines the attributes and the syntax of their values.</p> <dl> <dt><dfn class="adef" title="about" id="A-about">about</dfn></dt> <dd>a <a class="datatype internalDFN" title="SafeCURIEorCURIEorIRI" href="#dfn-safecurieorcurieoriri">SafeCURIEorCURIEorIRI</a>, used for stating what the data is about (a 'subject' in RDF terminology);</dd> <dt><dfn class="adef" title="content" id="A-content">content</dfn> </dt> <dd>a <code>CDATA</code> string, for supplying machine-readable content for a literal (a 'literal object', in RDF terminology);</dd> <dt><dfn class="adef" title="datatype" id="A-datatype">datatype</dfn></dt> <dd>a <a class="datatype internalDFN" title="TERMorCURIEorAbsIRI" href="#dfn-termorcurieorabsiri">TERMorCURIEorAbsIRI</a> representing a datatype, to express the datatype of a literal;</dd> <dt><dfn class="adef" title="href" id="A-href">href</dfn> <small><strong>(optional)</strong></small></dt> <dd>a traditionally navigable <a class="externalDFN" title="IRI">IRI</a> for expressing the partner resource of a relationship (a 'resource object', in RDF terminology);</dd> <dt><dfn class="adef" title="inlist" id="A-inlist">inlist</dfn></dt> <dd>An attribute used to indicate that the object associated with a <code>rel</code> or <code>property</code> attribute on the same element is to be added to the list for that predicate. The value of this attribute <em class="rfc2119" title="MUST">MUST</em> be ignored. Presence of this attribute causes a list to be created if it does not already exist.</dd> <dt><dfn class="adef" title="prefix" id="A-prefix">prefix</dfn></dt> <dd>a white space separated list of prefix-name IRI pairs of the form <pre><a href="#P_prefix">NCName</a> ':' ' '+ xsd:anyURI</pre> </dd> <dt><dfn class="adef" title="property" id="A-property">property</dfn></dt> <dd>a white space separated list of <a class="datatype internalDFN" title="TERMorCURIEorAbsIRIs" href="#dfn-termorcurieorabsiris">TERMorCURIEorAbsIRIs</a>, used for expressing relationships between a subject and either a resource object if given or some literal text (also a 'predicate');</dd> <dt><dfn class="adef" title="rel" id="A-rel">rel</dfn></dt> <dd>a white space separated list of <a class="datatype internalDFN" title="TERMorCURIEorAbsIRIs" href="#dfn-termorcurieorabsiris">TERMorCURIEorAbsIRIs</a>, used for expressing relationships between two resources ('predicates' in RDF terminology);</dd> <dt><dfn class="adef" title="resource" id="A-resource">resource</dfn></dt> <dd>a <a class="datatype internalDFN" title="SafeCURIEorCURIEorIRI" href="#dfn-safecurieorcurieoriri">SafeCURIEorCURIEorIRI</a> for expressing the partner resource of a relationship that is not intended to be navigable (e.g., a 'clickable' link) (also an 'object');</dd> <dt><dfn class="adef" title="rev" id="A-rev">rev</dfn> </dt> <dd>a white space separated list of <a class="datatype internalDFN" title="TERMorCURIEorAbsIRIs" href="#dfn-termorcurieorabsiris">TERMorCURIEorAbsIRIs</a>, used for expressing reverse relationships between two resources (also 'predicates');</dd> <dt><dfn class="adef" title="src" id="A-src">src</dfn> <small><strong>(optional)</strong></small></dt> <dd>an <a class="externalDFN" title="IRI">IRI</a> for expressing the partner resource of a relationship when the resource is embedded (also a 'resource object');</dd> <dt><dfn class="adef" title="typeof" id="A-typeof">typeof</dfn></dt> <dd>a white space separated list of <a class="datatype internalDFN" title="TERMorCURIEorAbsIRIs" href="#dfn-termorcurieorabsiris">TERMorCURIEorAbsIRIs</a> that indicate the RDF type(s) to associate with a subject;</dd> <dt><dfn class="adef" title="vocab" id="A-vocab">vocab</dfn></dt> <dd>an <a class="externalDFN" title="IRI">IRI</a> that defines the mapping to use when a <a class="datatype internalDFN" title="TERM" href="#dfn-term">TERM</a> is referenced in an attribute value. See <a href="#s_terms">General Use of Terms in Attributes</a> and the <a href="#s_vocab_expansion">section on Vocabulary Expansion</a>.</dd> </dl> <div class="note"><div class="note-title" aria-level="2" role="heading" id="h_note_8"><span>Note</span></div><p class="">In all cases it is possible for these attributes to be used with no value (e.g., <a class="aref" href="#A-datatype" title="datatype">@datatype</a>="") or with a value that evaluates to no value after evaluation using the rules for <a href="#s_curieprocessing">CURIE and IRI Processing</a> (e.g., <a class="aref" href="#A-datatype" title="datatype">@datatype</a>="[noprefix:foobar]").</p></div> <section id="attribute_roles" typeof="bibo:Chapter" resource="#attribute_roles" rel="bibo:chapter"> <h3 aria-level="2" role="heading" id="h3_attribute_roles"><span class="secno">5.1 </span>Roles of attributes</h3> <p>The RDFa attributes play different roles in a semantically rich document. Briefly, those roles are:</p> <ul> <li>Syntax attributes: <a class="aref" href="#A-prefix" title="prefix">@prefix</a>, <a class="aref" href="#A-vocab" title="vocab">@vocab</a>.</li> <li>Subject attributes: <a class="aref" href="#A-about" title="about">@about</a>.</li> <li>Predicate attributes: <a class="aref" href="#A-property" title="property">@property</a>, <a class="aref" href="#A-rel" title="rel">@rel</a>, <a class="aref" href="#A-rev" title="rev">@rev</a>.</li> <li>Resource attributes: <a class="aref" href="#A-resource" title="resource">@resource</a>, <a class="aref" href="#A-href" title="href">@href</a>, <a class="aref" href="#A-src" title="src">@src</a>.</li> <li>Literal attributes: <a class="aref" href="#A-datatype" title="datatype">@datatype</a>, <a class="aref" href="#A-content" title="content">@content</a>, <a class="aref">@xml:lang</a> or <a class="aref">@lang</a>.</li> <li>Macro attributes: <a class="aref" href="#A-typeof" title="typeof">@typeof</a>, <a class="aref" href="#A-inlist" title="inlist">@inlist</a>.</li> </ul> </section> <section id="white_space" typeof="bibo:Chapter" resource="#white_space" rel="bibo:chapter"> <h3 aria-level="2" role="heading" id="h3_white_space"><span class="secno">5.2 </span>White space within attribute values</h3> <p>Many attributes accept a white space separated list of tokens. This specification defines white space as:</p> <pre><span id="P_whitespace">whitespace</span> ::= (#x20 | #x9 | #xD | #xA)+ </pre> <p rel="bibo:issue" typeof="bibo:Issue"><span resource="http://www.w3.org/2010/02/rdfa/meetings/2010-05-20#resolution_1" rel="bibo:affirmedBy">When attributes accept a white space separated list of tokens, an RDFa Processor <em class="rfc2119" title="MUST">MUST</em> ignore any leading or trailing white space.</span></p> <div class="note"><div class="note-title" aria-level="3" role="heading" id="h_note_9"><span>Note</span></div><p class="">This definition is consistent with the definition found in [<cite><a class="bibref" href="#bib-XML10">XML10</a></cite>].</p></div> </section> </section> <section class="normative" id="s_curies" typeof="bibo:Chapter" resource="#s_curies" rel="bibo:chapter"> <!--OddPage--><h2 aria-level="1" role="heading" id="h2_s_curies"><span class="secno">6. </span>CURIE Syntax Definition</h2> <div class="note"><div class="note-title" aria-level="2" role="heading" id="h_note_10"><span>Note</span></div><p class="">The working group is currently examining the productions for CURIE below in light of recent comments received from the RDF Working Group and members of the RDF Web Applications Working Group. It is possible that there will be minor changes to the production rules below in the near future, and that these changes will be backward <em>incompatible</em>. However, any such incompatibility will be limited to edge cases.</p></div> <p>The key component of RDF is the IRI, but these are usually long and unwieldy. RDFa therefore supports a mechanism by which IRIs can be abbreviated, called 'compact URI expressions' or simply, <dfn title="curie" id="T-curie">CURIEs</dfn>.</p> <p> When expanded, the resulting IRI <em class="rfc2119" title="MUST">MUST</em> be a syntactically valid IRI [<cite><a class="bibref" href="#bib-RFC3987">RFC3987</a></cite>]. For a more detailed explanation see <a href="#s_curieprocessing">CURIE and IRI Processing</a>. The <em>lexical space</em> of a CURIE is as defined in <a href="#P_curie">curie</a> below. The <em>value space</em> is the set of IRIs.</p> <p>A CURIE is comprised of two components, a <em><dfn title="prefix" id="T-prefix">prefix</dfn></em> and a <em><dfn title="reference" id="T-reference">reference</dfn></em>. The prefix is separated from the reference by a colon (<code>:</code>). In general use it is possible to omit the prefix, and so create a CURIE that makes use of the 'default prefix' mapping; in RDFa the 'default prefix' mapping is <code>http://www.w3.org/1999/xhtml/vocab#</code>. It's also possible to omit both the prefix <em>and</em> the colon, and so create a CURIE that contains just a reference which makes use of the 'no prefix' mapping. This specification does not define a 'no prefix' mapping. RDFa Host Languages <em class="rfc2119" title="MUST NOT">MUST NOT</em> define a 'no prefix' mapping. </p> <div class="note"><div class="note-title" aria-level="2" role="heading" id="h_note_11"><span>Note</span></div><p class=""> The RDFa 'default prefix' should not be confused with the 'default namespace' as defined in [<cite><a class="bibref" href="#bib-XML-NAMES">XML-NAMES</a></cite>]. An RDFa Processor <em class="rfc2119" title="MUST NOT">MUST NOT</em> treat an XML-NAMES 'default namespace' declaration as if it were setting the 'default prefix'. </p></div> <p> The general syntax of a CURIE can be summarized as follows: </p> <pre><span id="P_prefix">prefix</span> ::= <a href="https://www.w3.org/TR/2009/REC-xml-names-20091208/#NT-NCName">NCName</a> <span id="P_reference">reference</span> ::= ( ipath-absolute / ipath-rootless / ipath-empty ) [ "?" iquery ] [ "#" ifragment ] (as defined in [[!RFC3987]]) <span id="P_curie">curie ::= [ [ prefix ] ':' ] reference</span> <span id="P_safe_curie">safe_curie ::= '[' [ [ prefix ] ':' ] reference ']'</span> </pre> <div class="note"><div class="note-title" aria-level="2" role="heading" id="h_note_12"><span>Note</span></div><p class=""> The production <code>safe_curie</code> is not required, even in situations where an attribute value is permitted to be a CURIE or an IRI: An IRI that uses a scheme that is not an in-scope mapping <em>cannot</em> be confused with a CURIE. The concept of a safe_curie is retained for backward compatibility. </p></div> <div class="note"><div class="note-title" aria-level="2" role="heading" id="h_note_13"><span>Note</span></div><p class=""> It is possible to define a CURIE prefix mapping in such a way that it would overshadow a defined IRI scheme. For example, a document could map the prefix 'mailto' to 'http://www.example.com/addresses/'. Then a <a class="aref" href="#A-resource" title="resource">@resource</a> that contained 'mailto:user@example.com' might create a triple with the object 'http://www.example.com/addresses/user@example.com'. Moreover, it is possible though unlikely, that schemes will be introduced in the future that will conflict with prefix mappings defined in a document (e.g., the newly proposed 'widget' scheme [<cite><a class="bibref" href="#bib-WIDGETS-URI">WIDGETS-URI</a></cite>]). In neither case would this RDFa overshadowing of the underlying scheme alter the way other consumers of the IRI treat that IRI. It could, however, mean that the document author's intended use of the CURIE is mis-interpreted by another consumer as an IRI. The working group considers this risk to be minimal.</p></div> <p> In normal evaluation of CURIEs the following context information would need to be provided:</p> <ul> <li>a set of mappings from prefixes to IRIs;</li> <li>a mapping to use with the default prefix (for example, <code>:p</code>);</li> <li>a mapping to use when there is no prefix (for example, <code>p</code>);</li> <li>a mapping to use with the '_' prefix, which is used to generate unique identifiers (for example, <code>_:p</code>). </li> </ul> <p> In RDFa these values are defined as follows:</p> <ul> <li>the <strong>set of mappings from prefixes to IRIs</strong> is provided by the current in-scope prefix declarations of the <a class="tref" title="current-element" href="#T-current-element">current element</a> during parsing;</li> <li>the <strong>mapping to use with the default prefix</strong> is the current default prefix mapping;</li> <li>the <strong>mapping to use when there is no prefix</strong> is not defined;</li> <li>the <strong>mapping to use with the '_' prefix</strong>, is not explicitly stated, but since it is used to generate <a class="tref" title="bnode" href="#T-bnode">bnode</a>s, its implementation needs to be compatible with the RDF definition and rules in <a href="#s_blankNodes">Referencing Blank Nodes</a>. A document <em class="rfc2119" title="SHOULD NOT">SHOULD NOT</em> define a mapping for the '_' prefix. A Conforming RDFa Processor <em class="rfc2119" title="MUST">MUST</em> ignore any definition of a mapping for the '_' prefix.</li> </ul> <p>A CURIE is a representation of a full IRI. The rules for determining that IRI are:</p> <ul> <li>If a CURIE consists of an empty <code>prefix</code> and a <code>reference</code>, the IRI is obtained by taking the current default prefix mapping and concatenating it with the <code>reference</code>. If there is no current default prefix mapping, then this is not a valid CURIE and <em class="rfc2119" title="MUST">MUST</em> be ignored. </li> <li>Otherwise, if a CURIE consists of a non-empty <code>prefix</code> and a <code>reference</code>, and if there is an in-scope mapping for <code>prefix</code> (when compared case-insensitively), then the IRI is created by using that mapping, and concatenating it with the <code>reference</code>. </li> <li>Finally, if there is no in-scope mapping for <code>prefix</code>, then the value is not a CURIE. </li> </ul> <div class="note"><div class="note-title" aria-level="2" role="heading" id="h_note_14"><span>Note</span></div><p class="">See <a href="#s_terms">General Use of Terms in Attributes</a> for the way items with no colon can be interpreted in some datatypes by RDFa Processors.</p></div> <section class="informative" id="why-curies-and-not-qnames"> <h3 aria-level="2" role="heading" id="h3_why-curies-and-not-qnames"><span class="secno">6.1 </span>Why CURIEs and not QNames?</h3><p><em>This section is non-normative.</em></p> <p>In many cases, language designers have attempted to use QNames for an extension mechanism [<cite><a class="bibref" href="#bib-XMLSCHEMA11-2">XMLSCHEMA11-2</a></cite>]. QNames do permit independent management of the name collection, and <em>can</em> map the names to a resource. Unfortunately, QNames are unsuitable in most cases because 1) the use of QName as identifiers in attribute values and element content is problematic as discussed in [<cite><a class="bibref" href="#bib-QNAMES">QNAMES</a></cite>] and 2) the syntax of QNames is overly restrictive and does not allow all possible IRIs to be expressed.</p> <p>A specific example of the problem this causes comes from attempting to define the name collection for books. In a QName, the part after the colon must be a valid element name, making an example such as the following <em>invalid</em>: <code>isbn:0321154991</code></p> <p>This is not a valid QName simply because "0321154991" is not a valid element name. Yet, in the example given, we don't really want to define a valid element name anyway. The whole reason for using a QName was to reference an item in a private scope - that of ISBNs. Moreover, in this example, we want the names within that scope to map to an IRI that will reveal the meaning of that ISBN. As you can see, the definition of QNames and this (relatively common) use case are in conflict with one another.</p> <p>This specification addresses the problem by defining CURIEs. Syntactically, CURIEs are a superset of QNames.</p> <p>Note that this specification is targeted at language designers, not document authors. Any language designer considering the use of QNames as a way to represent IRIs or unique tokens should consider instead using CURIEs:</p> <ul> <li>CURIEs are designed from the ground up to be used in attribute values. QNames are designed for unambiguously naming elements and attributes.</li> <li>CURIEs expand to IRIs, and any IRI can be represented by such an expansion. QNames are treated as value pairs, but even if those pairs are combined into a string, only a subset of IRIs can be represented.</li> <li>CURIEs can be used in non-XML grammars, and can even be used in XML languages that do not support XML Namespaces. QNames are limited to XML Namespace-aware XML Applications.</li> </ul> </section> </section> <section class="normative" id="s_model" typeof="bibo:Chapter" resource="#s_model" rel="bibo:chapter"> <!--OddPage--><h2 aria-level="1" role="heading" id="h2_s_model"><span class="secno">7. </span>Processing Model</h2> <p> This section looks at a generic set of processing rules for creating a set of triples that represent the structured data present in an RDFa document. Processing need not follow the DOM traversal technique outlined here, although the effect of following some other manner of processing must be the same as if the processing outlined here were followed. The processing model is explained using the idea of DOM traversal which makes it easier to describe (particularly in relation to the <a class="tref" title="evaluation-context" href="#T-evaluation-context">evaluation context</a>). </p> <div class="explanation">Note that in this section, explanations about the processing model or guidance to implementors are enclosed in sections like this.</div> <section id="overview"> <h3 aria-level="2" role="heading" id="h3_overview"><span class="secno">7.1 </span>Overview</h3> <p> Evaluating a document for RDFa triples is carried out by starting at the document object, and then visiting each of its child elements in turn, in document order, applying processing rules. Processing is recursive in that for each child element the processor also visits each of <em>its</em> child elements, and applies the same processing rules. </p> <div class="note"><div class="note-title" aria-level="3" role="heading" id="h_note_15"><span>Note</span></div><p class=""> In some environments there will be little difference between starting at the root element of the document, and starting at the document object itself. It is defined this way because in some environments important information is present at the document object level which is not present on the root element. </p></div> <p> As processing continues, rules are applied which may generate triples, and may also change the <a class="tref" title="evaluation-context" href="#T-evaluation-context">evaluation context</a> information that will then be used when processing descendant elements. </p> <div class="note"><div class="note-title" aria-level="3" role="heading" id="h_note_16"><span>Note</span></div><p class=""> This specification does not say anything about what should happen to the triples generated, or whether more triples might be generated during processing than are outlined here. However, to be conforming, an RDFa Processor <em class="rfc2119" title="MUST">MUST</em> act as if at a minimum the rules in this section are applied, and a single <a class="tref" title="rdf-graph" href="#T-rdf-graph">RDF graph</a> produced. As described in the <a href="#processorconf">RDFa Processor Conformance</a> section, any additional triples generated <em class="rfc2119" title="MUST NOT">MUST NOT</em> appear in the <a class="tref" title="output-graph" href="#T-output-graph">output graph</a>. They <em class="rfc2119" title="MAY">MAY</em> be included in the <a class="tref" title="processor-graph" href="#T-processor-graph">processor graph</a>.</p></div> </section> <section id="evaluation-context"> <h3 aria-level="2" role="heading" id="h3_evaluation-context"><span class="secno">7.2 </span>Evaluation Context</h3> <p> During processing, each rule is applied using information provided by an <a class="tref" title="evaluation-context" href="#T-evaluation-context">evaluation context</a>. An <dfn title="initial-context" id="T-initial-context">initial context</dfn> is created when processing begins. That context has the following members:</p> <ul> <li> The <dfn title="base" id="T-base">base</dfn>. This will usually be the IRI of the document being processed, but it could be some other IRI, set by some other mechanism, such as the (X)HTML <code>base</code> element. The important thing is that it establishes an IRI against which relative paths can be resolved. </li> <li> The <dfn title="parent-subject" id="T-parent-subject">parent subject</dfn>. The initial value will be the same as the initial value of <a class="tref" title="base" href="#T-base">base</a>, but it will usually change during the course of processing. </li> <li> The <dfn title="parent-object" id="T-parent-object">parent object</dfn>. In some situations the object of a statement becomes the subject of any nested statements, and this member is used to convey this value. Note that this value may be a <a class="tref" title="bnode" href="#T-bnode">bnode</a>, since in some situations a number of nested statements are grouped together on one <a class="tref" title="bnode" href="#T-bnode">bnode</a>. This means that the <a class="tref" title="bnode" href="#T-bnode">bnode</a> must be set in the containing statement and passed down.</li> <li>A list of current, in-scope <dfn title="list-of-iri-mappings" id="T-list-of-iri-mappings">IRI mappings</dfn>.</li> <li>A list of <dfn title="incomplete-triple" id="T-incomplete-triple">incomplete triple</dfn>s. A triple can be incomplete when no object resource is provided alongside a predicate that requires a resource (i.e., <a class="aref" href="#A-rel" title="rel">@rel</a> or <a class="aref" href="#A-rev" title="rev">@rev</a>). The triples can be completed when a resource becomes available, which will be when the next subject is specified (part of the process called <a class="tref" title="chaining" href="#T-chaining">chaining</a>).</li> <li>A <dfn title="list-mapping" id="T-list-mapping">list mapping</dfn> that associates IRIs with lists.</li> <li>The <dfn title="language" id="T-language">language</dfn>. Note that there is no default language.</li> <li>The <dfn title="term-mappings" id="T-term-mappings">term mappings</dfn>, a list of terms and their associated IRIs. This specification does not define an initial list. Host Languages <em class="rfc2119" title="MAY">MAY</em> define an initial list.</li> <li>The <dfn title="default-vocabulary" id="T-default-vocabulary">default vocabulary</dfn>, a value to use as the prefix IRI when a <a class="tref" title="term" href="#T-term">term</a> unknown to the RDFa Processor is used. This specification does not define an initial setting for the default vocabulary. Host Languages <em class="rfc2119" title="MAY">MAY</em> define an initial setting.</li> </ul> <p>During the course of processing, new <a class="tref" title="evaluation-context" href="#T-evaluation-context">evaluation context</a>s are created which are passed to each child element. The initial rules described below will determine the values of the items in the context. Then the core rules will cause new triples to be created by combining information provided by an element with information from the <a class="tref" title="evaluation-context" href="#T-evaluation-context">evaluation context</a>.</p> <p>During the course of processing a number of locally scoped values are needed, as follows:</p> <ul> <li>An initially empty list of <a class="tref" title="iri-mapping" href="#T-iri-mapping">IRI mapping</a>s, called the <dfn title="local-list-of-iri-mappings" id="T-local-list-of-iri-mappings">local list of IRI mappings</dfn>.</li> <li>An initially empty <dfn title="list-of-incomplete-triples" id="T-list-of-incomplete-triples">list of incomplete triples</dfn>, called the <dfn title="local-list-of-incomplete-triples" id="T-local-list-of-incomplete-triples">local list of incomplete triples</dfn>.</li> <li>An initially empty <a class="tref" title="language" href="#T-language">language</a> value.</li> <!-- <li>A <tdef>recurse</tdef> flag. Processing generally continues recursively through the entire tree of elements available. However, if an author indicates that some branch of the tree should be treated as an XML literal, no further processing should take place on that branch, and setting this flag to <code>false</code> would have that effect. </li> --> <li> A <dfn title="skip-element" id="T-skip-element">skip element</dfn> flag, which indicates whether the <a class="tref" title="current-element" href="#T-current-element">current element</a> can safely be ignored since it has no relevant RDFa attributes. Note that descendant elements will still be processed. </li> <li> A <dfn title="new-subject" id="T-new-subject">new subject</dfn> value, which once calculated will set the <a class="tref" title="parent-subject" href="#T-parent-subject">parent subject</a> in an <a class="tref" title="evaluation-context" href="#T-evaluation-context">evaluation context</a>, as well as being used to complete any <a class="tref" title="incomplete-triple" href="#T-incomplete-triple">incomplete triple</a>s, as described in the next section. </li> <li> A value for the <dfn title="current-property-value" id="T-current-property-value">current property value</dfn>, the literal to use when creating triples that have a literal object, or IRI-s in the absence of <a class="aref" href="#A-rel" title="rel">@rel</a> or <a class="aref" href="#A-rev" title="rev">@rev</a>. </li> <li> A value for the <dfn title="current-object-resource" id="T-current-object-resource">current object resource</dfn>, the resource to use when creating triples that have a resource object. </li> <li> A value for the <dfn title="typed-resource" id="T-typed-resource">typed resource</dfn>, the source for creating <code>rdf:type</code> relationships to types specified in <a class="aref" href="#A-typeof" title="typeof">@typeof</a>. </li> <li> The <dfn title="local-term-mappings" id="T-local-term-mappings">local term mappings</dfn>, a list of terms and their associated IRIs.</li> <li> The <dfn title="local-list-mapping" id="T-local-list-mapping">local list mapping</dfn>, mapping IRIs to lists</li> <li> A <dfn title="local-default-vocabulary" id="T-local-default-vocabulary">local default vocabulary</dfn>, an IRI to use as a prefix mapping when a <a class="tref" title="term" href="#T-term">term</a> is used.</li> </ul> </section> <section id="s_chaining" typeof="bibo:Chapter" resource="#s_chaining" rel="bibo:chapter"> <h3 aria-level="2" role="heading" id="h3_s_chaining"><span class="secno">7.3 </span>Chaining</h3> <p>Statement <dfn title="chaining" id="T-chaining">chaining</dfn> is an RDFa feature that allows the author to link RDF statements together while avoiding unnecessary repetitive markup. For example, if an author were to add statements as children of an object that was a resource, these statements should be interpreted as being about that resource: </p> <div class="example"><div class="example-title"><span>Example 24</span></div><pre class="example"><div about="http://dbpedia.org/resource/Albert_Einstein"> <span property="foaf:name">Albert Einstein</span> <span property="dbp:dateOfBirth" datatype="xsd:date">1879-03-14</span> <div rel="dbp:birthPlace" <span class="hilite">resource="http://dbpedia.org/resource/German_Empire"</span>> <span class="hilite"><span property="dbp:conventionalLongName">the German Empire</span></span> </div> </div></pre></div> <p> In this example we can see that an object resource ('German_Empire'), has become the subject for nested statements. This markup also illustrates the basic chaining pattern of 'A has a B has a C' (i.e., Einstein has a birth place of the German Empire, which has a long name of 'the German Empire'). </p> <p>It's also possible for the subject of nested statements to provide the object for <em>containing</em> statements — essentially the reverse of the example we have just seen. To illustrate, we'll take an example of the type of chaining just described, and show how it could be marked up more efficiently. To start, we mark up the fact that Albert Einstein had, at some point in his life, a residence both in the German Empire and in Switzerland: </p> <div class="example"><div class="example-title"><span>Example 25</span></div><pre class="example"><div about="http://dbpedia.org/resource/Albert_Einstein"> <span class="hilite"><div rel="dbp-owl:residence" resource="http://dbpedia.org/resource/German_Empire"></div></span> <span class="hilite"><div rel="dbp-owl:residence" resource="http://dbpedia.org/resource/Switzerland"></div></span> </div></pre></div> <p>Now, we show the same information, but this time we create an <a class="tref" title="incomplete-triple" href="#T-incomplete-triple">incomplete triple</a> from the residence part, and then use any number of further subjects to 'complete' that triple, as follows:</p> <div class="example"><div class="example-title"><span>Example 26</span></div><pre class="example"><div about="http://dbpedia.org/resource/Albert_Einstein" rel="dbp-owl:residence"> <span class="hilite"><span about="http://dbpedia.org/resource/German_Empire"></span></span> <span class="hilite"><span about="http://dbpedia.org/resource/Switzerland"></span></span> </div></pre></div> <p> In this example, the <a class="tref" title="incomplete-triple" href="#T-incomplete-triple">incomplete triple</a> actually gets completed twice, once for the German Empire and once for Switzerland, giving exactly the same information as we had in the earlier example: </p> <div class="example"><div class="example-title"><span>Example 27</span></div><pre class="example"><http://dbpedia.org/resource/Albert_Einstein> dbp-owl:residence <http://dbpedia.org/resource/German_Empire> . <http://dbpedia.org/resource/Albert_Einstein> dbp-owl:residence <http://dbpedia.org/resource/Switzerland> .</pre></div> <p> Chaining can sometimes involve elements containing relatively minimal markup, for example showing only one resource, or only one predicate. Here the <code>img</code> element is used to carry a picture of Einstein: </p> <div class="example"><div class="example-title"><span>Example 28</span></div><pre class="example"><div about="http://dbpedia.org/resource/Albert_Einstein"> <div <span class="hilite">rel="foaf:depiction"</span>> <img src="http://en.wikipedia.org/wiki/Image:Albert_Einstein_Head.jpg" /> </div> </div></pre></div> <p> When such minimal markup is used, any of the resource-related attributes could act as a subject or an object in the chaining: </p> <div class="example"><div class="example-title"><span>Example 29</span></div><pre class="example"><div <span class="hilite">about="http://dbpedia.org/resource/Albert_Einstein"</span>> <div <span class="hilite">rel="dbp-owl:residence"</span>> <span <span class="hilite">about="http://dbpedia.org/resource/German_Empire"</span>></span> <span <span class="hilite">about="http://dbpedia.org/resource/Switzerland"</span>></span> </div> </div></pre></div> <p>Note that, as noted above, in many situations the <a class="aref" href="#A-property" title="property">@property</a> and <a class="aref" href="#A-rel" title="rel">@rel</a> are interchangeable. This is <em>not</em> true for chaining. Taking the first example, if that example was used as follows:</p> <div class="example"><div class="example-title"><span>Example 30</span></div><pre class="example"><div about="http://dbpedia.org/resource/Albert_Einstein"> <span property="foaf:name">Albert Einstein</span> <span property="dbp:dateOfBirth" datatype="xsd:date">1879-03-14</span> <div <span class="hilite">property="dbp:birthPlace"</span> resource="http://dbpedia.org/resource/German_Empire"> <span property="dbp:conventionalLongName">the German Empire</span> </div> </div></pre></div> <p>The subject for 'the German Empire' would remain Albert Einstein (and that would, of course, be an error). This is the main difference between <a class="aref" href="#A-property" title="property">@property</a> and <a class="aref" href="#A-rel" title="rel">@rel</a>: the latter induces chaining, whereas the former, usually, does not.</p> </section> <section id="s_curieprocessing" typeof="bibo:Chapter" resource="#s_curieprocessing" rel="bibo:chapter"> <h3 aria-level="2" role="heading" id="h3_s_curieprocessing"><span class="secno">7.4 </span>CURIE and IRI Processing</h3> <p> Since RDFa is ultimately a means for transporting RDF, a key concept is the <em>resource</em> and its manifestation as an IRI. RDF deals with complete IRIs (not relative paths); when converting RDFa to triples, any relative IRIs <em class="rfc2119" title="MUST">MUST</em> be resolved relative to the base IRI, using the algorithm defined in section 6.5 of RFC 3987 [<cite><a class="bibref" href="#bib-RFC3987">RFC3987</a></cite>], <em>Reference Resolution</em>. The values of <a href="#s_syntax">RDFa attributes</a> that refer to IRIs use three different datatypes: <a class="externalDFN" title="IRI">IRI</a>, <a class="datatype internalDFN" title="SafeCURIEorCURIEorIRI" href="#dfn-safecurieorcurieoriri">SafeCURIEorCURIEorIRI</a>, or <a class="datatype internalDFN" title="TERMorCURIEorAbsIRI" href="#dfn-termorcurieorabsiri">TERMorCURIEorAbsIRI</a>. All these attributes are mapped, after processing, to IRIs. The handling of these attributes is as follows:</p> <dl> <dt>IRI</dt> <dd>The content is an IRI, and is used as such.</dd> <dt>SafeCURIEorCURIEorIRI</dt> <dd> <ul> <li>When the value is surrounded by square brackets, then the content within the brackets is evaluated as a CURIE according to the <a href="#s_curies">CURIE Syntax Definition</a>. If it is not a valid CURIE, the value <em class="rfc2119" title="MUST">MUST</em> be ignored.</li> <li>Otherwise, the value is evaluated as a CURIE. If it is a valid CURIE, the resulting IRI is used; otherwise, the value is processed as an IRI. </li> </ul> <div class="note"><div class="note-title" aria-level="3" role="heading" id="h_note_17"><span>Note</span></div><p class="">A consequence of this is that when the value of an attribute of this datatype is the empty string (e.g., <a class="aref" href="#A-about" title="about">@about</a>=""), that value resolves to an IRI. An IRI of "" is a relative IRI that is interpreted as being the same as the <a class="tref" title="base" href="#T-base">base</a>. In other words, a value of "" will usually resolve to the IRI of the current document.</p></div> <div class="note"><div class="note-title" aria-level="3" role="heading" id="h_note_18"><span>Note</span></div><p class="">A related consequence of this is that when the value of an attribute of this datatype is an empty SafeCURIE (e.g., <a class="aref" href="#A-about" title="about">@about</a>="[]"), that value does not result in an IRI and therefore the value is ignored.</p></div> </dd> <dt>TERMorCURIEorAbsIRI</dt> <dd rel="bibo:issue" typeof="bibo:Issue"> <ul resource="http://www.w3.org/2010/02/rdfa/meetings/2010-07-01#resolution_3" rel="bibo:affirmedBy"> <li>If the value is a <a class="tref" title="term" href="#T-term">term</a> then it is evaluated as a term according to <a href="#s_terms">General Use of Terms in Attributes</a>. Note that this step may mean that the value is to be ignored.</li> <li>If the value is a valid CURIE, then the resulting IRI is used.</li> <li>If the value is an absolute IRI, that value is used.</li> <li>Otherwise, the value is ignored.</li> </ul> </dd> </dl> <p rel="bibo:issue" typeof="bibo:Issue"><span resource="http://www.w3.org/2010/02/rdfa/meetings/2010-05-20#resolution_2" rel="bibo:affirmedBy">Note that it is possible for all values in an attribute to be ignored. When that happens, the attribute <em class="rfc2119" title="MUST">MUST</em> be treated as if it were empty.</span></p> <p>For example, the full IRI for Albert Einstein on DBPedia is:</p> <div class="example"><div class="example-title"><span>Example 31</span></div><pre class="example">http://dbpedia.org/resource/Albert_Einstein</pre></div> <p>This can be shortened by authors to make the information easier to manage, using a CURIE. The first step is for the author to create a prefix mapping that links a prefix to some leading segment of the IRI. In RDFa these mappings are expressed using <a class="aref" href="#A-prefix" title="prefix">@prefix</a>:</p> <div class="example"><div class="example-title"><span>Example 32</span></div><pre class="example"><div <span class="hilite">prefix="db: http://dbpedia.org/"</span>> ... </div></pre></div> <p>Once the prefix has been established, an author can then use it to shorten an IRI as follows:</p> <div class="example"><div class="example-title"><span>Example 33</span></div><pre class="example"><div prefix="db: http://dbpedia.org/"> <div about="<span class="hilite">db:resource/Albert_Einstein</span>"> ... </div> </div></pre></div> <p> The author is free to split the IRI at any point. However, since a common use of CURIEs is to make available libraries of terms and values, the prefix will usually be mapped to some common segment that provides the most re-use, often provided by those who manage the library of terms. For example, since DBPedia contains an enormous list of resources, it is more efficient to create a prefix mapping that uses the base location of the resources:</p> <div class="example"><div class="example-title"><span>Example 34</span></div><pre class="example"><div <span class="hilite">prefix="dbr: http://dbpedia.org/resource/"</span>> <div about="<span class="hilite">dbr:Albert_Einstein</span>"> ... </div> <div about="<span class="hilite">dbr:Baruch_Spinoza</span>"> ... </div> </div></pre></div> <div class="explanation"> Note that it is generally considered a bad idea to use relative paths in prefix declarations. Since it is possible that an author may ignore this guidance, it is further possible that the IRI obtained from a CURIE is relative. However, since all IRIs must be resolved relative to <a class="tref" title="base" href="#T-base">base</a> before being used to create triples, the use of relative paths should not have any effect on processing. </div> <section id="scoping-of-prefix-mappings"> <h4 aria-level="3" role="heading" id="h4_scoping-of-prefix-mappings"><span class="secno">7.4.1 </span>Scoping of Prefix Mappings</h4> <p>CURIE prefix mappings are defined on the current element and its descendants. The inner-most mapping for a given prefix takes precedence. For example, the IRIs expressed by the following two CURIEs are different, despite the common prefix, because the prefix mappings are locally scoped: </p> <div class="example"><div class="example-title"><span>Example 35</span></div><pre class="example"><div <span class="hilite">prefix="dbr: http://dbpedia.org/resource/"</span>> <div about="<span class="hilite">dbr:Albert_Einstein</span>"> ... </div> </div> <div <span class="hilite">prefix="dbr: http://someotherdb.org/resource/"</span>> <div about="<span class="hilite">dbr:Albert_Einstein</span>"> ... </div> </div></pre></div> <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_19"><span>Note</span></div><p class="">In general it is a bad practice to redefine prefix mappings within a document. In particular, while it is permitted, mapping a prefix to different values at different places within a document could lead to confusion. The working group recommends that document authors use the same prefix to map to the same vocabulary throughout a document. Many vocabularies have recommended prefix names. The working group recommends that these names are used whenever possible.</p></div> </section> <section id="general-use-of-curies-in-attributes"> <h4 aria-level="3" role="heading" id="h4_general-use-of-curies-in-attributes"><span class="secno">7.4.2 </span>General Use of CURIEs in Attributes</h4> <p> There are a number of ways that attributes make use of CURIEs, and they need to be dealt with differently. These are: </p> <ol> <li>An attribute may allow one or more values that are a mixture of TERMs, CURIEs, and absolute IRIs.</li> <li>An attribute may allow one or more values that are a mixture of CURIEs and IRIs. In this case any value that is not a CURIE, as outlined in section <a href="#s_curies">CURIE Syntax Definition</a>, will be processed as an IRI.</li> <li>If the value <em>is</em> surrounded by square brackets, then the content within the brackets is always evaluated according to the rules in <a href="#s_curies">CURIE Syntax Definition</a> - and if that content is not a CURIE, then the content <em class="rfc2119" title="MUST">MUST</em> be ignored.</li> </ol> <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_20"><span>Note</span></div><p class="">An empty attribute value (e.g., <code>typeof=''</code>) is <em>still </em> a CURIE, and is processed as such. The rules for this processing are defined in <a href="#s_sequence">Sequence</a>. Specifically, however, an empty attribute value is <em>never</em> treated as a relative IRI by this specification.</p></div> <p>An example of an attribute that can contain a CURIEorIRI is <a class="aref" href="#A-about" title="about">@about</a>. To express an IRI directly, an author might do this:</p> <div class="example"><div class="example-title"><span>Example 36</span></div><pre class="example"><div <span class="hilite">about="http://dbpedia.org/resource/Albert_Einstein"</span>> ... </div></pre></div> <p>whilst to express the IRI above as a CURIE an author would do this:</p> <div class="example"><div class="example-title"><span>Example 37</span></div><pre class="example"><div <span class="hilite">about="dbr:Albert_Einstein"</span>> ... </div></pre></div> <p>The author could also use a safe CURIE, as follows:</p> <div class="example"><div class="example-title"><span>Example 38</span></div><pre class="example"><div <span class="hilite">about="[dbr:Albert_Einstein]"</span>> ... </div></pre></div> <p> Since non-CURIE values <em class="rfc2119" title="MUST">MUST</em> be ignored, the following value in <a class="aref" href="#A-about" title="about">@about</a> would <em>not</em> set a new subject, since <a class="aref" href="#A-about" title="about">@about</a> does not permit the use of <a class="datatype internalDFN" title="TERM" href="#dfn-term">TERM</a>s, and the CURIE has no prefix separator.</p> <div class="example"><div class="example-title"><span>Example 39</span></div><pre class="example"><div <span class="hilite">about="[Albert_Einstein]"</span>> ... </div></pre></div> <p>However, this markup <em>would</em> set a subject, since it is not a CURIE, but a valid relative IRI:</p> <div class="example"><div class="example-title"><span>Example 40</span></div><pre class="example"><div <span class="hilite">about="Albert_Einstein"</span>> ... </div></pre></div> <p> Note that several RDFa attributes are able to also take <a class="datatype internalDFN" title="term" href="#dfn-term">TERMS</a> as their value. This is discussed in the next section. </p> </section> <section id="s_terms" typeof="bibo:Chapter" resource="#s_terms" rel="bibo:chapter"> <h4 aria-level="3" role="heading" id="h4_s_terms"><span class="secno">7.4.3 </span>General Use of Terms in Attributes</h4> <p>Some RDFa attributes have a datatype that permits a <dfn title="term" id="T-term">term</dfn> to be referenced. RDFa defines the syntax of a term as:</p> <pre><span id="P_term">term ::= <a href="https://www.w3.org/TR/2006/REC-xml-names-20060816/#NT-NCNameStartChar">NCNameStartChar</a> <a href="#P_termChar">termChar</a>*</span> <span id="P_termChar">termChar ::= ( <a href="https://www.w3.org/TR/2006/REC-xml-names-20060816/#NT-NCNameChar">NameChar</a> - ':' ) | '/'</span> </pre> <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_21"><span>Note</span></div><p class="">For the avoidance of doubt, this production means a 'term' in RDFa is an XML <a href="https://www.w3.org/TR/2006/REC-xml-names-20060816/#NT-NCName">NCName</a> that also permits slash as a non-leading character.</p></div> <p>When an RDFa attribute permits the use of a term, and the value being evaluated matches the production for term above, it is transformed to an IRI using the following logic:</p> <ul> <li>If there is a <a class="tref" title="local-default-vocabulary" href="#T-local-default-vocabulary">local default vocabulary</a> the IRI is obtained by concatenating that value and the <code>term</code>.</li> <li>Otherwise, check if the <code>term</code> matches an item in the list of <a class="tref" title="local-term-mappings" href="#T-local-term-mappings">local term mappings</a>. First compare against the list <em>case-sensitively</em>, and if there is no match then compare <em>case-insensitively</em>. If there is a match, use the associated IRI.</li> <li>Otherwise, the <code>term</code> has no associated IRI and <em class="rfc2119" title="MUST">MUST</em> be ignored.</li> </ul> <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_22"><span>Note</span></div><p class="">A <a class="tref" title="local-default-vocabulary" href="#T-local-default-vocabulary">local default vocabulary</a> can be defined by the Host Language as part of the <a class="tref" title="initial-context" href="#T-initial-context">initial context</a>, and can be overridden on the current element and its children using <a class="aref" href="#A-vocab" title="vocab">@vocab</a>.</p></div> </section> <section id="use-of-curies-in-specific-attributes"> <h4 aria-level="3" role="heading" id="h4_use-of-curies-in-specific-attributes"><span class="secno">7.4.4 </span>Use of CURIEs in Specific Attributes</h4> <p> The general rules discussed in the previous sections apply to the RDFa attributes in the following ways: </p> <ul> <li><a class="aref" href="#A-about" title="about">@about</a> and <a class="aref" href="#A-resource" title="resource">@resource</a> support the datatype <a class="datatype internalDFN" title="SafeCURIEorCURIEorIRI" href="#dfn-safecurieorcurieoriri">SafeCURIEorCURIEorIRI</a> - allowing a SafeCURIE, a CURIE, or an IRI.</li> <li><a class="aref" href="#A-href" title="href">@href</a> and <a class="aref" href="#A-src" title="src">@src</a> are as defined in the Host Language (e.g., XHTML), and support only an IRI.</li> <li><a class="aref" href="#A-vocab" title="vocab">@vocab</a> supports an IRI.</li> <li><a class="aref" href="#A-datatype" title="datatype">@datatype</a> supports the datatype <a class="datatype internalDFN" title="TERMorCURIEorAbsIRI" href="#dfn-termorcurieorabsiri">TERMorCURIEorAbsIRI</a> - allowing a single Term, CURIE, or Absolute IRI.</li> <li><a class="aref" href="#A-property" title="property">@property</a>, <a class="aref" href="#A-typeof" title="typeof">@typeof</a>, <a class="aref" href="#A-rel" title="rel">@rel</a>, and <a class="aref" href="#A-rev" title="rev">@rev</a> support the datatype <a class="datatype internalDFN" title="TERMorCURIEorAbsIRIs" href="#dfn-termorcurieorabsiris">TERMorCURIEorAbsIRIs</a> - allowing one or more Terms, CURIEs, or Absolute IRIs.</li> </ul> <p> Any value that matches a defined term <em class="rfc2119" title="MUST">MUST</em> be expanded into a reference to the corresponding IRI. For example in the following examples: </p> <div class="example"><div class="example-title"><span>Example 41</span></div><pre class="example"><link rel="<span class="hilite">license</span>" href="http://example.org/license.html" /> <link rel="<span class="hilite">xhv:license</span>" href="http://example.org/license.html" /></pre></div> <p>would each generate the following triple:</p> <div class="example"><div class="example-title"><span>Example 42</span></div><pre class="example"><> <http://www.w3.org/1999/xhtml/vocab#license> <http://example.org/license.html> .</pre></div> </section> <section id="s_blankNodes" typeof="bibo:Chapter" resource="#s_blankNodes" rel="bibo:chapter"> <h4 aria-level="3" role="heading" id="h4_s_blankNodes"><span class="secno">7.4.5 </span>Referencing Blank Nodes</h4> <p>In RDFa, it is possible to establish relationships using various types of resource references, including <a class="tref" title="bnode" href="#T-bnode">bnode</a>s. If a subject or object is defined using a CURIE, and that CURIE explicitly names a <a class="tref" title="bnode" href="#T-bnode">bnode</a>, then a Conforming Processor <em class="rfc2119" title="MUST">MUST</em> create the <a class="tref" title="bnode" href="#T-bnode">bnode</a> when it is encountered during parsing. The RDFa Processor <em class="rfc2119" title="MUST">MUST</em> also ensure that no <a class="tref" title="bnode" href="#T-bnode">bnode</a> created automatically (e.g., as a result of <a class="tref" title="chaining" href="#T-chaining">chaining</a>) has a name that collides with a <a class="tref" title="bnode" href="#T-bnode">bnode</a> that is defined by explicit reference in a CURIE.</p> <p>Consider the following example:</p> <div class="example"><div class="example-title"><span>Example 43</span></div><pre class="example"><link <span class="hilite">about="_:john"</span> rel="foaf:mbox" href="mailto:john@example.org" /> <link <span class="hilite">about="_:sue"</span> rel="foaf:mbox" href="mailto:sue@example.org" /> <link <span class="hilite">about="_:john"</span> rel="foaf:knows" resource="_:sue" /></pre></div> <p>In the above fragment, two <a class="tref" title="bnode" href="#T-bnode">bnodes</a> are explicitly created as the subject of triples. Those <a class="tref" title="bnode" href="#T-bnode">bnodes</a> are then referenced to demonstrate the relationship between the parties. After processing, the following triples will be generated:</p> <div class="example"><div class="example-title"><span>Example 44</span></div><pre class="example">_:john foaf:mbox <mailto:john@example.org> . _:sue foaf:mbox <mailto:sue@example.org> . _:john foaf:knows _:sue .</pre></div> <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_23"><span>Note</span></div><p class="" rel="bibo:issue" typeof="bibo:Issue"><span resource="http://www.w3.org/2010/02/rdfa/meetings/2010-10-21#resolution_3" rel="bibo:affirmedBy"> RDFa Processors use, internally, implementation-dependent identifiers for bnodes. When triples are <em>retrieved</em>, new bnode indentifiers are used, which usually bear no relation to the original identifiers. However, implementations do ensure that these generated bnode identifiers are consistent: each bnode will have its own identifier, all references to a particular bnode will use the same identifier, and different bnodes will have different identifiers. </span></p></div> <p>As a special case, <code>_:</code> is also a valid reference for <em>one</em> specific <a class="tref" title="bnode" href="#T-bnode">bnode</a>.</p> </section> </section> <section id="s_sequence" typeof="bibo:Chapter" resource="#s_sequence" rel="bibo:chapter"> <h3 aria-level="2" role="heading" id="h3_s_sequence"><span class="secno">7.5 </span>Sequence</h3> <p> Processing would normally begin after the document to be parsed has been completely loaded. However, there is no requirement for this to be the case, and it is certainly possible to use a stream-based approach, such as SAX [<cite><a class="bibref" href="#bib-SAX">SAX</a></cite>] to extract the RDFa information. However, if some approach other than the DOM traversal technique defined here is used, it is important to ensure that Host Language-specific processing rules are applied (e.g., XHTML+RDFa [<cite><a class="bibref" href="#bib-XHTML-RDFA">XHTML-RDFA</a></cite>] indicates the <code>base</code> element can be used, and <code>base</code> will affect the interpretation of IRIs in <code>meta</code> or <code>link</code> elements even if those elements are before the <code>base</code> element in the stream). </p> <div class="note"><div class="note-title" aria-level="3" role="heading" id="h_note_24"><span>Note</span></div><p class=""> In this section the term 'resource' is used to mean '<a class="externalDFN" title="IRI">IRI</a> or <a class="tref" title="bnode" href="#T-bnode">bnode</a>'. It is possible that this term will be replaced with some other, more formal term after consulting with other groups. Changing this term will in no way change this processing sequence. </p></div> <p id="PS-initial-context"> At the beginning of processing, an initial <dfn title="evaluation-context" id="T-evaluation-context">evaluation context</dfn> is created, as follows:</p> <ul> <li>the <a class="tref" title="base" href="#T-base">base</a> is set to the IRI of the document (or another value specified in a language specific manner such as the HTML <code>base</code> element); </li> <li>the <a class="tref" title="parent-subject" href="#T-parent-subject">parent subject</a> is set to the <a class="tref" title="base" href="#T-base">base</a> value;</li> <li>the <a class="tref" title="parent-object" href="#T-parent-object">parent object</a> is set to null;</li> <li>the <a class="tref" title="list-of-incomplete-triples" href="#T-list-of-incomplete-triples">list of incomplete triples</a> is empty;</li> <li>the <a class="tref" title="list-mapping" href="#T-list-mapping">list mapping</a> is empty;</li> <li>the <a class="tref" title="language" href="#T-language">language</a> is set to null.</li> <li rel="bibo:issue" typeof="bibo:Issue"><span resource="http://www.w3.org/2010/02/rdfa/meetings/2010-07-22#resolution_2" rel="bibo:affirmedBy"> the <a class="tref" title="list-of-iri-mappings" href="#T-list-of-iri-mappings">list of IRI mappings</a> is empty (or a list defined in the <a href="#s_initialcontexts">initial context</a> of the Host Language).</span></li> <li rel="bibo:issue" typeof="bibo:Issue"><span resource="http://www.w3.org/2010/02/rdfa/meetings/2010-07-22#resolution_2" rel="bibo:affirmedBy">the <a class="tref" title="term-mappings" href="#T-term-mappings">term mappings</a> is set to null (or a list defined in the <a href="#s_initialcontexts">initial context</a> of the Host Language).</span></li> <li rel="bibo:issue" typeof="bibo:Issue"><span resource="http://www.w3.org/2010/02/rdfa/meetings/2010-07-22#resolution_2" rel="bibo:affirmedBy">the <a class="tref" title="default-vocabulary" href="#T-default-vocabulary">default vocabulary</a> is set to null (or an IRI defined in the <a href="#s_initialcontexts">initial context</a> of the Host Language).</span></li> </ul> <p> Processing begins by applying the processing rules below to the document object, in the context of this initial <a class="tref" title="evaluation-context" href="#T-evaluation-context">evaluation context</a>. All elements in the tree are also processed according to the rules described below, depth-first, although the <a class="tref" title="evaluation-context" href="#T-evaluation-context">evaluation context</a> used for each set of rules will be based on previous rules that may have been applied.</p> <div class="note"><div class="note-title" aria-level="3" role="heading" id="h_note_25"><span>Note</span></div><p class="">This specification defines processing rules for optional attributes that may not be present in all Host Languages (e.g., <a class="aref" href="#A-href" title="href">@href</a>). If these attributes are not supported in the Host Language, then the corresponding processing rules are not relevant for that language.</p></div> <p> The processing rules are:</p> <ol> <li id="PS-initialization"> First, the local values are initialized, as follows: <ul> <!-- <li>the <tref>recurse</tref> flag is set to 'true';</li> --> <li>the <a class="tref" title="skip-element" href="#T-skip-element">skip element</a> flag is set to 'false';</li> <li><a class="tref" title="new-subject" href="#T-new-subject">new subject</a> is set to null;</li> <li><a class="tref" title="current-object-resource" href="#T-current-object-resource">current object resource</a> is set to null;</li> <li><a class="tref" title="typed-resource" href="#T-typed-resource">typed resource</a> is set to null;</li> <li>the <a class="tref" title="local-list-of-iri-mappings" href="#T-local-list-of-iri-mappings">local list of IRI mappings</a> is set to the list of IRI mappings from the <a class="tref" title="evaluation-context" href="#T-evaluation-context">evaluation context</a>;</li> <li>the <a class="tref" title="local-list-of-incomplete-triples" href="#T-local-list-of-incomplete-triples">local list of incomplete triples</a> is set to null;</li> <li>the <a class="tref" title="list-mapping" href="#T-list-mapping">list mapping</a> is set to (a reference of) the list mapping from the <a class="tref" title="evaluation-context" href="#T-evaluation-context">evaluation context</a>;</li> <li>the <a class="tref" title="current-language" href="#T-current-language">current language</a> value is set to the <a class="tref" title="language" href="#T-language">language</a> value from the <a class="tref" title="evaluation-context" href="#T-evaluation-context">evaluation context</a>.</li> <li>the <a class="tref" title="local-term-mappings" href="#T-local-term-mappings">local term mappings</a> is set to the <a class="tref" title="term-mappings" href="#T-term-mappings">term mappings</a> from the <a class="tref" title="evaluation-context" href="#T-evaluation-context">evaluation context</a>.</li> <li>the <a class="tref" title="local-default-vocabulary" href="#T-local-default-vocabulary">local default vocabulary</a> is set to the <a class="tref" title="default-vocabulary" href="#T-default-vocabulary">default vocabulary</a> from the <a class="tref" title="evaluation-context" href="#T-evaluation-context">evaluation context</a>.</li> </ul> <div class="explanation">Note that some of the local variables are temporary containers for values that will be passed to descendant elements via an <a class="tref" title="evaluation-context" href="#T-evaluation-context">evaluation context</a>. In some cases the containers will have the same name, so to make it clear which is being acted upon in the following steps, the local version of an item will generally be referred to as such. </div> <div class="explanation">Note that the <a class="tref" title="local-term-mappings" href="#T-local-term-mappings">local term mappings</a> is always reset to a global value, provided by the <a class="tref" title="initial-context" href="#T-initial-context">initial context</a>. Future versions of this specification may introduce a mechanism whereby the <a class="tref" title="local-term-mappings" href="#T-local-term-mappings">local term mappings</a> can be set dynamically, in which case the <a class="tref" title="local-term-mappings" href="#T-local-term-mappings">local term mappings</a> would inherit from the parent's values.</div> </li> <li id="PS-default-vocabulary"> Next the <dfn title="current-element" id="T-current-element">current element</dfn> is examined for any change to the <a class="tref" title="default-vocabulary" href="#T-default-vocabulary">default vocabulary</a> via <a class="aref" href="#A-vocab" title="vocab">@vocab</a>. If <a class="aref" href="#A-vocab" title="vocab">@vocab</a> is present and contains a value, the <a class="tref" title="local-default-vocabulary" href="#T-local-default-vocabulary">local default vocabulary</a> is updated according to the section on <a href="#s_curieprocessing">CURIE and IRI Processing</a>. If the value is empty, then the <a class="tref" title="local-default-vocabulary" href="#T-local-default-vocabulary">local default vocabulary</a> <em class="rfc2119" title="MUST">MUST</em> be reset to the Host Language defined default (if any). <div class="explanation"> The value of <a class="aref" href="#A-vocab" title="vocab">@vocab</a> is used to generate a triple as follows: <dl> <dt>subject</dt> <dd><a class="tref" title="base" href="#T-base">base</a></dd> <dt>predicate</dt> <dd><code>http://www.w3.org/ns/rdfa#usesVocabulary</code></dd> <dt>object</dt> <dd>value from <a class="aref" href="#A-vocab" title="vocab">@vocab</a></dd> </dl> </div> <div class="explanation"> A Host Language is not required to define a default vocabulary. In such a case, setting <a class="aref" href="#A-vocab" title="vocab">@vocab</a> to the empty value has the effect of setting the <a class="tref" title="local-default-vocabulary" href="#T-local-default-vocabulary">local default vocabulary</a> to null. </div> </li> <li id="PS-IRI-mappings">Next, the <a class="tref" title="current-element" href="#T-current-element">current element</a> is examined for <dfn title="iri-mapping" id="T-iri-mapping">IRI mapping</dfn>s and these are added to the <a class="tref" title="local-list-of-iri-mappings" href="#T-local-list-of-iri-mappings">local list of IRI mappings</a>. Note that an <a class="tref" title="iri-mapping" href="#T-iri-mapping">IRI mapping</a> will simply overwrite any current mapping in the list that has the same name; <div class="explanation" rel="bibo:issue" typeof="bibo:Issue"> Mappings are defined via <a class="aref" href="#A-prefix" title="prefix">@prefix</a>. <span resource="http://www.w3.org/2010/02/rdfa/meetings/2011-01-13#ISSUE__2d_62__3a____40_prefix_processing_order" rel="bibo:affirmedBy">Values in this attribute are evaluated from beginning to end (e.g., left to right in typical documents).</span> <span rel="bibo:affirmedBy" resource="http://www.w3.org/2010/02/rdfa/meetings/2011-02-14#resolution_3">For backward compatibility, RDFa Processors <em class="rfc2119" title="SHOULD">SHOULD</em> also permit the definition of mappings via <span class="aref">@xmlns</span>. In this case, the value to be mapped is set by the XML namespace prefix, and the value to map is the value of the attribute — an IRI. (Note that prefix mapping via <span class="aref">@xmlns</span> is deprecated, and may be removed in a future version of this specification.)</span> When <span class="aref">xmlns</span> is supported, such mappings <em class="rfc2119" title="MUST">MUST</em> be processed before processing any mappings from <a class="aref" href="#A-prefix" title="prefix">@prefix</a> on the same element. <span resource="http://www.w3.org/2010/02/rdfa/meetings/2010-05-13#resolution_1" rel="bibo:affirmedBy"> Regardless of how the mapping is declared, the value to be mapped <em class="rfc2119" title="MUST">MUST</em> be converted to lower case</span>, and the IRI is not processed in any way; in particular if it is a relative path it <em class="rfc2119" title="MUST NOT">MUST NOT</em> be resolved against the current <a class="tref" title="base" href="#T-base">base</a>. Authors <em class="rfc2119" title="SHOULD NOT">SHOULD NOT</em> use relative paths as the IRI. </div> </li> <li id="PS-language" rel="bibo:issue" typeof="bibo:Issue"><span resource="http://www.w3.org/2010/02/rdfa/meetings/2010-05-13#resolution_3" rel="bibo:affirmedBy"> The <a class="tref" title="current-element" href="#T-current-element">current element</a> is also parsed for any language information, and if present, <a class="tref" title="current-language" href="#T-current-language">current language</a> is set accordingly;</span> <div class="explanation"> Host Languages that incorporate RDFa <em class="rfc2119" title="MAY">MAY</em> provide a mechanism for specifying the natural language of an element and its contents (e.g., XML provides the general-purpose XML attribute <span class="aref">@xml:lang</span>). </div> </li> <li id="PS-new-subject"> If the <a class="tref" title="current-element" href="#T-current-element">current element</a> contains no <a class="aref" href="#A-rel" title="rel">@rel</a> or <a class="aref" href="#A-rev" title="rev">@rev</a> attribute, then the next step is to establish a value for <a class="tref" title="new-subject" href="#T-new-subject">new subject</a>. This step has two possible alternatives. <ol> <li rel="bibo:issue" typeof="bibo:Issue"><span resource="http://www.w3.org/2010/02/rdfa/meetings/2011-11-10#resolution_2" rel="bibo:affirmedBy"> If the <a class="tref" title="current-element" href="#T-current-element">current element</a> contains the <a class="aref" href="#A-property" title="property">@property</a> attribute, but does <em>not</em> contain either the <a class="aref" href="#A-content" title="content">@content</a> or <a class="aref" href="#A-datatype" title="datatype">@datatype</a> attributes, then</span> <div class="explanation"> <a class="tref" title="new-subject" href="#T-new-subject">new subject</a> is set to the resource obtained from the first match from the following rule: <ul> <li>by using the resource from <a class="aref" href="#A-about" title="about">@about</a>, if present, obtained according to the section on <a href="#s_curieprocessing">CURIE and IRI Processing</a>;</li> <li><em>otherwise</em>, if the element is the root element of the document, then act as if there is an empty <a class="aref" href="#A-about" title="about">@about</a> present, and process it according to the rule for <a class="aref" href="#A-about" title="about">@about</a>, above;</li> <li><em>otherwise</em>, if <a class="tref" title="parent-object" href="#T-parent-object">parent object</a> is present, <a class="tref" title="new-subject" href="#T-new-subject">new subject</a> is set to the value of <a class="tref" title="parent-object" href="#T-parent-object">parent object</a>.</li> </ul> <p>If <a class="aref" href="#A-typeof" title="typeof">@typeof</a> is present then <a class="tref" title="typed-resource" href="#T-typed-resource">typed resource</a> is set to the resource obtained from the first match from the following rules:</p> <ul> <li>by using the resource from <a class="aref" href="#A-about" title="about">@about</a>, if present, obtained according to the section on <a href="#s_curieprocessing">CURIE and IRI Processing</a>;</li> <li><em>otherwise</em>, if the element is the root element of the document, then act as if there is an empty <a class="aref" href="#A-about" title="about">@about</a> present and process it according to the previous rule;</li> <li><em>otherwise</em>, <ul> <li>by using the resource from <a class="aref" href="#A-resource" title="resource">@resource</a>, if present, obtained according to the section on <a href="#s_curieprocessing">CURIE and IRI Processing</a>;</li> <li><em>otherwise</em>, by using the <a class="externalDFN" title="IRI">IRI</a> from <a class="aref" href="#A-href" title="href">@href</a>, if present, obtained according to the section on <a href="#s_curieprocessing">CURIE and IRI Processing</a>;</li> <li><em>otherwise</em>, by using the IRI from <a class="aref" href="#A-src" title="src">@src</a>, if present, obtained according to the section on <a href="#s_curieprocessing">CURIE and IRI Processing</a>;</li> <li><em>otherwise</em>, the value of <a class="tref" title="typed-resource" href="#T-typed-resource">typed resource</a> is set to a newly created <a class="tref" title="bnode" href="#T-bnode">bnode</a>.</li> <li>The value of the <a class="tref" title="current-object-resource" href="#T-current-object-resource">current object resource</a> is then set to the value of <a class="tref" title="typed-resource" href="#T-typed-resource">typed resource</a>.</li> </ul> </li></ul> </div> </li> <li><em>otherwise</em>: <div class="explanation"> <ul> <li>If the element contains an <a class="aref" href="#A-about" title="about">@about</a>, <a class="aref" href="#A-href" title="href">@href</a>, <a class="aref" href="#A-src" title="src">@src</a>, or <a class="aref" href="#A-resource" title="resource">@resource</a> attribute, <a class="tref" title="new-subject" href="#T-new-subject">new subject</a> is set to the resource obtained as follows: <ul> <li>by using the resource from <a class="aref" href="#A-about" title="about">@about</a>, if present, obtained according to the section on <a href="#s_curieprocessing">CURIE and IRI Processing</a>;</li> <li><em>otherwise</em>, by using the resource from <a class="aref" href="#A-resource" title="resource">@resource</a>, if present, obtained according to the section on <a href="#s_curieprocessing">CURIE and IRI Processing</a>;</li> <li><em>otherwise</em>, by using the <a class="externalDFN" title="IRI">IRI</a> from <a class="aref" href="#A-href" title="href">@href</a>, if present, obtained according to the section on <a href="#s_curieprocessing">CURIE and IRI Processing</a>;</li> <li><em>otherwise</em>, by using the IRI from <a class="aref" href="#A-src" title="src">@src</a>, if present, obtained according to the section on <a href="#s_curieprocessing">CURIE and IRI Processing</a>.</li> </ul> </li> <li><em>otherwise</em>, if no resource is provided by a resource attribute, then the first match from the following rules will apply: <ul> <li>if the element is the root element of the document, then act as if there is an empty <a class="aref" href="#A-about" title="about">@about</a> present, and process it according to the rule for <a class="aref" href="#A-about" title="about">@about</a>, above;</li> <li><em>otherwise</em>, if <a class="aref" href="#A-typeof" title="typeof">@typeof</a> is present, then <a class="tref" title="new-subject" href="#T-new-subject">new subject</a> is set to be a newly created <a class="tref" title="bnode" href="#T-bnode">bnode</a>;</li> <li><em>otherwise</em>, if <a class="tref" title="parent-object" href="#T-parent-object">parent object</a> is present, <a class="tref" title="new-subject" href="#T-new-subject">new subject</a> is set to the value of <a class="tref" title="parent-object" href="#T-parent-object">parent object</a>. Additionally, if <a class="aref" href="#A-property" title="property">@property</a> is <em>not</em> present then the <a class="tref" title="skip-element" href="#T-skip-element">skip element</a> flag is set to 'true'.</li> </ul> </li> <li rel="bibo:issue" typeof="bibo:Issue"> <p resource="http://www.w3.org/2010/02/rdfa/meetings/2011-11-10#resolution_2" rel="bibo:affirmedBy">Finally, if <a class="aref" href="#A-typeof" title="typeof">@typeof</a> is present, set the <a class="tref" title="typed-resource" href="#T-typed-resource">typed resource</a> to the value of <a class="tref" title="new-subject" href="#T-new-subject">new subject</a>. </p></li> </ul> </div> </li> </ol> </li> <!-- step 6 --> <li id="PS-new-subject-and-object"> If the <a class="tref" title="current-element" href="#T-current-element">current element</a> <em>does</em> contain a <a class="aref" href="#A-rel" title="rel">@rel</a> or <a class="aref" href="#A-rev" title="rev">@rev</a> attribute, then the next step is to establish <em>both</em> a value for <a class="tref" title="new-subject" href="#T-new-subject">new subject</a> and a value for <a class="tref" title="current-object-resource" href="#T-current-object-resource">current object resource</a>: <div class="explanation"> <a class="tref" title="new-subject" href="#T-new-subject">new subject</a> is set to the resource obtained from the first match from the following rules: <ul> <li>by using the resource from <a class="aref" href="#A-about" title="about">@about</a>, if present, obtained according to the section on <a href="#s_curieprocessing">CURIE and IRI Processing</a>;</li> </ul> <p rel="bibo:issue" typeof="bibo:Issue"><span resource="http://www.w3.org/2010/02/rdfa/meetings/2011-11-10#resolution_2" rel="bibo:affirmedBy"> if the <a class="aref" href="#A-typeof" title="typeof">@typeof</a> attribute is present, set <a class="tref" title="typed-resource" href="#T-typed-resource">typed resource</a> to <a class="tref" title="new-subject" href="#T-new-subject">new subject</a>.</span></p> <p>If no resource is provided then the first match from the following rules will apply:</p> <ul> <li>if the element is the root element of the document then act as if there is an empty <a class="aref" href="#A-about" title="about">@about</a> present, and process it according to the rule for <a class="aref" href="#A-about" title="about">@about</a>, above;</li> <li><em>otherwise</em>, if <a class="tref" title="parent-object" href="#T-parent-object">parent object</a> is present, <a class="tref" title="new-subject" href="#T-new-subject">new subject</a> is set to that.</li> </ul> <p>Then the <a class="tref" title="current-object-resource" href="#T-current-object-resource">current object resource</a> is set to the resource obtained from the first match from the following rules:</p> <ul> <li>by using the resource from <a class="aref" href="#A-resource" title="resource">@resource</a>, if present, obtained according to the section on <a href="#s_curieprocessing">CURIE and IRI Processing</a>;</li> <li><em>otherwise</em>, by using the <a class="externalDFN" title="IRI">IRI</a> from <a class="aref" href="#A-href" title="href">@href</a>, if present, obtained according to the section on <a href="#s_curieprocessing">CURIE and IRI Processing</a>;</li> <li><em>otherwise</em>, by using the <a class="externalDFN" title="IRI">IRI</a> from <a class="aref" href="#A-src" title="src">@src</a>, if present, obtained according to the section on <a href="#s_curieprocessing">CURIE and IRI Processing</a>;</li> <li><em>otherwise</em>, if <a class="aref" href="#A-typeof" title="typeof">@typeof</a> is present and <a class="aref" href="#A-about" title="about">@about</a> is not, use a newly created <a class="tref" title="bnode" href="#T-bnode">bnode</a>.</li> </ul> <p rel="bibo:issue" typeof="bibo:Issue"><span resource="http://www.w3.org/2010/02/rdfa/meetings/2011-11-10#resolution_2" rel="bibo:affirmedBy"> If <a class="aref" href="#A-typeof" title="typeof">@typeof</a> is present and <a class="aref" href="#A-about" title="about">@about</a> is not, set <a class="tref" title="typed-resource" href="#T-typed-resource">typed resource</a> to <a class="tref" title="current-object-resource" href="#T-current-object-resource">current object resource</a>.</span></p> <p>Note that final value of the <a class="tref" title="current-object-resource" href="#T-current-object-resource">current object resource</a> will either be null (from initialization) or a full IRI or <a class="tref" title="bnode" href="#T-bnode">bnode</a>.</p> </div> </li> <!-- step 7 --> <li id="PS-subject-types" rel="bibo:issue" typeof="bibo:Issue"><span resource="http://www.w3.org/2010/02/rdfa/meetings/2011-11-10#resolution_2" rel="bibo:affirmedBy"> If in any of the previous steps a <a class="tref" title="typed-resource" href="#T-typed-resource">typed resource</a> was set to a non-null value, it is now used to provide a subject for type values;</span> <div class="explanation"> One or more 'types' for the <a class="tref" title="typed-resource" href="#T-typed-resource">typed resource</a> can be set by using <a class="aref" href="#A-typeof" title="typeof">@typeof</a>. If present, the attribute may contain one or more IRIs, obtained according to the section on <a href="#s_curieprocessing">CURIE and IRI Processing</a>, each of which is used to generate a triple as follows: <dl> <dt>subject</dt> <dd><a class="tref" title="typed-resource" href="#T-typed-resource">typed resource</a></dd> <dt>predicate</dt> <dd>http://www.w3.org/1999/02/22-rdf-syntax-ns#type</dd> <dt>object</dt> <dd>current full IRI of 'type' from <a class="tref" title="typed-resource" href="#T-typed-resource">typed resource</a></dd> </dl> </div> </li> <li id="PS-empty-list-mapping"> If in any of the previous steps a <a class="tref" title="new-subject" href="#T-new-subject">new subject</a> was set to a non-null value <em>different</em> from the <a class="tref" title="parent-object" href="#T-parent-object">parent object</a>; <div class="explanation"> The <a class="tref" title="list-mapping" href="#T-list-mapping">list mapping</a> taken from the <a class="tref" title="evaluation-context" href="#T-evaluation-context">evaluation context</a> is set to a new, empty mapping. </div> </li> <!-- step 9 --> <li id="PS-generate-triples"> If in any of the previous steps a <a class="tref" title="current-object-resource" href="#T-current-object-resource">current object resource</a> was set to a non-null value, it is now used to generate triples and add entries to the <a class="tref" title="local-list-mapping" href="#T-local-list-mapping">local list mapping</a>: <div class="explanation"> If the element contains <em>both</em> the <a class="aref" href="#A-inlist" title="inlist">@inlist</a> and the <a class="aref" href="#A-rel" title="rel">@rel</a> attributes the <a class="aref" href="#A-rel" title="rel">@rel</a> may contain one or more resources, obtained according to the section on <a href="#s_curieprocessing">CURIE and IRI Processing</a> each of which is used to add an entry to the <a class="tref" title="list-mapping" href="#T-list-mapping">list mapping</a> as follows: <ul> <li>if the <a class="tref" title="local-list-mapping" href="#T-local-list-mapping">local list mapping</a> does not contain a list associated with the IRI, instantiate a new list and add to local list mappings</li> <li>add the <a class="tref" title="current-object-resource" href="#T-current-object-resource">current object resource</a> to the list associated with the resource in the <a class="tref" title="local-list-mapping" href="#T-local-list-mapping">local list mapping</a></li> </ul> </div> <div class="explanation"> Predicates for the <a class="tref" title="current-object-resource" href="#T-current-object-resource">current object resource</a> can be set by using one or both of the <a class="aref" href="#A-rel" title="rel">@rel</a> and the <a class="aref" href="#A-rev" title="rev">@rev</a> attributes but, in case of the <a class="aref" href="#A-rel" title="rel">@rel</a> attribute, only if the <a class="aref" href="#A-inlist" title="inlist">@inlist</a> is <em>not</em> present: <ul> <li> If present, <a class="aref" href="#A-rel" title="rel">@rel</a> may contain one or more resources, obtained according to the section on <a href="#s_curieprocessing">CURIE and IRI Processing</a> each of which is used to generate a triple as follows: <dl> <dt>subject</dt> <dd><a class="tref" title="new-subject" href="#T-new-subject">new subject</a></dd> <dt>predicate</dt> <dd>full IRI</dd> <dt>object</dt> <dd><a class="tref" title="current-object-resource" href="#T-current-object-resource">current object resource</a></dd> </dl> </li> <li> If present, <a class="aref" href="#A-rev" title="rev">@rev</a> may contain one or more resources, obtained according to the section on <a href="#s_curieprocessing">CURIE and IRI Processing</a> each of which is used to generate a triple as follows: <dl> <dt>subject</dt> <dd><a class="tref" title="current-object-resource" href="#T-current-object-resource">current object resource</a></dd> <dt>predicate</dt> <dd>full IRI</dd> <dt>object</dt> <dd><a class="tref" title="new-subject" href="#T-new-subject">new subject</a></dd> </dl> </li> </ul> </div> </li> <!-- step 10 --> <li id="PS-incomplete-triples"> If however <a class="tref" title="current-object-resource" href="#T-current-object-resource">current object resource</a> was set to null, but there are predicates present, then they must be stored as <a class="tref" title="incomplete-triple" href="#T-incomplete-triple">incomplete triple</a>s, pending the discovery of a subject that can be used as the object. Also, <a class="tref" title="current-object-resource" href="#T-current-object-resource">current object resource</a> should be set to a newly created <a class="tref" title="bnode" href="#T-bnode">bnode</a> (so that the incomplete triples have a subject to connect to if they are ultimately turned into triples); <div class="explanation"> Predicates for <a class="tref" title="incomplete-triple" href="#T-incomplete-triple">incomplete triple</a>s can be set by using one or both of the <a class="aref" href="#A-rel" title="rel">@rel</a> and <a class="aref" href="#A-rev" title="rev">@rev</a> attributes: <ul> <li> If present, <a class="aref" href="#A-rel" title="rel">@rel</a> must contain one or more resources, obtained according to the section on <a href="#s_curieprocessing">CURIE and IRI Processing</a> each of which is added to the <a class="tref" title="local-list-of-incomplete-triples" href="#T-local-list-of-incomplete-triples">local list of incomplete triples</a> as follows: <ul> <li> If the element contains the <a class="aref" href="#A-inlist" title="inlist">@inlist</a> attribute, then <ul> <li>if the <a class="tref" title="local-list-mapping" href="#T-local-list-mapping">local list mapping</a> does not contain a list associated with the IRI, instantiate a new list and add to local list mappings. </li> <li>Add: <dl> <dt>list</dt> <dd>list from <a class="tref" title="local-list-mapping" href="#T-local-list-mapping">local list mapping</a> for this IRI</dd> <dt>direction</dt> <dd>none</dd> </dl> </li> </ul> </li> <li>Otherwise add: <ul> <li> <dl> <dt>predicate</dt> <dd>full IRI</dd> <dt>direction</dt> <dd>forward</dd> </dl> </li> </ul> </li> </ul> </li> <li> If present, <a class="aref" href="#A-rev" title="rev">@rev</a> must contain one or more resources, obtained according to the section on <a href="#s_curieprocessing">CURIE and IRI Processing</a>, each of which is added to the <a class="tref" title="local-list-of-incomplete-triples" href="#T-local-list-of-incomplete-triples">local list of incomplete triples</a> as follows: <dl> <dt>predicate</dt> <dd>full IRI</dd> <dt>direction</dt> <dd>reverse</dd> </dl> </li> </ul> </div> </li> <!-- step 11 --> <li id="PS-current-object-literal"> The next step of the iteration is to establish any <a class="tref" title="current-property-value" href="#T-current-property-value">current property value</a>; <div class="explanation"> Predicates for the <a class="tref" title="current-property-value" href="#T-current-property-value">current property value</a> can be set by using <a class="aref" href="#A-property" title="property">@property</a>. If present, one or more resources are obtained according to the section on <a href="#s_curieprocessing">CURIE and IRI Processing</a>, and then the actual literal value is obtained as follows: <ul> <li> as a <a class="tref" title="typed-literal" href="#T-typed-literal">typed literal</a> if <a class="aref" href="#A-datatype" title="datatype">@datatype</a> is present, does not have an empty value according to the section on <a href="#s_curieprocessing">CURIE and IRI Processing</a>, and is not set to <code>XMLLiteral</code> in the vocabulary <code>http://www.w3.org/1999/02/22-rdf-syntax-ns#</code>. <p>The actual literal is either the value of <a class="aref" href="#A-content" title="content">@content</a> (if present) <em>or</em> a string created by concatenating the value of all descendant text nodes, of the <a class="tref" title="current-element" href="#T-current-element">current element</a> in turn. The final string includes the datatype IRI, as described in [<cite><a class="bibref" href="#bib-RDF-SYNTAX">RDF-SYNTAX</a></cite>], which will have been obtained according to the section on <a href="#s_curieprocessing">CURIE and IRI Processing</a>.</p> </li> <li> <em>otherwise</em>, as a <a class="tref" title="plain-literal" href="#T-plain-literal">plain literal</a> if <a class="aref" href="#A-datatype" title="datatype">@datatype</a> is present but has an empty value according to the section on <a href="#s_curieprocessing">CURIE and IRI Processing</a>. <p>The actual literal is either the value of <a class="aref" href="#A-content" title="content">@content</a> (if present) <em>or</em> a string created by concatenating the value of all descendant text nodes, of the <a class="tref" title="current-element" href="#T-current-element">current element</a> in turn.</p> </li> <li rel="bibo:issue" typeof="bibo:Issue"><span resource="http://www.w3.org/2010/02/rdfa/meetings/2010-06-17#resolution_2" rel="bibo:affirmedBy"> <em>otherwise</em>, as an <a class="tref" title="xml-literals" href="#T-xml-literals">XML literal</a> if <a class="aref" href="#A-datatype" title="datatype">@datatype</a> is present and is set to <code>XMLLiteral</code> in the vocabulary <code>http://www.w3.org/1999/02/22-rdf-syntax-ns#</code>.</span> <p>The value of the <a class="tref" title="xml-literals" href="#T-xml-literals">XML literal</a> is a string created by serializing to text, all nodes that are descendants of the <a class="tref" title="current-element" href="#T-current-element">current element</a>, i.e., not including the element itself, and giving it a datatype of <code>XMLLiteral</code> in the vocabulary <code>http://www.w3.org/1999/02/22-rdf-syntax-ns#</code>. The format of the resulting serialized content is as defined in Exclusive XML Canonicalization Version 1.0 [<cite><a class="bibref" href="#bib-XML-EXC-C14N">XML-EXC-C14N</a></cite>].</p> <div class="note"><div class="note-title" aria-level="3" role="heading" id="h_note_26"><span>Note</span></div><p class="" rel="bibo:issue" typeof="bibo:Issue"><span resource="http://www.w3.org/2010/02/rdfa/meetings/2011-01-13#ISSUE__2d_60__3a__XMLLiteral_context_preservation" rel="bibo:affirmedBy"> In order to maintain maximum portability of this literal, any children of the current node that are elements <em class="rfc2119" title="MUST">MUST</em> have the current XML namespace declarations (if any) declared on the serialized element. Since the child element node could also declare new XML namespaces, the RDFa Processor <em class="rfc2119" title="MUST">MUST</em> be careful to merge these together when generating the serialized element definition. For avoidance of doubt, any re-declarations on the child node <em class="rfc2119" title="MUST">MUST</em> take precedence over declarations that were active on the current node. </span></p></div> </li> <li rel="bibo:issue" typeof="bibo:Issue"><span resource="http://www.w3.org/2010/02/rdfa/meetings/2011-11-10#resolution_2" rel="bibo:affirmedBy"> <em>otherwise</em>, as a <a class="tref" title="plain-literal" href="#T-plain-literal">plain literal</a> using the value of <a class="aref" href="#A-content" title="content">@content</a> if <a class="aref" href="#A-content" title="content">@content</a> is present.</span></li> <li rel="bibo:issue" typeof="bibo:Issue"><span resource="http://www.w3.org/2010/02/rdfa/meetings/2011-11-10#resolution_2" rel="bibo:affirmedBy"> <em>otherwise</em>, if the <a class="aref" href="#A-rel" title="rel">@rel</a>, <a class="aref" href="#A-rev" title="rev">@rev</a>, and <a class="aref" href="#A-content" title="content">@content</a> attributes are <em>not</em> present, as a resource obtained from one of the following:</span> <ul> <li>by using the resource from <a class="aref" href="#A-resource" title="resource">@resource</a>, if present, obtained according to the section on <a href="#s_curieprocessing">CURIE and IRI Processing</a>;</li> <li><em>otherwise</em>, by using the <a class="externalDFN" title="IRI">IRI</a> from <a class="aref" href="#A-href" title="href">@href</a>, if present, obtained according to the section on <a href="#s_curieprocessing">CURIE and IRI Processing</a>;</li> <li><em>otherwise</em>, by using the <a class="externalDFN" title="IRI">IRI</a> from <a class="aref" href="#A-src" title="src">@src</a>, if present, obtained according to the section on <a href="#s_curieprocessing">CURIE and IRI Processing</a>.</li> </ul> </li> <li rel="bibo:issue" typeof="bibo:Issue"><span resource="http://www.w3.org/2010/02/rdfa/meetings/2011-11-10#resolution_2" rel="bibo:affirmedBy"> <em>otherwise</em>, if <a class="aref" href="#A-typeof" title="typeof">@typeof</a> is present and <a class="aref" href="#A-about" title="about">@about</a> is not, the value of <a class="tref" title="typed-resource" href="#T-typed-resource">typed resource</a>. </span></li> <li rel="bibo:issue" typeof="bibo:Issue"><span resource="http://www.w3.org/2010/02/rdfa/meetings/2010-05-13#resolution_2" rel="bibo:affirmedBy"> <em>otherwise</em> as a <a class="tref" title="plain-literal" href="#T-plain-literal">plain literal</a>.</span> </li> </ul> <p>Additionally, if there is a value for <dfn title="current-language" id="T-current-language">current language</dfn> then the value of the <a class="tref" title="plain-literal" href="#T-plain-literal">plain literal</a> should include this language information, as described in [<cite><a class="bibref" href="#bib-RDF-SYNTAX">RDF-SYNTAX</a></cite>]. The actual literal is either the value of <a class="aref" href="#A-content" title="content">@content</a> (if present) <em>or</em> a string created by concatenating the text content of each of the descendant elements of the <a class="tref" title="current-element" href="#T-current-element">current element</a> in document order.</p> <p>The <a class="tref" title="current-property-value" href="#T-current-property-value">current property value</a> is then used with each predicate as follows:</p> <ul> <li>If the element also includes the <a class="aref" href="#A-inlist" title="inlist">@inlist</a> attribute, the <a class="tref" title="current-property-value" href="#T-current-property-value">current property value</a> is added to the <a class="tref" title="local-list-mapping" href="#T-local-list-mapping">local list mapping</a> as follows: <ul> <li>if the <a class="tref" title="local-list-mapping" href="#T-local-list-mapping">local list mapping</a> does not contain a list associated with the predicate IRI, instantiate a new list and add to local list mappings</li> <li>add the <a class="tref" title="current-property-value" href="#T-current-property-value">current property value</a> to the list associated with the predicate IRI in the <a class="tref" title="local-list-mapping" href="#T-local-list-mapping">local list mapping</a></li> </ul> </li> <li>Otherwise the <a class="tref" title="current-property-value" href="#T-current-property-value">current property value</a> is used to generate a triple as follows: <dl> <dt>subject</dt> <dd><a class="tref" title="new-subject" href="#T-new-subject">new subject</a></dd> <dt>predicate</dt> <dd>full IRI</dd> <dt>object</dt> <dd><a class="tref" title="current-property-value" href="#T-current-property-value">current property value</a></dd> </dl> </li> </ul> </div> <!-- <p>Once the triple has been created, if the <tdef>datatype</tdef> of the <tref>current property value</tref> is <code>rdf:XMLLiteral</code>, then the <tref>recurse</tref> flag is set to <code>false</code>.</p> --> </li> <!-- step 12 --> <li id="PS-complete-triples"> If the <a class="tref" title="skip-element" href="#T-skip-element">skip element</a> flag is 'false', <em>and</em> <a class="tref" title="new-subject" href="#T-new-subject">new subject</a> was set to a non-null value, then any <a class="tref" title="incomplete-triple" href="#T-incomplete-triple">incomplete triple</a>s <em>within the current context</em> should be completed: <div class="explanation"> The <a class="tref" title="list-of-incomplete-triples" href="#T-list-of-incomplete-triples">list of incomplete triples</a> from the current <a class="tref" title="evaluation-context" href="#T-evaluation-context">evaluation context</a> (<em>not</em> the <a class="tref" title="local-list-of-incomplete-triples" href="#T-local-list-of-incomplete-triples">local list of incomplete triples</a>) will contain zero or more predicate IRIs. This list is iterated over and each of the predicates is used with <a class="tref" title="parent-subject" href="#T-parent-subject">parent subject</a> and <a class="tref" title="new-subject" href="#T-new-subject">new subject</a> to generate a triple or add a new element to the <a class="tref" title="local-list-mapping" href="#T-local-list-mapping">local list mapping</a>. Note that at each level there are <em>two</em> lists of <a class="tref" title="incomplete-triple" href="#T-incomplete-triple">incomplete triple</a>s; one for the current processing level (which is passed to each child element in the previous step), and one that was received as part of the <a class="tref" title="evaluation-context" href="#T-evaluation-context">evaluation context</a>. It is the latter that is used in processing during this step. </div> <div class="explanation"> Note that each <a class="tref" title="incomplete-triple" href="#T-incomplete-triple">incomplete triple</a> has a <dfn title="direction" id="T-direction">direction</dfn> value that is used to determine what will become the subject, and what will become the object, of each generated triple: <ul> <li>If <a class="tref" title="direction" href="#T-direction">direction</a> is 'none', the <a class="tref" title="new-subject" href="#T-new-subject">new subject</a> is added to the list from the iterated <a class="tref" title="incomplete-triple" href="#T-incomplete-triple">incomplete triple</a>. </li> <li> If <a class="tref" title="direction" href="#T-direction">direction</a> is 'forward' then the following triple is generated: <dl> <dt>subject</dt> <dd><a class="tref" title="parent-subject" href="#T-parent-subject">parent subject</a></dd> <dt>predicate</dt> <dd>the predicate from the iterated <a class="tref" title="incomplete-triple" href="#T-incomplete-triple">incomplete triple</a></dd> <dt>object</dt> <dd><a class="tref" title="new-subject" href="#T-new-subject">new subject</a></dd> </dl> </li> <li> If <a class="tref" title="direction" href="#T-direction">direction</a> is 'reverse' then this is the triple generated: <dl> <dt>subject</dt> <dd><a class="tref" title="new-subject" href="#T-new-subject">new subject</a></dd> <dt>predicate</dt> <dd>the predicate from the iterated <a class="tref" title="incomplete-triple" href="#T-incomplete-triple">incomplete triple</a></dd> <dt>object</dt> <dd><a class="tref" title="parent-subject" href="#T-parent-subject">parent subject</a></dd> </dl> </li> </ul> </div> </li> <!-- step 13 --> <li id="PS-recurse"> Next, all elements that are children of the <a class="tref" title="current-element" href="#T-current-element">current element</a> are processed using the rules described here, using a new <a class="tref" title="evaluation-context" href="#T-evaluation-context">evaluation context</a>, initialized as follows: <div class="explanation"> <ul> <li> If the <a class="tref" title="skip-element" href="#T-skip-element">skip element</a> flag is 'true' then the new <a class="tref" title="evaluation-context" href="#T-evaluation-context">evaluation context</a> is a copy of the current context that was passed in to this level of processing, with the <a class="tref" title="language" href="#T-language">language</a> and <a class="tref" title="list-of-iri-mappings" href="#T-list-of-iri-mappings">list of IRI mappings</a> values replaced with the local values; </li> <li> Otherwise, the values are: <ul> <li>the <a class="tref" title="base" href="#T-base">base</a> is set to the <a class="tref" title="base" href="#T-base">base</a> value of the current <a class="tref" title="evaluation-context" href="#T-evaluation-context">evaluation context</a>;</li> <li>the <a class="tref" title="parent-subject" href="#T-parent-subject">parent subject</a> is set to the value of <a class="tref" title="new-subject" href="#T-new-subject">new subject</a>, if non-null, <em>or</em> the value of the <a class="tref" title="parent-subject" href="#T-parent-subject">parent subject</a> of the current <a class="tref" title="evaluation-context" href="#T-evaluation-context">evaluation context</a>;</li> <li>the <a class="tref" title="parent-object" href="#T-parent-object">parent object</a> is set to value of <a class="tref" title="current-object-resource" href="#T-current-object-resource">current object resource</a>, if non-null, <em>or</em> the value of <a class="tref" title="new-subject" href="#T-new-subject">new subject</a>, if non-null, <em>or</em> the value of the <a class="tref" title="parent-subject" href="#T-parent-subject">parent subject</a> of the current <a class="tref" title="evaluation-context" href="#T-evaluation-context">evaluation context</a>;</li> <li>the <a class="tref" title="list-of-iri-mappings" href="#T-list-of-iri-mappings">list of IRI mappings</a> is set to the <a class="tref" title="local-list-of-iri-mappings" href="#T-local-list-of-iri-mappings">local list of IRI mappings</a>;</li> <li>the <a class="tref" title="list-of-incomplete-triples" href="#T-list-of-incomplete-triples">list of incomplete triples</a> is set to the <a class="tref" title="local-list-of-incomplete-triples" href="#T-local-list-of-incomplete-triples">local list of incomplete triples</a>;</li> <li>the <a class="tref" title="list-mapping" href="#T-list-mapping">list mapping</a> is set to the <a class="tref" title="local-list-mapping" href="#T-local-list-mapping">local list mapping</a>;</li> <li><a class="tref" title="language" href="#T-language">language</a> is set to the value of <a class="tref" title="current-language" href="#T-current-language">current language</a>.</li> <!-- <li>the <tref>term mappings</tref> is set to the value of the <tref>local term mappings</tref>.</li> --> <li>the <a class="tref" title="default-vocabulary" href="#T-default-vocabulary">default vocabulary</a> is set to the value of the <a class="tref" title="local-default-vocabulary" href="#T-local-default-vocabulary">local default vocabulary</a>.</li> </ul> </li> </ul> </div> </li> <!-- step 14 --> <li id="PS-Lists">Finally, if there is one or more mapping in the <a class="tref" title="local-list-mapping" href="#T-local-list-mapping">local list mapping</a>, list triples are generated as follows: <div class="explanation"> For each IRI in the <a class="tref" title="local-list-mapping" href="#T-local-list-mapping">local list mapping</a>, if the equivalent list does not exist in the <a class="tref" title="evaluation-context" href="#T-evaluation-context">evaluation context</a>, indicating that the list was originally instantiated on the current element, use the list as follows: <ul> <li> If there are zero items in the list associated with the IRI, generate the following triple: <dl> <dt>subject</dt> <dd><a class="tref" title="current-subject" href="#T-current-subject">current subject</a></dd> <dt>predicate</dt> <dd>full IRI of the <a class="tref" title="local-list-mapping" href="#T-local-list-mapping">local list mapping</a> associated with this list</dd> <dt>object</dt> <dd><code>http://www.w3.org/1999/02/22-rdf-syntax-ns#nil</code></dd> </dl> </li> </ul> <ul> <li>Otherwise, <ul> <li>Create a new ‘bnode’ array containing newly created <a class="tref" title="bnode" href="#T-bnode">bnode</a>s, one for each item in the list</li> <li>For each <a class="tref" title="bnode" href="#T-bnode">bnode</a>-(<a class="externalDFN" title="IRI">IRI</a> or literal) pair from the list the following triple is generated: <dl> <dt>subject</dt> <dd><a class="tref" title="bnode" href="#T-bnode">bnode</a></dd> <dt>predicate</dt> <dd><code>http://www.w3.org/1999/02/22-rdf-syntax-ns#first</code></dd> <dt>object</dt> <dd>full IRI or literal</dd> </dl> </li> <li>For each item in the ‘bnode’ array the following triple is generated: <dl> <dt>subject</dt> <dd><a class="tref" title="bnode" href="#T-bnode">bnode</a></dd> <dt>predicate</dt> <dd><code>http://www.w3.org/1999/02/22-rdf-syntax-ns#rest</code></dd> <dt>object</dt> <dd>next item in the ‘bnode’ array or, if that does not exist, <code>http://www.w3.org/1999/02/22-rdf-syntax-ns#nil</code></dd> </dl> </li> <li>A single additional triple is generated: <dl> <dt>subject</dt> <dd><a class="tref" title="current-subject" href="#T-current-subject">current subject</a></dd> <dt>predicate</dt> <dd>full IRI of the <a class="tref" title="local-list-mapping" href="#T-local-list-mapping">local list mapping</a> associated with this list</dd> <dt>object</dt> <dd>first item of the ‘bnode’ array</dd> </dl> </li> </ul> </li> </ul> </div></li> </ol> </section> <section id="processor-status" typeof="bibo:Chapter" resource="#processor-status" rel="bibo:chapter"> <h3 aria-level="2" role="heading" id="h3_processor-status"><span class="secno">7.6 </span>Processor Status</h3> <p> The processing rules covered in the previous section are designed to extract as many triples as possible from a document. The RDFa Processor is designed to continue processing, even in the event of errors. For example, failing to resolve a prefix mapping or <a class="tref" title="term" href="#T-term">term</a> would result in the RDFa Processor skipping the generation of a triple and continuing with document processing. There are cases where knowing each RDFa Processor warning or error would be beneficial to authors. The <a class="tref" title="processor-graph" href="#T-processor-graph">processor graph</a> is designed as the mechanism to capture all informational, warning, and error messages as triples from the RDFa Processor. These status triples may be retrieved and used to aid RDFa authoring or automated error detection. </p> <p rel="bibo:issue" typeof="bibo:Issue"><span rel="bibo:affirmedBy" resource="http://www.w3.org/2010/02/rdfa/meetings/2010-07-15#resolution_1"> If an RDFa Processor supports the generation of a <a class="tref" title="processor-graph" href="#T-processor-graph">processor graph</a>, then it <em class="rfc2119" title="MUST">MUST</em> generate a set of triples when the following processing issues occur:</span> </p> <ul> <li>An <code>rdfa:Error</code> <em class="rfc2119" title="MUST">MUST</em> be generated when the document fails to be fully processed as a result of non-conformant Host Language markup.</li> <li>A <code>rdfa:Warning</code> <em class="rfc2119" title="MUST">MUST</em> be generated when a CURIE prefix fails to be resolved.</li> <li>A <code>rdfa:Warning</code> <em class="rfc2119" title="MUST">MUST</em> be generated when a Term fails to be resolved.</li> </ul> <p> Other implementation-specific <code>rdfa:Info</code>, <code>rdfa:Warning</code>, or <code>rdfa:Error</code> triples <em class="rfc2119" title="MAY">MAY</em> be generated by the RDFa Processor. </p> <section id="accessing-the-processor-graph" typeof="bibo:Chapter" resource="#accessing-the-processor-graph" rel="bibo:chapter"> <h4 aria-level="3" role="heading" id="h4_accessing-the-processor-graph"><span class="secno">7.6.1 </span>Accessing the Processor Graph</h4> <p> Accessing the <a class="tref" title="processor-graph" href="#T-processor-graph">processor graph</a> may be accomplished in a variety of ways and is dependent on the type of RDFa Processor and access method that the developer is utilizing. </p> <p> SAX-based processors or processors that utilize function or method callbacks to report the generation of triples are classified as <dfn title="event-based-rdfa-processor" id="T-event-based-rdfa-processor">event-based RDFa Processor</dfn>s. For Event-based RDFa Processors, the software <em class="rfc2119" title="MUST">MUST</em> allow the developer to register a function or callback that is called when a triple is generated for the <a class="tref" title="processor-graph" href="#T-processor-graph">processor graph</a>. The callback <em class="rfc2119" title="MAY">MAY</em> be the same as the one that is used for the <a class="tref" title="output-graph" href="#T-output-graph">output graph</a> as long as it can be determined if a generated triple belongs in the <a class="tref" title="processor-graph" href="#T-processor-graph">processor graph</a> or the <a class="tref" title="output-graph" href="#T-output-graph">output graph</a>. </p> <p> A <dfn title="whole-graph-rdfa-processor" id="T-whole-graph-rdfa-processor">whole-graph RDFa Processor</dfn> is defined as any RDFa Processor that processes the entire document and only provides the developer access to the triples after processing has completed. RDFa Processors that typically fall into this category express their output via a single call using RDF/XML, N3, TURTLE, or N-Triples notation. For whole-graph RDFa Processors, the software <em class="rfc2119" title="MUST">MUST</em> allow the developer to specify if they would like to retrieve the <a class="tref" title="output-graph" href="#T-output-graph">output graph</a>, the <a class="tref" title="processor-graph" href="#T-processor-graph">processor graph</a>, or both graphs as a single, combined graph from the RDFa Processor. <span id="whole-graph-output-graph-preference" rel="bibo:issue" typeof="bibo:Issue"><span rel="bibo:affirmedBy" resource="http://www.w3.org/2010/02/rdfa/meetings/2010-07-01#resolution_1"> If the graph preference is not specified, the <a class="tref" title="output-graph" href="#T-output-graph">output graph</a> <em class="rfc2119" title="MUST">MUST</em> be returned. </span></span> </p> <p> A <dfn title="web-service-rdfa-processor" id="T-web-service-rdfa-processor">web service RDFa Processor</dfn> is defined as any RDFa Processor that is capable of processing a document by performing an HTTP GET, POST or similar action on an RDFa Processor IRI. For this class of RDFa Processor, the software <em class="rfc2119" title="MUST">MUST</em> allow the caller to specify if they would like to retrieve the <a class="tref" title="output-graph" href="#T-output-graph">output graph</a>, the <a class="tref" title="processor-graph" href="#T-processor-graph">processor graph</a>, or both graphs as a single, combined graph from the web service. The <code>rdfagraph</code> query parameter <em class="rfc2119" title="MUST">MUST</em> be used to specify the value. The allowable values are <code>output</code>, <code>processor</code> or both values, in any order, separated by a comma character. <span id="web-service-output-graph-preference" rel="bibo:issue" typeof="bibo:Issue"><span about="#web-service-output-graph-preference" rel="bibo:affirmedBy" resource="http://www.w3.org/2010/02/rdfa/meetings/2010-07-01#resolution_1"> If the graph preference is not specified, the <a class="tref" title="output-graph" href="#T-output-graph">output graph</a> <em class="rfc2119" title="MUST">MUST</em> be returned. </span></span> </p> </section> <section id="processor-graph-terms" typeof="bibo:Chapter" resource="#processor-graph-terms" rel="bibo:chapter"> <h4 aria-level="3" role="heading" id="h4_processor-graph-terms"><span class="secno">7.6.2 </span>Processor Graph Terms</h4> <p> To ensure interoperability, a core hierarchy of classes is defined for the content of the processor graph. Separate errors or warnings are resources (typically blank nodes) of a specific type, with additional properties giving more details on the error condition or the warning. This specification defines only the top level classes and the ones referring to the error and warning conditions defined <a href="#processor-status">explicitly</a> by this document. Other, implementation-specific subclasses may be defined by the RDFa Processor.</p> <p>The top level classes are <code>rdfa:Error</code>, <code>rdfa:Warning</code>, and <code>rdfa:Info</code>, defined as part of the <a href="#processor-graph-reporting">RDFa Vocabulary</a>. Furthermore, a single property is defined on those classes, namely <code>rdfa:context</code>, that provides an extra context for the error, e.g., http response, an XPath information, or simply the IRI to the RDFa resource. Usage of this property is optional, and more than one triple can be used with this predicate on the same subject. Finally, error and warning instances <em class="rfc2119" title="SHOULD">SHOULD</em> use the <code>dc:description</code> and <code>dc:date</code> properties. <code>dc:description</code> should provide a short, human readable but implementation dependent description of the error. <code>dc:date</code> should give the time when the error was found and it is advised to be as precise as possible to allow the detection of, for example, possible network errors. </p> <p>The example below shows the triples that should be minimally present in the processor graph as a result of an error (the content of the literal for the <code>dc:description</code> predicate is implementation dependent): </p> <div class="example"><div class="example-title"><span>Example 45</span></div><pre class="example">@prefix rdfa: <http://www.w3.org/ns/rdfa#> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix dc: <http://purl.org/dc/terms/> . [] a rdfa:DocumentError ; dc:description "The document could not be parsed due to parsing errors." ; dc:date "2010-06-30T13:40:23"^^xsd:dateTime .</pre></div> <p>A slightly more elaborate example makes use of the <code>rdfa:context</code> property to provide further information, using external vocabularies to represent HTTP headers or XPointer information (note that a processor may not have these information in all cases, i.e., these <code>rdfa:context</code> information are not required):</p> <div class="example"><div class="example-title"><span>Example 46</span></div><pre class="example">@prefix rdfa: <http://www.w3.org/ns/rdfa#> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix dc: <http://purl.org/dc/terms/> . @prefix ptr: <http://www.w3.org/2009/pointers#> . @prefix ht: <http://www.w3.org/2006/http#> . [] a rdfa:DocumentError ; dc:description "The document could not be parsed due to parsing errors." ; dc:date "2010-06-30T13:40:23"^^xsd:dateTime ; rdfa:context <http://www.example.org/doc> ; rdfa:context [ a ptr:Pointer ; # Detailed xpointer/xpath information provided here to locate the error. ] ; rdfa:context [ a ht:Response ; ht:responseCode <http://www.w3.org/2006/http#404> # The HTTP response headers on the request for the source file. ].</pre></div> </section> </section> <section id="vocabulary-expansion"> <h3 aria-level="2" role="heading" id="h3_vocabulary-expansion"><span class="secno">7.7 </span>Vocabulary Expansion</h3> <p> Processors <em class="rfc2119" title="MAY">MAY</em> perform vocabulary expansion by utilizing limited RDFS and OWL entailment rules, as described in <a href="#s_vocab_expansion">RDFa Vocabulary Expansion</a>. </p> </section> </section> <section class="informative" id="s_rdfaindetail" typeof="bibo:Chapter" resource="#s_rdfaindetail" rel="bibo:chapter"> <!--OddPage--><h2 aria-level="1" role="heading" id="h2_s_rdfaindetail"><span class="secno">8. </span>RDFa Processing in detail</h2><p><em>This section is non-normative.</em></p> <p> This section provides an in-depth examination of the processing steps described in the previous section. It also includes examples which may help clarify some of the steps involved. </p> <p> The key to processing is that a triple is generated whenever a predicate/object combination is detected. The actual triple generated will include a subject that may have been set previously, so this is tracked in the current <a class="tref" title="evaluation-context" href="#T-evaluation-context">evaluation context</a> and is called the <a class="tref" title="parent-subject" href="#T-parent-subject">parent subject</a>. Since the subject will default to the current document if it hasn't been set explicitly, then a predicate/object combination is always enough to generate one or more triples. </p> <p> The attributes for setting a predicate are <a class="aref" href="#A-rel" title="rel">@rel</a>, <a class="aref" href="#A-rev" title="rev">@rev</a> and <a class="aref" href="#A-property" title="property">@property</a>, whilst the attributes for setting an object are <a class="aref" href="#A-resource" title="resource">@resource</a>, <a class="aref" href="#A-href" title="href">@href</a>, <a class="aref" href="#A-content" title="content">@content</a>, and <a class="aref" href="#A-src" title="src">@src</a>. <a class="aref" href="#A-typeof" title="typeof">@typeof</a> is unique in that it sets <em>both</em> a predicate and an object at the same time (and also a subject when it appears in the absence of other attributes that would set a subject). Inline content might also set an object, if <a class="aref" href="#A-content" title="content">@content</a> is not present, but <a class="aref" href="#A-property" title="property">@property</a> is present. </p> <div class="note"><div class="note-title" aria-level="2" role="heading" id="h_note_27"><span>Note</span></div><p class=""> There are many examples in this section. The examples are all written using XHTML+RDFa. However, the explanations are relevant regardless of the Host Language.</p></div> <section id="changing-the-evaluation-context"> <h3 aria-level="2" role="heading" id="h3_changing-the-evaluation-context"><span class="secno">8.1 </span>Changing the Evaluation Context</h3><p><em>This section is non-normative.</em></p> <section id="setting-the-current-subject"> <h4 aria-level="3" role="heading" id="h4_setting-the-current-subject"><span class="secno">8.1.1 </span>Setting the current subject</h4><p><em>This section is non-normative.</em></p> <p>When triples are created they will always be in relation to a subject resource which is provided either by <a class="tref" title="new-subject" href="#T-new-subject">new subject</a> (if there are rules on the current element that have set a subject) or <a class="tref" title="parent-subject" href="#T-parent-subject">parent subject</a>, as passed in via the <a class="tref" title="evaluation-context" href="#T-evaluation-context">evaluation context</a>. This section looks at the specific ways in which these values are set. Note that it doesn't matter how the subject is set, so in this section we use the idea of the <dfn title="current-subject" id="T-current-subject">current subject</dfn> which may be <em>either</em> <a class="tref" title="new-subject" href="#T-new-subject">new subject</a> or <a class="tref" title="parent-subject" href="#T-parent-subject">parent subject</a>.</p> <section id="the-current-document"> <h5 aria-level="4" role="heading" id="h5_the-current-document"><span class="secno">8.1.1.1 </span>The current document</h5><p><em>This section is non-normative.</em></p> <p>When parsing begins, the <a class="tref" title="current-subject" href="#T-current-subject">current subject</a> will be the IRI of the document being parsed, or a value as set by a Host Language-provided mechanism (e.g., the <code>base</code> element in (X)HTML). This means that by default any metadata found in the document will concern the document itself:</p> <div class="example"><div class="example-title"><span>Example 47</span></div><pre class="example"><html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Jo's Friends and Family Blog</title> <span class="hilite"><link rel="foaf:primaryTopic" href="#bbq" /></span> <span class="hilite"><meta property="dc:creator" content="Jo" /></span> </head> <body> ... </body> </html></pre></div> <p>This would generate the following triples:</p> <div class="example"><div class="example-title"><span>Example 48</span></div><pre class="example"><> foaf:primaryTopic <#bbq> . <> dc:creator "Jo" .</pre></div> <p>It is possible for the data to appear elsewhere in the document:</p> <div class="example"><div class="example-title"><span>Example 49</span></div><pre class="example"><html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Jo's Blog</title> </head> <body> <h1><span class="hilite"><span property="dc:creator">Jo</span></span>'s blog</h1> <p> Welcome to my blog. </p> </body> </html></pre></div> <p>which would still generate the triple:</p> <div class="example"><div class="example-title"><span>Example 50</span></div><pre class="example"><> dc:creator "Jo" .</pre></div> <p>In (X)HTML the value of <code>base</code> may change the initial value of <a class="tref" title="current-subject" href="#T-current-subject">current subject</a>:</p> <div class="example"><div class="example-title"><span>Example 51</span></div><pre class="example"><html xmlns="http://www.w3.org/1999/xhtml"> <head> <span class="hilite"><base href="http://www.example.org/jo/blog" /></span> <title>Jo's Friends and Family Blog</title> <link rel="foaf:primaryTopic" href="#bbq" /> <meta property="dc:creator" content="Jo" /> </head> <body> ... </body> </html></pre></div> <p>An RDFa Processor should now generate the following triples, regardless of the IRI from which the document is served:</p> <div class="example"><div class="example-title"><span>Example 52</span></div><pre class="example"><http://www.example.org/jo/blog> foaf:primaryTopic <http://www.example.org//jo/blog#bbq> . <http://www.example.org/jo/blog> dc:creator "Jo" .</pre></div> </section> <section id="using-about"> <h5 aria-level="4" role="heading" id="h5_using-about"><span class="secno">8.1.1.2 </span>Using <a class="aref" href="#A-about" title="about">@about</a></h5> <p>As processing progresses, any <a class="aref" href="#A-about" title="about">@about</a> attributes will change the <a class="tref" title="current-subject" href="#T-current-subject">current subject</a>. The value of <a class="aref" href="#A-about" title="about">@about</a> is an IRI or a CURIE. If it is a relative IRI then it needs to be resolved against the current <a class="tref" title="base" href="#T-base">base</a> value. To illustrate how this affects the statements, note in this markup how the properties inside the (X)HTML <code>body</code> element become part of a new calendar event object, rather than referring to the document as they do in the head of the document: </p> <div class="example"><div class="example-title"><span>Example 53</span></div><pre class="example"><html xmlns="http://www.w3.org/1999/xhtml" prefix="cal: http://www.w3.org/2002/12/cal/ical#"> <head> <title>Jo's Friends and Family Blog</title> <link rel="foaf:primaryTopic" href="#bbq" /> <meta property="dc:creator" content="Jo" /> </head> <body> <p <span class="hilite">about="#bbq"</span> <span class="hilite">typeof="cal:Vevent"</span>> I'm holding <span <span class="hilite">property="cal:summary"</span>> one last summer barbecue </span>, on <span <span class="hilite">property="cal:dtstart"</span> content="2015-09-16T16:00:00-05:00" datatype="xsd:dateTime"> September 16th at 4pm </span>. </p> </body> </html></pre></div> <p>With this markup an RDFa Processor will generate the following triples:</p> <div class="example"><div class="example-title"><span>Example 54</span></div><pre class="example"><> foaf:primaryTopic <#bbq> . <> dc:creator "Jo" . <span class="hilite"><#bbq> rdf:type cal:Vevent .</span> <span class="hilite"><#bbq> cal:summary "one last summer barbecue" .</span> <span class="hilite"><#bbq> cal:dtstart "2015-09-16T16:00:00-05:00"^^xsd:dateTime .</span></pre></div> <p>Other kinds of resources can be used to set the <a class="tref" title="current-subject" href="#T-current-subject">current subject</a>, not just references to web-pages. Although not advised, email addresses might be used to represent a person:</p> <div class="example"><div class="example-title"><span>Example 55</span></div><pre class="example">John knows <a <span class="hilite">about="mailto:john@example.org"</span> rel="foaf:knows" href="mailto:sue@example.org">Sue</a>. Sue knows <a <span class="hilite">about="mailto:sue@example.org"</span> rel="foaf:knows" href="mailto:jim@example.org">Jim</a>.</pre></div> <p>This should generate the following triples:</p> <div class="example"><div class="example-title"><span>Example 56</span></div><pre class="example"><mailto:john@example.org> foaf:knows <mailto:sue@example.org> . <mailto:sue@example.org> foaf:knows <mailto:jim@example.org> .</pre></div> <p>Similarly, authors may make statements about images:</p> <div class="example"><div class="example-title"><span>Example 57</span></div><pre class="example"><div <span class="hilite">about="photo1.jpg"</span>> this photo was taken by <span property="dc:creator">Mark Birbeck</span> </div></pre></div> <p>which should generate the following triple:</p> <div class="example"><div class="example-title"><span>Example 58</span></div><pre class="example"><photo1.jpg> dc:creator "Mark Birbeck" .</pre></div> </section> <section id="typing-resources-with-typeof"> <h5 aria-level="4" role="heading" id="h5_typing-resources-with-typeof"><span class="secno">8.1.1.3 </span>Typing resources with <a class="aref" href="#A-typeof" title="typeof">@typeof</a></h5> <p><a class="aref" href="#A-typeof" title="typeof">@typeof</a> defines typing triples. <a class="aref" href="#A-typeof" title="typeof">@typeof</a> works differently to other ways of setting a predicate since the predicate is always <code>rdf:type</code>, which means that the processor only requires the value of the type. The question is: which resource gets these typing information?</p> <p>If the element has an <a class="aref" href="#A-about" title="about">@about</a>, which creates a new context for statements, the typing relationships are defined on that resource. For example, the following:</p> <div class="example"><div class="example-title"><span>Example 59</span></div><pre class="example"><div <span class="hilite">about="http://dbpedia.org/resource/Albert_Einstein" typeof="foaf:Person"</span>> <span property="foaf:name">Albert Einstein</span> <span property="foaf:givenName">Albert</span> </div></pre></div> <p>also creates the triple:</p> <div class="example"><div class="example-title"><span>Example 60</span></div><pre class="example"><http://dbpedia.org/resource/Albert_Einstein> rdf:type foaf:Person .</pre></div> <p>The <a class="aref" href="#A-about" title="about">@about</a> attribute is the main source for typing; if it is present on an element, it determines the effect of <a class="aref" href="#A-typeof" title="typeof">@typeof</a> with the highest priority. If <a class="aref" href="#A-about" title="about">@about</a> is <em>not</em> present, but the element is used only to define possible subject resources via, e.g., <a class="aref" href="#A-resource" title="resource">@resource</a> (i.e., there is <em>no</em> <a class="aref" href="#A-rel" title="rel">@rel</a>, <a class="aref" href="#A-rev" title="rev">@rev</a>, or <a class="aref" href="#A-property" title="property">@property</a> present), then that resource is used for the typed resource, just like <a class="aref" href="#A-about" title="about">@about</a>.</p> <p>If an <a class="aref" href="#A-rel" title="rel">@rel</a> is present (and still no <a class="aref" href="#A-about" title="about">@about</a>) then the explicit object of the triples defined by <a class="aref" href="#A-rel" title="rel">@rel</a> is typed. For example, in the case of:</p> <div class="example"><div class="example-title"><span>Example 61</span></div><pre class="example"><div about="http://dbpedia.org/resource/Albert_Einstein"> <div rel="dbp:birthPlace" <span class="hilite">resource="http://dbpedia.org/resource/German_Empire"</span> <span class="hilite">typeof="http://schema.org/Country"</span>> </div> </div></pre></div> <p>the generated triples also include:</p> <div class="example"><div class="example-title"><span>Example 62</span></div><pre class="example"><http://dbpedia.org/resource/German_Empire> rdf:type <http://schema.org/Country> .</pre></div> <p>Finally, <a class="aref" href="#A-typeof" title="typeof">@typeof</a> also has the additional feature of creating a new context for statements, <em>in case no other attributes define any</em>. This involves generating a new <a class="tref" title="bnode" href="#T-bnode">bnode</a> (see below for more about bnodes). For example, an author may wish to create markup for a person using the FOAF vocabulary, but without having a clear identifier for the item: </p> <div class="example"><div class="example-title"><span>Example 63</span></div><pre class="example"><div <span class="hilite">typeof="foaf:Person"</span>> <span property="foaf:name">Albert Einstein</span> <span property="foaf:givenName">Albert</span> </div></pre></div> <p> This markup would cause a <a class="tref" title="bnode" href="#T-bnode">bnode</a> to be created which has a 'type' of <code>foaf:Person</code>, as well as name and given name properties: </p> <div class="example"><div class="example-title"><span>Example 64</span></div><pre class="example">_:a rdf:type foaf:Person . _:a foaf:name "Albert Einstein" . _:a foaf:givenName "Albert" .</pre></div> <p>This usage of “isolated” <a class="aref" href="#A-typeof" title="typeof">@typeof</a> may be viewed as a shorthand for: </p> <div class="example"><div class="example-title"><span>Example 65</span></div><pre class="example"><div <span class="hilite">resource="_:a" typeof="foaf:Person"</span>> <span property="foaf:name">Albert Einstein</span> <span property="foaf:givenName">Albert</span> </div></pre></div> <p>Similarly, </p> <div class="example"><div class="example-title"><span>Example 66</span></div><pre class="example"><div about="http://dbpedia.org/resource/Albert_Einstein"> <div rel="dbp:birthPlace" <span class="hilite">typeof="http://schema.org/Country"</span>> <span property="dbp:conventionalLongName">the German Empire</span> </div> </div></pre></div> <p>generates:</p> <div class="example"><div class="example-title"><span>Example 67</span></div><pre class="example"><http://dbpedia.org/resource/Albert_Einstein"> dbp:birthPlace _:b . _:b dbp:conventionalLongName "the German Empire" .</pre></div> <div class="explanation"> A <a class="tref" title="bnode" href="#T-bnode">bnode</a> is simply a unique identifier that is only available to the processor, not to any external software. By generating values internally, the processor is able to keep track of properties for <code>_:a</code> as being distinct from <code>_:b</code>. But by not exposing these values to any external software, it is possible to have complete control over the identifier, as well as preventing further statements being made about the item. </div> <section typeof="bibo:Chapter" resource="#s_chaining_property_typeof" rel="bibo:chapter" id="chaining-with-property-and-typeof"> <h6 id="s_chaining_property_typeof" aria-level="5" role="heading"><span class="secno">8.1.1.3.1 </span>Chaining with <a class="aref" href="#A-property" title="property">@property</a> and <a class="aref" href="#A-typeof" title="typeof">@typeof</a></h6><p><em>This section is non-normative.</em></p> <p>As emphasized in the <a href="#s_chaining">section on chaining</a>, one of the main differences between <a class="aref" href="#A-property" title="property">@property</a> and <a class="aref" href="#A-rel" title="rel">@rel</a> (or <a class="aref" href="#A-rev" title="rev">@rev</a>) is that the former does not induce chaining. The <em>only</em> exception to this rule is when <a class="aref" href="#A-typeof" title="typeof">@typeof</a> is also present on the element. In that case the effect of <a class="aref" href="#A-property" title="property">@property</a> is identical to <a class="aref" href="#A-rel" title="rel">@rel</a>. For example, the previous example could have been written as: </p> <div class="example"><div class="example-title"><span>Example 68</span></div><pre class="example"><div about="http://dbpedia.org/resource/Albert_Einstein"> <div property="dbp:birthPlace" <span class="hilite">typeof="http://schema.org/Country"</span>> <span property="dbp:conventionalLongName">the German Empire</span> </div> </div></pre></div> <p>generating the same triples as before. Here again, a <a class="aref" href="#A-typeof" title="typeof">@typeof</a> without an <a class="aref" href="#A-about" title="about">@about</a> or a <a class="aref" href="#A-resource" title="resource">@resource</a> can be regarded as a shorthand for an additional <a class="aref" href="#A-resource" title="resource">@resource</a> attribute referring to the identifier of a fresh <a class="tref" title="bnode" href="#T-bnode">bnode</a>.</p> </section> </section> <section id="determining-the-subject-with-neither-about-nor-typeof"> <h5 aria-level="4" role="heading" id="h5_determining-the-subject-with-neither-about-nor-typeof"><span class="secno">8.1.1.4 </span>Determining the subject with neither <a class="aref" href="#A-about" title="about">@about</a> nor <a class="aref" href="#A-typeof" title="typeof">@typeof</a></h5> <p> As described in the previous two sections, <a class="aref" href="#A-about" title="about">@about</a> will always take precedence and mark a new subject, but if no <a class="aref" href="#A-about" title="about">@about</a> value is available then <a class="aref" href="#A-typeof" title="typeof">@typeof</a> will do the same job, although using an implied identifier, i.e., a <a class="tref" title="bnode" href="#T-bnode">bnode</a>.</p> <p> But if neither <a class="aref" href="#A-about" title="about">@about</a> or <a class="aref" href="#A-typeof" title="typeof">@typeof</a> are present, there are a number of ways that the subject could be arrived at. One of these is to 'inherit' the subject from the containing statement, with the value to be inherited set either explicitly, or implicitly. </p> <section id="inheriting-subject-from-resource"> <h6 aria-level="5" role="heading" id="h6_inheriting-subject-from-resource"><span class="secno">8.1.1.4.1 </span>Inheriting subject from <a class="aref" href="#A-resource" title="resource">@resource</a></h6> <p> The most usual way that an inherited subject might get set would be when the parent statement has an object that is a resource. Returning to the earlier example, in which the long name for the German_Empire was added, the following markup was used: </p> <div class="example"><div class="example-title"><span>Example 69</span></div><pre class="example"><div about="http://dbpedia.org/resource/Albert_Einstein"> <span property="foaf:name">Albert Einstein</span> <span property="dbp:dateOfBirth" datatype="xsd:date">1879-03-14</span> <div rel="dbp:birthPlace" resource="http://dbpedia.org/resource/German_Empire" /> <span class="hilite"><span about="http://dbpedia.org/resource/German_Empire" property="dbp:conventionalLongName">the German Empire</span></span> </div></pre></div> <p> In an earlier illustration the subject and object for the German Empire were connected by removing the <a class="aref" href="#A-resource" title="resource">@resource</a>, relying on the <a class="aref" href="#A-about" title="about">@about</a> to set the object: </p> <div class="example"><div class="example-title"><span>Example 70</span></div><pre class="example"><div about="http://dbpedia.org/resource/Albert_Einstein"> <span property="foaf:name">Albert Einstein</span> <span property="dbp:dateOfBirth" datatype="xsd:date">1879-03-14</span> <span class="hilite"><div rel="dbp:birthPlace"></span> <span about="http://dbpedia.org/resource/German_Empire" property="dbp:conventionalLongName">the German Empire</span> </div> </div></pre></div> <p> but it is also possible for authors to achieve the same effect by removing the <a class="aref" href="#A-about" title="about">@about</a> and leaving the <a class="aref" href="#A-resource" title="resource">@resource</a>: </p> <div class="example"><div class="example-title"><span>Example 71</span></div><pre class="example"><div about="http://dbpedia.org/resource/Albert_Einstein"> <span property="foaf:name">Albert Einstein</span> <span property="dbp:dateOfBirth" datatype="xsd:date">1879-03-14</span> <div rel="dbp:birthPlace" <span class="hilite">resource="http://dbpedia.org/resource/German_Empire"</span>> <span property="dbp:conventionalLongName">the German Empire</span> </div> </div></pre></div> <p> In this situation, all statements that are 'contained' by the object resource representing the German Empire (the value in <a class="aref" href="#A-resource" title="resource">@resource</a>) will have the same subject, making it easy for authors to add additional statements: </p> <div class="example"><div class="example-title"><span>Example 72</span></div><pre class="example"><div about="http://dbpedia.org/resource/Albert_Einstein"> <span property="foaf:name">Albert Einstein</span> <span property="dbp:dateOfBirth" datatype="xsd:date">1879-03-14</span> <div rel="dbp:birthPlace" resource="http://dbpedia.org/resource/German_Empire"> <span property="dbp:conventionalLongName">the German Empire</span> <span class="hilite"><span rel="dbp-owl:capital" resource="http://dbpedia.org/resource/Berlin" /></span> </div> </div></pre></div> <p>Looking at the triples that an RDFa Processor would generate, we can see that we actually have two groups of statements; the first group is set to refer to the <a class="aref" href="#A-about" title="about">@about</a> that contains them:</p> <div class="example"><div class="example-title"><span>Example 73</span></div><pre class="example"><http://dbpedia.org/resource/Albert_Einstein> foaf:name "Albert Einstein" . <http://dbpedia.org/resource/Albert_Einstein> dbp:dateOfBirth "1879-03-14"^^xsd:date . <http://dbpedia.org/resource/Albert_Einstein> dbp:birthPlace <http://dbpedia.org/resource/German_Empire> .</pre></div> <p>while the second group refers to the <a class="aref" href="#A-resource" title="resource">@resource</a> that contains them:</p> <div class="example"><div class="example-title"><span>Example 74</span></div><pre class="example"><http://dbpedia.org/resource/German_Empire> dbp:conventionalLongName "the German Empire" . <http://dbpedia.org/resource/German_Empire> dbp-owl:capital <http://dbpedia.org/resource/Berlin> .</pre></div> <p> Note also that the same principle described here applies to <a class="aref" href="#A-src" title="src">@src</a> and <a class="aref" href="#A-href" title="href">@href</a>. </p> </section> <section id="inheriting-an-anonymous-subject"> <h6 aria-level="5" role="heading" id="h6_inheriting-an-anonymous-subject"><span class="secno">8.1.1.4.2 </span>Inheriting an anonymous subject</h6> <p> There will be occasions when the author wants to connect the subject and object as shown above, but is not concerned to name the resource that is common to the two statements (i.e., the object of the first statement, which is the subject of the second). For example, to indicate that Einstein was influenced by Spinoza the following markup could well be used: </p> <div class="example"><div class="example-title"><span>Example 75</span></div><pre class="example"><div about="http://dbpedia.org/resource/Baruch_Spinoza" rel="dbp-owl:influenced"> <div about="http://dbpedia.org/resource/Albert_Einstein"> <span property="foaf:name">Albert Einstein</span> <span property="dbp:dateOfBirth" datatype="xsd:date">1879-03-14</span> </div> </div></pre></div> <p> An RDFa Processor will generate the following triples: </p> <div class="example"><div class="example-title"><span>Example 76</span></div><pre class="example"><http://dbpedia.org/resource/Baruch_Spinoza> dbp-owl:influenced <http://dbpedia.org/resource/Albert_Einstein> . <http://dbpedia.org/resource/Albert_Einstein> foaf:name "Albert Einstein" . <http://dbpedia.org/resource/Albert_Einstein> dbp:dateOfBirth "1879-03-14"^^xsd:date .</pre></div> <p> However, an author could just as easily say that Spinoza influenced <em>something by the name of Albert Einstein, that was born on March 14th, 1879</em>: </p> <div class="example"><div class="example-title"><span>Example 77</span></div><pre class="example"><div about="http://dbpedia.org/resource/Baruch_Spinoza" rel="dbp-owl:influenced"> <span class="hilite"><div></span> <span property="foaf:name">Albert Einstein</span> <span property="dbp:dateOfBirth" datatype="xsd:date">1879-03-14</span> <span class="hilite"></div></span> </div></pre></div> <p> In RDF terms, the item that 'represents' Einstein is <em>anonymous</em>, since it has no IRI to identify it. However, the item is given an automatically generated <a class="tref" title="bnode" href="#T-bnode">bnode</a>, and it is onto this identifier that all child statements are attached: </p> <p> An RDFa Processor will generate the following triples: </p> <div class="example"><div class="example-title"><span>Example 78</span></div><pre class="example"><http://dbpedia.org/resource/Baruch_Spinoza> dbp-owl:influenced _:a . _:a foaf:name "Albert Einstein" . _:a dbp:dateOfBirth "1879-03-14"^^xsd:date .</pre></div> <p> Note that the <code>div</code> is superfluous, and an RDFa Processor will create the intermediate object even if the element is removed: </p> <div class="example"><div class="example-title"><span>Example 79</span></div><pre class="example"><div about="http://dbpedia.org/resource/Baruch_Spinoza" rel="dbp-owl:influenced"> <span property="foaf:name">Albert Einstein</span> <span property="dbp:dateOfBirth" datatype="xsd:date">1879-03-14</span> </div></pre></div> <p> An alternative pattern is to <em>keep</em> the <code>div</code> and move the <a class="aref" href="#A-rel" title="rel">@rel</a> onto it: </p> <div class="example"><div class="example-title"><span>Example 80</span></div><pre class="example"><div about="http://dbpedia.org/resource/Baruch_Spinoza"> <div <span class="hilite">rel="dbp-owl:influenced"</span>> <span property="foaf:name">Albert Einstein</span> <span property="dbp:dateOfBirth" datatype="xsd:date">1879-03-14</span> </div> </div></pre></div> <p> From the point of view of the markup, this latter layout is to be preferred, since it draws attention to the 'hanging rel'. But from the point of view of an RDFa Processor, all of these permutations need to be supported. </p> </section> </section> </section> </section> <section id="s_Completing_Incomplete_Triples" typeof="bibo:Chapter" resource="#s_Completing_Incomplete_Triples" rel="bibo:chapter"> <h3 aria-level="2" role="heading" id="h3_s_Completing_Incomplete_Triples"><span class="secno">8.2 </span>Completing incomplete triples</h3> <p> When a new subject is calculated, it is also used to complete any incomplete triples that are pending. This situation arises when the author wants to 'chain' a number of statements together. For example, an author could have a statement that Albert Einstein was born in the German Empire: </p> <div class="example"><div class="example-title"><span>Example 81</span></div><pre class="example"><div about="http://dbpedia.org/resource/Albert_Einstein"> <span property="foaf:name">Albert Einstein</span> <span property="dbp:dateOfBirth" datatype="xsd:date">1879-03-14</span> <span class="hilite"><div rel="dbp:birthPlace" resource="http://dbpedia.org/resource/German_Empire" /></span> </div></pre></div> <p> and then a further statement that the 'long name' for this country is <em>the German Empire</em>: </p> <div class="example"><div class="example-title"><span>Example 82</span></div><pre class="example"><span about="http://dbpedia.org/resource/German_Empire" property="dbp:conventionalLongName">the German Empire</span></pre></div> <p> RDFa allows authors to insert this statement as a self-contained unit into other contexts: </p> <div class="example"><div class="example-title"><span>Example 83</span></div><pre class="example"><div about="http://dbpedia.org/resource/Albert_Einstein"> <span property="foaf:name">Albert Einstein</span> <span property="dbp:dateOfBirth" datatype="xsd:date">1879-03-14</span> <div rel="dbp:birthPlace" resource="http://dbpedia.org/resource/German_Empire" /> <span class="hilite"><span about="http://dbpedia.org/resource/German_Empire" property="dbp:conventionalLongName">the German Empire</span></span> </div></pre></div> <p> But it also allows authors to avoid unnecessary repetition and to 'normalize' out duplicate identifiers, in this case the one for the German Empire: </p> <div class="example"><div class="example-title"><span>Example 84</span></div><pre class="example"><div about="http://dbpedia.org/resource/Albert_Einstein"> <span property="foaf:name">Albert Einstein</span> <span property="dbp:dateOfBirth" datatype="xsd:date">1879-03-14</span> <span class="hilite"><div rel="dbp:birthPlace"></span> <span about="http://dbpedia.org/resource/German_Empire" property="dbp:conventionalLongName">the German Empire</span> </div> </div></pre></div> <p> When this happens the <a class="aref" href="#A-rel" title="rel">@rel</a> for 'birth place' is regarded as a 'hanging rel' because it has not yet generated any triples, but these 'incomplete triples' are completed by the <a class="aref" href="#A-about" title="about">@about</a> that appears on the next line. The first step is therefore to store the two parts of the triple that the RDFa Processor <em>does</em> have, but without an object: </p> <div class="example"><div class="example-title"><span>Example 85</span></div><pre class="example"><http://dbpedia.org/resource/Albert_Einstein> dbp:birthPlace <span class="hilite">?</span> .</pre></div> <p> Then as processing continues, the RDFa Processor encounters the subject of the statement about the long name for the German Empire, and this is used in two ways. First it is used to complete the 'incomplete triple': </p> <div class="example"><div class="example-title"><span>Example 86</span></div><pre class="example"><http://dbpedia.org/resource/Albert_Einstein> dbp:birthPlace <span class="hilite"><http://dbpedia.org/resource/German_Empire></span> .</pre></div> <p>and second it is used to generate its own triple:</p> <div class="example"><div class="example-title"><span>Example 87</span></div><pre class="example"><http://dbpedia.org/resource/German_Empire> dbp:conventionalLongName "the German Empire" .</pre></div> <p> Note that each occurrence of <a class="aref" href="#A-about" title="about">@about</a> will complete any incomplete triples. For example, to mark up the fact that Albert Einstein had a residence both in the German Empire and Switzerland, an author need only specify one <a class="aref" href="#A-rel" title="rel">@rel</a> value that is then used with multiple <a class="aref" href="#A-about" title="about">@about</a> values: </p> <div class="example"><div class="example-title"><span>Example 88</span></div><pre class="example"><div about="http://dbpedia.org/resource/Albert_Einstein" rel="dbp-owl:residence"> <span class="hilite"><span about="http://dbpedia.org/resource/German_Empire" /></span> <span class="hilite"><span about="http://dbpedia.org/resource/Switzerland" /></span> </div></pre></div> <p> In this example there is one incomplete triple: </p> <div class="example"><div class="example-title"><span>Example 89</span></div><pre class="example"><http://dbpedia.org/resource/Albert_Einstein> dbp-owl:residence <span class="hilite">?</span> .</pre></div> <p> When the processor meets each of the <a class="aref" href="#A-about" title="about">@about</a> values, this triple is completed, giving: </p> <div class="example"><div class="example-title"><span>Example 90</span></div><pre class="example"><http://dbpedia.org/resource/Albert_Einstein> dbp-owl:residence <span class="hilite"><http://dbpedia.org/resource/German_Empire></span> . <http://dbpedia.org/resource/Albert_Einstein> dbp-owl:residence <span class="hilite"><http://dbpedia.org/resource/Switzerland></span> .</pre></div> <p>These examples show how <a class="aref" href="#A-about" title="about">@about</a> completes triples, but there are other situations that can have the same effect. For example, when <a class="aref" href="#A-typeof" title="typeof">@typeof</a> creates a new <a class="tref" title="bnode" href="#T-bnode">bnode</a> (as described above), that will be used to complete any 'incomplete triples'. To indicate that Spinoza influenced both Einstein and Schopenhauer, the following markup could be used: </p> <div class="example"><div class="example-title"><span>Example 91</span></div><pre class="example"><div about="http://dbpedia.org/resource/Baruch_Spinoza"> <div rel="dbp-owl:influenced"> <div <span class="hilite">typeof="foaf:Person"</span>> <span property="foaf:name">Albert Einstein</span> <span property="dbp:dateOfBirth" datatype="xsd:date">1879-03-14</span> </div> <div <span class="hilite">typeof="foaf:Person"</span>> <span property="foaf:name">Arthur Schopenhauer</span> <span property="dbp:dateOfBirth" datatype="xsd:date">1788-02-22</span> </div> </div> </div></pre></div> <p>First the following incomplete triple is stored:</p> <div class="example"><div class="example-title"><span>Example 92</span></div><pre class="example"><http://dbpedia.org/resource/Baruch_Spinoza> dbp-owl:influenced <span class="hilite">?</span> .</pre></div> <p> Then when the RDFa Processor processes the two occurrences of <a class="aref" href="#A-typeof" title="typeof">@typeof</a>, each generates a <a class="tref" title="bnode" href="#T-bnode">bnode</a>, which is used to both complete the 'incomplete triple', and to set the subject for further statements: </p> <div class="example"><div class="example-title"><span>Example 93</span></div><pre class="example"><http://dbpedia.org/resource/Baruch_Spinoza"> dbp-owl:influenced <span class="hilite">_:a</span> . <span class="hilite">_:a</span> rdf:type foaf:Person . <span class="hilite">_:a</span> foaf:name "Albert Einstein" . <span class="hilite">_:a</span> dbp:dateOfBirth "1879-03-14"^^xsd:date . <http://dbpedia.org/resource/Baruch_Spinoza"> dbp-owl:influenced <span class="hilite">_:b</span> . <span class="hilite">_:b</span> rdf:type foaf:Person . <span class="hilite">_:b</span> foaf:name "Arthur Schopenhauer" . <span class="hilite">_:b</span> dbp:dateOfBirth "1788-02-22"^^xsd:date .</pre></div> <p> Triples are also 'completed' if any one of <a class="aref" href="#A-property" title="property">@property</a>, <a class="aref" href="#A-rel" title="rel">@rel</a> or <a class="aref" href="#A-rev" title="rev">@rev</a> are present. However, unlike the situation when <a class="aref" href="#A-about" title="about">@about</a> or <a class="aref" href="#A-typeof" title="typeof">@typeof</a> are present, all predicates are attached to one <a class="tref" title="bnode" href="#T-bnode">bnode</a>: </p> <div class="example"><div class="example-title"><span>Example 94</span></div><pre class="example"><div about="http://dbpedia.org/resource/Baruch_Spinoza" rel="dbp-owl:influenced"> <span property="foaf:name">Albert Einstein</span> <span property="dbp:dateOfBirth" datatype="xsd:date">1879-03-14</span> <div rel="dbp-owl:residence"> <span about="http://dbpedia.org/resource/German_Empire" /> <span about="http://dbpedia.org/resource/Switzerland" /> </div> </div></pre></div> <p> This example has two 'hanging rels', and so two situations when 'incomplete triples' will be created. Processing would proceed as follows; first an incomplete triple is stored: </p> <div class="example"><div class="example-title"><span>Example 95</span></div><pre class="example"><http://dbpedia.org/resource/Baruch_Spinoza> dbp-owl:influenced <span class="hilite">?</span> .</pre></div> <p> Next, the RDFa Processor processes the predicate values for <code>foaf:name</code>, <code>dbp:dateOfBirth</code> and <code>dbp-owl:residence</code>, but note that only the first needs to 'complete' the 'hanging rel'. So processing <code>foaf:name</code> generates two triples: </p> <div class="example"><div class="example-title"><span>Example 96</span></div><pre class="example"><http://dbpedia.org/resource/Baruch_Spinoza> dbp-owl:influenced <span class="hilite">_:a</span> . <span class="hilite">_:a</span> foaf:name "Albert Einstein" .</pre></div> <p> but processing <code>dbp:dateOfBirth</code> generates only one: </p> <div class="example"><div class="example-title"><span>Example 97</span></div><pre class="example"><span class="hilite">_:a</span> dbp:dateOfBirth "1879-03-14"^^xsd:date .</pre></div> <p>Processing <code>dbp-owl:residence</code> also uses the same <a class="tref" title="bnode" href="#T-bnode">bnode</a>, but note that it also generates its own 'incomplete triple':</p> <div class="example"><div class="example-title"><span>Example 98</span></div><pre class="example">_:a dbp-owl:residence <span class="hilite">?</span> .</pre></div> <p>As before, the two occurrences of <a class="aref" href="#A-about" title="about">@about</a> complete the 'incomplete triple', once each:</p> <div class="example"><div class="example-title"><span>Example 99</span></div><pre class="example">_:a dbp-owl:residence <span class="hilite"><http://dbpedia.org/resource/German_Empire></span> . _:a dbp-owl:residence <span class="hilite"><http://dbpedia.org/resource/Switzerland></span> .</pre></div> <p> The entire set of triples that an RDFa Processor should generate is as follows: </p> <div class="example"><div class="example-title"><span>Example 100</span></div><pre class="example"><http://dbpedia.org/resource/Baruch_Spinoza> dbp-owl:influenced <span class="hilite">_:a</span> . <span class="hilite">_:a</span> foaf:name "Albert Einstein" . <span class="hilite">_:a</span> dbp:dateOfBirth "1879-03-14"^^xsd:date . <span class="hilite">_:a</span> dbp-owl:residence <http://dbpedia.org/resource/German_Empire> . <span class="hilite">_:a</span> dbp-owl:residence <http://dbpedia.org/resource/Switzerland> .</pre></div> </section> <section id="object-resolution"> <h3 aria-level="2" role="heading" id="h3_object-resolution"><span class="secno">8.3 </span>Object resolution</h3> <p> Although objects have been discussed in the previous sections, as part of the explanation of subject resolution, chaining, evaluation contexts, and so on, this section will look at objects in more detail. </p> <p>There are two types of object, <a class="tref" title="iri-resource" href="#T-iri-resource">IRI resource</a>s and <a class="tref" title="literal" href="#T-literal">literal</a>s.</p> <p>A <a class="tref" title="literal" href="#T-literal">literal</a> object can be set by <a class="aref" href="#A-content" title="content">@content</a> or the inline text of element if <a class="aref" href="#A-property" title="property">@property</a> to express a <a class="tref" title="predicate" href="#T-predicate">predicate</a>. <em>Note that the use of <a class="aref" href="#A-content" title="content">@content</a> prohibits the inclusion of rich markup in your literal. If the inline content of an element accurately represents the object, then documents should rely upon that rather than duplicating that data using the <a class="aref" href="#A-content" title="content">@content</a>.</em></p> <p>An <dfn title="iri-resource" id="T-iri-resource">IRI resource</dfn> object can be set using one of <a class="aref" href="#A-rel" title="rel">@rel</a> or <a class="aref" href="#A-rev" title="rev">@rev</a> to express a <a class="tref" title="predicate" href="#T-predicate">predicate</a>, and then <em>either</em> using one of <a class="aref" href="#A-href" title="href">@href</a>, <a class="aref" href="#A-resource" title="resource">@resource</a> or <a class="aref" href="#A-src" title="src">@src</a> to provide an object resource explicitly, <em>or</em> using the chaining techniques described above to obtain an object from a nested subject, or from a <a class="tref" title="bnode" href="#T-bnode">bnode</a>. <em>Alternatively</em>, the <a class="aref" href="#A-property" title="property">@property</a> can also be used to define an IRI resource; this requires the presence of a <a class="aref" href="#A-resource" title="resource">@resource</a>, <a class="aref" href="#A-href" title="href">@href</a>, or <a class="aref" href="#A-src" title="src">@src</a> <em>and</em> the absence of <a class="aref" href="#A-rel" title="rel">@rel</a>, <a class="aref" href="#A-rev" title="rev">@rev</a>, <a class="aref" href="#A-datatype" title="datatype">@datatype</a>, or <a class="aref" href="#A-content" title="content">@content</a>.</p> <section id="object-resolution-for-the-property-attribute"> <h4 aria-level="3" role="heading" id="h4_object-resolution-for-the-property-attribute"><span class="secno">8.3.1 </span>Object resolution for the <a class="aref" href="#A-property" title="property">@property</a> attribute</h4> <p> An <dfn title="object-literal" id="T-object-literal">object literal</dfn> will be generated when <a class="aref" href="#A-property" title="property">@property</a> is present and no resource attribute is present. <a class="aref" href="#A-property" title="property">@property</a> provides the predicate, and the following sections describe how the actual literal to be generated is determined. </p> <section id="plain-literals-1"> <h5 aria-level="4" role="heading" id="h5_plain-literals-1"><span class="secno">8.3.1.1 </span>Plain Literals</h5> <p><a class="aref" href="#A-content" title="content">@content</a> can be used to indicate a <a class="tref" title="plain-literal" href="#T-plain-literal">plain literal</a>, as follows:</p> <div class="example"><div class="example-title"><span>Example 101</span></div><pre class="example"><meta about="http://internet-apps.blogspot.com/" property="dc:creator" <span class="hilite">content="Mark Birbeck"</span> /></pre></div> <p>The <a class="tref" title="plain-literal" href="#T-plain-literal">plain literal</a> can also be specified by using the content of the element:</p> <div class="example"><div class="example-title"><span>Example 102</span></div><pre class="example"><span about="http://internet-apps.blogspot.com/" property="dc:creator"><span class="hilite">Mark Birbeck</span></span></pre></div> <p> Both of these examples give the following triple: </p> <div class="example"><div class="example-title"><span>Example 103</span></div><pre class="example"><http://internet-apps.blogspot.com/> dc:creator "Mark Birbeck" .</pre></div> <p>The value of <a class="aref" href="#A-content" title="content">@content</a> is given precedence over any element content, so the following would give exactly the same triple as shown above:</p> <div class="example"><div class="example-title"><span>Example 104</span></div><pre class="example"><span about="http://internet-apps.blogspot.com/" property="dc:creator" <span class="hilite">content="Mark Birbeck"</span>>John Doe</span></pre></div> <section id="language-tags"> <h6 aria-level="5" role="heading" id="h6_language-tags"><span class="secno">8.3.1.1.1 </span>Language Tags</h6> <p>RDF allows <a class="tref" title="plain-literal" href="#T-plain-literal">plain literal</a>s to have a language tag, as illustrated by the following example from [<cite><a class="bibref" href="#bib-RDF-TESTCASES">RDF-TESTCASES</a></cite>]:</p> <div class="example"><div class="example-title"><span>Example 105</span></div><pre class="example"><http://example.org/node> <http://example.org/property> "chat"<span class="hilite">@fr</span> .</pre></div> <p>In RDFa the Host Language may provide a mechanism for setting the language tag. In XHTML+RDFa [<cite><a class="bibref" href="#bib-XHTML-RDFA">XHTML-RDFA</a></cite>], for example, the XML language attribute <span class="aref">@xml:lang</span> or the attribute <span class="aref">@lang</span> is used to add this information, whether the plain literal is designated by <a class="aref" href="#A-content" title="content">@content</a>, or by the inline text of the element:</p> <div class="example"><div class="example-title"><span>Example 106</span></div><pre class="example"><meta about="http://example.org/node" property="ex:property" <span class="hilite">xml:lang="fr"</span> content="chat" /></pre></div> <p>Note that the language value can be inherited as defined in [<cite><a class="bibref" href="#bib-XML10-4e">XML10-4e</a></cite>], so the following syntax will give the same triple as above:</p> <div class="example"><div class="example-title"><span>Example 107</span></div><pre class="example"><html xmlns="http://www.w3.org/1999/xhtml" prefix="ex: http://www.example.com/ns/" <span class="hilite">xml:lang="fr"</span>> <head> <title xml:lang="en">Example</title> <meta about="http://example.org/node" property="ex:property" content="chat" /> </head> ... </html></pre></div> </section> </section> <section id="typed-literals-1"> <h5 aria-level="4" role="heading" id="h5_typed-literals-1"><span class="secno">8.3.1.2 </span>Typed Literals</h5> <p>Literals can be given a data type using <a class="aref" href="#A-datatype" title="datatype">@datatype</a>.</p> <p>This can be represented in RDFa as follows:</p> <div class="example"><div class="example-title"><span>Example 108</span></div><pre class="example"><span property="cal:dtstart" content="2015-09-16T16:00:00-05:00" <span class="hilite">datatype="xsd:dateTime"</span>> September 16th at 4pm </span>.</pre></div> <p>The triple that this markup generates includes the datatype after the literal:</p> <div class="example"><div class="example-title"><span>Example 109</span></div><pre class="example"><> cal:dtstart "2015-09-16T16:00:00-05:00"^^<span class="hilite">xsd:dateTime</span> .</pre></div> </section> <section id="s-xml-literals" typeof="bibo:Chapter" resource="#s-xml-literals" rel="bibo:chapter"> <h5 aria-level="4" role="heading" id="h5_s-xml-literals"><span class="secno">8.3.1.3 </span><dfn title="xml-literals" id="T-xml-literals">XML Literals</dfn></h5> <p>XML documents cannot contain XML markup in their attributes, which means it is not possible to represent XML within <a class="aref" href="#A-content" title="content">@content</a> (the following would cause an XML parser to generate an error):</p> <div class="example"><div class="example-title"><span>Example 110</span></div><pre class="example"><head> <meta property="dc:title" <span class="hilite">content="E = mc<sup>2</sup>: The Most Urgent Problem of Our Time"</span> /> </head></pre></div> <p>RDFa therefore supports the use of arbitrary markup to express XML literals by using <a class="aref" href="#A-datatype" title="datatype">@datatype</a>:</p> <div class="example"><div class="example-title"><span>Example 111</span></div><pre class="example"><h2 property="dc:title" datatype="rdf:XMLLiteral"> <span class="hilite">E = mc<sup>2</sup>: The Most Urgent Problem of Our Time</span> </h2></pre></div> <p>This would generate the following triple, with the XML preserved in the literal:</p> <div class="example"><div class="example-title"><span>Example 112</span></div><pre class="example"><> dc:title "E = mc<sup>2</sup>: The Most Urgent Problem of Our Time"^^rdf:XMLLiteral .</pre></div> <div class="note"><div class="note-title" aria-level="5" role="heading" id="h_note_28"><span>Note</span></div><p class=""> This requires that an IRI mapping for the prefix <code>rdf</code> has been defined. </p></div> <p> In the examples given here the <code>sup</code> element is actually part of the meaning of the literal, but there will be situations where the extra markup means nothing, and can therefore be ignored. In this situation omitting the <a class="aref" href="#A-datatype" title="datatype">@datatype</a> attribute or specifying an empty <a class="aref" href="#A-datatype" title="datatype">@datatype</a> value can be used to create a plain literal: </p> <div class="example"><div class="example-title"><span>Example 113</span></div><pre class="example"><p>You searched for <strong>Einstein</strong>:</p> <p about="http://dbpedia.org/resource/Albert_Einstein"> <span property="foaf:name" <span class="hilite">datatype=""</span>>Albert <strong>Einstein</strong></span> (b. March 14, 1879, d. April 18, 1955) was a German-born theoretical physicist. </p></pre></div> <p>Rendering of this page has highlighted the term the user searched for. Setting <a class="aref" href="#A-datatype" title="datatype">@datatype</a> to nothing ensures that the data is interpreted as a plain literal, giving the following triple:</p> <div class="example"><div class="example-title"><span>Example 114</span></div><pre class="example"><http://dbpedia.org/resource/Albert_Einstein> foaf:name <span class="hilite">"Albert Einstein"</span> .</pre></div> <div class="note"><div class="note-title" aria-level="5" role="heading" id="h_note_29"><span>Note</span></div><p class="">The value of this <a class="tref" title="xml-literals" href="#T-xml-literals">XML Literal</a> is the exclusive canonicalization [<cite><a class="bibref" href="#bib-XML-EXC-C14N">XML-EXC-C14N</a></cite>] of the RDFa element's value.</p></div> </section> </section> <section id="iri-object-resolution"> <h4 aria-level="3" role="heading" id="h4_iri-object-resolution"><span class="secno">8.3.2 </span>IRI object resolution</h4> <p> Most of the rules governing the processing of objects that are resources are to be found in the processing descriptions given above, since they are important for establishing the subject. This section aims to highlight general concepts, and anything that might have been missed. </p> <p> One or more <dfn title="iri-object" id="T-iri-object">IRI object</dfn>s are needed when <a class="aref" href="#A-rel" title="rel">@rel</a> or <a class="aref" href="#A-rev" title="rev">@rev</a> is present. Each attribute will cause triples to be generated when used with <a class="aref" href="#A-href" title="href">@href</a>, <a class="aref" href="#A-resource" title="resource">@resource</a> or <a class="aref" href="#A-src" title="src">@src</a>, or with the subject value of any nested statement if none of these attributes are present. </p> <p> If <a class="aref" href="#A-rel" title="rel">@rel</a> or <a class="aref" href="#A-rev" title="rev">@rev</a> is not present, and neither is <a class="aref" href="#A-datatype" title="datatype">@datatype</a> or <a class="aref" href="#A-content" title="content">@content</a>, a <a class="aref" href="#A-property" title="property">@property</a> attribute will cause triples to be generated when used with <a class="aref" href="#A-href" title="href">@href</a>, <a class="aref" href="#A-resource" title="resource">@resource</a> or <a class="aref" href="#A-src" title="src">@src</a>. (See also the <a href="#s_chaining_property_typeof">section on <span class="aref">@property</span> and <span class="aref">@typeof</span></a> for an additional special case involving <a class="aref" href="#A-property" title="property">@property</a>.)</p> <p> <a class="aref" href="#A-rel" title="rel">@rel</a> and <a class="aref" href="#A-rev" title="rev">@rev</a> are essentially the inverse of each other; whilst <a class="aref" href="#A-rel" title="rel">@rel</a> establishes a relationship between the <a class="tref" title="current-subject" href="#T-current-subject">current subject</a> as subject, and the <a class="tref" title="current-object-resource" href="#T-current-object-resource">current object resource</a> as the object, <a class="aref" href="#A-rev" title="rev">@rev</a> does the exact opposite, and uses the <a class="tref" title="current-object-resource" href="#T-current-object-resource">current object resource</a> as the subject, and the <a class="tref" title="current-subject" href="#T-current-subject">current subject</a> as the object. </p> <section id="using-resource-to-set-the-object"> <h5 aria-level="4" role="heading" id="h5_using-resource-to-set-the-object"><span class="secno">8.3.2.1 </span>Using <a class="aref" href="#A-resource" title="resource">@resource</a> to set the object</h5> <p>RDFa provides the <a class="aref" href="#A-resource" title="resource">@resource</a> attribute as a way to set the object of statements. This is particularly useful when referring to resources that are not themselves navigable links:</p> <div class="example"><div class="example-title"><span>Example 115</span></div><pre class="example"><html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>On Crime and Punishment</title> <base href="http://www.example.com/candp.xhtml" /> </head> <body> <blockquote about="#q1" rel="dc:source" <span class="hilite">resource="urn:ISBN:0140449132"</span> > <p id="q1"> Rodion Romanovitch! My dear friend! If you go on in this way you will go mad, I am positive! Drink, pray, if only a few drops! </p> </blockquote> </body> </html></pre></div> <p>The <code>blockquote</code> element generates the following triple:</p> <div class="example"><div class="example-title"><span>Example 116</span></div><pre class="example"><http://www.example.com/candp.xhtml#q1> <http://purl.org/dc/terms/source> <urn:ISBN:0140449132> .</pre></div> <p>Note that, in the example above, <a class="aref" href="#A-property" title="property">@property</a> could have been used instead of <a class="aref" href="#A-rel" title="rel">@rel</a>, yielding the same triple.</p> </section> <section id="using-href-or-src-to-set-the-object"> <h5 aria-level="4" role="heading" id="h5_using-href-or-src-to-set-the-object"><span class="secno">8.3.2.2 </span>Using <a class="aref" href="#A-href" title="href">@href</a> or <a class="aref" href="#A-src" title="src">@src</a> to set the object</h5> <p> If no <a class="aref" href="#A-resource" title="resource">@resource</a> is present, then <a class="aref" href="#A-href" title="href">@href</a> or <a class="aref" href="#A-src" title="src">@src</a> are next in priority order for setting the object. </p> <p>When a predicate has been expressed using <a class="aref" href="#A-rel" title="rel">@rel</a>, the <a class="aref" href="#A-href" title="href">@href</a> or <a class="aref" href="#A-src" title="src">@src</a> on the RDFa statement's element is used to identify the object with a <a class="tref" title="iri-reference" href="#T-iri-reference">IRI reference</a>. Their types are an IRI:</p> <div class="example"><div class="example-title"><span>Example 117</span></div><pre class="example"><link about="mailto:john@example.org" <span class="hilite">rel="foaf:knows" href="mailto:sue@example.org"</span> /></pre></div> <p>It's also possible to use both <a class="aref" href="#A-rel" title="rel">@rel</a> and <a class="aref" href="#A-rev" title="rev">@rev</a> at the same time on an element. This is particularly useful when two things stand in two different relationships with each other, for example when a picture is taken <em>by</em> Mark, but that picture also <em>depicts</em> him:</p> <div class="example"><div class="example-title"><span>Example 118</span></div><pre class="example"><img about="http://www.blogger.com/profile/1109404" src="photo1.jpg" <span class="hilite">rev="dc:creator" rel="foaf:img"</span>/></pre></div> <p>which then yields two triples:</p> <div class="example"><div class="example-title"><span>Example 119</span></div><pre class="example"><photo1.jpg> dc:creator <http://www.blogger.com/profile/1109404> . <http://www.blogger.com/profile/1109404> foaf:img <photo1.jpg> .</pre></div> </section> <section typeof="bibo:Chapter" resource="#s_Incomplete_Triples" rel="bibo:chapter" id="incomplete-triples"> <h5 id="s_Incomplete_Triples" aria-level="4" role="heading"><span class="secno">8.3.2.3 </span>Incomplete triples</h5> <p>When a triple predicate has been expressed using <a class="aref" href="#A-rel" title="rel">@rel</a> or <a class="aref" href="#A-rev" title="rev">@rev</a>, but no <a class="aref" href="#A-href" title="href">@href</a>, <a class="aref" href="#A-src" title="src">@src</a>, or <a class="aref" href="#A-resource" title="resource">@resource</a> exists on the same element, there is a 'hanging rel'. This causes the current subject and all possible predicates (with an indicator of whether they are 'forwards, i.e., <a class="aref" href="#A-rel" title="rel">@rel</a> values, or not, i.e., <a class="aref" href="#A-rev" title="rev">@rev</a> values), to be stored as 'incomplete triples' pending discovery of a subject that could be used to 'complete' those triples.</p> <p>This process is described in more detail in <a href="#s_Completing_Incomplete_Triples">Completing 'Incomplete Triples'</a>.</p> </section> </section> </section> <section id="list-generation"> <h3 aria-level="2" role="heading" id="h3_list-generation"><span class="secno">8.4 </span>List Generation</h3> <p>An RDF graph is a collection of triples. This also means that if the graph contains two triples sharing the same subject and predicate:</p> <div class="example"><div class="example-title"><span>Example 120</span></div><pre class="example"><http://www.example.com> <http://www.example.com/predicate> "first object", "second object" ;</pre></div> <p>There is no way for an application to rely on the relative order of the two triples when, for example, querying a database containing these triples. For most of the applications and data sets this is not a problem, but, in some cases, the order is important. A typical case is publications: when a book or an article has several co-authors, the order of the authors may be important. </p> <p>RDF has a set of predefined predicates that have an agreed-upon semantic of order. For example, the publication: "Semantic Annotation and Retrieval, by Ben Adida, Mark Birbeck, and Ivan Herman" could be described in RDF triples using these terms as follows:</p> <div class="example"><div class="example-title"><span>Example 121</span></div><pre class="example">@prefix bibo: <http://purl.org/ontology/bibo/> . @prefix dc: <http://purl.org/dc/terms/> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . [ a bibo:Chapter ; dc:title "Semantic Annotation and Retrieval" ; dc:creator [ rdf:first <http://ben.adida.net/#me ; rdf:rest [ rdf:first <http://twitter.com/markbirbeck> ; rdf:rest [ rdf:first <http://www.ivan-herman.net/foaf#me> ; rdf:rest rdf:nil . ] . ] . ] . ... ]</pre></div> <p>which conveys the notion of 'order' for the three authors. Admittedly, this is not very readable. However, Turtle has a syntactic shorthand for these structures:</p> <div class="example"><div class="example-title"><span>Example 122</span></div><pre class="example">@prefix bibo: <http://purl.org/ontology/bibo/> . @prefix dc: <http://purl.org/dc/terms/> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . [ a bibo:Chapter ; dc:title "Semantic Annotation and Retrieval" ; dc:creator ( <http://ben.adida.net/#me> <http://twitter.com/markbirbeck> <http://www.ivan-herman.net/foaf#me> ) . ... ]</pre></div> <p>It would of course be possible to reproduce the same structure in RDFa, using the RDF predicates <code>rdf:first</code>, <code>rdf:rest</code>, as well as the special resource <code>rdf:nil</code>. However, to make this easier, RDFa provides the <a class="aref" href="#A-inlist" title="inlist">@inlist</a>. What this attribute signals is that the object generated on that element should be put on a list; the list is used with the common predicate and subject. Here is how the previous structure could look like in RDFa:</p> <div class="example"><div class="example-title"><span>Example 123</span></div><pre class="example"><p prefix="bibo: http://purl.org/ontology/bibo/ dc: http://purl.org/dc/terms/ typeof="bibo:Chapter"> "<span property="dc:title">Semantic Annotation and Retrieval</span>" by <a <span class="hilite">inlist=""</span> <span class="hilite">property="dc:creator"</span> <span class="hilite">href="http://ben.adida.net/#me"</span>>Ben Adida</a>, <a <span class="hilite">inlist=""</span> <span class="hilite">property="dc:creator"</span> <span class="hilite">href="http://twitter.com/markbirbeck"</span>>Mark Birbeck</a>, and <a <span class="hilite">inlist=""</span> <span class="hilite">property="dc:creator"</span> <span class="hilite">href="http://www.ivan-herman.net/foaf#me"</span>>Ivan Herman</a>. </p></pre></div> <p>Note that the order in the list is determined by the document order. (The value of the <a class="aref" href="#A-inlist" title="inlist">@inlist</a> is not relevant, only its presence is.)</p> <p>Lists may also include IRIs and not only literals. For example, two of the three co-authors could decide to publicise their FOAF address in the authors’ list:</p> <div class="example"><div class="example-title"><span>Example 124</span></div><pre class="example"><p prefix="bibo: http://purl.org/ontology/bibo/ dc: http://purl.org/dc/terms/ typeof="bibo:Chapter"> "<span property="dc:title">Semantic Annotation and Retrieval</span>", by <span <span class="hilite">inlist=""</span> <span class="hilite">property="dc:creator"</span> <span class="hilite">resource="http://ben.adida.net/#me"</span>>Ben Adida</span>, <span <span class="hilite">inlist=""</span> <span class="hilite">property="dc:creator"</span>>Mark Birbeck</span>, and <span <span class="hilite">inlist=""</span> <span class="hilite">property="dc:creator"</span> <span class="hilite">resource="http://www.ivan-herman.net/foaf#me"</span>>Ivan Herman</span>. </p></pre></div> <p>yielding:</p> <div class="example"><div class="example-title"><span>Example 125</span></div><pre class="example">@prefix bibo: <http://purl.org/ontology/bibo/> . @prefix dc: <http://purl.org/dc/terms/> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . [ a bibo:Chapter ; dc:title "Semantic Annotation and Retrieval" ; dc:creator ( <http://ben.adida.net/#me> "Mark Birbeck" <http://www.ivan-herman.net/foaf#me> ) . ... ]</pre></div> <p>In the example above, <a class="aref" href="#A-rel" title="rel">@rel</a> could have been used leading exactly to the same triples:</p> <div class="example"><div class="example-title"><span>Example 126</span></div><pre class="example"><p prefix="bibo: http://purl.org/ontology/bibo/ dc: http://purl.org/dc/terms/ typeof="bibo:Chapter"> "<span property="dc:title">Semantic Annotation and Retrieval</span>", by <span <span class="hilite">inlist=""</span> <span class="hilite">rel="dc:creator"</span> <span class="hilite">resource="http://ben.adida.net/#me"</span>>Ben Adida</span>, <span <span class="hilite">inlist=""</span> <span class="hilite">property="dc:creator"</span>>Mark Birbeck</span>, and <span <span class="hilite">inlist=""</span> <span class="hilite">rel="dc:creator"</span> <span class="hilite">resource="http://www.ivan-herman.net/foaf#me"</span>>Ivan Herman</span>. </p></pre></div> <p><a href="#s_Incomplete_Triples">Incomplete Triples</a> can also be used in conjunction with lists when all list elements are resources and not literals. For example, the previous example, this time with all three authors referring to their FOAF profile, could have been written as:</p> <div class="example"><div class="example-title"><span>Example 127</span></div><pre class="example"><p prefix="bibo: http://purl.org/ontology/bibo/ dc: http://purl.org/dc/terms/ typeof="bibo:Chapter"> "<span property="dc:title">Semantic Annotation and Retrieval</span>", by <span <span class="hilite">rel="dc:creator"</span> <span class="hilite">inlist=""</span>> <a <span class="hilite">href="http://ben.adida.net/#me"</span>>Ben Adida</a>, <a <span class="hilite">href="http://internet-apps.blogspot.com/2008/03/my-profile.html#me"</span>>Mark Birbeck</a>, and <a <span class="hilite">href="http://www.ivan-herman.net/foaf#me"</span>>Ivan Herman</a>. </span> </p></pre></div> <p>Resulting in:</p> <div class="example"><div class="example-title"><span>Example 128</span></div><pre class="example">@prefix bibo: <http://purl.org/ontology/bibo/> . @prefix dc: <http://purl.org/dc/terms/> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . [ a bibo:Chapter ; dc:title "Semantic Annotation and Retrieval" ; dc:creator ( <http://ben.adida.net/#me> <http://internet-apps.blogspot.com/2008/03/my-profile.html#me> <http://www.ivan-herman.net/foaf#me> ) . ... ]</pre></div> <p>Note that it is also possible to express an empty list, without <a class="aref" href="#A-inlist" title="inlist">@inlist</a>, using:</p> <div class="example"><div class="example-title"><span>Example 129</span></div><pre class="example"><span rel="prop" resource="rdf:nil"/></pre></div> </section> </section> <section id="s_initialcontexts" typeof="bibo:Chapter" resource="#s_initialcontexts" rel="bibo:chapter"> <!--OddPage--><h2 aria-level="1" role="heading" id="h2_s_initialcontexts"><span class="secno">9. </span>RDFa Initial Contexts</h2> <p>RDFa permits Host Languages to define an <a class="tref" title="initial-context" href="#T-initial-context">initial context</a>. Such a context is a collection of terms, prefix mappings, and/or a default vocabulary declaration. An initial context is either intrinsically known to the parser, or it is loaded as external documents and processed. These documents <em class="rfc2119" title="MUST">MUST</em> be defined in an approved RDFa Host Language (currently XML+RDFa, XHTML+RDFa [<cite><a class="bibref" href="#bib-XHTML-RDFA">XHTML-RDFA</a></cite>], and HTML+RDFa [<cite><a class="bibref" href="#bib-HTML-RDFA">HTML-RDFA</a></cite>]). <span rel="bibo:issue" typeof="bibo:Issue"><span resource="http://www.w3.org/2010/02/rdfa/meetings/2010-10-21#resolution_2" rel="bibo:affirmedBy"> They <em class="rfc2119" title="MAY">MAY</em> also be defined in other formats (e.g., RDF/XML [<cite><a class="bibref" href="#bib-RDF-SYNTAX-GRAMMAR">RDF-SYNTAX-GRAMMAR</a></cite>], or Turtle [<cite><a class="bibref" href="#bib-TURTLE">TURTLE</a></cite>]).</span> When an initial context document is processed, it is evaluated as follows:</span></p> <ol> <li>Parse the content (according to the processing rules for that document type) and extract the triples into a collection associated with that IRI. Note: These triples <em class="rfc2119" title="MUST NOT">MUST NOT</em> be co-mingled with the triples being extracted from any other IRI. </li> <li>For every subject with a pair of predicates that have the values <code>rdfa:prefix</code> and <code>rdfa:uri</code>, create a key-value mapping from the <code>rdfa:prefix</code> object literal (the key) to the <code>rdfa:uri</code> object literal (the value). Add this mapping to the <a class="tref" title="list-of-iri-mappings" href="#T-list-of-iri-mappings">list of IRI mappings</a> of the <a href="#s_sequence">initial evaluation context</a>, after transforming the 'prefix' component to lower-case.</li> <li>For every subject with a pair of predicates that have the values <code>rdfa:term</code> and <code>rdfa:uri</code>, create a key-value mapping from the <code>rdfa:term</code> object literal (the key) to the <code>rdfa:uri</code> object literal (the value). Add this mapping to the <a class="tref" title="term-mappings" href="#T-term-mappings">term mappings</a> of the <a href="#s_sequence">initial evaluation context</a>.</li> <li>For an extracted triple that has a predicate of <code>rdfa:vocabulary</code>, define the <a class="tref" title="default-vocabulary" href="#T-default-vocabulary">default vocabulary</a> of the <a href="#s_sequence">initial evaluation context</a> to be the object literal of the <code>rdfa:vocabulary</code> predicate.</li> </ol> <p rel="bibo:issue" typeof="bibo:Issue"><span resource="http://www.w3.org/2010/02/rdfa/meetings/2010-10-21#resolution_2" rel="bibo:affirmedBy"> When an RDFa Initial Context is defined using an RDF serialization, it <em class="rfc2119" title="MUST">MUST</em> use the vocabulary terms above to declare the components of the context.</span></p> <div class="note"><div class="note-title" aria-level="2" role="heading" id="h_note_30"><span>Note</span></div><p class="">Caching of the relevant triples retrieved via this mechanism is <em class="rfc2119" title="RECOMMENDED">RECOMMENDED</em>. Embedding definitions for well known, stable RDFa Initial Contexts in the implementation is <em class="rfc2119" title="RECOMMENDED">RECOMMENDED</em>.</p></div> <div class="note"><div class="note-title" aria-level="2" role="heading" id="h_note_31"><span>Note</span></div><div class=""><ul><li>The object literal for the <code>rdfa:uri</code> predicate <em class="rfc2119" title="MUST">MUST</em> be an absolute IRI.</li> <li>The object literal for the <code>rdfa:term</code> predicate <em class="rfc2119" title="MUST">MUST</em> match the production for <a href="#P_term">term</a>.</li> <li>The object literal for the <code>rdfa:prefix</code> predicate must match the production for <a href="#P_prefix">prefix</a>.</li> <li>The object literal for the <code>rdfa:vocabulary</code> predicate <em class="rfc2119" title="MUST">MUST</em> be an absolute IRI.</li> <li> If one of the objects is not a literal, does not match its associated production, if there is more than one <code>rdfa:vocabulary</code> predicate, or if there are additional <code>rdfa:uri</code> or <code>rdfa:term</code> predicates sharing the same subject, an RDFa Processor <em class="rfc2119" title="MUST NOT">MUST NOT</em> create the associated mapping.</li></ul></div></div> </section> <section id="s_vocab_expansion" typeof="bibo:Chapter" resource="#s_vocab_expansion" rel="bibo:chapter"> <!--OddPage--><h2 aria-level="1" role="heading" id="h2_s_vocab_expansion"><span class="secno">10. </span>RDFa Vocabulary Expansion</h2> <p> Since RDFa is based on RDF, the semantics of RDF vocabularies can be used to gain more knowledge about data. Vocabularies, properties and classes are identified by IRIs, which enables them to be discoverable. RDF data published at the location of these IRIs can be retrieved, and descriptions of the properties and classes using specified semantics can be applied. </p> <p><dfn id="T-vocab-expansion">RDFa Vocabulary Expansion</dfn> is an optional processing step which may be added once the normal processing steps described in <a href="#s_model">Processing Model</a> are complete. Vocabulary expansion relies on a very small sub-set of OWL entailment [<cite><a class="bibref" href="#bib-OWL2-OVERVIEW">OWL2-OVERVIEW</a></cite>] to add triples to the <a class="tref" title="output-graph" href="#T-output-graph">output graph</a> based on rules and property/class relationships described in referenced vocabularies. Vocabulary expansion <em class="rfc2119" title="MAY">MAY</em> be performed as part of a larger RDF toolset including, for example, an OWL 2 RL reasoner. Alternatively, using vocabulary data added to the <a class="tref" title="output-graph" href="#T-output-graph">output graph</a> in processing step 2 of <a href="#s_sequence">Sequence</a>, expansion <em class="rfc2119" title="MAY">MAY</em> also be done using a separate and dedicated (e.g., rule based) reasoner after the <a class="tref" title="output-graph" href="#T-output-graph">output graph</a> has been generated, or as the last processing step by an RDFa processor. </p> <p> It can be very useful to make generalized data available for subsequent usage of RDFa-embedded data by expanding inferred statements entailed by these semantics. This provides for existing vocabularies that extend well-known vocabularies to have those properties added to the output graph automatically. For example, the namespace document of the Creative Commons vocabulary, i.e., <code>http://creativecommons.org/ns</code>, defines <code>cc:license</code> to be a sub-property of <code>dc:license</code>. By using the <a class="aref" href="#A-vocab" title="vocab">@vocab</a> attribute, one can describe a licensing information as follows:</p> <div class="example"><div class="example-title"><span>Example 130</span></div><pre class="example">This document is licensed under the <a vocab="http://creativecommons.org/ns#" rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/"> Creative Commons By-NC-ND License </a>.</pre></div> <p>which results in the following <a class="tref" title="output-graph" href="#T-output-graph">output graph</a>:</p> <div class="example"><div class="example-title"><span>Example 131</span></div><pre class="example">@prefix cc: <http://creativecommons.org/ns#> . @prefix rdfa: <http://www.w3.org/ns/rdfa#> . <> cc:license <http://creativecommons.org/licenses/by-nc-nd/3.0/> ; rdfa:usesVocabulary <http://creativecommons.org/ns#> .</pre></div> <p>After vocabulary expansion, the <a class="tref" title="output-graph" href="#T-output-graph">output graph</a> contains:</p> <div class="example"><div class="example-title"><span>Example 132</span></div><pre class="example">@prefix cc: <http://creativecommons.org/ns#> . @prefix rdfa: <http://www.w3.org/ns/rdfa#> . <span class="hilite">@prefix dc: <http://purl.org/dc/terms/> .</span> <> cc:license <http://creativecommons.org/licenses/by-nc-nd/3.0/>; <span class="hilite">dc:license <http://creativecommons.org/licenses/by-nc-nd/3.0/></span> ; rdfa:usesVocabulary <http://creativecommons.org/ns#> .</pre></div> <p> Other vocabularies, specifically intended to provide relations to multiple vocabularies, could also be defined by publishers, allowing use of terms in a single namespace which result in properties and/or classes from other primary vocabularies being imported. This benefits publishers as data is now more widely searchable and encourages the practice of referencing well-known vocabularies. </p> <section class="informative" id="s_vocab_expansion_details" typeof="bibo:Chapter" resource="#s_vocab_expansion_details" rel="bibo:chapter"> <h3 aria-level="2" role="heading" id="h3_s_vocab_expansion_details"><span class="secno">10.1 </span>Details of the RDFa Vocabulary Expansion</h3><p><em>This section is non-normative.</em></p> <p>Once the <a class="tref" title="output-graph" href="#T-output-graph">output graph</a> is generated following the processing steps defined in <a href="#s_sequence">Sequence</a>, processors <em class="rfc2119" title="MAY">MAY</em> perform the following processing steps on the output graph. It must do so only if the user of the processor explicitly asks for it, as prescribed in <a href="#s_expansion_control">Vocabulary Expansion Control of RDFa Processors</a>.</p> <p>A <dfn title="vocabulary-graph" id="T-vocabulary-graph">vocabulary graph</dfn> is created as follows: Each object IRI in the <a class="tref" title="output-graph" href="#T-output-graph">output graph</a> that has a subject the current document (<a class="tref" title="base" href="#T-base">base</a>) IRI and a predicate of <code>rdfa:usesVocabulary</code> is dereferenced. <!-- For each IRI being the object of a triple in the <tref>output graph</tref> with the subject being the current document (<tref>base</tref>) IRI and the property being <code>rdfa:usesVocabulary</code>, that IRI is dereferenced. --> If the dereferencing yields the serialization of an RDF graph, that serialization is parsed and the resulting graph is merged with the vocabulary graph. (An RDFa processor capable of vocabulary expansion <em class="rfc2119" title="MUST">MUST</em> accept an RDF graph serialized in RDFa, and <em class="rfc2119" title="SHOULD">SHOULD</em> accept other standard serialization formats of RDF such as RDF/XML [<cite><a class="bibref" href="#bib-RDF-SYNTAX-GRAMMAR">RDF-SYNTAX-GRAMMAR</a></cite>] and Turtle [<cite><a class="bibref" href="#bib-TURTLE">TURTLE</a></cite>].) </p> <div class="note"><div class="note-title" aria-level="3" role="heading" id="h_note_32"><span>Note</span></div><p class=""> Note that if, in the second step, a particular vocabulary is serialized in RDFa, that particular graph is not expected to undergo any vocabulary expansion on its own. </p></div> <p>Vocabulary expansion is then performed as follows:</p> <ol> <li>The processor operates on the merge of the default and vocabulary graphs using <a href="#s_vocab_entailment">RDFa Vocabulary Entailment</a>.</li> <li>Add the new triples inferred from the <a class="tref" title="output-graph" href="#T-output-graph">output graph</a> using this entailment to the (expanded) <a class="tref" title="output-graph" href="#T-output-graph">output graph</a>. The processor <em class="rfc2119" title="SHOULD NOT">SHOULD NOT</em> add the triples appearing in the <a class="tref" title="vocabulary-graph" href="#T-vocabulary-graph">vocabulary graph</a> only.</li> </ol> <div class="explanation"> The goal of the second step is to avoid adding the "axioms", e.g., the sub-property definitions to the output graph. Applications usually do not require any of this additional information. </div> <section id="s_vocab_entailment" typeof="bibo:Chapter" resource="#s_vocab_entailment" rel="bibo:chapter"> <h4 aria-level="3" role="heading" id="h4_s_vocab_entailment"><span class="secno">10.1.1 </span><dfn id="T-vocab-entailment">RDFa Vocabulary Entailment</dfn></h4><p><em>This section is non-normative.</em></p> <p> For the purpose of vocabulary processing, RDFa used a very restricted subset of the OWL vocabulary and is based on the RDF-Based Semantics of OWL [<cite><a class="bibref" href="#bib-OWL2-RDF-BASED-SEMANTICS">OWL2-RDF-BASED-SEMANTICS</a></cite>]. The RDFa Vocabulary Entailment uses the following terms: </p> <ul> <li><code>rdf:type</code></li> <li><code>rdfs:subClassOf</code></li> <li><code>rdfs:subPropertyOf</code></li> <li><code>owl:equivalentClass</code></li> <li><code>owl:equivalentProperty</code><br> </li> </ul> <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_33"><span>Note</span></div><p class="">RDFa Vocabulary Entailment considers only the entailment on individuals (i.e., not on the relationships that can be deduced on the properties or the classes themselves.)<br> </p></div> <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_34"><span>Note</span></div><p class="">While the formal definition of the RDFa Entailment refers to the general OWL 2 Semantics, practical implementations may rely on a subset of the OWL 2 RL Profile’s entailment expressed in rules (<cite><a href="https://www.w3.org/TR/2009/REC-owl2-profiles-20091027/#Reasoning_in_OWL_2_RL_and_RDF_Graphs_using_Rules">section 4.3</a></cite> of [<cite><a class="bibref" href="#bib-OWL2-PROFILES">OWL2-PROFILES</a></cite>]). The relevant rules are, using the rule identifications in <cite><a href="https://www.w3.org/TR/2009/REC-owl2-profiles-20091027/#Reasoning_in_OWL_2_RL_and_RDF_Graphs_using_Rules">section 4.3</a></cite> of [<cite><a class="bibref" href="#bib-OWL2-PROFILES">OWL2-PROFILES</a></cite>]): <code>prp-spo1</code>, <code>prp-eqp1</code>, <code>prp-eqp2</code>, <code>cax-sco</code>, <code>cax-eqc1</code>, and <code>cax-eqc2</code>. </p></div> <p>The entailment described in this section is the <em>minimum</em> useful level for RDFa. Processors may, of course, choose to follow more powerful entailment regimes, e.g., include full RDFS [<cite><a class="bibref" href="#bib-RDF-MT">RDF-MT</a></cite>] or OWL [<cite><a class="bibref" href="#bib-OWL2-OVERVIEW">OWL2-OVERVIEW</a></cite>] entailments. Using those entailments applications may perform datatype validation by checking <code>rdfs:range</code> of a property, or use the advanced facilities offered by, e.g., OWL’s property chains to interlink vocabularies further.</p> </section> </section> <section class="normative" id="s_expansion_control" typeof="bibo:Chapter" resource="#s_expansion_control" rel="bibo:chapter"> <h3 aria-level="2" role="heading" id="h3_s_expansion_control"><span class="secno">10.2 </span>Vocabulary Expansion Control of RDFa Processors</h3> <p> Conforming RDFa processors are not required to provide vocabulary expansion. </p> <p> If an RDFa processor provides vocabulary expansion, it <em class="rfc2119" title="MUST NOT">MUST NOT</em> be performed by default. Instead, the processor <em class="rfc2119" title="MUST">MUST</em> provide an option, <code>vocab_expansion</code>, which, when used, instructs the RDFa processor to perform a vocabulary expansion before returning the output graph. </p> <div class="note"><div class="note-title" aria-level="3" role="heading" id="h_note_35"><span>Note</span></div><p class=""> Although vocabulary expansion is described in terms of a <a class="tref" title="vocabulary-graph" href="#T-vocabulary-graph">vocabulary graph</a> and OWL 2 entailment rules, processors are free to use any process which obtains equivalent results. </p></div> <section class="informative" id="s_vocab_guidelines" typeof="bibo:Chapter" resource="#s_vocab_guidelines" rel="bibo:chapter"> <h4 aria-level="3" role="heading" id="h4_s_vocab_guidelines"><span class="secno">10.2.1 </span>Notes to RDFa Vocabulary Implementations and Publishing</h4><p><em>This section is non-normative.</em></p> <p>For RDFa Processors caching the relevant graphs retrieved via this mechanism is <em class="rfc2119" title="RECOMMENDED">RECOMMENDED</em>. Caching is usually based on HTTP response headers like expiration time, cache control, etc.</p> <p>For publishers of vocabularies, the IRI for the vocabularies <em class="rfc2119" title="SHOULD">SHOULD</em> be dereferenceable, and should return an RDF graph with the vocabulary description. This vocabulary description <em class="rfc2119" title="SHOULD">SHOULD</em> be available encoded in RDFa, and <em class="rfc2119" title="MAY">MAY</em> also be available in other RDF serialization syntaxes (using content negotiation to choose among the different formats). If possible, vocabulary descriptions <em class="rfc2119" title="SHOULD">SHOULD</em> include subproperty and subclass statements linking the vocabulary terms to other, well-known vocabularies. Finally, HTTP responses <em class="rfc2119" title="SHOULD">SHOULD</em> include fields usable for cache control, e.g., expiration date.</p> </section> </section> </section> <section class="appendix" id="s_datatypes" typeof="bibo:Chapter" resource="#s_datatypes" rel="bibo:chapter"> <!--OddPage--><h2 aria-level="1" role="heading" id="h2_s_datatypes"><span class="secno">A. </span>CURIE Datatypes</h2> <p>In order to facilitate the use of CURIEs in markup languages, this specification defines some additional datatypes in the XHTML datatype space (<code>http://www.w3.org/1999/xhtml/datatypes/</code>). Markup languages that want to import these definitions can find them in the "datatypes" file for their schema grammar:</p> <ul> <li><a href="https://www.w3.org/MarkUp/DTD/xhtml-datatypes-1.mod">DTD xhtml-datatypes.mod</a></li> <li><a href="https://www.w3.org/MarkUp/SCHEMA/xhtml-datatypes-1.xsd">XML Schema xhtml-datatypes.xsd</a></li> </ul> <p>Specifically, the following datatypes are defined:</p> <dl> <dt><dfn id="dfn-curie">CURIE</dfn></dt> <dd>A single <a href="#P_curie">curie</a></dd> <dt><dfn id="dfn-curies">CURIEs</dfn></dt> <dd>A white space separated list of <a class="datatype internalDFN" title="CURIE" href="#dfn-curie">CURIE</a>s</dd> <dt><dfn id="dfn-curieoriri">CURIEorIRI</dfn></dt> <dd>A <a class="datatype internalDFN" title="CURIE" href="#dfn-curie">CURIE</a> or an <a class="externalDFN" title="IRI">IRI</a></dd> <dt><dfn id="dfn-curieoriris">CURIEorIRIs</dfn></dt> <dd>A white space separated list of <a class="datatype internalDFN" title="CURIEorIRI" href="#dfn-curieoriri">CURIEorIRI</a>s</dd> <dt><dfn id="dfn-safecurie">SafeCURIE</dfn></dt> <dd>A single <a href="#P_safe_curie">safe_curie</a></dd> <dt><dfn id="dfn-safecurieorcurieoriri">SafeCURIEorCURIEorIRI</dfn></dt> <dd>A single <a class="datatype internalDFN" title="SafeCURIE" href="#dfn-safecurie">SafeCURIE</a> or <a class="datatype internalDFN" title="CURIEorIRI" href="#dfn-curieoriri">CURIEorIRI</a></dd> <dt><dfn id="dfn-safecurieorcurieoriris">SafeCURIEorCURIEorIRIs</dfn></dt> <dd>A white space separated list of <a class="datatype internalDFN" title="SafeCURIEorCURIEorIRI" href="#dfn-safecurieorcurieoriri">SafeCURIEorCURIEorIRI</a>s.</dd> <dt><dfn id="dfn-term">TERM</dfn></dt> <dd>A single <a href="#P_term">term</a></dd> <dt><dfn id="dfn-termorcurieorabsiri">TERMorCURIEorAbsIRI</dfn></dt> <dd>A <a class="datatype internalDFN" title="TERM" href="#dfn-term">TERM</a> or a <a class="datatype internalDFN" title="CURIEorIRI" href="#dfn-curieoriri">CURIEorIRI</a></dd> <dt><dfn id="dfn-termorcurieorabsiris">TERMorCURIEorAbsIRIs</dfn></dt> <dd>A white space separated list of <a class="datatype internalDFN" title="TERMorCURIEorAbsIRI" href="#dfn-termorcurieorabsiri">TERMorCURIEorAbsIRI</a>s</dd> </dl> <section class="informative" id="xml-schema-definition"> <h3 aria-level="2" role="heading" id="h3_xml-schema-definition"><span class="secno">A.1 </span>XML Schema Definition</h3><p><em>This section is non-normative.</em></p> <p>The following <i>informative</i> XML Schema definition for these datatypes is included as an example:</p> <div class="example"><div class="example-title"><span>Example 133</span></div><pre class="example"><?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/1999/xhtml/datatypes/" xmlns:xh11d="http://www.w3.org/1999/xhtml/datatypes/" targetNamespace="http://www.w3.org/1999/xhtml/datatypes/" elementFormDefault="qualified" > <xs:simpleType name="CURIE"> <xs:restriction base="xs:string"> <xs:pattern value="(([\i-[:]][\c-[:]]*)?:)?(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)" /> <xs:minLength value="1"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="CURIEs"> <xs:list itemType="xh11d:CURIE"/> </xs:simpleType> <xs:simpleType name="SafeCURIE"> <xs:restriction base="xs:string"> <xs:pattern value="\[(([\i-[:]][\c-[:]]*)?:)?(/[^\s/][^\s]*|[^\s/][^\s]*|[^\s]?)\]" /> <xs:minLength value="3"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="SafeCURIEs"> <xs:list itemType="xh11d:SafeCURIE"/> </xs:simpleType> <xs:simpleType name="TERM"> <xs:restriction base="xs:Name"> <xs:pattern value="[\i-[:]][/\c-[:]]*" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="CURIEorIRI"> <xs:union memberTypes="xh11d:CURIE xsd:anyURI" /> </xs:simpleType> <xs:simpleType name="CURIEorIRIs"> <xs:list itemType="xh11d:CURIEorIRI"/> </xs:simpleType> <xs:simpleType name="SafeCURIEorCURIEorIRI"> <xs:union memberTypes="xh11d:SafeCURIE xh11d:CURIE xsd:anyURI" /> </xs:simpleType> <xs:simpleType name="SafeCURIEorCURIEorIRIs"> <xs:list itemType="xh11d:SafeCURIEorCURIEorIRI"/> </xs:simpleType> <xs:simpleType name='AbsIRI'> <xs:restriction base='xs:string'> <xs:pattern value="[\i-[:]][\c-[:]]+:.+" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="TERMorCURIEorAbsIRI"> <xs:union memberTypes="xh11d:TERM xh11d:CURIE xh11d:AbsIRI" /> </xs:simpleType> <xs:simpleType name="TERMorCURIEorAbsIRIs"> <xs:list itemType="xh11d:SafeCURIEorCURIEorAbsIRI"/> </xs:simpleType> </xs:schema></pre></div> </section> <section class="informative" id="xml-dtd-definition"> <h3 aria-level="2" role="heading" id="h3_xml-dtd-definition"><span class="secno">A.2 </span>XML DTD Definition</h3><p><em>This section is non-normative.</em></p> <p>The following <i>informative</i> XML DTD definition for these datatypes is included as an example:</p> <div class="example"><div class="example-title"><span>Example 134</span></div><pre class="example"><!ENTITY % CURIE.datatype "CDATA" > <!ENTITY % CURIEs.datatype "CDATA" > <!ENTITY % CURIEorIRI.datatype "CDATA" > <!ENTITY % CURIEorIRIs.datatype "CDATA" > <!ENTITY % SafeCURIEorCURIEorIRI.datatype "CDATA" > <!ENTITY % SafeCURIEorCURIEorIRIs.datatype "CDATA" > <!ENTITY % TERMorCURIEorAbsIRI.datatype "CDATA" > <!ENTITY % TERMorCURIEorAbsIRIs.datatype "CDATA" ></pre></div> </section> </section> <section class="normative" id="vocabulary" typeof="bibo:Chapter" resource="#vocabulary" rel="bibo:chapter"> <!--OddPage--><h2 aria-level="1" role="heading" id="h2_vocabulary"><span class="secno">B. </span>The RDFa Vocabulary</h2> <p>The RDFa Vocabulary has three roles: it contains the predicates to define the terms and prefixes in <a class="tref" title="initial-context" href="#T-initial-context">initial context</a> documents, it contains the classes and predicates for the messages that a <a class="tref" title="processor-graph" href="#T-processor-graph">processor graph</a> may contain and, finally, it contains the predicate necessary for vocabulary processing. The IRI of the vocabulary is <code>http://www.w3.org/ns/rdfa#</code>; the usual prefix used in this document is <code>rdfa</code>.</p> <p>This vocabulary specification is available in <a href="https://www.w3.org/ns/rdfa.html">XHTML+RDFa 1.1</a>, <a href="https://www.w3.org/ns/rdfa.ttl">Turtle</a>, and in <a href="https://www.w3.org/ns/rdfa.rdf">RDF/XML</a> formats.</p> <section class="normative" id="term-prefix-definitions-vocabulary" typeof="bibo:Chapter" resource="#term-prefix-definitions-vocabulary" rel="bibo:chapter"> <h3 aria-level="2" role="heading" id="h3_term-prefix-definitions-vocabulary"><span class="secno">B.1 </span>Term and Prefix Assignments</h3> <p>The RDFa Vocabulary includes the following triples (shown here in Turtle [<cite><a class="bibref" href="#bib-TURTLE">TURTLE</a></cite>] format): </p> <div class="example"><div class="example-title"><span>Example 135</span></div><pre class="example">@prefix dc: <http://purl.org/dc/terms/> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix rdfa: <http://www.w3.org/ns/rdfa#> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . <http://www.w3.org/ns/rdfa#> a owl:Ontology . rdfa:PrefixOrTermMapping a rdfs:Class, owl:Class ; dc:description "The top level class for prefix or term mappings." . rdfa:PrefixMapping dc:description "The class for prefix mappings." . rdfs:subClassOf rdfa:PrefixOrTermMapping . rdfa:TermMapping dc:description "The class for term mappings." . rdfs:subClassOf rdfa:PrefixOrTermMapping . rdfa:prefix a rdf:Property, owl:DatatypeProperty ; rdfs:domain rdfa:PrefixMapping ; dc:description "Defines a prefix mapping for an IRI; the value is supposed to be a NMTOKEN." . rdfa:term a rdf:Property, owl:DatatypeProperty ; rdfs:domain rdfa:TermMapping ; dc:description "Defines a term mapping for an IRI; the value is supposed to be a NMTOKEN." . rdfa:uri a rdf:Property, owl:DatatypeProperty ; rdfs:domain rdfa:PrefixOrTermMapping ; dc:description """Defines the IRI for either a prefix or a term mapping; the value is supposed to be an absolute IRI.""" . rdfa:vocabulary a rdf:Property, owl:DatatypeProperty ; dc:description """Defines an IRI to be used as a default vocabulary; the value is can be any string; for documentation purposes it is advised to use the string ‘true’ or ‘True’.""" . </pre></div> <p>These predicates can be used to define the <a class="tref" title="initial-context" href="#T-initial-context">initial context</a> for a given Host Language.</p> <p>These predicates are used to 'pair' IRI strings and their usage in the form of a prefix and/or a term as part of, for example, a blank node. An example can be as follows:</p> <div class="example"><div class="example-title"><span>Example 136</span></div><pre class="example">[] rdfa:uri "http://xmlns.com/foaf/0.1/name" ; rdfa:prefix "foaf" . </pre></div> <p>which defines a prefix for the FOAF IRI.</p> </section> <section class="normative" id="processor-graph-reporting" typeof="bibo:Chapter" resource="#processor-graph-reporting" rel="bibo:chapter"> <h3 aria-level="2" role="heading" id="h3_processor-graph-reporting"><span class="secno">B.2 </span>Processor Graph Reporting</h3> <p>The Vocabulary includes the following term definitions (shown here in Turtle [<cite><a class="bibref" href="#bib-TURTLE">TURTLE</a></cite>] format): </p> <div class="example"><div class="example-title"><span>Example 137</span></div><pre class="example">@prefix dc: <http://purl.org/dc/terms/> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix rdfa: <http://www.w3.org/ns/rdfa#> . rdfa:PGClass a rdfs:Class, owl:Class; dc:description "The top level class of the hierarchy." . rdfa:Error dcterms:description "The class for all error conditions."; rdfs:subClassOf rdfa:PGClass . rdfa:Warning dcterms:description "The class for all warnings."; rdfs:subClassOf rdfa:PGClass . rdfa:Info dcterms:description "The class for all informations."; rdfs:subClassOf rdfa:PGClass . rdfa:DocumentError dc:description "An error condition to be used when the document fails to be fully processed as a result of non-conformant host language markup."; rdfs:subClassOf rdfa:Error . rdfa:VocabReferenceError dc:description "A warning to be used when the value of a @vocab attribute cannot be dereferenced, hence the vocabulary expansion cannot be completed."; rdfs:subClassOf rdfa:Warning . rdfa:UnresolvedTerm dc:description "A warning to be used when a Term fails to be resolved."; rdfs:subClassOf rdfa:Warning . rdfa:UnresolvedCURIE dc:description "A warning to be used when a CURIE prefix fails to be resolved."; rdfs:subClassOf rdfa:Warning . rdfa:context a owl:ObjectProperty, rdf:Property; dc:description "Provides extra context for the error, e.g., http response, an XPointer/XPath information, or simply the IRI that created the error."; rdfs:domain rdfa:PGClass .</pre></div> </section> <section class="normative" id="vocabulary-relationship" typeof="bibo:Chapter" resource="#vocabulary-relationship" rel="bibo:chapter"> <h3 aria-level="2" role="heading" id="h3_vocabulary-relationship"><span class="secno">B.3 </span>Term for vocabulary expansion</h3> <p>The Vocabulary includes the following term definitions (shown here in Turtle [<cite><a class="bibref" href="#bib-TURTLE">TURTLE</a></cite>] format): </p> <div class="example"><div class="example-title"><span>Example 138</span></div><pre class="example">@prefix dc: <http://purl.org/dc/terms/> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfa: <http://www.w3.org/ns/rdfa#> . rdfa:usesVocabulary a owl:ObjectProperty, rdf:Property; dc:description "Provides a relationship between the host document and a vocabulary defined using the @vocab facility of RDFa1.1." .</pre></div> </section> </section> <section class="informative" id="a_history" typeof="bibo:Chapter" resource="#a_history" rel="bibo:chapter"> <!--OddPage--><h2 aria-level="1" role="heading" id="h2_a_history"><span class="secno">C. </span>Changes</h2><p><em>This section is non-normative.</em></p> <section id="major-differences-with-rdfa-syntax-1.0"> <h3 aria-level="2" role="heading" id="h3_major-differences-with-rdfa-syntax-1.0"><span class="secno">C.1 </span>Major differences with RDFa Syntax 1.0</h3><p><em>This section is non-normative.</em></p> <p>This specification introduces a number of new features, and extends the behavior of some features from the previous version. The following summary may be helpful to RDFa Processor developers, but is <em>not</em> meant to be comprehensive.</p> <ul> <li>Specific rules about XHTML have been moved into a companion specification: [<cite><a class="bibref" href="#bib-XHTML-RDFA">XHTML-RDFA</a></cite>].</li> <li>Prefix mappings can now be declared using <a class="aref" href="#A-prefix" title="prefix">@prefix</a> in addition to <span class="aref">@xmlns</span>. The usage of <span class="aref">@xmlns</span> has been deprecated.</li> <li>Prefix names are now required to be converted to lower-case when the mapping is defined. Prefixes are checked in a case-insensitive manner during CURIE expansion.</li> <li>You can now use an Absolute IRI everywhere you could previously only use a CURIE (e.g., in the value of <a class="aref" href="#A-datatype" title="datatype">@datatype</a>).</li> <li>There is now a concept of a <a class="tref" title="term" href="#T-term">term</a>. This concept has replaced the concept of a 'reserved word'. It is possible now to use a 'term' in most places where you could previously only use a CURIE.</li> <li>You can define a default prefix mapping (via <a class="aref" href="#A-vocab" title="vocab">@vocab</a>) that will be used on undefined terms.</li> <li>When a triple would include an object literal, and there is no explicit datatype attribute, the object literal will now be a 'plain literal'. In version 1.0 it would have been an 'XMLLiteral'.</li> <li>The <a class="aref" href="#A-inlist" title="inlist">@inlist</a> attribute can be used to instruct the processor to generate RDF lists with the resources rather than simple triples.</li> <li>The effect of <a class="aref" href="#A-src" title="src">@src</a> is now identical to <a class="aref" href="#A-href" title="href">@href</a> rather than <a class="aref" href="#A-about" title="about">@about</a> like in version 1.0. </li> </ul> <p>While this specification strives to be as backward compatible as possible with [<cite><a class="bibref" href="#bib-RDFA-SYNTAX">RDFA-SYNTAX</a></cite>], the changes above mean that there are some circumstances where it is possible for different RDF triples to be output for the same document when processed by an RDFa 1.0 processor vs. an RDFa 1.1 processor. In order to minimize these differences, a document author can do the following:</p> <ul> <li>Use the XHTML+RDFa 1.0 document type as defined in [<cite><a class="bibref" href="#bib-RDFA-SYNTAX">RDFA-SYNTAX</a></cite>].</li> <li>Place a <span class="aref">@version</span> attribute with the value <code>XHTML+RDFa 1.0</code> on the <code>html</code> element.</li> <li>If there are places in the document where an object literal <em class="rfc2119" title="MUST">MUST</em> be an XMLLiteral, use <code>datatype='rdf:XMLLiteral'</code>.</li> <li>If there are places in the document where an object literal <em class="rfc2119" title="MUST">MUST</em> be a plain literal, use <code>datatype=''</code>.</li> <li>If there are places in the document where <a class="aref" href="#A-src" title="src">@src</a> is used, add an <a class="aref" href="#A-about" title="about">@about</a> (unless already present) with the same IRI.</li> </ul> <p>When producing XHTML+RDFa 1.1 documents, it is possible to reduce the incompatibilities with RDFa 1.0 conforming processors by doing the following:</p> <ul> <li>DO NOT use the <a class="aref" href="#A-vocab" title="vocab">@vocab</a> feature.</li> <li>DO NOT rely upon host language defaults for IRI mappings.</li> <li>DO NOT use absolute IRIs in place of CURIEs.</li> <li>Use <span class="aref">@xmlns</span> AND <a class="aref" href="#A-prefix" title="prefix">@prefix</a> when declaring prefix mappings.</li> <li>DO NOT use TERMs on <a class="aref" href="#A-datatype" title="datatype">@datatype</a>, <a class="aref" href="#A-property" title="property">@property</a>, or <a class="aref" href="#A-typeof" title="typeof">@typeof</a>.</li> <li>When using TERMs in <a class="aref" href="#A-rel" title="rel">@rel</a> and <a class="aref" href="#A-rev" title="rev">@rev</a>, only use ones defined in [<cite><a class="bibref" href="#bib-RDFA-SYNTAX">RDFA-SYNTAX</a></cite>].</li> <li>Place a <span class="aref">version</span> attribute with the value <code>XHTML+RDFa 1.0</code> on the <code>html</code> element.</li> <li>If there are places in the document where an object literal <em class="rfc2119" title="MUST">MUST</em> be an XMLLiteral, use <code>datatype='rdf:XMLLiteral'</code>.</li> <li>If there are places in the document where an object literal <em class="rfc2119" title="MUST">MUST</em> be a plain literal, use <code>datatype=''</code>.</li> <li>If there are places in the document where <a class="aref" href="#A-src" title="src">@src</a> is used, add an <a class="aref" href="#A-about" title="about">@about</a> (unless already present) with the same IRI.</li> </ul> </section> </section> <section class="informative" id="a_acks" typeof="bibo:Chapter" resource="#a_acks" rel="bibo:chapter"> <!--OddPage--><h2 aria-level="1" role="heading" id="h2_a_acks"><span class="secno">D. </span>Acknowledgments</h2><p><em>This section is non-normative.</em></p> <p>At the time of publication, the active members of the RDF Web Applications Working Group were:</p> <ul> <li>Stéphane Corlosquet, MIND Center for Interdisciplinary Informatics</li> <li>Ivan Herman, <abbr title="World Wide Web Consortium">W3C</abbr></li> <li>Gregg Kellogg (Invited Expert)</li> <li>Niklas Lindström (Invited Expert)</li> <li>Shane McCarron, Applied Testing and Technology, Inc. (Invited Expert)</li> <li>Steven Pemberton, Centre for Mathematics and Computer Science (CWI)</li> <li>Manu Sporny, Digital Bazaar (Chair, Invited Expert) </li> </ul> </section> <section id="references" class="appendix" typeof="bibo:Chapter" resource="#references" rel="bibo:chapter"><!--OddPage--><h2 aria-level="1" role="heading" id="h2_references"><span class="secno">E. </span>References</h2><section id="normative-references" typeof="bibo:Chapter" resource="#normative-references" rel="bibo:chapter"><h3 aria-level="2" role="heading" id="h3_normative-references"><span class="secno">E.1 </span>Normative references</h3><dl class="bibliography" about=""><dt id="bib-HTML-RDFA">[HTML-RDFA]</dt><dd rel="dcterms:requires">Manu Sporny et al. <a href="https://www.w3.org/TR/html-rdfa">HTML+RDFa 1.1</a>. 22 August 2013. W3C Recommendation. URL: <a href="https://www.w3.org/TR/html-rdfa/">http://www.w3.org/TR/html-rdfa/</a> </dd><dt id="bib-OWL2-OVERVIEW">[OWL2-OVERVIEW]</dt><dd rel="dcterms:requires">W3C OWL Working Group. <a href="https://www.w3.org/TR/owl2-overview/"><cite>OWL 2 Web Ontology Language Document Overview (Second Edition)</cite></a>. 11 December 2012. W3C Recommendation. URL: <a href="https://www.w3.org/TR/owl2-overview/">http://www.w3.org/TR/owl2-overview/</a> </dd><dt id="bib-OWL2-PROFILES">[OWL2-PROFILES]</dt><dd rel="dcterms:requires">Boris Motik; Bernardo Cuenca Grau; Ian Horrocks; Zhe Wu; Achille Fokoue. <a href="https://www.w3.org/TR/owl2-profiles/"><cite>OWL 2 Web Ontology Language Profiles (Second Edition)</cite></a>. 11 December 2012. W3C Recommendation. URL: <a href="https://www.w3.org/TR/owl2-profiles/">http://www.w3.org/TR/owl2-profiles/</a> </dd><dt id="bib-OWL2-RDF-BASED-SEMANTICS">[OWL2-RDF-BASED-SEMANTICS]</dt><dd rel="dcterms:requires">Michael Schneider. <a href="https://www.w3.org/TR/owl2-rdf-based-semantics/"><cite>OWL 2 Web Ontology Language RDF-Based Semantics (Second Edition)</cite></a>. 11 December 2012. W3C Recommendation. URL: <a href="https://www.w3.org/TR/owl2-rdf-based-semantics/">http://www.w3.org/TR/owl2-rdf-based-semantics/</a> </dd><dt id="bib-RDF-MT">[RDF-MT]</dt><dd rel="dcterms:requires">Patrick Hayes. <a href="https://www.w3.org/TR/rdf-mt/"><cite>RDF Semantics</cite></a>. 10 February 2004. W3C Recommendation. URL: <a href="https://www.w3.org/TR/rdf-mt/">http://www.w3.org/TR/rdf-mt/</a> </dd><dt id="bib-RDF-SYNTAX-GRAMMAR">[RDF-SYNTAX-GRAMMAR]</dt><dd rel="dcterms:requires">Dave Beckett. <a href="https://www.w3.org/TR/rdf-syntax-grammar"><cite>RDF/XML Syntax Specification (Revised)</cite></a>. 10 February 2004. W3C Recommendation. URL: <a href="https://www.w3.org/TR/rdf-syntax-grammar">http://www.w3.org/TR/rdf-syntax-grammar</a> </dd><dt id="bib-RFC2119">[RFC2119]</dt><dd rel="dcterms:requires">S. Bradner. <a href="http://www.ietf.org/rfc/rfc2119.txt"><cite>Key words for use in RFCs to Indicate Requirement Levels.</cite></a> March 1997. Internet RFC 2119. URL: <a href="http://www.ietf.org/rfc/rfc2119.txt">http://www.ietf.org/rfc/rfc2119.txt</a> </dd><dt id="bib-RFC3987">[RFC3987]</dt><dd rel="dcterms:requires">M. Dürst; M. Suignard. <a href="http://www.ietf.org/rfc/rfc3987.txt"><cite>Internationalized Resource Identifiers (IRIs)</cite></a>. January 2005. RFC. URL: <a href="http://www.ietf.org/rfc/rfc3987.txt">http://www.ietf.org/rfc/rfc3987.txt</a> </dd><dt id="bib-XHTML-RDFA">[XHTML-RDFA]</dt><dd rel="dcterms:requires">Shane McCarron. <a href="https://www.w3.org/TR/xhtml-rdfa/">XHTML+RDFa 1.1 - Second Edition</a>. 22 August 2013. W3C Recommendation. URL: <a href="https://www.w3.org/TR/xhtml-rdfa">http://www.w3.org/TR/xhtml-rdfa/</a> </dd><dt id="bib-XML-NAMES">[XML-NAMES]</dt><dd rel="dcterms:requires">Tim Bray; Dave Hollander; Andrew Layman; Richard Tobin; Henry Thompson et al. <a href="https://www.w3.org/TR/xml-names"><cite>Namespaces in XML 1.0 (Third Edition)</cite></a>. 8 December 2009. W3C Recommendation. URL: <a href="https://www.w3.org/TR/xml-names">http://www.w3.org/TR/xml-names</a> </dd><dt id="bib-XML10-4e">[XML10-4e]</dt><dd rel="dcterms:requires">C. M. Sperberg-McQueen et al. <a href="https://www.w3.org/TR/2006/REC-xml-20060816/"><cite>Extensible Markup Language (XML) 1.0 (Fourth Edition)</cite></a>. 26 November 2008. W3C Recommendation. URL: <a href="https://www.w3.org/TR/2006/REC-xml-20060816/">http://www.w3.org/TR/2006/REC-xml-20060816/</a> </dd><dt id="bib-XMLSCHEMA11-2">[XMLSCHEMA11-2]</dt><dd rel="dcterms:requires">David Peterson; Sandy Gao; Ashok Malhotra; Michael Sperberg-McQueen; Henry Thompson; Paul V. Biron et al. <a href="https://www.w3.org/TR/xmlschema11-2/"><cite>W3C XML Schema Definition Language (XSD) 1.1 Part 2: Datatypes</cite></a>. 5 April 2012. W3C Recommendation. URL: <a href="https://www.w3.org/TR/xmlschema11-2/">http://www.w3.org/TR/xmlschema11-2/</a> </dd></dl></section><section id="informative-references" typeof="bibo:Chapter" resource="#informative-references" rel="bibo:chapter"><h3 aria-level="2" role="heading" id="h3_informative-references"><span class="secno">E.2 </span>Informative references</h3><dl class="bibliography" about=""><dt id="bib-HTML401">[HTML401]</dt><dd rel="dcterms:references">Dave Raggett; Arnaud Le Hors; Ian Jacobs. <a href="https://www.w3.org/TR/html401"><cite>HTML 4.01 Specification</cite></a>. 24 December 1999. W3C Recommendation. URL: <a href="https://www.w3.org/TR/html401">http://www.w3.org/TR/html401</a> </dd><dt id="bib-MICROFORMATS">[MICROFORMATS]</dt><dd rel="dcterms:references"><a href="http://microformats.org"><cite>Microformats</cite></a>. URL: <a href="http://microformats.org">http://microformats.org</a> </dd><dt id="bib-QNAMES">[QNAMES]</dt><dd rel="dcterms:references">N. Walsh. <a href="https://www.w3.org/2001/tag/doc/qnameids-2004-03-17"><cite>Using Qualified Names (QNames) as Identifiers in XML Content</cite></a>. 17 March, 2004. TAG Finding. URL: <a href="https://www.w3.org/2001/tag/doc/qnameids-2004-03-17">http://www.w3.org/2001/tag/doc/qnameids-2004-03-17</a> </dd><dt id="bib-RDF-PRIMER">[RDF-PRIMER]</dt><dd rel="dcterms:references">Frank Manola; Eric Miller. <a href="https://www.w3.org/TR/rdf-primer/"><cite>RDF Primer</cite></a>. 10 February 2004. W3C Recommendation. URL: <a href="https://www.w3.org/TR/rdf-primer/">http://www.w3.org/TR/rdf-primer/</a> </dd><dt id="bib-RDF-SYNTAX">[RDF-SYNTAX]</dt><dd rel="dcterms:references">Graham Klyne; Jeremy Carroll. <a href="https://www.w3.org/TR/rdf-concepts/"><cite>Resource Description Framework (RDF): Concepts and Abstract Syntax</cite></a>. 10 February 2004. W3C Recommendation. URL: <a href="https://www.w3.org/TR/rdf-concepts/">http://www.w3.org/TR/rdf-concepts/</a> </dd><dt id="bib-RDF-TESTCASES">[RDF-TESTCASES]</dt><dd rel="dcterms:references">jan grant; Dave Beckett. <a href="https://www.w3.org/TR/rdf-testcases"><cite>RDF Test Cases</cite></a>. 10 February 2004. W3C Recommendation. URL: <a href="https://www.w3.org/TR/rdf-testcases">http://www.w3.org/TR/rdf-testcases</a> </dd><dt id="bib-RDFA-PRIMER">[RDFA-PRIMER]</dt><dd rel="dcterms:references">Ben Adida; Ivan Herman; Manu Sporny; Mark Birbeck. <a href="https://www.w3.org/TR/rdfa-primer/">RDFa 1.1 Primer</a>. 22 August 2013. W3C Note. URL: <a href="https://www.w3.org/TR/rdfa-primer">http://www.w3.org/TR/rdfa-primer/</a> </dd><dt id="bib-RDFA-SYNTAX">[RDFA-SYNTAX]</dt><dd rel="dcterms:references">Ben Adida; Mark Birbeck; Shane McCarron; Steven Pemberton et al. <a href="https://www.w3.org/TR/2008/REC-rdfa-syntax-20081014">RDFa in XHTML: Syntax and Processing</a>. 14 October 2008. W3C Recommendation. URL: <a href="https://www.w3.org/TR/2008/REC-rdfa-syntax-20081014">http://www.w3.org/TR/2008/REC-rdfa-syntax-20081014</a> </dd><dt id="bib-RELAXNG-SCHEMA">[RELAXNG-SCHEMA]</dt><dd rel="dcterms:references"><a href="http://standards.iso.org/ittf/PubliclyAvailableStandards/c052348_ISO_IEC_19757-2_2008(E).zip"><cite>Information technology -- Document Schema Definition Language (DSDL) -- Part 2: Regular-grammar-based validation -- RELAX NG</cite></a>. ISO/IEC 19757-2:2008. URL: <a href="http://standards.iso.org/ittf/PubliclyAvailableStandards/c052348_ISO_IEC_19757-2_2008(E).zip">http://standards.iso.org/ittf/PubliclyAvailableStandards/c052348_ISO_IEC_19757-2_2008(E).zip</a> </dd><dt id="bib-SAX">[SAX]</dt><dd rel="dcterms:references">D. Megginson, et al. <a href="http://www.megginson.com/downloads/SAX/"><cite>SAX: The Simple API for XML</cite></a>. May 1998. URL: <a href="http://www.megginson.com/downloads/SAX/"> http://www.megginson.com/downloads/SAX/</a> </dd><dt id="bib-TURTLE">[TURTLE]</dt><dd rel="dcterms:references">David Beckett; Tim Berners-Lee. <a href="https://www.w3.org/TeamSubmission/turtle/"><cite>Turtle: Terse RDF Triple Language</cite></a>. January 2008. W3C Team Submission. URL: <a href="https://www.w3.org/TeamSubmission/turtle/">http://www.w3.org/TeamSubmission/turtle/</a> </dd><dt id="bib-WIDGETS-URI">[WIDGETS-URI]</dt><dd rel="dcterms:references">Marcos Caceres. <a href="https://www.w3.org/TR/widgets-uri/"><cite>Widget URI scheme</cite></a>. 13 March 2012. W3C Note. URL: <a href="https://www.w3.org/TR/widgets-uri/">http://www.w3.org/TR/widgets-uri/</a> </dd><dt id="bib-XHTML11">[XHTML11]</dt><dd rel="dcterms:references">Shane McCarron; Masayasu Ishikawa. <a href="https://www.w3.org/TR/xhtml11/"><cite>XHTML™ 1.1 - Module-based XHTML - Second Edition</cite></a>. 23 November 2010. W3C Recommendation. URL: <a href="https://www.w3.org/TR/xhtml11/">http://www.w3.org/TR/xhtml11/</a> </dd><dt id="bib-XML-EXC-C14N">[XML-EXC-C14N]</dt><dd rel="dcterms:references">John Boyer; Donald Eastlake; Joseph Reagle. <a href="https://www.w3.org/TR/xml-exc-c14n"><cite>Exclusive XML Canonicalization Version 1.0</cite></a>. 18 July 2002. W3C Recommendation. URL: <a href="https://www.w3.org/TR/xml-exc-c14n">http://www.w3.org/TR/xml-exc-c14n</a> </dd><dt id="bib-XML10">[XML10]</dt><dd rel="dcterms:references">Tim Bray; Jean Paoli; Michael Sperberg-McQueen; Eve Maler; François Yergeau et al. <a href="https://www.w3.org/TR/xml"><cite>Extensible Markup Language (XML) 1.0 (Fifth Edition)</cite></a>. 26 November 2008. W3C Recommendation. URL: <a href="https://www.w3.org/TR/xml">http://www.w3.org/TR/xml</a> </dd><dt id="bib-XMLSCHEMA11-1">[XMLSCHEMA11-1]</dt><dd rel="dcterms:references">Sandy Gao; Michael Sperberg-McQueen; Henry Thompson; Noah Mendelsohn; David Beech; Murray Maloney. <a href="https://www.w3.org/TR/xmlschema11-1/"><cite>W3C XML Schema Definition Language (XSD) 1.1 Part 1: Structures</cite></a>. 5 April 2012. W3C Recommendation. URL: <a href="https://www.w3.org/TR/xmlschema11-1/">http://www.w3.org/TR/xmlschema11-1/</a> </dd></dl></section></section><script src="https://www.w3.org/scripts/TR/fixup.js"></script></body></html>