merge
authorLuc Moreau <l.moreau@ecs.soton.ac.uk>
Thu, 24 May 2012 17:32:04 +0100
changeset 2958 2828a5af0017
parent 2957 1de10c9c77fb (current diff)
parent 2956 e69c62136b7e (diff)
child 2959 5a312b034907
merge
--- a/primer/Primer.html	Thu May 24 17:31:13 2012 +0100
+++ b/primer/Primer.html	Thu May 24 17:32:04 2012 +0100
@@ -13,6 +13,7 @@
    .note { font-size:small; margin-left:50px }
   </style>
 
+  <script src="http://www.w3.org/2007/OWL/toggles.js" class="remove"></script> 
   <script src="http://dev.w3.org/2009/dap/ReSpec.js/js/respec.js" class="remove"></script>
 
   <script class="remove">
@@ -155,30 +156,30 @@
    environments such as the Web. This document is an
    intuitive introduction and guide with simple illustrative examples
    of the core aspects of PROV.
-      
-      <h4>PROV Family of Specifications</h4>
-The PROV family of specifications aims to define the various aspects that are necessary to achieve the vision of inter-operable
-interchange of provenance information in heterogeneous environments such as the Web.  
-The specifications are as follows.
-<ul>
-<li> PROV-PRIMER, a primer for the PROV data model (this document),</li>
-<li> PROV-DM, the PROV data model for provenance,</li>
-<li> PROV-DM-CONSTRAINTS, a set of constraints applying to the PROV data model,</li>
-<li> PROV-N, a notation for provenance aimed at human consumption,</li>
-<li> PROV-O, the PROV ontology, an OWL-RL ontology allowing the mapping of PROV to RDF;</li>
-<li> PROV-AQ, the mechanisms for accessing and querying provenance; </li>
-<li> PROV-SEM, a formal semantics for the PROV data model.</li>
-<li> PROV-XML, an XML schema for the PROV data model.</li>
-</ul>
-<h4>How to read the PROV Family of Specifications</h4>
-<ul>
-<li>The primer is the entry point to PROV offering a pedagogical presentation of the provenance model.</li>
-<li>The Linked Data and Semantic Web community should focus on PROV-O defining PROV classes and properties specified in an OWL-RL ontology. For further details, PROV-DM and PROV-DM-CONSTRAINTS specify the constraints applicable to the data model, and its interpretation. PROV-SEM provides a mathematical semantics.</li>
-<li>The XML community should focus on PROV-XML defining an XML schema for PROV-DM. Further details can also be found in PROV-DM, PROV-DM-CONSTRAINTS, and PROV-SEM.</li>
-<li>Developers seeking to retrieve or publish provenance should focus of PROV-AQ.</li>
-<li>Readers seeking to implement other PROV serializations
-should focus on PROV-DM and PROV-DM-CONSTRAINTS.  PROV-O, PROV-N, PROV-XML offer examples of mapping to RDF, text, and XML, respectively.</li>
-</ul>
+
+   <h4>PROV Family of Specifications</h4>
+   The PROV family of specifications aims to define the various aspects that are necessary to achieve the vision of inter-operable
+   interchange of provenance information in heterogeneous environments such as the Web.  
+   The specifications are as follows.
+   <ul>
+    <li> PROV-PRIMER, a primer for the PROV data model (this document),</li>
+    <li> PROV-DM, the PROV data model for provenance,</li>
+    <li> PROV-DM-CONSTRAINTS, a set of constraints applying to the PROV data model,</li>
+    <li> PROV-N, a notation for provenance aimed at human consumption,</li>
+    <li> PROV-O, the PROV ontology, an OWL-RL ontology allowing the mapping of PROV to RDF;</li>
+    <li> PROV-AQ, the mechanisms for accessing and querying provenance; </li>
+    <li> PROV-SEM, a formal semantics for the PROV data model.</li>
+    <li> PROV-XML, an XML schema for the PROV data model.</li>
+   </ul>
+   <h4>How to read the PROV Family of Specifications</h4>
+   <ul>
+    <li>The primer is the entry point to PROV offering a pedagogical presentation of the provenance model.</li>
+    <li>The Linked Data and Semantic Web community should focus on PROV-O defining PROV classes and properties specified in an OWL-RL ontology. For further details, PROV-DM and PROV-DM-CONSTRAINTS specify the constraints applicable to the data model, and its interpretation. PROV-SEM provides a mathematical semantics.</li>
+    <li>The XML community should focus on PROV-XML defining an XML schema for PROV-DM. Further details can also be found in PROV-DM, PROV-DM-CONSTRAINTS, and PROV-SEM.</li>
+    <li>Developers seeking to retrieve or publish provenance should focus of PROV-AQ.</li>
+    <li>Readers seeking to implement other PROV serializations
+     should focus on PROV-DM and PROV-DM-CONSTRAINTS.  PROV-O, PROV-N, PROV-XML offer examples of mapping to RDF, text, and XML, respectively.</li>
+   </ul>
 
 
   </section>
@@ -225,8 +226,8 @@
     Provenance records are metadata.  There are other kinds of metadata that is 
     not provenance.  For example, the size of an image is metadata of 
     that image but it is not provenance.
-    </p>
-    
+   </p>
+
    <p>
     For general background on provenance, a 
     comprehensive overview of requirements, use cases, prior research, and proposed 
@@ -236,25 +237,25 @@
     that may help identify the provenance aspects of planned applications and 
     help plan the design of a provenance system.
    </p>
-   
+
    <p>
     This primer document aims to ease the adoption of the PROV specifications by providing:
    </p>
    <ul>
     <li>An intuitive explanation of how PROV models provenance. A detailed description of
-    all the concepts and relations in the PROV Data Model is provided in [[PROV-DM]].</li>
+     all the concepts and relations in the PROV Data Model is provided in [[PROV-DM]].</li>
     <li>A simple self-contained example that illustrates how to produce and use PROV assertions, highlighting how 
-    to combine PROV with other popular vocabularies such as FOAF and Dublin Core.  A description
-    of the formal PROV ontology (PROV-O) can be found in [[PROV-O]].</li>
+     to combine PROV with other popular vocabularies such as FOAF and Dublin Core.  A description
+     of the formal PROV ontology (PROV-O) can be found in [[PROV-O]].</li>
     <li>Example snippets using a notation of PROV designed for human
-    consumption (PROV-N).  Details of this notation can be found at [[PROV-N]].</li>
+     consumption (PROV-N).  Details of this notation can be found at [[PROV-N]].</li>
    </ul>
-   
+
    <p>There are additional reference documents for PROV that are not covered in this 
-   primer, including the PROV Access and Query aspects of the specification (PROV-AQ), 
-   the constraints on the PROV data model (PROV-DM-CONSTRAINTS), 
-   a formal semantics of the PROV data model (PROV-SEM), and the PROV XML notation 
-   (PROV-XML). </p>
+    primer, including the PROV Access and Query aspects of the specification (PROV-AQ), 
+    the constraints on the PROV data model (PROV-DM-CONSTRAINTS), 
+    a formal semantics of the PROV data model (PROV-SEM), and the PROV XML notation 
+    (PROV-XML). </p>
 
   </section>
 
@@ -275,7 +276,7 @@
     PROV relations are named so they can be used in assertions about the past.  
     This also affects the domain and range of the relations in PROV.  
    </p>
-  
+
    <div style="text-align: center;">
     <img src="OverviewDiagram.png" alt="PROV-DM overview"/>
    </div>
@@ -355,10 +356,10 @@
      the entity.
     </p>
     <p>
-    One may want to describe the provenance of an agent.  For example, an organization 
-    responsible for the creation of a report may evolve over time as the report is written as
-    some members leave and others join.  To make provenance assertions about an agent in PROV ,
-    the agent must be declared explicitly both as an agent and as an entity.
+     One may want to describe the provenance of an agent.  For example, an organization 
+     responsible for the creation of a report may evolve over time as the report is written as
+     some members leave and others join.  To make provenance assertions about an agent in PROV ,
+     the agent must be declared explicitly both as an agent and as an entity.
     </p>
 
    </section>
@@ -432,21 +433,21 @@
     </p>
     <ul>
      <li>The same entity can appear with different descriptions in a provenance record
-     because each appearance emphasizes different aspects of the entity, e.g.
-     a book may be described by its title in one place and by its author and publication date
-     in another.</li>
+      because each appearance emphasizes different aspects of the entity, e.g.
+      a book may be described by its title in one place and by its author and publication date
+      in another.</li>
      <li>The same entity can evolve over time into different 
-     versions, e.g. a document that is repeatedly updated and has 
-     subsequent releases over time.</li>
+      versions, e.g. a document that is repeatedly updated and has 
+      subsequent releases over time.</li>
      <li>The same entity can be copied 
-     or replicated, e.g. a document may be copied to several directories.</li>
+      or replicated, e.g. a document may be copied to several directories.</li>
      <li>An entity can go through different incarnations, e.g.
-     a committee producing a report may have a set of members when the report 
-     is first released and have a different set of members when an update of
-     the report is released.</li>
+      a committee producing a report may have a set of members when the report 
+      is first released and have a different set of members when an update of
+      the report is released.</li>
     </ul>
     <p>
-       In all these situations, 
+     In all these situations, 
      the more specific entities (the versions, copies, incarnations) can be said in PROV to be <i>specializations</i>
      of the more general entity (the book, the document or the committee as a general entity).
      The specific entities in each example are also <i>alternates</i> of each other, as they are specializations
@@ -465,6 +466,34 @@
   <section>
    <h2>Examples of Key Concepts in PROV</h2>
 
+   <form action="#"><p> 
+     <input id="hide-turtle-examples" type="button" value="Hide Turtle Examples" 
+            onclick="
+             set_display_by_class('pre','turtle example','none');
+             set_display_by_class('div','turtle example','none');
+             set_display_by_id('hide-turtle-examples','none');
+             set_display_by_id('show-turtle-examples','');" />
+     <input id="show-turtle-examples" type="button" value="Show Turtle Examples"
+            style="display:none" onclick="
+             set_display_by_class('pre','turtle example','');
+             set_display_by_class('div','turtle example','');
+             set_display_by_id('hide-turtle-examples','');
+             set_display_by_id('show-turtle-examples','none');" />
+     <input id="hide-provn-examples" type="button" value="Hide PROV-N Examples"
+            style="display:none" onclick="
+             set_display_by_class('pre','provn example','none');
+             set_display_by_class('div','provn example','none');
+             set_display_by_id('hide-provn-examples','none');
+             set_display_by_id('show-provn-examples','');" />
+     <input id="show-provn-examples" type="button" value="Show PROV-N Examples" 
+            onclick="
+             set_display_by_class('pre','provn example','');
+             set_display_by_class('div','provn example','');
+             set_display_by_id('hide-provn-examples','');
+             set_display_by_id('show-provn-examples','none');" />
+    </p> 
+   </form>
+
    <p>
     In the following sections, we show how PROV can be used to model 
     provenance in a specific example scenario.
@@ -497,14 +526,29 @@
      Betty retrieves a record of the provenance of the article, describing how it was created.
     </p>
     <p>Betty finds the following descriptions of entities in the provenance:</p>
-    <pre class="turtle example">
-     ex:article     a prov:Entity ;
-                    dcterms:title "Crime rises in cities" .
-     ex:dataset1    a prov:Entity .
-     ex:regionList  a prov:Entity .
-     ex:composition a prov:Entity .
-     ex:chart1      a prov:Entity .
-    </pre>
+    <div class="turtle example">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>Turtle Example</b></span></div>
+     <pre>
+  ex:article     a prov:Entity ;
+                 dcterms:title "Crime rises in cities" .
+  ex:dataset1    a prov:Entity .
+  ex:regionList  a prov:Entity .
+  ex:composition a prov:Entity .
+  ex:chart1      a prov:Entity .
+     </pre>
+    </div>
+    <div class="provn example" style="display:none">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>PROV-N Example</b></span></div>
+     <pre>
+  entity(ex:article, [dcterms:title="Crime rises in cities"])
+  entity(ex:dataSet1)
+  entity(ex:regionList)
+  entity(ex:composition)
+  entity(ex:chart1)
+     </pre>
+    </div>
     <p>
      These statements, in order, refer to the article (<code>ex:article</code>),
      an original data set (<code>ex:dataSet1</code>),
@@ -530,18 +574,35 @@
      an activity (<code>ex:compile</code>) denoting the compilation of the
      chart from the data set.
     </p>
-    <pre class="turtle example">
-     ex:compile a prov:Activity .
-    </pre>
+    <div class="turtle example">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>Turtle Example</b></span></div>
+     <pre>
+  ex:compile a prov:Activity .
+     </pre>
+    </div>
     <p>
      The provenance also includes reference to the more specific steps involved in this compilation,
      which are first composing the data by region (<code>ex:compose</code>) and then generating the
      chart graphic (<code>ex:illustrate</code>).
     </p>
-    <pre class="turtle example">
+    <div class="turtle example">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>Turtle Example</b></span></div>
+     <pre>
      ex:compose    a prov:Activity .
      ex:illustrate a prov:Activity .
-    </pre>
+     </pre>
+    </div>
+    <div class="provn example" style="display:none">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>PROV-N Example</b></span></div>
+     <pre>
+     activity(ex:compile)
+     activity(ex:compose)
+     activity(ex:illustrate)
+     </pre>
+    </div>
     <p>
      In visualizations of the PROV data, activities are depicted as rectangles, as below.
     </p>
@@ -562,19 +623,39 @@
      (<code>ex:compose</code>) used the original data set, that it used the list of
      regions, and that the composed data was generated by this activity.
     </p>
-    <pre class="turtle example">
+    <div class="turtle example">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>Turtle Example</b></span></div>
+     <pre>
      ex:compose      prov:used           ex:dataSet1 ;
                      prov:used           ex:regionList .
      ex:composition  prov:wasGeneratedBy ex:compose .
-    </pre>
+     </pre>
+    </div>
     <p>
      Similarly, the chart graphic creation activity (<code>ex:illustrate</code>)
      used the composed data, and the chart was generated by this activity.
     </p>
-    <pre class="turtle example">
+    <div class="turtle example">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>Turtle Example</b></span></div>
+     <pre>
      ex:illustrate prov:used           ex:composition .
      ex:chart1     prov:wasGeneratedBy ex:illustrate .
-    </pre>
+     </pre>
+    </div>
+    <div class="provn example" style="display:none">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>PROV-N Example</b></span></div>
+     <pre>
+     used(ex:compose, ex:dataSet1, -)
+     used(ex:compose, ex:regionList, -)
+     wasGeneratedBy(ex:composition, ex:compose, -)
+
+     used(ex:illustrate, ex:composition, -)
+     wasGeneratedBy(ex:chart1, ex:illustrate, -)
+     </pre>
+    </div>
     <p>
      In visualizing the PROV data, usage and generation are connections between
      entities and activities.
@@ -590,40 +671,89 @@
      Betty sees that Derek was involved in both the composition and
      chart creation activities:
     </p>
-    <pre class="turtle example">
+    <div class="turtle example">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>Turtle Example</b></span></div>
+     <pre>
      ex:compose    prov:wasAssociatedWith ex:derek .
      ex:illustrate prov:wasAssociatedWith ex:derek .
-    </pre>
+     </pre>
+    </div>
+    <div class="provn example" style="display:none">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>PROV-N Example</b></span></div>
+     <pre>
+     wasAssociatedWith(ex:compose, ex:derek, -)
+     wasAssociatedWith(ex:illustrate, ex:derek, -)
+     </pre>
+    </div>
     <p>
      The record for Derek provides the
      following information, of which the first lines are PROV-O statements that
      Derek is an agent, specifically a person, followed by (non-PROV) statements
      giving general properties of Derek.
     </p>
-    <pre class="turtle example">
+    <div class="turtle example">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>Turtle Example</b></span></div>
+     <pre>
      ex:derek a prov:Agent ;
               a prov:Person ;
               foaf:givenName "Derek"^^xsd:string ;
               foaf:mbox      &lt;mailto:derek@example.org&gt; .
-    </pre>
+     </pre>
+    </div>
+    <div class="provn example" style="display:none">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>PROV-N Example</b></span></div>
+     <pre>
+     agent(ex:derek, [ prov:type="prov:Person", foaf:givenName = "Derek", 
+            foaf:mbox= "&lt;mailto:derek@example.org&gt;"])
+     </pre>
+    </div>
     <p>
      Derek works as part of an organization, Chart Generators Inc, and so the provenance
      declares that he acts on their behalf. Note that the organization is itself
      an agent.
     </p>
-    <pre class="turtle example">
+    <div class="turtle example">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>Turtle Example</b></span></div>
+     <pre>
      ex:derek prov:actedOnBehalfOf ex:chartgen .
      ex:chartgen a prov:Agent ;
                  a prov:Organization ;
                  foaf:name "Chart Generators Inc" .
-    </pre>
+     </pre>
+    </div>
+    <div class="provn example" style="display:none">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>PROV-N Example</b></span></div>
+     <pre>
+     agent(ex:chartgen, [ prov:type="prov:Organization",
+            foaf:name = "Chart Generators Inc"])
+     actedOnBehalfOf(ex:derek, ex:chartgen, ex:compose)
+     </pre>
+    </div>
     <p>
      Finally, there is an explicit statement in the provenance that the chart was
      attributed to Derek.
     </p>
-    <pre class="turtle example">
+    <div class="turtle example">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>Turtle Example</b></span></div>
+     <pre>
      ex:chart1 prov:wasAttributedTo ex:derek .
-    </pre>
+     </pre>
+    </div>
+    <div class="provn example" style="display:none">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>PROV-N Example</b></span></div>
+     <pre>
+     wasAttributedTo(ex:chart1, ex:derek)
+     </pre>
+    </div>
+
     <p>
      We can extend our graphical depiction to show the agents, association and attribution links.
     </p>
@@ -650,21 +780,29 @@
      resulting composed data (<code>ex:composedData</code>), and the
      analyst doing the composition (<code>ex:analyst</code>).
     </p>
-    <pre class="turtle example">
+    <div class="turtle example">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>Turtle Example</b></span></div>
+     <pre>
      ex:dataToCompose        a prov:Role .
      ex:regionsToAggregateBy a prov:Role .
      ex:composedData         a prov:Role .
      ex:analyst              a prov:Role .
-    </pre>
+     </pre>
+    </div>
     <p>
      Examples in the sections above show descriptions of the simple facts that the
      composition activity used, generated and was enacted by entities/agents.
      For example, the usage of the data set by the compose activity is expressed
      as follows.
     </p>
-    <pre class="turtle example">
+    <div class="turtle example">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>Turtle Example</b></span></div>
+     <pre>
      ex:compose prov:used ex:dataSet1 .
-    </pre>
+     </pre>
+    </div>
     <p>     
      The
      provenance can contain more details of exactly how these entities and agents
@@ -679,31 +817,56 @@
      of the government data set (<code>ex:dataSet1</code>) in the role of the data
      to be composed (<code>ex:dataToCompose</code>).
     </p>
-    <pre class="turtle example">
+    <div class="turtle example">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>Turtle Example</b></span></div>
+     <pre>
      ex:compose prov:qualifiedUsage [
                    a prov:Usage ;
                    prov:entity  ex:dataSet1 ;
                    prov:hadRole ex:dataToCompose 
      ] .
-    </pre>
+     </pre>
+    </div>
+    <div class="provn example" style="display:none">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>PROV-N Example</b></span></div>
+     <pre>
+     used(ex:compose, ex:dataSet1,   -, [ prov:role = "ex:dataToCompose"])
+     </pre>
+    </div>
     <p>
      This can then be distinguished from the same activity's usage of the list of
      regions because the roles played are different.
     </p>
-    <pre class="turtle example">
+    <div class="turtle example">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>Turtle Example</b></span></div>
+     <pre>
      ex:compose prov:qualifiedUsage [
                    a prov:Usage ;
                    prov:entity  ex:regionList ;
                    prov:hadRole ex:regionsToAggregateBy
      ] .
-    </pre>
+     </pre>
+    </div>
+    <div class="provn example" style="display:none">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>PROV-N Example</b></span></div>
+     <pre>
+     used(ex:compose, ex:regionList, -, [ prov:role = "ex:regionsToAggregateBy"])
+     </pre>
+    </div>
     <p>
      Similarly, the provenance includes descriptions that the same activity was
      enacted in a particular way by Derek, so it indicates that he had the role of 
      <code>ex:analyst</code>, and that the entity <code>ex:composition</code> took the role of the composed
      data in what the activity generated:
     </p>
-    <pre class="turtle example">
+    <div class="turtle example">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>Turtle Example</b></span></div>
+     <pre>
      ex:compose  prov:qualifiedAssociation [
                    a  prov:Association ;
                    prov:agent    ex:derek ;
@@ -714,7 +877,8 @@
                         prov:activity  ex:compose ;
                         prov:hadRole   ex:composedData
      ] .
-    </pre>
+     </pre>
+    </div>
     <p>
      Depicting the above visually, we have the following.
     </p>
@@ -734,26 +898,52 @@
      <code>ex:dataSet2</code>, states that it is a revision of the
      old data set, <code>ex:dataSet1</code>.
     </p>
-    <pre class="turtle example">
+    <div class="turtle example">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>Turtle Example</b></span></div>
+     <pre>
      ex:dataSet2 a prov:Entity ;
                  prov:wasRevisionOf ex:dataSet1 .
-    </pre>
+     </pre>
+    </div>
+    <div class="provn example" style="display:none">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>PROV-N Example</b></span></div>
+     <pre>
+     wasRevisionOf(ex:dataSet2, ex:dataSet1, -)
+     </pre>
+    </div>
     <p>
      Derek notices that there is a new dataset available and creates a new chart based on the revised data, 
      using another compilation activity. Betty checks the article again at a
      later point, and wants to know if it is based on the old or new GovData.
      She sees a new description stating that the new chart is derived from the new dataset.
     </p>
-    <pre class="example turtle">
+    <div class="turtle example">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>Turtle Example</b></span></div>
+     <pre>
      ex:chart2 a prov:Entity ;
                prov:wasDerivedFrom ex:dataSet2 .
-    </pre>
+     </pre>
+    </div>
+    <div class="provn example" style="display:none">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>PROV-N Example</b></span></div>
+     <pre>
+     wasDerivedFrom(ex:chart2, ex:dataSet2)
+     </pre>
+    </div>
     <p>and that the new chart is a revision of the original one:
     </p>
-    <pre class="turtle example">
+    <div class="turtle example">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>Turtle Example</b></span></div>
+     <pre>
      ex:chart2 a prov:Entity ;
                  prov:wasRevisionOf ex:chart1 .
-    </pre>
+     </pre>
+    </div>
     <p>
      Derivation and revision are connections between entities, and so depicted
      with arrows in our visualization.
@@ -772,24 +962,39 @@
      First, the correction activity (<code>ex:correct</code>), the person who corrected
      it, Edith (<code>ex:edith</code>), and the correction instructions (<code>ex:instructions</code>)
      are described.
-    <pre class="turtle example">
+    <div class="turtle example">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>Turtle Example</b></span></div>
+     <pre>
      ex:correct      a prov:Activity .
      ex:edith        a prov:Agent, prov:Person .
      ex:instructions a prov:Plan .
-    </pre>
+     </pre>
+    </div>
     <p>
      The connection between them is expressed in PROV-O using a qualified association giving details of
      how Edith was associated with the correction activity,
      including that she followed the above correction instructions.
     </p>
-    <pre class="turtle example">
+    <div class="turtle example">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>Turtle Example</b></span></div>
+     <pre>
      ex:correct prov:qualifiedAssociation [
                     a Association ;
                     prov:agent   ex:edith ;
                     prov:hadPlan ex:instructions
                 ] .
      ex:dataSet2 prov:wasGeneratedBy ex:correct .
-    </pre>
+     </pre>
+    </div>
+    <div class="provn example" style="display:none">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>PROV-N Example</b></span></div>
+     <pre>
+     wasAssociatedWith(ex:correct, ex:edith, ex:instructions)
+     </pre>
+    </div>
     <p>
      Plans are additional information about the connection from an activity to
      an agent, and so, in our visualization, connect to the link between them.
@@ -808,7 +1013,10 @@
      description of the generation. The snippet below shows that the second chart
      was generated roughly a month after the first.
     </p>
-    <pre class="turtle example">
+    <div class="turtle example">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>Turtle Example</b></span></div>
+     <pre>
      ex:chart1 prov:qualifiedGeneration [
                     a prov:Generation ;
                     prov:activity ex:compile ;
@@ -819,7 +1027,17 @@
                     prov:activity ex:compile2 ;
                     prov:atTime   "2012-04-01T15:21:00"^^xsd:dateTime
      ] .
-    </pre>
+     </pre>
+    </div>
+    <div class="provn example" style="display:none">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>PROV-N Example</b></span></div>
+     <pre>
+     wasGeneratedBy(ex:chart1, ex:compile,  2012-03-02T10:30:00)
+     wasGeneratedBy(ex:chart2, ex:compile2, 2012-04-01T15:21:00)
+     </pre>
+    </div>
+
     <p>
      To ensure their procedures are efficient, the agency also wish to know how long the
      corrections took once the error was discovered. That is, they wish to know the
@@ -827,10 +1045,21 @@
      These details are expressed as follows, showing that the corrections took a
      little over a day.
     </p>
-    <pre class="turtle example">
+    <div class="turtle example">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>Turtle Example</b></span></div>
+     <pre>
      ex:correct prov:startedAtTime "2012-03-31T09:21:00"^^xsd:dateTime ;
                 prov:endedAtTime   "2012-04-01T15:21:00"^^xsd:dateTime .
-    </pre>
+     </pre>
+    </div>
+    <div class="provn example" style="display:none">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>PROV-N Example</b></span></div>
+     <pre>
+     activity(ex:correct, 2012-03-31T09:21:00, 2012-04-01T15:21:00)
+     </pre>
+    </div>
     <p>
      Time is visualized as additional information regarding activities or the
      links between activities and entities or agents.
@@ -846,10 +1075,22 @@
      posted a blog entry about the article. The blog entry had its own published
      provenance, stating that it quoted from the article.
     </p>
-    <pre class="turtle example">
+    <div class="turtle example">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>Turtle Example</b></span></div>
+     <pre>
      ex:blogEntry a prov:Entity ;
                   prov:wasQuotedFrom ex:article .
-    </pre>
+     </pre>
+    </div>
+    <div class="provn example" style="display:none">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>PROV-N Example</b></span></div>
+     <pre>
+     entity(ex:blogEntry)
+     wasQuotedFrom(ex:blogEntry, ex:article)
+     </pre>
+    </div>
     <p>
      The newspaper, from past experience, anticipated that there could be revisions
      to the article, and so created identifiers for both the article in general
@@ -858,9 +1099,24 @@
      In the provenance records, the newspaper describes the connection between the two: that
      the first version of the article is a specialization of the article in general.
     </p>
-    <pre class="turtle example">
+    <div class="turtle example">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>Turtle Example</b></span></div>
+     <pre>
      ex:articleV1 prov:specializationOf ex:article .
-    </pre>
+     </pre>
+    </div>
+    <div class="provn example" style="display:none">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>PROV-N Example</b></span></div>
+     <pre>
+     entity(ex:articleV1)
+     specializationOf(ex:articleV1, ex:article)
+
+     specializationOf(ex:articleV2, ex:article)
+     alternateOf(ex:articleV1, ex:articleV2)
+     </pre>
+    </div>
     <p>
      Later, after the data set is corrected and the new chart generated, a new version
      of the article is created, <code>ex:articleV2</code>, with its own URI where the article
@@ -869,17 +1125,29 @@
      is connected with the provenance of <code>ex:article</code> and <code>ex:articleV1</code>,
      the newspaper describes how these entities are related.
     </p>
-    <pre class="turtle example">
+    <div class="turtle example">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>Turtle Example</b></span></div>
+     <pre>
      ex:articleV2 prov:specializationOf ex:article .
      ex:articleV2 prov:alternateOf      ex:articleV1 .
-    </pre>
+     </pre>
+    </div>
+    <div class="provn example" style="display:none">
+     <div class="exampleheader">
+      <span class="exampleheader"><b>PROV-N Example</b></span></div>
+     <pre>
+     specializationOf(ex:articleV2, ex:article)
+     alternateOf(ex:articleV1, ex:articleV2)
+     </pre>
+    </div>
     <p>
      Specialization and alternate relations connect entities, and so are visualized
      as links between them.
     </p>
     <img src="images/specialization.png" alt="Specialization and alternate links between entities"/>
    </section>
-   
+
    <section>
     <h3>Complete PROV data</h3>
     <p>
@@ -898,7 +1166,7 @@
    </p>
    <section>
     <h3>Entities</h3>
-    <pre class="example asn">
+    <pre class = "provn example">
      entity(ex:article, [dcterms:title="Crime rises in cities"])
      entity(ex:dataSet1)
      entity(ex:regionList)
@@ -909,7 +1177,7 @@
 
    <section>
     <h3>Activities</h3>
-    <pre class="example asn">
+    <pre class="provn example">
      activity(ex:compile)
      activity(ex:compose)
      activity(ex:illustrate)
@@ -918,7 +1186,7 @@
 
    <section>
     <h3>Use and Generation</h3>
-    <pre class="example asn">
+    <pre class="provn example">
      used(ex:compose, ex:dataSet1, -)
      used(ex:compose, ex:regionList, -)
      wasGeneratedBy(ex:composition, ex:compose, -)
@@ -930,7 +1198,7 @@
 
    <section>
     <h3>Agents and Responsibility</h3>
-    <pre class="example asn">
+    <pre class="provn example">
      agent(ex:derek, [ prov:type="prov:Person", foaf:givenName = "Derek", 
             foaf:mbox= "&lt;mailto:derek@example.org&gt;"])
      wasAssociatedWith(ex:compose, ex:derek, -)
@@ -950,9 +1218,9 @@
      Roles are not declared directly in PROV, rather they are attributes of 
      relations. Thus, the entire Turtle example in Section 3.5 is rendered as follows:
     </p>
-    <pre class="example asn">
+    <pre class="provn example">
      used(ex:compose, ex:dataSet1,   -, [ prov:role = "ex:dataToCompose"])
-     used(ex:compose, ex:regionList, -, [ prov:role = "ex:regionsToAggregteBy"])
+     used(ex:compose, ex:regionList, -, [ prov:role = "ex:regionsToAggregateBy"])
     </pre>
     <p>
      In the first description above, note that this adds a "role" attribute to the first 'used' description of A.3.
@@ -962,28 +1230,28 @@
 
    <section>
     <h3>Derivation and Revision</h3>
-    <pre class="example asn">
+    <pre class="provn example">
      wasRevisionOf(ex:dataSet2, ex:dataSet1, -)
     </pre>
 
-    <pre class="example asn">
+    <pre class="provn example">
      wasDerivedFrom(ex:chart2, ex:dataSet2)
     </pre>
    </section>
-   
+
    <section>
     <h3>Plans</h3>
     <p>
      Similarly to roles, plans are attributes of relations, specifically association relations.
     </p>
-    <pre class="example asn">
+    <pre class="provn example">
      wasAssociatedWith(ex:correct, ex:edith, ex:instructions)
     </pre>
    </section>
-   
+
    <section>
     <h3>Time</h3>
-    <pre class="example asn">
+    <pre class="provn example">
      wasGeneratedBy(ex:chart1, ex:compile,  2012-03-02T10:30:00)
      wasGeneratedBy(ex:chart2, ex:compile2, 2012-04-01T15:21:00)
 
@@ -993,7 +1261,7 @@
 
    <section>
     <h3>Alternate Entities and Specialization</h3>
-    <pre class="example asn">
+    <pre class="provn example">
      entity(ex:blogEntry)
      wasQuotedFrom(ex:blogEntry, ex:article)
      
@@ -1016,24 +1284,9 @@
   </section>
 
   <section class="appendix"> 
-   <h2>Changes Since First Public Working Draft</h2> 
+   <h2>Changes Since Second Public Working Draft</h2> 
    <ul>
-    <li>Removed details about "things" and attributes from intuition on entities.</li>
-    <li>Removed discussion and examples of "eventually derived from" from intuition on derivation.</li>
-    <li>Revised language and namespace prefix (ex1) to talk about a single worked example.</li>
-    <li>Updated wasControlledBy to wasAssociatedWith.</li>
-    <li>Changed (Qualified)Involvement classes and associated relations to match current ontology.</li>
-    <li>Added actedOnBehalfOf in intuition and example.</li>
-    <li>Removed the FAQ section.</li>
-    <li>Added intuition and example sections on plans.</li>
-    <li>Added intuition and example sections on time.</li>
-    <li>Added intuition and example sections on alternates and specialization.</li>
-    <li>Added intuition and examples on quotation.</li>
-    <li>Included description of attribution in intuition section on agents and responsibility.</li>
-    <li>Changed from ASN to PROV-N</li>
-    <li>Updated examples to latest PROV-O terms</li>
-    <li>Updated old PROV-N and added new PROV-N for all recently added concepts</li>
-    <li>Added provenance graph figures for the examples</li>
+    <li>Added selection between Turtle and PROV-N examples.</li>
    </ul>
   </section>