Skip to content

Commit 78fce53

Browse files
committed
Updated and released 2nd HTML+RDFa draft.
1 parent 7855c8e commit 78fce53

File tree

6 files changed

+570
-50
lines changed

6 files changed

+570
-50
lines changed

docs/microsections-process.svg

Lines changed: 377 additions & 0 deletions
Loading

headers/header-w3c-rdfa

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<!-- when publishing, change bits marked ZZZ -->
44
<html lang="en-US-x-Hixie">
55
<head>
6-
<title>HTML5+RDFa</title>
6+
<title>HTML+RDFa</title>
77
<style type="text/css">
88
pre { margin-left: 2em; white-space: pre-wrap; }
99
h2 { margin: 3em 0 1em 0; }
@@ -202,11 +202,11 @@
202202
src="http://www.w3.org/Icons/w3c_home"
203203
width="72"></a>
204204
</p>
205-
<h1>HTML5+RDFa</h1>
205+
<h1>HTML+RDFa</h1>
206206
<h2 class="no-num no-toc" id="a-mechanism-for-embedding-rdf-in-html">
207207
A mechanism for embedding RDF in HTML
208208
</h2>
209-
<h2 class="no-num no-toc" id="editor-s-draft-date-30-August-2009">Editor's Draft 30 August 2009</h2>
209+
<h2 class="no-num no-toc" id="editor-s-draft-date-05-September-2009">Editor's Draft 05 September 2009</h2>
210210
<!--:ZZZ-->
211211
<dl>
212212
<!-- ZZZ: update the month/day (twice), (un)comment out
@@ -233,7 +233,7 @@
233233
Steven Pemberton (Chair, XHTML2, CWI)
234234
</dd>
235235
<dd>
236-
<a href="mailto:msporny@digitalbazaar.com">Manu Sporny</a>, (Editor, HTML5+RDFa, Digital Bazaar, Inc.)
236+
<a href="mailto:msporny@digitalbazaar.com">Manu Sporny</a>, (Editor, HTML+RDFa, Digital Bazaar, Inc.)
237237
</dd>
238238
</dl>
239239
<p class="copyright">
@@ -259,8 +259,8 @@
259259
This specification defines rules and guidelines for adapting the
260260
RDF in XHTML: Syntax and Processing (RDFa) specification for use in the
261261
HTML5 and XHTML5 members of the HTML family. The rules defined in this
262-
document not only apply to HTML5 documents, but also to HTML4 documents
263-
interpreted through the HTML5 parsing rules.
262+
document not only apply to HTML5 documents in non-XML and XML mode, but
263+
also to HTML4 documents interpreted through the HTML5 parsing rules.
264264
</p>
265265
<h2 class="no-num no-toc"
266266
id="status-of-this-document">
@@ -318,8 +318,9 @@
318318
</p>
319319
<!-- UNDER NO CIRCUMSTANCES IS THE FOLLOWING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- context and rationale (required) -->
320320
<p>
321-
This specification is intended to be included in the HTML5 specification
322-
as a section of the overall specification.
321+
This specification is an extension to the HTML5 language. All
322+
normative content in the HTML5 specification, unless overridden by this
323+
specification, is intended to be the basis for this specification.
323324
</p>
324325
<!-- UNDER NO CIRCUMSTANCES IS THE FOLLOWING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- required patent boilerplate -->
325326
<p>

microsections/rdfa/rdfa-conformance-requirements

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<h3>
1414
Document Conformance
1515
</h3>
16+
1617
<p>
1718
In order for a document to claim that it is a conforming HTML+RDFa document,
1819
it must provide the facilities described as mandatory in this section.
@@ -22,15 +23,14 @@
2223

2324
<ol>
2425
<li>
25-
There should be a DOCTYPE declaration specified prior to the root element
26-
in the document that follows the conventions outlined in the
27-
<span>The DOCTYPE</span> section in the HTML5 specification
28-
[<a href="http://www.w3.org/TR/html5">HTML5</a>].
26+
All document conformance requirements stated as mandatory in the HTML5
27+
specification must be met.
2928
</li>
3029
<li>
31-
The root element of the document must follow the conventions outlined
32-
in <span>The root element</span> section in the HTML5 specification
33-
[<a href="http://www.w3.org/TR/html5">HTML5</a>].
30+
There should be a <code>version</code> attribute on the <code>html</code>
31+
element. The value of the <code>version</code> attribute should be
32+
"HTML+RDFa 1.0" if the document is a non-XML mode document, or
33+
"XHTML+RDFa 1.0" if the document is a XML mode document.
3434
</li>
3535
<li>
3636
There may be a <code>link</code> element contained in the
@@ -56,7 +56,8 @@
5656
<li>
5757
Implement all of the features specified in the XHTML+RDFa specification,
5858
excluding those features which are specifically overridden by
59-
this specification.
59+
this specification as detailed in the
60+
<a href="#modifications-to-xhtml-rdfa">Modifications to XHTML+RDFa</a>.
6061
</li>
6162
</ul>
6263
</p>

microsections/rdfa/rdfa-modifications-to-html5

Lines changed: 62 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<h2>
2-
Modifications to HTML5
2+
Extensions to the HTML5 Syntax
33
</h2>
44
<p>
55
<em>This section is normative.</em>
@@ -10,14 +10,70 @@
1010
necessary modifications to the base HTML5 specification.
1111
</p>
1212

13-
<h3>Preservation of the <code>profile</code> keyword in <code>rel</code> attributes</h3>
13+
<h3>The <code>profile</code> attribute and link type</h3>
1414
<p>
15-
In order to provide a language version signalling mechanism, the
16-
<code>profile</code> keyword is provided for use in <code>rel</code>
17-
attributes embedded in <code>link</code> elements.
15+
For content conforming to this specification, <code>profile</code>
16+
is an obsolete but conforming attribute name when used in the
17+
<code>head</code> element and when its value is set to the
18+
XHTML Vocabulary URI: "http://www.w3.org/1999/xhtml/vocab".
19+
The <code>profile</code> link type replaces
20+
the <code>profile</code> attribute. The <code>profile</code> link type
21+
should be used in the <code>rel</code> attribute in a <code>link</code>
22+
element contained in the <code>head</code> element of a conforming
23+
document. When the <code>profile</code> link type is specified, its
24+
value must be the XHTML Vocabulary URI:
25+
"http://www.w3.org/1999/xhtml/vocab". For example:
26+
</p>
27+
<pre>
28+
&lt;head&gt;
29+
&lt;link rel="profile" href="http://www.w3.org/1999/xhtml/vocab" /&gt;
30+
&lt;/head&gt;
31+
</pre>
32+
<p>
33+
This particular attribute and link type is used to provide a language
34+
version signalling mechanism to the RDFa Processor. In future versions
35+
of RDFa, the value of the profile may trigger different processing
36+
rules in RDFa Processors.
37+
</p>
38+
<p>
39+
Authors should use the <code>profile</code> link type instead of the
40+
<code>profile</code> attribute when authoring new HTML documents.
41+
</p>
42+
43+
<p>
44+
The table entry below extends the list of link types as specified in
45+
<a href="http://www.w3.org/TR/html5/Overview.html#linkTypes">Link types section</a>
46+
of the HTML5 specification:
47+
<table>
48+
<thead>
49+
<tr>
50+
<th rowspan="2">Link type</th>
51+
<th colspan="2">Effect on...</th>
52+
<th rowspan="2">Brief description</th>
53+
</tr>
54+
<tr>
55+
<th><code>link</code></th>
56+
<th><code>a</code> and <code>area</code></th>
57+
</tr>
58+
</thead>
59+
<tbody>
60+
61+
<tr>
62+
<td><code title="rel-profile">profile</code></td>
63+
<td><span title="hyperlink link">Hyperlink</span></td>
64+
<td><em>not allowed</em></td>
65+
<td>
66+
In the future, this may trigger different RDFa Processor behavior
67+
based on the value of the <code>href</code> attribute.
68+
</td>
69+
</tr>
70+
71+
</tbody
72+
</thead>
73+
</table>
1874
</p>
1975

20-
<h3>Preservation and Validation of <code>xmlns:</code></h3>
76+
<h3>Attributes That Start With <code>xmlns:</code></h3>
2177

2278
<p>
2379
Since RDFa uses <code>xmlns:</code> to specify CURIE prefixes, it is

microsections/rdfa/rdfa-modifications-to-xhtml-rdfa

Lines changed: 90 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,43 +12,115 @@
1212
attributes and processing rules defined in XHTML+RDFa in order to
1313
support extracting RDF from HTML documents.
1414
</p>
15+
<p>
16+
The requirements and rules, as specified in XHTML+RDFa and further
17+
modified in this document, apply to all HTML5 documents. The RDFa Processor
18+
operating on HTML and XHTML documents, specifically the resulting DOMs,
19+
must apply the same processing rules for both types of serializations an
20+
DOMs.
21+
</p>
1522

1623
<h3>Specifying the language for a literal</h3>
1724
<p>
18-
The <code>lang</code> attribute must be supported in the same manner
19-
as the <code>xml:lang</code> attribute is in the XHTML+RDFa specification.
20-
The precedence rules for selecting which value overrides the other is
21-
outlined in the section titled "The lang and xml:lang attributes" in
22-
the HTML5 specification.
25+
The <code>lang</code> attribute must be processed in the same manner
26+
as the <code>xml:lang</code> attribute is in the XHTML+RDFa specification,
27+
<a href="http://www.w3.org/TR/rdfa-syntax/#sec_5.5.">Section 5.5</a>,
28+
step #3.
29+
</p>
30+
The rules for determining the language of a node are specified in the
31+
section titled
32+
<a href="http://www.w3.org/TR/html5/Overview.html#the-lang-and-xml:lang-attributes">The lang and xml:lang attributes</a> in the HTML5 specification.
2333
</p>
2434
<p>
25-
If an author is unsure of the final encapsulating DOCTYPE for their
26-
markup, such as HTML5 vs. XHTML5, it is suggested that the author specify
27-
both <code>lang</code> and <code>xml:lang</code> where the value in
28-
both attributes is exactly the same.
35+
If an author is editing an HTML fragment and is unsure of the final
36+
encapsulating MIME type for their markup, it is suggested that the
37+
author specify both <code>lang</code> and <code>xml:lang</code> where the
38+
value in both attributes is exactly the same.
2939
</p>
3040

3141
<h3>Invalid XMLLiteral values</h3>
3242
<p>
3343
When generating literals of type XMLLiteral, the processor must ensure that
34-
the output XMLLiteral is
35-
<a href="http://www.w3.org/TR/xml/#dt-wellformed">well-formed XML</a>.
36-
If the input is not well-formed XML</a>, the processor must transform
37-
the input text in a way that generates well-formed XML. An RDFa Processor
38-
that is transforming not well-formed XML to well-formed XML must use the
39-
algorithm for serializing a DOM subtree into XHTML5 as specified in the
40-
HTML5 specification.
44+
the output XMLLiteral is a namespace well-formed XML fragment. A namespace
45+
well-formed XML fragment has the following properties:
46+
<ul>
47+
<li>
48+
The XML fragment, when placed inside of a single root element, must
49+
validate as well-formed XML. The normative language that describes a
50+
well-formed XML document is specified in
51+
<a href="http://www.w3.org/TR/REC-xml/#sec-well-formed">Section 2.1 "Well-Formed XML Documents"</a>
52+
of the XML specification.
53+
</li>
54+
<li>
55+
A case-insensitive match for the currently active <code>xmlns</code>
56+
attribute as well as all currently active attributes starting with
57+
<code>xmlns:</code> must be preserved in the generated XMLLiteral.
58+
This preservation must be accomplished by placing all active namespaces
59+
in each top-level element in the generated XMLLiteral, taking care to
60+
not over-write pre-existing namespace values.
61+
</li>
62+
</ul>
63+
If the input is not a namespace well-formed XML fragment, the processor
64+
must transform the input text in a way that ensures the well-formedness
65+
rules described in this section. If a sequence of characters cannot be
66+
transformed into a namespace well-formed XML fragment, the triple
67+
containing the XMLLiteral must not be generated.
4168
</p>
4269
<p>
43-
Transformation to well-formed XML is required because an application
44-
that consumes XMLLiteral data expects that data to be well-formed.
70+
An RDFa Processor that transforms the XML fragment must use the
71+
<a href="http://www.w3.org/TR/html5/Overview.html#coercing-an-html-dom-into-an-infoset">Coercing an HTML DOM into an Infoset</a>
72+
rules, as specified in the HTML5 specification, prior to generating the
73+
triple containing the XMLLiteral. The serialization algorithm that must
74+
be used for generating the XMLLiteral is normatively defined in the
75+
<a href="http://www.w3.org/TR/html5/Overview.html#serializing-xhtml-fragments">Serializing XHTML Fragments</a>
76+
section of the HTML5 specification.
77+
</p>
78+
<p>
79+
Transformation to a namespace well-formed XML fragment is required
80+
because an application that consumes XMLLiteral data expects that
81+
data to be a namespace well-formed XML fragment.
4582
</p>
4683
<p>
4784
The transformation requirement does not apply to input data that are
4885
text-only, such as literals that contain a <code>datatype</code> attribute
4986
with an empty value (<code>""</code>), or input data that that contain
5087
only text nodes.
5188
</p>
89+
<p>
90+
An example transformation demonstrating the preservation of namespace values is provided below. The &rarr; symbol is used to denote that the line is a continuation of the previous line and is included purely for the purposes of readability:
91+
92+
<pre>
93+
&lt;p xmlns:ex="http://example.org/vocab#"
94+
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"&gt;
95+
Two rectangles (the example markup for them are stored in a triple):
96+
&lt;svg xmlns="http://www.w3.org/2000/svg" property="ex:markup" datatype="rdf:XMLLiteral"&gt;
97+
&rarr; &lt;rect width="300" height="100"
98+
&rarr; style="fill:rgb(0,0,255);stroke-width:1; stroke:rgb(0,0,0)"/&gt;
99+
&rarr; &lt;rect width="50" height="50"
100+
&rarr; style="fill:rgb(255,0,0);stroke-width:2;
101+
&rarr; stroke:rgb(0,0,0)"/&gt;&lt;/svg&gt;
102+
&lt;/p&gt;
103+
</pre>
104+
105+
The markup above should produce the following triple:
106+
107+
<pre>
108+
&lt;&gt;
109+
&lt;http://example.org/vocab#markup&gt;
110+
"&lt;rect xmlns=\"http://www.w3.org/2000/svg\" xmlns:ex=\"http://example.org/vocab#\"
111+
&rarr; xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" width=\"300\"
112+
&rarr; height=\"100\" style=\"fill:rgb(0,0,255);stroke-width:1; stroke:rgb(0,0,0)\"/&gt;
113+
&rarr; &lt;rect xmlns=\"http://www.w3.org/2000/svg\" xmlns:ex=\"http://example.org/vocab#\"
114+
&rarr; xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" width=\"50\"
115+
&rarr; height=\"50\" style=\"fill:rgb(255,0,0);stroke-width:2;
116+
&rarr; stroke:rgb(0,0,0)\"/&gt;"^^http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral
117+
</pre>
118+
119+
Note the preservation of the namespaces by injecting a new
120+
<code>xmlns</code> attribute, as well as the attributes starting
121+
with the character sequence <code>xmlns:</code>, into each <code>rect</code>
122+
element.
123+
</p>
52124

53125
<h3>The <code>xmlns:</code> attribute</h3>
54126
<p>
Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<h2>
22
Parsing Model
33
</h2>
4+
<p>
5+
<em>This section is normative.</em>
6+
</p>
47
<p>
58
Section 5 of the
69
[<a href="http://www.w3.org/TR/rdfa-syntax/">XHTML+RDFa</a>] specification
@@ -9,22 +12,32 @@
912
model suited for the RDFa processing rules is intentionally not defined
1013
in the XHTML+RDFa specification. The method of transformation was intended
1114
to be defined in the implementation language, in this case, this section of
12-
the HTML5 specification.
15+
the HTML+RDFa specification.
16+
</p>
17+
<p>
18+
The HTML5 and XHTML5 DOMs are each a super-set of the tree-based model
19+
on which the RDFa processing rules operate. Therefore, a mapping mechanism
20+
to translate from a DOM to a tree-model is not necessary.
21+
The HTML5 and XHTML5 DOM, or equivalent data structure, should be used
22+
as input to the RDFa processing rules. The normative language for
23+
construction of the HTML5 DOM and XHTML5 DOM is contained in the HTML5
24+
specification.
1325
</p>
26+
<h3>Modifying the Input Document</h3>
1427
<p>
15-
In the context of the HTML5 specification, the parsing rules for an input
16-
document in HTML4 and HTML5 are clearly defined. The processing model
17-
defined in Section 5 of the XHTML+RDFa specification should be executed
18-
on the HTML5 DOM. While the HTML5 DOM is not currently stable, any
19-
mechanism that generates a valid HTML5 DOM, such as the html5lib library,
20-
may provide a mechanism that is guaranteed to eventually provide a
21-
stable, tree-based model for the RDFa processing rules.
28+
<em>This section is informative.</em>
2229
</p>
2330
<p>
2431
RDFa's tree-based processing rules enable an input document to be
2532
automatically corrected, cleaned-up, re-arranged, or modified in any
2633
way that is approved by the host language. For example, element nesting
2734
issues in HTML documents may be corrected before the input document is
28-
serialized into the tree-based model on which the RDFa processing rules
29-
will operate.
35+
translated into the DOM, a valid tree-based model, on which the
36+
RDFa processing rules will operate.
37+
</p>
38+
<p>
39+
Any mechanism that generates a data structure equivalent to the HTML5 or
40+
XHTML5 DOM, such as the html5lib library, may be used as the mechanism to
41+
construct the tree-based model provided as input to the RDFa processing
42+
rules.
3043
</p>

0 commit comments

Comments
 (0)