merge
authorTim L <lebot@rpi.edu>
Tue, 10 Jul 2012 09:16:10 -0400
changeset 3873 c70f48459564
parent 3872 ea354a4e4966 (current diff)
parent 3871 01d2cc8809e3 (diff)
child 3874 a8e34cf622a0
merge
--- a/model/grammar/ll.html	Tue Jul 10 09:15:47 2012 -0400
+++ b/model/grammar/ll.html	Tue Jul 10 09:16:10 2012 -0400
@@ -579,8 +579,7 @@
 <td><a id="term-prov_n_LL-PN_CHARS_OTHERS" name="term-prov_n_LL-PN_CHARS_OTHERS"></a>[<span class="prodNo">64</span>]&nbsp;&nbsp;&nbsp;</td>
 <td>&lt;<code class="production term">PN_CHARS_OTHERS</code>&gt;</td>
 <td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>
-<td><code class="content"><span class="prod"><a class="grammarRef" href="#prod-prov_n_LL-PERCENT">PERCENT</a></span><br/>
-| "/"<br/>
+<td><code class="content">"/"<br/>
 | "@"<br/>
 | "~"<br/>
 | "&amp;"<br/>
@@ -590,6 +589,7 @@
 | "#"<br/>
 | "$"<br/>
 | "!"<br/>
+| <span class="prod"><a class="grammarRef" href="#prod-prov_n_LL-PERCENT">PERCENT</a></span><br/>
 | <span class="prod"><a class="grammarRef" href="#prod-prov_n_LL-PN_CHARS_ESC">PN_CHARS_ESC</a></span></code></td>
 </tr>
 </tbody>
--- a/model/grammar/ll.js	Tue Jul 10 09:15:47 2012 -0400
+++ b/model/grammar/ll.js	Tue Jul 10 09:16:10 2012 -0400
@@ -580,8 +580,7 @@
 '<td><a id="prod-PN_CHARS_OTHERS" name="prod-PN_CHARS_OTHERS"></a>[<span class="prodNo">64</span>]&nbsp;&nbsp;&nbsp;</td> ' + 
 '<td>&lt;<code class="production term">PN_CHARS_OTHERS</code>&gt;</td> ' + 
 '<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td> ' + 
-'<td><code class="content"><span class="prod"><a class="grammarRef" href="#prod-PERCENT">PERCENT</a></span><br/> ' + 
-'| "/"<br/> ' + 
+'<td><code class="content">"/"<br/> ' + 
 '| "@"<br/> ' + 
 '| "~"<br/> ' + 
 '| "&amp;"<br/> ' + 
@@ -591,6 +590,7 @@
 '| "#"<br/> ' + 
 '| "$"<br/> ' + 
 '| "!"<br/> ' + 
+'| <span class="prod"><a class="grammarRef" href="#prod-PERCENT">PERCENT</a></span><br/> ' + 
 '| <span class="prod"><a class="grammarRef" href="#prod-PN_CHARS_ESC">PN_CHARS_ESC</a></span></code></td> ' + 
 '</tr> ' + 
 '</tbody> ' + 
--- a/model/grammar/yack/prov-n-LL.bnf	Tue Jul 10 09:15:47 2012 -0400
+++ b/model/grammar/yack/prov-n-LL.bnf	Tue Jul 10 09:16:10 2012 -0400
@@ -194,7 +194,7 @@
 
 [100s] PN_LOCAL ::= ( PN_CHARS_U | [0-9] | PN_CHARS_OTHERS ) ( ( PN_CHARS | '.' | PN_CHARS_OTHERS )*  ( PN_CHARS | PN_CHARS_OTHERS ) ) ?
 
-[160s] PN_CHARS_OTHERS ::= PERCENT | '/' | '@' | '~' | '&' | '+'  | '*' | '?' | '#' | '$' | '!' | PN_CHARS_ESC
+[160s] PN_CHARS_OTHERS ::= '/' | '@' | '~' | '&' | '+'  | '*' | '?' | '#' | '$' | '!' | PERCENT | PN_CHARS_ESC
 
 PN_CHARS_ESC ::= '\\' ('=' | '\'' | '(' | ')' | ',' | '-'| ':'| ';' | '[' | ']'  | '.') 
 
--- a/model/grammar/yack/prov-n-LL.bnf.html	Tue Jul 10 09:15:47 2012 -0400
+++ b/model/grammar/yack/prov-n-LL.bnf.html	Tue Jul 10 09:16:10 2012 -0400
@@ -578,8 +578,7 @@
 <td><a id="term-prov_n_LL-PN_CHARS_OTHERS" name="term-prov_n_LL-PN_CHARS_OTHERS"></a>[<span class="prodNo">64</span>]&nbsp;&nbsp;&nbsp;</td>
 <td>&lt;<code class="production term">PN_CHARS_OTHERS</code>&gt;</td>
 <td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>
-<td><code class="content"><span class="prod"><a class="grammarRef" href="#prod-prov_n_LL-PERCENT">PERCENT</a></span><br/>
-| "/"<br/>
+<td><code class="content">"/"<br/>
 | "@"<br/>
 | "~"<br/>
 | "&amp;"<br/>
@@ -589,6 +588,7 @@
 | "#"<br/>
 | "$"<br/>
 | "!"<br/>
+| <span class="prod"><a class="grammarRef" href="#prod-prov_n_LL-PERCENT">PERCENT</a></span><br/>
 | <span class="prod"><a class="grammarRef" href="#prod-prov_n_LL-PN_CHARS_ESC">PN_CHARS_ESC</a></span></code></td>
 </tr>
 </tbody>
--- a/model/prov-n.html	Tue Jul 10 09:15:47 2012 -0400
+++ b/model/prov-n.html	Tue Jul 10 09:16:10 2012 -0400
@@ -32,6 +32,10 @@
 	border-color: gray;
 	-moz-border-radius: ;
 }
+.grammarRef {
+    font-family: "Consolas", "Inconsolata", "Liberation", "Monaco", "Monospace", monospace ;
+    text-size: 90% ;
+}
 </style>
 
     <script src="grammar/ll.js" class="remove"></script>
@@ -498,16 +502,29 @@
 <section id="grammar-notation">
 <h3>EBNF Grammar</h3>
 
-<p>The grammar is specified using the Extended  Backus-Naur Form (EBNF) notation.</p>
+<p>The grammar is specified using a subset of the Extended Backus-Naur
+Form (EBNF) notation, as defined in Extensible Markup Language (XML) 1.1
+[[XML11]] section <a
+href="http://www.w3.org/TR/2006/REC-xml11-20060816/#sec-notation">6
+Notation</a>.
+</p>
+
+<p>
+The below provides an introduction to the EBNF notation used in
+this document.</p>
 <div class="grammar">
-  Each production rule (or <dfn>production</dfn>, for short) in the grammar defines one non-terminal symbol <span class="nonterminal">E</span>, in the following form:</p>
+  EBNF specifies a series of production rules (<dfn>production</dfn>). 
+  Each production rule in the grammar defines a symbol <span
+  class="nonterminal">E</span> (the <dfn>non-terminal symbol</dfn>)
+  using the following form:</p>
 
 <span class="nonterminal">E</span>&nbsp;::= <em>term</em>
 
-<p>Within the term on the right-hand side of a rule, the following terms are used to match strings of one or more characters:
+<p>Within the term on the right-hand side of a rule, the following
+<em>term</em>s are used to match strings of one or more characters:
 <ul>
 <li> 
-<span class="nonterminal">E</span>: matches term satisfying rule for symbol E.
+<span class="nonterminal">E</span>: matches production for non-terminal symbol E.
 </li>
 
 <li> 
@@ -516,7 +533,7 @@
 
 
 <li> 
-<span class="optional"><em>term</em></span>: optional <em>term</em>, matches <em>term</em> or nothing.
+<span class="optional"><em>term</em></span>: optional, matches <em>term</em> or nothing.
 </li>
 
 <li> 
@@ -537,9 +554,13 @@
 
 <section id="main-productions">
 <h3>Main Productions</h3>
-
-The grammar is centered on nonterminals for various types of <a class="grammarRef" href="#prod-expression">expression</a>. The main production is introduced here below as it reflects the rationale for the design of the entire grammar. Note that parser developers may use the top level
-<a class="grammarRef" href="#prod-bundle">bundle</a>  nonterminal as a starting point instead.
+The grammar groups the general PROV-N <em>non-terminals</em> in a
+<em>production rule</em> called <code class="grammarRef">expression</code>
+(shown below). This production is introduced as it provides an 
+entry point for the core expressions of this grammar. Note that parser
+developers should use the production rule for the <a href="#prod-bundle">top
+level <span class="grammarRef">bundle</span></a> as a starting point
+instead.
 
 
 <!--
@@ -2105,7 +2126,8 @@
 <p>
 A <dfn id="dfn-qualifiedName">qualified name</dfn> is a name subject to <a>namespace</a> interpretation. It consists of a <a>namespace</a>, denoted by an optional prefix, and a local name.
 The PROV data model  stipulates that a qualified name can be mapped into an IRI
- by concatenating the IRI associated with the prefix and the local part.
+ by concatenating the IRI associated with the prefix and the local part.  This section provides the exact details of this procedure for qualified names supported by PROV-N. </p>
+
 <p>A qualified name's prefix is OPTIONAL. If a prefix occurs in a
  qualified name, it MUST refer to a <a>namespace</a> declared in a namespace declaration.  In the absence of prefix, the qualified name 
  refers to the <a title="default namespace declaration">default namespace</a>.</p>
@@ -2129,10 +2151,18 @@
 -->
 
 
-<p>A PROV qualified name <code class="content"><a class="grammarRef" href="#prod-QUALIFIED_NAME">QUALIFIED_NAME</a></code> has a more permissive syntax then XML's <code class="content"><a href="http://www.w3.org/TR/2009/REC-xml-names-20091208/#NT-QName">QName</a></code> [[!XML-NAMES]]
+<p>A PROV-N qualified name <code class="content"><a class="grammarRef" href="#prod-QUALIFIED_NAME">QUALIFIED_NAME</a></code> has a more permissive syntax then XML's <code class="content"><a href="http://www.w3.org/TR/2009/REC-xml-names-20091208/#NT-QName">QName</a></code> [[!XML-NAMES]]
 and SPARQL <code class="content"><a href="http://www.w3.org/TR/2008/REC-rdf-sparql-query-20080115/#rPrefixedName">PrefixedName</a></code> [[!RDF-SPARQL-QUERY]]. 
-
-<p>It is a PROV requirement that the concatenation of the namespace with the local part results in a valid IRI [[!IRI]]. 
+A PROV-N qualified name <code class="content"><a class="grammarRef" href="#prod-QUALIFIED_NAME">QUALIFIED_NAME</a></code> consists of a prefix and a local part. Prefixes follow the production <code class="content"><a class="grammarRef" href="http://www.w3.org/TR/rdf-sparql-query/#rPN_PREFIX">PN_PREFIX</a></code> defined by SPARQL [[!RDF-SPARQL-QUERY]]. Local parts have to be conformant with <code class="content"><a class="grammarRef" href="#prod-PN_LOCAL">PN_LOCAL</a></code>, which extends the original SPARQL <code class="content"><a class="grammarRef" href="http://www.w3.org/TR/rdf-sparql-query/#rPN_LOCAL">PN_LOCAL</a></code> definition 
+by allowing further characters (see <code class="content"><a class="grammarRef" href="#prod-PN_CHARS_OTHERS">PN_CHARS_OTHERS</a></code>):</p>
+<ul>
+<li> an extra set of characters commonly encountered in IRIs;
+<li> %-escaped charaters (see <code class="content"><a class="grammarRef" href="#prod-PERCENT">PERCENT</a></code>) to be interpreted as per
+ Section 3.1.  Mapping of IRIs to URIs in [[!RFC3987]];</li>
+<li> and \-escaped characters (see <code class="content"><a class="grammarRef" href="#prod-PN_CHARS_ESC">PN_CHARS_ESC</a></code>).</li>
+</ul>
+
+
 
 <p>Given that 
 '=' (equal),
@@ -2144,14 +2174,13 @@
 ';' (semi-colon),
 '"' (double quote),
 '[' (left square bracket),
-']' (right square bracket) are used by the PROV notation as delimiters, they are not allowed in local parts. Instead, they can be escaped using the '\' (backslash character) as per production <code class="content"><a class="grammarRef" href="#prod-PN_CHARS_ESC">PN_CHARS_ESC</a></code>
-</p>
-
-
-<p>Qualified names <code class="content"><a class="grammarRef" href="#prod-QUALIFIED_NAME">QUALIFIED_NAME</a></code> consist of a prefix and a local part. Prefixes follow the production <code class="content"><a class="grammarRef" href="http://www.w3.org/TR/rdf-sparql-query/#rPN_PREFIX">PN_PREFIX</a></code> defined by SPARQL [[!RDF-SPARQL-QUERY]]. Local parts have to be conformant with <code class="content"><a class="grammarRef" href="#prod-PN_LOCAL">PN_LOCAL</a></code>, which extends the original SPARQL <code class="content"><a class="grammarRef" href="http://www.w3.org/TR/rdf-sparql-query/#rPN_LOCAL">PN_LOCAL</a></code> definition by allowing further characters (see <code class="content"><a class="grammarRef" href="#prod-PN_CHARS_OTHERS">PN_CHARS_OTHERS</a></code>)  and %-escaped charaters (see <code class="content"><a class="grammarRef" href="#prod-PERCENT">PERCENT</a></code>). %-escaped characters are to be interpreted as per
- section 3.1.  Mapping of IRIs to URIs in [[!RFC3987]].</p>
-
-
+']' (right square bracket) are used by the PROV notation as delimiters, they are not allowed in local parts. 
+Instead, those characters permitted in SPARQL
+<code class="content"><a class="grammarRef" href="http://www.w3.org/TR/rdf-sparql-query/#rIRI_REF">IRI_REF</a></code>,  are also allowed in <code class="content"><a class="grammarRef" href="#prod-PN_LOCAL">PN_LOCAL</a></code> if they are escaped by the '\' (backslash character) as per production <code class="content"><a class="grammarRef" href="#prod-PN_CHARS_ESC">PN_CHARS_ESC</a></code>. Furthermore, '.' (dot), ':' (colon), '-' (hyphen) can also be \-escaped.</p>
+
+
+
+<p>A PROV-N qualified name <code class="content"><a class="grammarRef" href="#prod-QUALIFIED_NAME">QUALIFIED_NAME</a></code> can be mapped to a valid IRI [[!IRI]] by concatenating the namespace denoted  its local name <code class="content"><a class="grammarRef" href="http://www.w3.org/TR/rdf-sparql-query/#rPN_PREFIX">PN_PREFIX</a></code> to the local name <code class="content"><a class="grammarRef" href="#prod-PN_LOCAL">PN_LOCAL</a></code>, whose \-escaped characters have been unescaped by dropping the character '\' (backslash).</p>
 
  
 <table class="grammar">
@@ -2204,6 +2233,24 @@
 </div>
 
 
+<div class="anexample" id="anexample-qualified-name3">
+<p>Examples of \-escaped characters.</p>
+<pre class="codeexample">
+bundle
+  prefix ex &lt;http://example.org/&gt;
+  default &lt;http://example.org/default&gt;
+
+  entity(ex:foo?a\=1)            // corresponds to IRI http://example.org/foo?a=1
+  entity(ex:\-)                  // corresponds to IRI http://example.org/-
+  entity(ex:?fred\=fish%20soup)  // corresponds to IRI http://example.org/?fred=fish%20soup
+
+  used(-;a1,e1,-)                // identifier not specified for usage  
+  used(\-;a1,e1,-)               // usage identifier corresponds to http://example.org/default-
+endBundle
+</pre>
+</div>
+
+
 <p><b>Note:</b>The productions for  <code class="content"><a class="grammarRef" href="#prod-QUALIFIED_NAME">QUALIFIED_NAME</a></code> and  <code class="content"><a class="grammarRef" href="http://www.w3.org/TR/rdf-sparql-query/#rPN_PREFIX">PN_PREFIX</a></code> are conflicting.  In the context of a <code class="content"><a class="grammarRef" href="#prod-namespaceDeclaration">namespaceDeclaration</a></code>, a parser should give precedence to the production for <code class="content"><a class="grammarRef" href="http://www.w3.org/TR/rdf-sparql-query/#rPN_PREFIX">PN_PREFIX</a></code>.
 </p>