NOTE-curie-20101216 33.4 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="http://www.w3.org/StyleSheets/TR/W3C-WG-NOTE.css" type="text/css"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN"
"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" xmlns:xv="http://www.w3.org/1999/xhtml/vocab#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org" />
<title>CURIE Syntax 1.0</title>
<style type="text/css">
code           { font-family: monospace; }

span.hilite { color: red; /* font-weight: bold */ }

div.constraint,
div.issue,
div.note,
div.notice     { margin-left: 2em; }

dt.label       { display: run-in; }

li p           { margin-top: 0.3em;
                 margin-bottom: 0.3em; }

div.example pre { margin-left: 1em;
                       margin-top: 0em; margin-bottom: 0em}
div.example { background-color: #d5dee3;
                   border-top-width: 4px;
                   border-top-style: double;
                   border-top-color: #d3d3d3;
                   border-bottom-width: 4px;
                   border-bottom-style: double;
                   border-bottom-color: #d3d3d3;
                   padding: 4px; margin: 0em }

.xmlverb-default          { color: #333333; background-color: #ffffff; font-family: monospace }
.xmlverb-element-name     { color: #990000 }
.xmlverb-element-nsprefix { color: #666600 }
.xmlverb-attr-name        { color: #660000 }
.xmlverb-attr-content     { color: #000099; font-weight: bold }
.xmlverb-ns-name          { color: #666600 }
.xmlverb-ns-uri           { color: #330099 }
.xmlverb-text             { color: #000000; font-weight: bold }
.xmlverb-comment          { color: #006600; font-style: italic }
.xmlverb-pi-name          { color: #006600; font-style: italic }
.xmlverb-pi-content       { color: #006666; font-style: italic }
      .dtd-code {  font-family: monospace; background-color: #dfdfdf; white-space: pre; border: #000000; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px}
      code {
      color: green;
      font-family: monospace;
      font-weight: bold;
      }
      h4 { color: #005A9C; background: white }
      code.greenmono {
      color: green;
      font-family: monospace;
      font-weight: bold;
      }
      .bad  {
      border: solid red;
      border-width: 2px;
      margin-left: 0;
      margin-right: 5%;
      color: rgb(192, 101, 101);
      }
      div.navbar { text-align: center; }
      div.contents {
      background-color: rgb(204,204,255);
      padding: 0.5em;
      border: none;
      margin-right: 5%;
      }
      .tocline { list-style: none; }
      td { text-align: left }
      .ins { background-color: yellow }
      .del { background-color: yellow; text-decoration: line-through }
      ul.acks { list-style: none }
    p.issueTitle {
        font-size: 150% ;
    }
    div.issue {
        background-color: #cfc ;
        border: none ;
        margin-right: 5% ;
    }
</style>

<link rel="stylesheet" type="text/css" href="http://www.w3.org/StyleSheets/TR/W3C-WG-NOTE.css" />
</head>
<body>
<div class="head"><a href="http://www.w3.org/"><img height="48" width="72" alt="W3C" src="http://www.w3.org/Icons/w3c_home" /></a> 

<h1><a id="title"> CURIE Syntax 1.0</a></h1>

<h2><a id="subtitle"> A syntax for expressing Compact URIs</a></h2>

<h2><a id="w3c-doctype"> W3C Working Group Note 16 December 2010</a></h2>

<dl>
<dt>This version:</dt>

<dd><a href="http://www.w3.org/TR/2010/NOTE-curie-20101216">http://www.w3.org/TR/2010/NOTE-curie-20101216</a></dd>

<dt>Latest version:</dt>

<dd><a href="http://www.w3.org/TR/curie">http://www.w3.org/TR/curie</a></dd>

<dt>Previous version:</dt>

<dd><a href='http://www.w3.org/TR/2009/CR-curie-20090116'>http://www.w3.org/TR/2009/CR-curie-20090116</a></dd>

<dt>Diff from previous version:</dt>

<dd><a href="curie-diff.html">curie-diff.html</a></dd>

<dt>Editors:</dt>

<dd>Mark Birbeck, <a href="http://sidewinderlabs.com/">Sidewinder Labs</a> <a href="mailto:mark.birbeck@sidewinderlabs.com">mark.birbeck@sidewinderlabs.com</a></dd>

<dd><a href="mailto:shane@aptest.com">Shane McCarron</a>, <a href="http://www.aptest.com">Applied Testing and Technology, <abbr title="Incorporated">Inc.</abbr></a><br />
</dd>
</dl>

<p>This document is also available in these non-normative formats: <a href="curie.ps">PostScript version</a>, <a href="curie.pdf">PDF version</a>.</p>

<p class="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> &#169; 2007-2010 <a href="http://www.w3.org/"><acronym title="World Wide Web Consortium">
W3C</acronym></a><sup>&#174;</sup> (<a href="http://www.csail.mit.edu/"><acronym title="Massachusetts Institute of Technology">MIT</acronym></a>, <a href="http://www.ercim.eu/"><acronym title= 
"European Research Consortium for Informatics and Mathematics">ERCIM</acronym></a>, <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C <a href= 
"http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href= 
"http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.</p>

<hr />
</div>

<div>
<h2><a id="abstract"> Abstract</a></h2>

<p>This document defines a generic, abbreviated syntax for expressing URIs. This syntax is intended to be used as a common element by language designers. Target languages include, but are not limited
to, XML languages. The intended audience for this document is Language designers, not the users of those Languages.</p>
</div>

<div>
<h2><a id="status"> Status of this Document</a></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 W3C publications and the latest revision of
this technical report can be found in the <a href="http://www.w3.org/TR/">W3C technical reports index</a> at http://www.w3.org/TR/.</em></p>

<p>This document is a Working Group Note. The XHTML2 Working Group's charter expired before it could complete work on this document. It is possible that the work will be continued by another group in
the future.</p>

<p>This version is based upon comments received during the Candidate Recommendation period, upon work done in the definition of [<a class="nref" href="#ref_XHTML2">XHTML2</a>], and upon work done by
the <a href="http://w3.org/2001/sw/BestPractices/HTML/">RDF-in-HTML Task Force</a>, a joint task force of the <a href="http://w3.org/2001/sw/BestPractices/">Semantic Web Best Practices and Deployment
Working Group</a> and <a href="http://www.w3.org/MarkUp/">XHTML 2 Working Group</a>. It is considered mature and stable by the working group. Comments on this document should be addressed to <a href= 
"mailto:www-html-editor@w3.org">www-html-editor@w3.org</a>. All comments sent to that address are available in a (<a href="http://lists.w3.org/Archives/Public/www-html-editor/">public
archive</a>).</p>

<p>Publication as a Working Group Note does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is
inappropriate to cite this document as other than work in progress.</p>

<p>This document has been produced by the <a href="http://www.w3.org/MarkUp/">W3C XHTML 2 Working Group</a> as part of the <a href="http://www.w3.org/MarkUp/Activity">HTML Activity</a>. The goals of
the XHTML 2 Working Group are discussed in the <a href="http://www.w3.org/2007/03/XHTML2-WG-charter">XHTML 2 Working Group charter</a>.</p>

<p>This document was produced by a group operating under the <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 W3C Patent Policy</a>. W3C maintains a <a rel="disclosure"
href="http://www.w3.org/2004/01/pp-impl/32107/status">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="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential
Claim(s)</a> must disclose the information in accordance with <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of the W3C Patent Policy</a>.</p>

<p>Please report errors in this specification to <a href="mailto:www-html-editor@w3.org">www-html-editor@w3.org</a> (<a href="http://lists.w3.org/Archives/Public/www-html-editor/">archive</a>). It is
inappropriate to send discussion email to this address. Public discussion may take place on <a href="mailto:www-html@w3.org">www-html@w3.org</a> (<a href=
"http://lists.w3.org/Archives/Public/www-html/">archive</a>).</p>
</div>

<h2><a id="contents"> Table of Contents</a></h2>

<div class="toc">
<ul class='toc'>
<li class='tocline'>1. <a href="#s_intro" class="tocxref">Introduction</a> 

<ul class="toc">
<li class='tocline'>1.1. <a href="#sec_1.1." class="tocxref">Existing Uses of CURIEs</a></li>
</ul>
</li>

<li class='tocline'>2. <a href="#s_usage" class="tocxref">Usage</a> 

<ul class="toc">
<li class='tocline'>2.1. <a href="#sec_2.1." class="tocxref">Example CURIEs</a></li>

<li class='tocline'>2.2. <a href="#sec_2.2." class="tocxref">Ambiguities Between CURIEs and URIs</a></li>
</ul>
</li>

<li class='tocline'>3. <a href="#s_syntax" class="tocxref">Syntax</a></li>

<li class='tocline'>4. <a href="#s_hostlanguages" class="tocxref">Incorporating CURIEs into Host Languages</a> 

<ul class="toc">
<li class='tocline'>4.1. <a href="#sec_4.1." class="tocxref">SPARQL</a></li>

<li class='tocline'>4.2. <a href="#sec_4.2." class="tocxref">XHTML+RDFa</a></li>

<li class='tocline'>4.3. <a href="#sec_4.3." class="tocxref">XHTML 2</a></li>
</ul>
</li>

<li class='tocline'>5. <a href="#s_conformance" class="tocxref">Conformance Requirements</a> 

<ul class="toc">
<li class='tocline'>5.1. <a href="#processorconf" class="tocxref">CURIE Processor Conformance</a></li>
</ul>
</li>

<li class='tocline'>A. <a href="#s_schema" class="tocxref">CURIE Datatypes</a> 

<ul class="toc">
<li class='tocline'>A.1. <a href="#sec_A.1." class="tocxref">XML Schema Definition</a></li>

<li class='tocline'>A.2. <a href="#sec_A.2." class="tocxref">XML DTD Definition</a></li>
</ul>
</li>

<li class='tocline'>B. <a href="#s_references" class="tocxref">References</a> 

<ul class="toc">
<li class='tocline'>B.1. <a href="#sec_B.1." class="tocxref">Required Specifications</a></li>

<li class='tocline'>B.2. <a href="#sec_B.2." class="tocxref">Related Specifications</a></li>
</ul>
</li>

<li class='tocline'>C. <a href="#s_acks" class="tocxref">Acknowledgements</a></li>
</ul>
</div>

<!--OddPage-->
<h1><a id="s_intro">1. Introduction</a></h1>

<p><em>This section is informative.</em></p>

<p>More and more languages need a mechanism to permit the use of <em>extensible</em> name collections. These are primarily found in XML attribute values, but also found in other, similar spaces in
non-XML languages (e.g., [<a class="nref" href="#ref_SPARQL">SPARQL</a>]). Typically such extension mechanisms utilize the concept of <em>scoping</em>, where names are created within a unique <em>
scope</em>, and that scope's collection is managed by the group that defines it. Using such a mechanism allows independent organizations to define names without the risk of collision.</p>

<p>At the same time, language designers are trying to ensure that their languages mesh smoothly into the <em>semantic web</em>. Since the basis of the <em>semantic web</em> is the notion that meaning
can be derived through the relationship among resources, these extension mechanisms need a ready way of mapping their scoped names to resources (via URIs).</p>

<p>In many cases, language designers are attempting to use QNames for this extension mechanism [<a href="#XML-SCHEMA-QNAME">XML-SCHEMA-QNAME</a>]. 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 [<a class="nref" href="#ref_QNAMES">QNAMES</a>], and 2) the syntax of QNames is overly-restrictive and does not allow all possible URIs 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 a URI 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 creating a new data type whose purpose is specifically to allow for the definition of scoped names that map to URIs in exactly this way. This type is
called a "CURIE" or a "Compact URI". 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 URIs 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 any IRI. 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>

<h2><a id="sec_1.1.">1.1. Existing Uses of CURIEs</a></h2>

<p>Although they are not currently called CURIEs, the technique described here is in widespread usage. However, taken literally, QNames would not support many of the examples that we would find 'in
the wild' &#8212; the fact that they do is mainly because systems and authors take a very lax approach to QNames.</p>

<p>In other words, the <em>principle</em> used in QNames &#8212; that of combining a <em>namespace name</em> with a <em>local part</em> to generate a URI &#8212; is widely used, but little checking
is done on the <em>local part</em> to ensure that the string is a valid element name. However, this does mean that CURIEs can be easily used in a number of places, since there is already a large
amount of 'mind-share'.</p>

<!--OddPage-->
<h1><a id="s_usage">2. Usage</a></h1>

<p><em>This section is informative.</em></p>

<p>CURIEs can be used in exactly the same syntactic way QNames have been used in attribute values, with the modification that the format of the strings after the colon is looser. In all cases a
parsed CURIE will produce an IRI. However, the process of evaluating involves replacing the CURIE with a concatenation of the value represented by the prefix and the part after the colon (the <em>
reference</em>).</p>

<p>Note that if CURIEs are to be used in the context of scripting, accessing a CURIE via standard mechanisms such as the XML DOM will return the lexical form, not its value as IRI. In order to
develop portable applications that evaluate CURIEs, a script author must transform CURIEs into their value as IRI before evaluating them (e.g., dereferencing the resulting IRI or comparing two
CURIEs).</p>

<p>Also note that it is possible to define a CURIE prefix such that the resulting CURIEs in a document would resemble URIs (e.g., a prefix named 'mailto' would engender CURIEs that look like <code>
mailto:someone</code> but would expand to something else). Such CURIEs would only occur in contexts where a normal URI COULD NOT occur, but might still cause confusion for people reviewing the source
of a document.</p>

<h2><a id="sec_2.1.">2.1. Example CURIEs</a></h2>

<p>All of the following are valid CURIEs &#8212; even though they are not valid QNames &#8212; and they take advantage of the fact that the part after the colon no longer needs to conform to the
rules for element names:</p>

<div class="example">
<pre>
home:#start
joseki:
google:xforms+or+'xml+forms'
</pre>
</div>

<h2><a id="sec_2.2.">2.2. Ambiguities Between CURIEs and URIs</a></h2>

<p><a href="#P_curie">CURIEs</a> and <a href="#P_safe_curie">SafeCURIEs</a> map to IRIs, but neither a CURIE nor a Safe_CURIE <em>is</em> an IRI or URI. <span class="mustnot">Accordingly, CURIEs and
Safe_CURIEs MUST NOT be used as values for attributes or other content that are specified to contain only URIs, IRIs, URI-references, IRI-references, etc.</span> <span class="may">Specifications for
particular attribute values or other content MAY be written to allow either CURIEs or IRIs (or URIs, etc.).</span> <span class="must">The specifications for such languages MUST provide rules for
disambiguation in situations where the same string could be interpreted as either a CURIE or an IRI.</span> One way to do this is to require that all CURIEs be expressed as Safe_CURIEs, implying that
all unbracketed strings are to be interpreted directly as IRIs.</p>

<!--OddPage-->
<h1><a id="s_syntax">3. Syntax</a></h1>

<p><em>This section is normative.</em></p>

<p>The following definition makes the set of CURIEs a syntactic superset of the set of QNames. It is comprised of two components, a <em>prefix</em> and a <em>reference</em>. The prefix is separated
from the reference by a colon (<code>:</code>). It is possible to omit both the prefix and the colon, or to omit just the prefix and leave the colon. To disambiguate a CURIE when it appears in a
context where a normal [<a class="nref" href="#ref_URI">URI</a>] may also be used, the entire CURIE is permitted to be enclosed in brackets (<code>[</code>, <code>]</code>).</p>

<pre>
    <span id="P_safe_curie">safe_curie  :=   '[' curie ']'</span>

    <span id="P_curie">curie       :=   [ [ prefix ] ':' ] reference</span>

    prefix      :=   <a href="http://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-NCName">NCName</a>

    reference   :=   irelative-ref (as defined in <a class="nref" href="#ref_IRI">IRI</a>)
</pre>

<p><em>Note that while the empty string matches the production for curie above, an empty string is NOT a valid CURIE.</em></p>

<p><span class="must">The host language MUST provide one or more mechanisms for defining the mapping from the <code>prefix</code> to an IRI.</span></p>

<p><span class="may">A host language MAY interpret a <em>reference</em> value that is not preceded by a <em>prefix</em> and a colon as being a member of a host-language defined set of reserved
values.</span> <span class="must">Such reserved values MUST translate into an IRI, just as with any other CURIE.</span></p>

<p><span class="may">A host language MAY declare a default prefix value, or MAY provide a mechanism for defining a default prefix value.</span> <span class="must">In such a host language, when the
<code>prefix</code> is omitted from a CURIE, the default prefix value MUST be used.</span> <span class="mustnot">Conversely, if such a language does not define a default prefix value mechanism and
does not define a set of reserved values, CURIEs MUST NOT be used without a leading <em>prefix</em> and colon.</span></p>

<p>CURIEs are an abbreviation for strings which are intended to represent IRIs (as defined by the IRI production in [<a class="nref" href="#ref_IRI">IRI</a>]), but checking that intent is not part of
CURIE conformance. The intended IRI is constructed by concatenating the prefix binding with the reference part, if any. There MUST be a prefix binding for the prefix (or the default prefix, if the
prefix is absent) in scope. <span class="must">The concatenation of the prefix value associated with a CURIE and its <code>reference</code> MUST be an IRI (as defined by the IRI production in [<a
class="nref" href="#ref_IRI">IRI</a>])</span>.</p>

<p>The CURIE prefix '_' is reserved for use by languages that support RDF. <span class="should">For this reason, the prefix '_' SHOULD be avoided by authors.</span></p>

<p><span class="may">Host languages MAY define additional constraints on these syntax rules when CURIES are used in the context of those host languages.</span> <span class="mustnot">Host languages
MUST NOT relax the constraints defined this specification.</span></p>

<p>It is an error if a string required by a host language to be a CURIE or safe_curie fails to satisfy the constraints defined above. <span class="should">Rules for error reporting and/or recovery
SHOULD be provided in the specification for the host language.</span></p>

<p>The <code>safe_curie</code> production is for use in attribute values where it would be otherwise impossible to disambiguate between a CURIE and a URI. Host languages are NOT required to use
<code>safe_curie</code>s other than in such a context.</p>

<p><span class="should">When revising a language that has historically permitted URIs in certain locations (e.g., as values of a specific attribute), to ensure backward compatibility, language
designers SHOULD NOT permit CURIEs (or safe_curies) as the datatype in the corresponding location, but SHOULD provide a new mechanism (e.g., a new attribute).</span></p>

<!--OddPage-->
<h1><a id="s_hostlanguages">4. Incorporating CURIEs into Host Languages</a></h1>

<p><em>This section is informative.</em></p>

<p>CURIEs can be used in a variety of ways in host languages. This section shows a few simple examples.</p>

<h2><a id="sec_4.1.">4.1. SPARQL</a></h2>

<p>The [<a class="nref" href="#ref_SPARQL">SPARQL</a>] language provides a <code>PREFIX</code> keyword for defining the prefix used in their CURIE-like identifiers. SPARQL would need to constrain the
<em>reference</em> portion of a CURIE to get identical syntax, but such a constraint is permitted by this specification.</p>

<div class="example">
<pre>
<span class='hilite'>PREFIX foaf:   &lt;http://xmlns.com/foaf/0.1/&gt;</span> 
SELECT ?x ?name 
WHERE  { ?x <span class='hilite'>foaf:name</span> ?name }
</pre>
</div>

<h2><a id="sec_4.2.">4.2. XHTML+RDFa</a></h2>

<p>The RDFa Syntax specification defines an extended version of XHTML 1.1 called XHTML+RDFa. Because XHTML+RDFa is an XML markup language, the CURIE prefixes are defined using the <code>xmlns:</code>
attribute.</p>

<div class="example">
<pre>
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN"
         "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"&gt;
&lt;html version="XHTML+RDFa 1.0"
      xmlns="http://www.w3.org/1999/xhtml"
      <span class='hilite'>xmlns:dc="http://purl.org/dc/elements/1.1/"</span>&gt;
      &lt;head version="XHTML+RDFa 1.0"
            profile="http://www.w3.org/1999/xhtml/vocab"&gt;
            &lt;title&gt;An XHTML+RDFa document using CURIEs&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;p rel="cite"&gt;
              this content was written by 
              &lt;span property="<span class='hilite'>dc:creator</span>"&gt;some author&lt;/span&gt;
          &lt;/p&gt;
      &lt;/body&gt;
&lt;/html&gt;
</pre>
</div>

<h2><a id="sec_4.3.">4.3. XHTML 2</a></h2>

<p>XHTML 2 includes the <code>role</code> attribute. This attribute takes advantage of CURIEs to permit the easy definition of additional roles for the content of a page.</p>

<div class="example">
<pre>
&lt;html version="XHTML2"
      xmlns="http://www.w3.org/1999/xhtml"
      <span class='hilite'>xmlns:MR="http://www.example.org/roles/myRoles#"</span>&gt;
      &lt;head profile="http://www.w3.org/1999/xhtml/vocab"&gt;
          &lt;title&gt;An XHTML 2 document using Role&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;p role="<span class='hilite'>MR:main</span>"&gt;The main content&lt;/p&gt;
          &lt;p role="<span class='hilite'>MR:music</span>"&gt;Some musical support for the page&lt;/p&gt;
      &lt;/body&gt;
&lt;/html&gt;
</pre>
</div>

<!--OddPage-->
<h1><a id="s_conformance">5. Conformance Requirements</a></h1>

<p>This section is <em>normative</em>.</p>

<p>The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [<a class="nref" href= 
"#ref_RFC2119">RFC2119</a>].</p>

<h2><a id="processorconf">5.1. CURIE Processor Conformance</a></h2>

<p>A conforming CURIE processor must support all of the features required in this specification.</p>

<!--OddPage-->
<h1><a id="s_schema">A. CURIE Datatypes</a></h1>

<p><em>This section is informative.</em></p>

<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 use XHTML Modularization [<a class="nref" href="#ref_XHTMLMOD">XHTMLMOD</a>] can find these normative definitions in the
Modularization support file "datatypes" for their schema grammar:</p>

<ul>
<li><a href="http://www.w3.org/MarkUp/DTD/xhtml-datatypes-1.mod">DTD xhtml-datatypes.mod</a></li>

<li><a href="http://www.w3.org/MarkUp/SCHEMA/xhtml-datatypes-1.xsd">XML Schema xhtml-datatypes.xsd</a></li>
</ul>

<p>Specifically, the following datatypes are introduced:</p>

<dl>
<dt>CURIE</dt>

<dd>A single <a href="#P_curie">curie</a></dd>

<dt>CURIEs</dt>

<dd>A whitespace separated list of CURIEs</dd>

<dt>SafeCURIE</dt>

<dd>A single <a href="#P_safe_curie">safe_curie</a></dd>

<dt>SafeCURIEs</dt>

<dd>A whitespace separated list of SafeCURIEs</dd>

<dt>URIorSafeCURIE</dt>

<dd>A URI or a SafeCURIE (since you need a SafeCURIE to disambiguate between a common URI and a CURIE)</dd>

<dt>URIorSafeCURIEs</dt>

<dd>A whitespace separated list of URIorSafeCURIEs</dd>
</dl>

<h2><a id="sec_A.1.">A.1. XML Schema Definition</a></h2>

<p>The following <i>informative</i> XML Schema definition for these datatypes is included as an example:</p>

<div class="example">
<pre>
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;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"
&gt;
    &lt;xs:simpleType name="CURIE"&gt;
        &lt;xs:restriction base="xs:string"&gt;
            &lt;xs:pattern value="(([\i-[:]][\c-[:]]*)?:)?.+" /&gt;
            &lt;xs:minLength value="1"/&gt;
        &lt;/xs:restriction&gt;
    &lt;/xs:simpleType&gt; 

    &lt;xs:simpleType name="CURIEs"&gt;
        &lt;xs:list itemType="xh11d:CURIE"/&gt;
    &lt;/xs:simpleType&gt;

    &lt;xs:simpleType name="SafeCURIE"&gt;
        &lt;xs:restriction base="xs:string"&gt;
            &lt;xs:pattern value="\[(([\i-[:]][\c-[:]]*)?:)?.+\]" /&gt;
            &lt;xs:minLength value="3"/&gt;
        &lt;/xs:restriction&gt;
    &lt;/xs:simpleType&gt;

    &lt;xs:simpleType name="SafeCURIEs"&gt;
        &lt;xs:list itemType="xh11d:SafeCURIE"/&gt;
    &lt;/xs:simpleType&gt;

    &lt;xs:simpleType name="URIorSafeCURIE"&gt;
        &lt;xs:union memberTypes="xs:anyURI xh11d:SafeCURIE" /&gt;
    &lt;/xs:simpleType&gt;

    &lt;xs:simpleType name="URIorSafeCURIEs"&gt;
        &lt;xs:list itemType="xh11d:URIorSafeCURIE"/&gt;
    &lt;/xs:simpleType&gt;
&lt;/xs:schema&gt;
</pre>
</div>

<h2><a id="sec_A.2.">A.2. XML DTD Definition</a></h2>

<p>The following <i>informative</i> XML DTD definition for these datatypes is included as an example:</p>

<div class="example">
<pre>
&lt;!ENTITY % CURIE.datatype "CDATA" &gt;
&lt;!ENTITY % CURIEs.datatype "CDATA" &gt;
&lt;!ENTITY % SafeCURIE.datatype "CDATA" &gt;
&lt;!ENTITY % SafeCURIEs.datatype "CDATA" &gt;
&lt;!ENTITY % URIorSafeCURIE.datatype "CDATA" &gt;
&lt;!ENTITY % URIorSafeCURIEs.datatype "CDATA" &gt;
</pre>
</div>

<!--OddPage-->
<h1><a id="s_references">B. References</a></h1>

<h2><a id="sec_B.1.">B.1. Required Specifications</a></h2>

<p><em>This section is normative.</em></p>

<dl>
<dt><a id="ref_IRI" class="normref">IRI</a></dt>

<dd>"<cite><a href="http://www.ietf.org/rfc/rfc3987.txt">Internationalized Resource Identifiers (IRI)</a></cite>", RFC 3987, M.Duerst, M. Suignard January 2005.<br />
Available at: http://www.ietf.org/rfc/rfc3987.txt</dd>

<dt><a id="ref_RFC2119" class="normref">RFC2119</a></dt>

<dd>"<cite><a href="http://www.ietf.org/rfc/rfc2119.txt">Key words for use in RFCs to indicate requirement levels</a></cite>", RFC 2119, S. Bradner, March 1997.<br />
 Available at: http://www.ietf.org/rfc/rfc2119.txt</dd>

<dt><a id="ref_URI" class="normref">URI</a></dt>

<dd>"<cite><a href="http://www.rfc-editor.org/rfc/rfc3986.txt">Uniform Resource Identifiers (URI): Generic Syntax</a></cite>", RFC 3986, T. Berners-Lee <i xml:lang="la">et al.</i>, January
2005.<br />
Available at: http://www.rfc-editor.org/rfc/rfc3986.txt. This RFC updates RFC 1738 [<a class="nref" href="#ref_URI">URI</a>] and obsoletes RFC 2732, 2396 and 1808.</dd>

<dt><a id="ref_XML" class="normref">XML</a></dt>

<dd>"<cite><a href="http://www.w3.org/TR/2006/REC-xml-20060816">Extensible Markup Language (XML) 1.0 (Fourth Edition)</a></cite>", W3C Recommendation, T. Bray, J. Paoli, C. M. Sperberg-McQueen, E.
Maler, F. Yergeau, <i><abbr title="editors">eds.</abbr></i>, 16 August 2006.<br />
Available at: http://www.w3.org/TR/2006/REC-xml-20060816</dd>
</dl>

<h2><a id="sec_B.2.">B.2. Related Specifications</a></h2>

<p><em>This section is informative.</em></p>

<dl>
<dt class="informref"><a id="ref_QNAMES">QNAMES</a></dt>

<dd>"<cite><a href="http://www.w3.org/2001/tag/doc/qnameids-2004-03-17">Using Qualified Names (QNames) as Identifiers in XML Content</a></cite>". N. Walsh, 17 March, 2004.<br />
Available at: http://www.w3.org/2001/tag/doc/qnameids-2004-03-17<br />
The <a href="http://www.w3.org/2001/tag/doc/qnameids">latest version</a> is available at: http://www.w3.org/2001/tag/doc/qnameids</dd>

<dt class="informref"><a id="ref_XHTML2">XHTML2</a></dt>

<dd>"<cite><a href="http://www.w3.org/TR/2006/WD-xhtml2-20060726">XHTML&#8482; 2.0</a></cite>". J. Axelsson <i xml:lang="lt">et al.</i>, 26 July 2006.<br />
Available at: http://www.w3.org/TR/2006/WD-xhtml2-20060726<br />
The <a href="http://www.w3.org/TR/xhtml2">latest version</a> is available at: http://www.w3.org/TR/xhtml2</dd>

<dt><a id="ref_XHTMLMOD">XHTMLMOD</a></dt>

<dd>"<cite><a href="http://www.w3.org/TR/2008/REC-xhtml-modularization-20081008">Modularization of XHTML&#8482; 1.1</a></cite>", W3C Recommendation, D. Austin <i xml:lang="lt">et al.</i>, <i><abbr
title="editors">eds.</abbr></i>, 8 October 2008.<br />
Available at: http://www.w3.org/TR/2008/REC-xhtml-modularization-20081008<br />
The <a href="http://www.w3.org/TR/xhtml-modularization">latest version</a> is available at: http://www.w3.org/TR/xhtml-modularization</dd>

<dt class="informref" id="ref_XHTMLRDFa">RDFa in XHTML: Syntax and Processing</dt>

<dd>RDFa in XHTML: Syntax and Processing (See <a href="http://www.w3.org/TR/2008/REC-rdfa-syntax-20081014">http://www.w3.org/TR/2008/REC-rdfa-syntax-20081014</a>.)</dd>

<dt class="informref"><a id="XML-SCHEMA-QNAME"></a>XML-SCHEMA-QNAME</dt>

<dd>XML Schema Part 2: Datatypes Second Edition: Section 3.2.18 QName (See <a href="http://www.w3.org/TR/xmlschema-2/#QName">http://www.w3.org/TR/xmlschema-2/#QName</a>.)</dd>

<dt class="informref"><a id="ref_SPARQL"></a>SPARQL</dt>

<dd>"<cite><a href="http://www.w3.org/TR/2008/REC-rdf-sparql-query-20080115/">SPARQL Query Language for RDF</a></cite>". Eric Prud'hommeaux <i xml:lang="lt">et al.</i>, 15 January 2008.<br />
Available at: http://www.w3.org/TR/2008/REC-rdf-sparql-query-20080115<br />
The <a href="http://www.w3.org/TR/rdf-sparql-query">latest version</a> is available at: http://www.w3.org/TR/rdf-sparql-query</dd>
</dl>

<!--OddPage-->
<h1><a id="s_acks">C. Acknowledgements</a></h1>

<p><em>This section is informative.</em></p>

<p>This document was prepared by the <acronym title="World Wide Web Consortium">W3C</acronym> <acronym title="Extensible HyperText Markup Language">XHTML2</acronym> Working Group. The members at the
time of publication of the second edition were:</p>

<ul>
<li>Markus Gylling, <a href="http://www.daisy.org">DAISY Consortium</a> (<acronym title="Extensible HyperText Markup Language">XHTML</acronym> 2 Working Group Co-Chair)</li>

<li>Steven Pemberton, <acronym title="Centrum voor Wiskunde en Informatica" xml:lang="nl">CWI</acronym> (<acronym title="Extensible HyperText Markup Language">XHTML</acronym> 2 Working Group
Co-Chair)</li>

<li>Mark Birbeck, Sidewinder Labs (Invited Expert)</li>

<li>Susan Borgrink, Progeny Systems</li>

<li>Christina Bottomley, Society for Technical Communication (STC)</li>

<li>Alessio Cartocci, International Webmasters Association / HTML Writers Guild (IWA-HWG)</li>

<li>Alexander Graf, University of Innsbruck</li>

<li>Tina Holmboe, Greytower Technologies (Invited Expert)</li>

<li>John Kugelman, Progeny Systems</li>

<li>Luca Mascaro, International Webmasters Association / HTML Writers Guild (IWA-HWG)</li>

<li>Shane McCarron, Applied Testing and Technology, Inc. (Invited Expert)</li>

<li>Michael Rawling, IVIS Group Limited</li>

<li>Gregory Rosmaita, Invited Expert</li>

<li>Sebastian Schnitzenbaumer, Dreamlab Technologies AG</li>

<li>Richard Schwerdtfeger, <acronym title="International Business Machines">IBM</acronym></li>

<li>Elias Torres, <acronym title="International Business Machines">IBM</acronym></li>

<li>Masataka Yakura, Mitsue-Links Co., Ltd.</li>

<li>Toshihiko Yamakami, ACCESS Co., Ltd.</li>
</ul>
</body>
</html>