Added an "XML Schema Design" section
authorCurt Tilmes <Curt.Tilmes@nasa.gov>
Mon, 19 Nov 2012 10:34:02 -0500
changeset 4810 bd37132cc264
parent 4809 884e7bdeedfe
child 4812 8bc766e31bc6
Added an "XML Schema Design" section

I put in a place holder with a line about "Salami Slice". Needs to be
elaborated. I also described the 'elements vs. attributes' and put in
a Note with a question for reviewers about the ordering.
xml/prov-xml.html
--- a/xml/prov-xml.html	Mon Nov 19 15:26:28 2012 +0000
+++ b/xml/prov-xml.html	Mon Nov 19 10:34:02 2012 -0500
@@ -256,6 +256,76 @@
 
 </section> <!-- end introduction -->
 
+<section id="schema-design">
+<h2>XML Schema Design</h2>
+
+<p>Several general design principles and patterns were used in the
+construction of the PROV XML Schema.
+</p>
+
+<h3><i>Salami Slice</i> Design Pattern</h3>
+
+<p>The general design pattern for the XML schema has been
+called <i>Salami Slice Design</i> (cite?).  With this design, the
+individual components are each defined at the top level as separate
+elements with distinct types.  This allows the types to be easily
+reusable for domain specific extensions.
+</p>
+
+<h3>Elements vs. Attributes</h3>
+
+<p>The general PROV-N syntax patterns for expressing provenance
+concepts are:
+</p>
+
+<pre class="codeexample">
+thing(id, elem1, elem2, ..., [attr1=val1, attr2=val2])
+concept(id; elem1, elem2, ... [attr1=val2, attr2=val2])
+</pre>
+
+<p>In both cases (required id or optional id), the PROV-N id is
+treated as an XML attribute, the PROV-N "elements" are treated as XML
+elements, always with the same required order (position) as the
+PROV-DM/PROV-N description, and optional PROV-N "attributes", if
+allowed, always follow and are also represented by XML elements.  As
+in PROV-N, the attributes can be specified multiple times, and in any
+order, as long as they are all at the end of the encompassing element.
+</p>
+
+<p>Wherever an "id" is referenced from a later concept, the id is
+referenced as a prov:ref attribute of the element within the concept.
+</p>
+
+<p>This transformation technique yields a general XML pattern:
+</p>
+
+<pre class="codeexample">
+&lt;prov:thing prov:id="id"&gt;
+  &lt;prov:elem1 /&gt;
+  &lt;prov:elem2 /&gt;
+  ...
+  &lt;prov:attr1&gt;val1&lt;/prov:attr1&gt;
+  &lt;prov:attr2&gt;val2&lt;/prov:attr2&gt;
+  ...
+&lt;/prov:thing&gt;
+</pre>
+
+<p>Most of the concepts described below follow this general pattern.
+</p>
+
+<div class="note">
+<p>REVIEW QUESTION:</p>
+<p>Is this ordering of elements/attributes reasonable/satisfactory?</p>
+<p>Would it be better to loosen the ordering requirement allowing any mix
+of elements/attributes, or to tighten the ordering requirement,
+requiring all "prov:" namespace attributes to precede all non-"prov:"
+namespace attributes when expressed as XML elements?
+</p>
+</div>
+
+
+</section>
+
 <!-- should we instead break the schema down into complex types and elements? -->
 <section id="schema-components">