issue-438 stian's comments
authorLuc Moreau <l.moreau@ecs.soton.ac.uk>
Tue, 10 Jul 2012 17:53:40 +0100
changeset 3896 2fafac5fabb6
parent 3895 df4c869c3fe8
child 3897 99419249509b
issue-438 stian's comments
model/comments/issue-438-stian.txt
model/grammar/yack/prov-n-LL.bnf
model/prov-n.html
--- a/model/comments/issue-438-stian.txt	Tue Jul 10 17:26:11 2012 +0100
+++ b/model/comments/issue-438-stian.txt	Tue Jul 10 17:53:40 2012 +0100
@@ -49,12 +49,18 @@
    > something like "Those readers may find the definition _expression_ a
    > useful entry point into the grammar".
    > 
+
+TODO
+
    > 
    > 
    > 
    > > > 1.3 The PROV namespace (see Section 4.7.1)
    > The section number should be 3.7.4
    > 
+
+Fixed.
+
    > 
    > > > 2.1
    > > > All PROV data model relations involve two primary elements, the subject and the object, in this order
@@ -62,19 +68,30 @@
    > 
    > > > activity(a1)
    > > > entity(e1)
+
+
    > So those might not be 'relations' - but that is not clear from the
    > above. Rephrase to something like "Many PROV-N predicates denote a
    > relationship between two primary elements, the _subject_ and the
    > _object_, in this order".
+
+
+Table 2 in PROV-DM shows that entity/activity are prov-dm types, as opposed to prov-dm relations.
+So I think this is OK.
+
    > 
    > I would include an entity() example in this section, to show that not
    > all have subject and object. I would do this before Example 1 and the
    > above sentence.
+
    > 
    > > > Example 0:
    > > > In this example, _e1_ is asserted to be a PROV _entity_.
    > > >    entity(e1)
    > 
+
+Agreed, I have added an example for entity/activity.
+
    > 
    > > > Example 2
    > > > In the following expressions, the optional activity a along with the generation and usage identifiers g2 and u1:
@@ -83,16 +100,25 @@
    > expands the above derivation relation by providing additional
    > elements: the activity _a_, the generation _g2_ and the usage _u1_.
    > 
+
+Done.
+
+
    > > > Extended Backus-Naur Form (EBNF) notation
    > This is again well known in CS - but a hyperlink would be useful. Now
    > I had to go to Wikipedia. However the mini-intro right below is
    > useful. "The below is a summary of "
+
    > 
    > 
    > I would be more precise, that "The PROV-N grammar is specified in this
    > document using the .." - as knowledge of EBNF is not a requirement for
    > using PROV-N - just for understanding the definitions in this
    > document.
+
+Text was edited by Stian, thanks!
+
+
    > 
    > 
    > 
@@ -106,10 +132,15 @@
    > _expression_ above, e.g. entityExpression, corresponds to one element
    > (e.g. entity) in the PROV data model."
    > 
+
+Done
+
    > 
    > Why hyperlinks on 'expression' here in this section? It goes 1 line up
    > or down, it's very confusing.  Use <code>expression</code> or similar
    > instead.
+
+Yep
    > 
    > 
    > > > such that the text for an element matches the corresponding expression production of the grammar.
@@ -122,12 +153,22 @@
    > PROV-N documents. That might well be the case, as they want to reuse
    > namespaces, etc - but that should then be stated explicitly, kind of
    > like
+
+
+I don't think we stated these examples were all documents.  Very often
+we just discuss expressions.
+
+
    > 
    > 
    > > > 2.3 Optional attributes
    > Should add something like "The interpretation of an optional attribute
    > that is not provided is given by Section 4.1 in PROV-CONSTRAINTS"
    > somewhere.
+
+No action here.
+
+
    > 
    > 
    > > > 2.4 Identifiers and attributes
@@ -143,6 +184,8 @@
    > "Almost all expressions defined in this grammar may also include an
    > identifier for the expression.  Most expression can also include a set
    > of attribute-value pairs, grouped within square brackets."
+
+Done
    > 
    > 
    > "By convention, optional identifiers are separated using a semi-colon
@@ -155,16 +198,23 @@
    > permutations that are non-ambigious? The defition for
    > optionalIdentifier says no. (good!)
    > 
+
+Done
    > 
    > > > Example 7
    > > > ..
    > > > The third example shows that one can optionally indicate the missing identifier using the - marker.
    > Add "This is equivalent to the first expression".
+
+Done
    > 
    > > > Example 8
    > > > The first and second activities have no attributes.
    > Add ", and are equivalent."
-   > 
+   >
+
+Done
+ 
    > 
    > > > 2.5 Comments
    > > > ... such cooments ...
@@ -188,6 +238,9 @@
    > > > wasGeneratedBy(ex:g1; e, a, tr:WD-prov-dm-20111215)
    > because tr:WD-prov-dm-20111215 is not a valid timeOrMarker.
    > 
+
+yes fixed
+
    > 
    > I would also recommend that these show-cases use the same names, so
    > rather than say intermixing a1 and ex:edit1 - just always use a1.
@@ -200,8 +253,16 @@
    > "Since" does not make sense here - where is it stated that they MUST
    > be present? Here. So try rather:  "... are not valid in PROV-N; at
    > least one of... MUST be present"
+
+'Since' is justified, since it is a prov-dm requirement.
+
    > 
    > Equivalent comment for this kind of paragraph for usage, startExpression, etc.
+
+
+We see this as "semantic/post-parsing" checking. It would unecessarily
+make the productions complicated.
+
    > 
    > 
    > 
@@ -311,12 +372,21 @@
    > prov:QUALIFIED_NAME union xsd:anyURI - but I'm not sure as "a Literal
    > may be an IRI-typed string (with datatype xsd:anyURI); such IRI has no
    > specific interpretation in the context of PROV.".
+
+I added a forwarded pointer at the first occurrence of this convenienceNotation.
+
    > 
    > So does prov:type="contract" simply mean "contract" out of thin air
    > rather than bound to any namespace? We would struggle to translate
    > this to PROV-O where prov:type maps to rdf:type. If this is the case,
    > then I expect all prov:type="prov.*" should be with single quotes
    > instead.
+
+Yes, it's the case that all prov:type='prov:*' are in single quote.
+
+It is fine to require a conversion function if they don't use URI like types.
+
+
    > 
    > 
    > http://dvcs.w3.org/hg/prov/raw-file/default/model/releases/ED-prov-dm-20120628/prov-dm.html#term-attribute-type
@@ -325,6 +395,9 @@
    > PROV-DM Value." - but does not distinguish between 'single',  "double"
    > quote and "qualified" %% prov:QUALIFIED_NAME notation.
    > 
+
+Convenience notation appears later.
+
    > 
    > 
    > > > 3.4.1 Bundle declaration
@@ -335,11 +408,17 @@
    > > >   ...
    > > > endBundle
    > Nitpicking, but I would use " // ... " as "..." is not valid PROV-N.
+
+done
+
    > 
    > 
    > 3.4.1 should also provide a forward link to 4. Toplevel Bundle,
    > because otherwise the example does not make sense (prefix ex: is not
    > declared)
+
+prefix ex: was added since the named bundle must be self contained
+
    > 
    > 
    > 
@@ -372,6 +451,9 @@
    > 'members'. (I do not propose to make the entity or entity set as first
    > argument)
    > 
+
+hadMembers
+
    > 
    > Opposite of all other example, this example does not start with a
    > 'full' expression, as the 'complete' argument is missing. Also the
@@ -381,6 +463,8 @@
    >  memberOf(mId; c, {e1, e2, e3}, true, [dct:description="All of them"])
    >   // Collection membership
    > 
+
+Done
    > 
    > > > // default "complete" flag is false
    > This is a PROV-DM or PROV-CONSTRAINT matter and should not be
@@ -400,6 +484,8 @@
    > First one of these should be invalid by the same reason as for usage,
    > and thus should not be listed. (It would need to include some
    > attributes in [] to be valid)
+
+I don't understand why?
    > 
    > 
    > 3.7.1 Identifier
@@ -696,7 +782,11 @@
    > endBundle
 
 
-TODO
+An example was added to clarify how scope works.
+http://dvcs.w3.org/hg/prov/raw-file/default/model/prov-n.html#anexample-namespace-scope
+Bundles are designed to be self contained. So in effect,
+no inheritance of namespace declaration.
+
    > 
    > 
    > > > Section 4
@@ -723,12 +813,32 @@
    >   endBundle
    > endBundle
    > 
+
+Given that bundles need to be self contained, we would generally expect
+some namespace to be declared for the identifiers occurring in the bundle.
+
+However, a toplevel bundle may be empty. Hence, no declaration required.
+
+I guess because a named bundle always has a name ... it would always
+require a namespace declaration. Should we enforce this in the grammar?
+I didn't make a change, I see this as "semantic" processing, beyond parsing.
+
    > 
    > I found it confusing that the top level bundle and named bundle have
    > the same keyword. However I expect - although it is not stated
    > explicitly here - that you can't have a free-standing named bundle -
    > and that a PROV-N Document should have all expressions and named
    > bundled within a single top level bundle.
+
+
+I considered naming toplevel bundle differently.
+But ultimately, it contains expressions and namespace declarations ...
+it's a bundle.
+
+I made sure it was a distinct production to avoid arbitrary nesting of
+named bundles.
+
+
    > 
    > 
    > > >  activity(a1, 2011-11-16T16:05:00, -,[prov:type="edit"])
@@ -737,11 +847,17 @@
    >  activity(a1, 2011-11-16T16:05:00, -, [prov:type="edit"])
    > 
    > 
+
+Fixed
+
    > > > The following container
    > > >  (..)
    > > > This container
    > s/container/bundle/g
    > 
+
+Fixed.
+
    > 
    > 
    > 
--- a/model/grammar/yack/prov-n-LL.bnf	Tue Jul 10 17:26:11 2012 +0100
+++ b/model/grammar/yack/prov-n-LL.bnf	Tue Jul 10 17:53:40 2012 +0100
@@ -5,16 +5,13 @@
 
 
 [2] expression::=
-        (   
-
-           entityExpression | activityExpression | generationExpression  | usageExpression
+        ( entityExpression | activityExpression | generationExpression  | usageExpression
          | startExpression | endExpression | invalidationExpression | communicationExpression 
         | agentExpression |  associationExpression | attributionExpression | delegationExpression
         | derivationExpression | influenceExpression
         | alternateExpression | specializationExpression | mentionExpression | membershipExpression 
        | extensibilityExpression
-        | insertionExpression | removalExpression | dictMembershipExpression
-        )
+        | insertionExpression | removalExpression | dictMembershipExpression )
 
 
 [3] entityExpression::=	"entity" "(" identifier optionalAttributeValuePairs ")"
--- a/model/prov-n.html	Tue Jul 10 17:26:11 2012 +0100
+++ b/model/prov-n.html	Tue Jul 10 17:53:40 2012 +0100
@@ -461,7 +461,7 @@
 <table border="1" style="margin-left: auto; margin-right: auto;">
 <caption id="namespace-table">Table 1: Prefix and Namespaces used in this specification</caption>
 <tr><td><a><b>prefix</b></a></td><td><b>namespace uri</b></td> <td><b>definition</b></td></tr>
-<tr><td><a>prov</a></td><td>http://www.w3.org/ns/prov#</td><td>The PROV namespace (see Section <a href="#expression-NamespaceDeclaration">4.7.1</a>)</td></tr>
+<tr><td><a>prov</a></td><td>http://www.w3.org/ns/prov#</td><td>The PROV namespace (see Section <a href="#expression-NamespaceDeclaration">3.7.4</a>)</td></tr>
 <tr><td><a>xsd</a></td><td>http://www.w3.org/2000/10/XMLSchema#</td><td>XML Schema Namespace [[!XMLSCHEMA11-2]]</td></tr>
 <tr><td><a>(others)</a></td><td>(various)</td><td>All other namespace prefixes are used in examples only. <br/> In particular, URIs starting with "http://example.com" represent<br/> some application-dependent URI [[!URI]]</td></tr>
 </table>
@@ -477,17 +477,37 @@
 <section id="functional-syntax"> 
 <h3>Functional-style Syntax</h3>
 
-<p> PROV-N adopts a functional-style syntax consisting of a predicate name and an ordered list of terms.
+<p> PROV-N adopts a functional-style syntax consisting of a predicate name and an ordered list of terms.</p>
+
+<p>
+All PROV data model types have an identifier. Furthermore, some expressions also admit additional elements that further characterize it. </p>
+<div class="anexample">
+<p>The following expression should be read as "entity <span class="name">e1</span>". 
+<pre class="codeexample" >
+entity(e1)
+</pre>
+  </div>
+<div class="anexample">
+<p>The following expression should be read as "activity <span class="name">a2</span>, which occurred
+between <code>2011-11-16T16:00:00</code> and <code>2011-11-16T16:00:01</code>". 
+<pre class="codeexample" >
+entity(e1)
+activity(a2, 2011-11-16T16:00:00, 2011-11-16T16:00:01)
+</pre>
+  </div>
+
+<p>
 All PROV data model relations involve two primary elements, the <em>subject</em> and the <em>object</em>, in this order. Furthermore, some expressions also admit additional elements that further characterize it.
 <div class="anexample">
-The following expression should be read as "<span class="name">e2</span> was derived from <span class="name">e1</span>". Here <span class="name">e2</span> is the subject, and  <span class="name">e1</span> is the object.
+<p>The following expression should be read as "<span class="name">e2</span> was derived from <span class="name">e1</span>". Here <span class="name">e2</span> is the subject, and  <span class="name">e1</span> is the object.
 <pre class="codeexample" >
 wasDerivedFrom(e2, e1)
 </pre>
   </div>
   
 <div class="anexample">
-In the following expressions, the optional activity <span class="name">a</span> along with the generation and usage identifiers <span class="name">g2</span> and <span class="name">u1</span>:
+<p>The following expression expands the above derivation relation by providing
+additional elements the optional activity <span class="name">a</span>, the generation <span class="name">g2</span>, and the usage <span class="name">u1</span>:
 <pre class="codeexample" >
 wasDerivedFrom(e2, e1, a, g2, u1)
 </pre>
@@ -639,7 +659,8 @@
 </table>
 
 
-Each expression non-terminal <a class="grammarRef" href="#prod-expression">expression</a>, i.e., <a class="grammarRef" href="#prod-entityExpression">entityExpression</a>,  <a class="grammarRef" href="#prod-activityExpression">activityExpression</a> etc., corresponds to one element (entity, activity, etc.) of the PROV data model.
+<p>Each of the symbols included in <code>expression</code> above, i.e., <code><a class="grammarRef" href="#prod-entityExpression">entityExpression</a></code>,  <code><a class="grammarRef" href="#prod-activityExpression">activityExpression</a></code> etc., corresponds to one element (e.g., entity, activity, etc.) of the PROV data model.</p>
+
 <p>A PROV-N document consists of a collection of <a title="expression">expressions</a>, wrapped in a <a class="grammarRef" href="#prod-bundle">toplevel bundle</a> with some namespace declarations, such that the text for an element matches the corresponding <a class="grammarRef" href="#prod-expression">expression</a> production of the grammar.
 
 </section>
@@ -692,10 +713,11 @@
 <section id="prov-n-standard-terms"> 
 <h3>Identifiers and attributes</h3>
 
-<p>Most expressions defined in the grammar include the use of two terms: an identifier and a set of attribute-value pairs, delimited by square brackets. Identifiers are optional except for Entities, Activites, and Agents. Identifiers are always the first term in any expression. By convention, </em>optional</em> identifiers are separated using a semi-colon ';'. This makes it possible to completely omit an optional identifier with no ambiguity arising. Also, if the set of attribute-value pairs is present, it is always the last term in any expression.</p>
+<p>Almost all expressions defined in the grammar include an identifier. Most expressions
+can aslo include a set of attribute-value pairs, delimited by square brackets. Identifiers are optional except for Entities, Activites, and Agents. Identifiers are always the first term in any expression.  </em>Optional</em> identifiers MUST be separated using a semi-colon ';', but where the identifiers are required, a regular comma ',' MUST be used. This makes it possible to completely omit an optional identifier with no ambiguity arising. Also, if the set of attribute-value pairs is present, it is always the last term in any expression.</p>
 
 <div class="anexample">
-<p>Derivation has an optional identifier. In the first expression, the identifier is not available, while it is explicit in the second. The third example shows that one can optionally indicate the missing identifier using the <span class="name">-</span> marker.</p>
+<p>Derivation has an optional identifier. In the first expression, the identifier is not available, while it is explicit in the second. The third example shows that one can optionally indicate the missing identifier using the <span class="name">-</span> marker. This is equivalent to the first expression. </p>
 <pre class="codeexample" >
 wasDerivedFrom(e2, e1)
 wasDerivedFrom(d; e2, e1)
@@ -708,7 +730,7 @@
 <!-- Expressions with no attributes A distinction is made between expressions with no attributes, and expressions that include an empty list of attributes.  -->
 
 <div class="anexample">
-<p>The first and second activities have no attributes.
+<p>The first and second activities have no attributes, and are equivalent.
 <!-- does not have any attributes. The second has an empty list of attributes. -->
 The third activity  has two attributes. 
 <pre class="codeexample" >
@@ -932,8 +954,8 @@
 The remaining examples show cases where some of the optionals are omitted.
   
 <pre class="codeexample">
-wasGeneratedBy(e2, a1, tr:WD-prov-dm-20111215)
-wasGeneratedBy(e, ex:edit1, 2011-11-16T16:00:00)
+wasGeneratedBy(e2, a1, -)
+wasGeneratedBy(e2, a1, 2011-11-16T16:00:00)
 wasGeneratedBy(e2, a1, -, [ex:fct="save"])     
 wasGeneratedBy(e2, [ex:fct="save"])     
 wasGeneratedBy(ex:g1; e)
@@ -941,7 +963,7 @@
 </pre>
 </div>
 
-<p>Even though the production <code class="content"><a class="grammarRef" href="#prod-generationExpression">generationExpression</a></code> allows for expressions <span class="name">wasGeneratedBy(e2, -, -)</span>  and <span class="name">wasGeneratedBy(-; e2, -, -)</span>, these expressions are not valid in PROV-N, since at least one  of <a href="http://www.w3.org/TR/prov-dm/#generation.id"><span class='attribute'>id</span></a>, <a href="http://www.w3.org/TR/prov-dm/#generation.activity"><span class='attribute'>activity</span></a>, <a href="http://www.w3.org/TR/prov-dm/#generation.time"><span class='attribute'>time</span></a>, and  <a href="http://www.w3.org/TR/prov-dm/#generation.attributes"><span class='attribute'>attributes</span></a> MUST be present.</p>
+<p><strong>Note:</strong> Even though the production <code class="content"><a class="grammarRef" href="#prod-generationExpression">generationExpression</a></code> allows for expressions <span class="name">wasGeneratedBy(e2, -, -)</span>  and <span class="name">wasGeneratedBy(-; e2, -, -)</span>, these expressions are not valid in PROV-N, since at least one  of <a href="http://www.w3.org/TR/prov-dm/#generation.id"><span class='attribute'>id</span></a>, <a href="http://www.w3.org/TR/prov-dm/#generation.activity"><span class='attribute'>activity</span></a>, <a href="http://www.w3.org/TR/prov-dm/#generation.time"><span class='attribute'>time</span></a>, and  <a href="http://www.w3.org/TR/prov-dm/#generation.attributes"><span class='attribute'>attributes</span></a> MUST be present.</p>
 
 
 
@@ -1123,7 +1145,7 @@
 </div>
 
 <p><strong>Note:</strong> Even though the production <code class="content"><a class="grammarRef" href="#prod-startExpression">startExpression</a></code> allows for expressions <span class="name">wasStartedBy(e2, -, -, -)</span>  and <span class="name">wasStartedBy(-; e2, -, -, -)</span>, these expressions are not valid in PROV-N,
-since at least one  of <a href="http://www.w3.org/TR/prov-dm/#start.id"><span class='attribute'>id</span></a>, <a href="http://www.w3.org/TR/prov-dm/#start.trigger"><span class='attribute'>trigger</span></a>, <a href="http://www.w3.org/TR/prov-dm/#start.starter"><span class='attribute'>starter</span></a>, <a href="http://www.w3.org/TR/prov-dm/#start.time"><span class='attribute'>time</span></a>, and  <a href="http://www.w3.org/TR/prov-dm/#start.attributes"><span class='attribute'>attributes</span></a> MUST be present.</p>
+since at least one  of <a href="http://www.w3.org/TR/prov-dm/#start.id"><span class='attribute'>id</span></a>, <a href="http://www.w3.org/TR/prov-dm/#start.trigger"><span class='attribute'>trigger</span></a>, <a href="http://www.w3.org/TR/prov-dm/#start.starter"><span class='attribute'>starter</span></a>, <a href="http://www.w3.org/TR/prov-dm/#start.time"><span class='attribute'>time</span></a>, and  <a href="http://www.w3.org/TR/prov-dm/#start.attributes"><span class='attribute'>attributes</span></a> MUST be present (as per [[PROV-DM]]).</p>
 
 </section>
 
@@ -1410,7 +1432,7 @@
   </pre>
 <p>Here, the derivation from
 <a href="#anexample-derivation" class="anexample-ref"><span>Example REF</span></a>
-is extended with a <span class="name">prov:type</span> attribute and value <span class="name">prov:Revision</span>.
+is extended with a <span class="name">prov:type</span> attribute and value <span class="name">prov:Revision</span>.  The expression <code>'prov:Revision'</code> is <code class="content"><a class="grammarRef" href="#prod-convenienceNotation">convenienceNotation</a></code> to denote a <code class="content"><a class="grammarRef" href="#prod-QUALIFIED_NAME">QUALIFIED_NAME</a></code> literal (See  <a href="#expression-literal">Section 3.7.3. Literal</a>).
 </div>
 
 
@@ -1771,7 +1793,7 @@
 <tbody class="grammar-ref" data-ref="prod-namedBundle"></tbody>
 </table>
 
-<p>Named bundles cannot be nested because <a class="grammarRef" href="#prod-namedBundle">namedBundle</a> is not an <a class="grammarRef" href="#prod-expression">expression</a>, and therefore cannot occurs inside another <a class="grammarRef" href="#prod-namedBundle">namedBundle</a>.</p>
+<p>Named bundles cannot be nested because <code><a class="grammarRef" href="#prod-namedBundle">namedBundle</a></code> is not an <code><a class="grammarRef" href="#prod-expression">expression</a></code>, and therefore cannot occurs inside another <code><a class="grammarRef" href="#prod-namedBundle">namedBundle</a></code>.</p>
 
 <p>Named bundles are self-contained: each identifier occuring in a named bundle, including the bundle identifier itself, MUST be interpreted with respect to the namespace declarations of that bundle. In other words, for every identifier with a prefix <code>p</code> within a named bundle, there MUST be a namespace declaration for <code>p</code> in this named bundled; for every identifier  without prefix, there MUST be a default namespace declaration  in this named bundled.</p>
 
@@ -1781,7 +1803,7 @@
   prefix ex  &lt;http://example.org/&gt;
   agent(ex:Paolo,   [ prov:type='prov:Person' ])
   agent(ex:Simon,   [ prov:type='prov:Person' ])
-  ...
+  //...
 endBundle
   </pre>
 <p> Here  <span class="name">ex:author-view</span> is the name of the bundle. 
@@ -2033,23 +2055,26 @@
 
 <div class="anexample">
     <pre class="codeexample">
-   hadMembers(mId, c, {e1, e2, e3}, [])   // Collection membership
+   hadMembers(mId, c, {e1, e2, e3}, true, [prov:label="A beautiful collection"])   // Collection membership
   </pre>
 <p>  Here
     <span class="name">mId</span> is the optional membership identifier,
   <span class="name">c</span> is the  identifier for the collection whose membership is stated,
   <span class="name"> {e1, e2, e3}</span> is the entity-set indicating the members of 
   <span class="name">c</span>,
-    and <span class="name">[]</span> is the optional (empty) set of attributes. </p>  
+    <span class="name">true</span> is the complete flag indicating that the collection member is believed to be closed,
+    and <span class="name">[prov:label="A beautiful collection"]</span> is the optional set of attributes. </p>  
+
+<p>
 In the remaining examples,  some of the optionals are omitted.
 
 <pre class="codeexample">
 hadMembers(c3, {e1})
-hadMembers(c3, {e1,e2})     // default "complete" flag is false
+hadMembers(c3, {e1,e2})     
 hadMembers(c3, {e1,e2}, false)
 hadMembers(c3, {e1,e2}, true)
-hadMembers(c3, ,[])  
-hadMembers(c3, ,true, [])  
+hadMembers(c3, {}, [])  
+hadMembers(c3, {}, true, [])  // c3 is effectively of type EmptyCollection
 </pre>
 </div>
 
@@ -2486,18 +2511,18 @@
 
 </table>
 
-<p>A <a class="grammarRef" href="#prod-namespaceDeclaration">namespaceDeclaration</a> consists of a binding between a prefix and a namespace. Every qualified name with this prefix in the scope of this declaration refers to this namespace.
-A <a class="grammarRef" href="#prod-defaultNamespaceDeclaration">defaultNamespaceDeclaration</a> consists of a namespace. Every qualified name without prefix in the scope of this declaration refers to this namespace. Scope of a declaration is specified as follows:</p>
+<p>A <code><a class="grammarRef" href="#prod-namespaceDeclaration">namespaceDeclaration</a></code> consists of a binding between a prefix and a namespace. Every qualified name with this prefix in the scope of this declaration refers to this namespace.
+A <code><a class="grammarRef" href="#prod-defaultNamespaceDeclaration">defaultNamespaceDeclaration</a></code> consists of a namespace. Every qualified name without prefix in the scope of this declaration refers to this namespace. Scope of a declaration is specified as follows:</p>
 <ul>
 <li> 
-The scope of a namespace declaration directly occurring in a <a class="grammarRef" href="#prod-namedBundle">namedBundle</a> is the <a class="grammarRef" href="#prod-namedBundle">namedBundle</a> itself;</li>
+The scope of a namespace declaration directly occurring in a <code><a class="grammarRef" href="#prod-namedBundle">namedBundle</a></code> is the <code><a class="grammarRef" href="#prod-namedBundle">namedBundle</a></code> itself;</li>
 <li>
-the scope of a namespace declaration directly occurring in a <a class="grammarRef" href="#prod-bundle">toplevel bundle</a> is the <a class="grammarRef" href="#prod-bundle">toplevel bundle</a> itself, except and <a class="grammarRef" href="#prod-namedBundle">namedBundle</a> it may contain.</li>
+the scope of a namespace declaration directly occurring in a <code><a class="grammarRef" href="#prod-bundle">toplevel bundle</a></code> is the <code><a class="grammarRef" href="#prod-bundle">toplevel bundle</a></code> itself, except and <code><a class="grammarRef" href="#prod-namedBundle">namedBundle</a></code> it may contain.</li>
 </ul>
 
-<p>A set of namespace declarations <a class="grammarRef" href="#prod-namespaceDeclarations">namespaceDeclarations</a> MUST NOT re-declare the same prefix.</p>
-
-<p>A namespace declaration <a class="grammarRef" href="#prod-namespaceDeclaration">namespaceDeclaration</a> MUST NOT declare prefixes <span class="name">prov</span> and <span class="name">xsd</span>  (see <a href="#namespace-table">Table 1</a> for their IRI).</p>
+<p>A set of namespace declarations <code><a class="grammarRef" href="#prod-namespaceDeclarations">namespaceDeclarations</a></code> MUST NOT re-declare the same prefix.</p>
+
+<p>A namespace declaration <code><a class="grammarRef" href="#prod-namespaceDeclaration">namespaceDeclaration</a></code> MUST NOT declare prefixes <span class="name">prov</span> and <span class="name">xsd</span>  (see <a href="#namespace-table">Table 1</a> for their IRI).</p>
 
 
 
@@ -2563,13 +2588,6 @@
 
 
 
-<p>A toplevel bundle, written <span class="name">bundle decls exprs bundles endBundle</span> in PROV-N, contains:
-<ul>
-<li><em>namespaceDeclarations</em>: a set <span class="name">decls</span> of namespace declarations, declaring namespaces and associated prefixes, which can be used in <a
-title="attribute">attributes</a> and  <a title="identifier">identifiers</a> occurring inside  <span class="name">exprs</span>;</li>
-<li><em>expressions</em>:  a non-empty set of expressions <span class="name">exprs</span>;</li>
-<li><em>namedBundles</em>:  a  set of <a href="#expression-bundle-declaration">bundle declarations</a> <span class="name">bundles</span>;</li>
-</ul>
 
 <p>A toplevel bundle's text matches the <code class="content"><a class="grammarRef"
  href="#prod-bundle">bundle</a></code> production.</p>
@@ -2578,6 +2596,16 @@
 <tbody class="grammar-ref" data-ref="prod-bundle"></tbody>
 </table>
 
+<p>A toplevel bundle contains:
+<ul>
+<li><em>namespaceDeclarations</em>: a set of namespace declarations <code><a class="grammarRef" href="#prod-namespaceDeclarations">namespaceDeclarations</a></code>, declaring namespaces and associated prefixes, which can be used in <a
+title="attribute">attributes</a> and  <a title="identifier">identifiers</a> occurring inside  <span class="name">exprs</span>;</li>
+<li><em>expressions</em>:  a set of expressions matching <code><a class="grammarRef" href="#prod-expression">expression</a></code>;</li>
+<li><em>namedBundles</em>:  a  set of
+<code><a class="grammarRef" href="#prod-namedBundle">namedBundle</a></code>.</li>
+</ul>
+
+
 <p>Thus, named bundles can occur inside a toplevel bundle. 
 Named bundles are self-contained: each identifier occuring in a named bundle, including the bundle identifier itself, MUST be interpreted with respect to the namespace declarations of that named bundle. In other words, named bundles do not inherit namespaces declarations from the toplevel bundle.
 </p>
@@ -2586,7 +2614,7 @@
 
 <div class="anexample">
 <p>
-The following container contains expressions related to the provenance of entity 
+The following bundle contains expressions related to the provenance of entity 
 <span class="name">e2</span>.
 </p>
 <pre class="codeexample">
@@ -2596,10 +2624,10 @@
 
   entity(e2, [ prov:type="File", ex:path="/shared/crime.txt", ex:creator="Alice", 
                ex:content="There was a lot of crime in London last month."])
-  activity(a1, 2011-11-16T16:05:00, -,[prov:type="edit"])
+  activity(a1, 2011-11-16T16:05:00, -, [prov:type="edit"])
   wasGeneratedBy(e2, a1, -, [ex:fct="save"])     
   wasAssociatedWith(a1, ag2, -, [prov:role="author"])
-  agent(ag2, [ prov:type='prov:Person' , ex:name="Bob" ])
+  agent(ag2, [ prov:type='prov:Person', ex:name="Bob" ])
 
 endBundle
 </pre>