<?xml version="1.0" encoding="ISO-8859-1" ?>
<?xml-stylesheet href="homepage2.xsl" type="text/xsl"?>
<!DOCTYPE homepage [
<!ENTITY primer '<a href="http://ruleml.org/papers/Primer/">Primer</a>'>
<!ENTITY content-models '<a href="./xsd/content_models_10.pdf">Content Models</a>'>
<!ENTITY glossary '<a href="./glossary/">Glossary</a>'>
<!ENTITY xsd-schemas '<a href="./xsd/"><abbr>XSD</abbr> Schemas</a>'>
<!ENTITY relaxng-schemas '<a href="./relaxng/">Relax NG Schemas</a>'>
<!ENTITY normalizer '<a href="./xslt/normalizer/">Normalizer</a>'>
<!ENTITY upgrader '<a href="./xslt/upgrader/">Upgrader</a>'>
<!ENTITY implementations '<a href="http://wiki.ruleml.org/index.php/RuleML_Implementations">Implementations</a>'>
<!ENTITY myng '<a href="./myng/"><acronym title="Modular sYNtax confiGurator">MYNG</acronym></a>'>
<!ENTITY overarching '<a href="http://cs.unb.ca/~boley/papers/RuleML-Overarching.pdf">Overarching</a>'>
]>

<homepage>

  <title>Schema Specification of Deliberation Rule<abbr>ML</abbr> Version 1.0 </title>

	<opening>
		<center>
			<br/>
			<br/>
			<h1>Schema Specification of Deliberation Rule<abbr title="Markup Language">ML</abbr> Version 1.0</h1>


                        <h2>
                                <a href="http://www.cs.unb.ca/~boley/">Harold Boley</a>,
                          <a href="http://www.athant.com/">Tara Athan</a>,
                          <a href="http://www.corporate-semantic-web.de/">Adrian Paschke</a>,
                                <a href="http://home.comcast.net/~stabet/">Said Tabet</a>,
                                <a href="http://www.mit.edu/~bgrosof/">Benjamin Grosof</a>, <br />
                                <a href="http://lpis.csd.auth.gr/people/nbassili/">Nick Bassiliades</a>,
                          <a href="http://www.governatori.net/">Guido Governatori</a>,
                          <a href="https://sites.google.com/site/frankolkenconsulting/home">Frank Olken</a>,
                          <a href="http://www.cs.uwaterloo.ca/~dhirtle/">David Hirtle</a>
                        </h2>


			<table border="0" align="center">
			<tr><td colspan="2" align="center"><h2>Version history:</h2></td></tr>
			<tr><td align="right">2001-01-25 - </td><td><a href="http://ruleml.org/indtd.html">Version 0.7</a></td></tr>
			<tr><td align="right">2001-07-11 - </td><td><a href="http://ruleml.org/indtd0.8.html">Version 0.8</a></td></tr>
			<tr><td align="right">2003-12-09 - </td><td><a href="http://ruleml.org/0.85/">Version 0.85</a></td></tr>
			<tr><td align="right">2004-06-23 - </td><td><a href="http://ruleml.org/0.86/">Version 0.86</a></td></tr>
			<tr><td align="right">2004-08-12 - </td><td><a href="http://ruleml.org/0.87/">Version 0.87</a></td></tr>
			<tr><td align="right">2005-03-01 - </td><td><a href="http://ruleml.org/0.88/">Version 0.88</a></td></tr>
			<tr><td align="right">2005-05-27 - </td><td><a href="http://ruleml.org/0.89/">Version 0.89</a></td></tr>
			<tr><td align="right">2005-11-09 - </td><td><a href="http://ruleml.org/0.9/">Version 0.9</a></td></tr>
			<tr><td align="right">2006-08-24 - </td><td><a href="http://ruleml.org/0.91/">Version 0.91</a></td></tr>
			<tr><td align="right">2011-09-27 - </td><td><a href="http://ruleml.org/0.91/">Version 0.91 Patched</a></td></tr>
			  <tr><td align="right"><h3>2012-04-03 - </h3></td><td><h3><a href="http://ruleml.org/1.0/">Version 1.0</a></h3></td></tr>
			</table>			

			<h2>Latest version: <a href="http://ruleml.org/spec/">ruleml.org/spec/</a></h2>
			<p/>
		</center>
	  <h2><a name="quicklinks"/>Quick links:</h2>
	  <itemize>
	    <item>
	      Parent Specification of Rule<abbr title="Markup Language">ML</abbr> 
	      (<a href="http://ruleml.org/">Homepage</a>) 
	      <br/> Prerequisites: None, Level: Informal</item>
	    <item>
	      Overarching Specification of Web Rules 
	      (&overarching;) 
	      <br/> Prerequisites: None, Level: Semi-formal </item>
	    <item>
	      Introduction to the Rule<abbr>ML</abbr> Language 
	      (&primer;) 
	      <br/> Prerequisites: None, Level: Informative</item>
	    <item>
	      High-level Presentation of the Rule<abbr>ML</abbr> Serialization Grammar 
	      (&content-models;) 
	      <br/> Prerequisites: <a href="http://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_Form"><abbr title="Extended Backus-Naur Form">EBNF</abbr></a> or <a href="http://relaxng.org">Relax NG</a>, Level: Semi-formal</item>
	    <item>
	      Machine-readable schemas in <abbr title="XML Schema Definition Lanuage">XSD</abbr>
	      (&xsd-schemas;) 
	      <br/> Prerequisites: <a href="http://www.w3schools.com/schema/"><abbr>XSD</abbr></a>, Level: Formal</item>
	    <item>
	      Machine-readable grammar in the Relax NG language 
	      (&relaxng-schemas;) 
	      <br/> Prerequisites: <a href="http://relaxng.org">Relax NG</a>, Level: Formal</item>
	    <item> 
	      Modular sYNtax confiGurator, a <acronym title="Graphical User Interface">GUI</acronym> for customizing Relax NG schemas 
	      (&myng;) 
	      <br/> Prerequisites: None, Level: Formal</item>
	    <item>
	      Stylesheet for transforming into the normal-form serialization 
	      (&normalizer;) 
	      <br/> Prerequisites: <a href="http://www.w3schools.com/xsl/"><abbr title="XSL Transformations ">XSLT</abbr></a>, Level: Formal</item>
	    <item>
	      Stylesheet for transforming from Version 0.91 into Version 1.0
	      (&upgrader;)
	      <br/> Prerequisites: <a href="http://www.w3schools.com/xsl/"><abbr title="XSL Transformations ">XSLT</abbr></a>, Level: Formal</item>
	    <item>
	      Illustrative Instances of the Version 1.0 Language 
	      (<a href="./exa/">Examples</a>) 
	      <br/> Prerequisites: &primer;, Level: Informative</item>
	    <item>
	      Definitions of Elements and Attributes
	      (&glossary;) 
	      <br/> Prerequisites: &primer;, Level: Semi-formal</item>
	    <item>
	      Diagrammatic Presentation of the Rule<abbr>ML</abbr> Normal-Form Serialization Grammar 
	      (<a href="./doc/">Schema Docs</a>) 
	      <br/> Prerequisites: &primer;, Level: Semi-formal</item>
	    <item>
	      Reference Implementation of RuleML Operational Semantics  (<a href="http://www.jdrew.org/oojdrew/">OO jDREW</a>) 
	      <br /> Prerequisites: <a href="http://ruleml.org/modularization/#Model">Naf Hornlog RuleML</a>, Level: Formal</item>
	    <item>
	      Implemented Rule<abbr>ML</abbr> tools 
	      (&implementations;)
	    </item>  
	  </itemize>
		<br/>
	  <!--<p>This is the specification for Version 1.0, as the overarching specification of Web rules that encompasses RIF RuleML as a subfamily, and takes into account corresponding OASIS, OMG (e.g., PRR, SBVR), and ISO (e.g., Common Logic) specifications. </p>-->
<!--	  <p>
	  Rules on the Web come in various formats and with diverse packaging.
	  Often, however, the semantics of Web-distributed rule content are compatible.
	  In such cases, rulebases can be reused with an interchange technology consisting of a family of canonical rule languages and bi-directional translators between canonical languages and the languages to be interchanged.
	  The need for Web rule interchange has been increasing with the amount of business rules (incl. policies, regulations, laws, ...) in many domains (e.g. finance, engineering, healthcare, ...) on the Web 1.0, 2.0 (Social), and 3.0 (Social Semantic).	  
	  </p> -->
<p>
Rule<abbr>ML</abbr> has been designed for the interchange of
  the major kinds of Web rules in an <abbr title="eXtensible Markup Language">XML</abbr> format that is uniform across various rule languages and platforms. It has broad coverage and is defined as an extensible family of languages, whose modular system of schemas permits rule interchange with high precision.</p>
	  <p>The scope of this specification covers </p>
	  <!--  
	    <itemize>
	    <item>syntax, including 
	        <itemize>
	          <item>abstract syntax</item> 
	          <item><abbr>XML</abbr> syntax, including -->
	          <itemize>
	            <item>
	            
	            content models for the named sublanguages, available from the &content-models; document (along with a glossary of all elements, available from the &glossary;);
	            
	            </item>
	            <item>schemas, including
	              <itemize>
	                <item>&xsd-schemas;  with Schematron annotation;</item>
	                <item>&relaxng-schemas;;</item>
	              </itemize>
	            </item> 
	            <item>a mapping from the Version 1.0 syntax to the "normalized" Version 1.0 syntax as given in the &normalizer; <abbr>XSLT</abbr>  stylesheet;</item>
	            <item>a mapping from the preceding Version 0.91 <abbr>XML</abbr> syntax to Version 1.0 <abbr>XML</abbr> syntax as given in the &upgrader; <abbr>XSLT</abbr>  stylesheet.</item>
	            
	          </itemize>
	        <!--</item>
	            <item>presentation syntax</item>
	          
	        </itemize>
	        </item>
	      <item>semantics, including
	        <itemize>
	      <item>an informal semantics as given in the &glossary;</item>
	          <item>formal model-theoretic semantics</item> 
	          <item>formal proof-theoretic semantics</item>
	          
	        </itemize>
	      </item>
	      </itemize> -->
	  <p>The scope of this specification does not cover tools that make use of Rule<abbr>ML</abbr> languages, such as parsers, inference engines or editors. For a listing of such tools, see the Rule<abbr>ML</abbr> &implementations; wiki page.</p>
	  <p>Version 1.0 is a "Rosetta Stone" release where two schema languages, <abbr>XSD</abbr> and Relax NG, are independently employed to formalize the syntax, to the extent possible within each language. See Design and Implementation of Highly Modular Schemas for <abbr>XML</abbr>: Customization of Rule<abbr>ML</abbr> in Relax NG (<a href="http://www.cs.unb.ca/~boley/papers/RuleMLinRelaxNG.pdf">Rule<abbr>ML</abbr> in Relax NG</a>) and the Rule<abbr>ML</abbr> <a href="http://wiki.ruleml.org/index.php/MYNG"><acronym>MYNG</acronym> Wiki</a> page for the details of this re-engineering effort. <acronym>MYNG</acronym> is an acronym for "Modular sYNtax confiGurator", or "Modularize Your NG", and may be pronounced either "ming" or "my N G". </p>
	  <p>The Version 1.0 <abbr>XSD</abbr> schemas are a minor modification of the patched <abbr>XSD</abbr> schemas of Version 0.91, which follow the <a href="http://ruleml.org/modularization">tree-based modularization approach</a>. <!--@@@The <abbr>XSD</abbr> schemas are permissive for certain invalid syntactic constructs as expressed by the Schematron annotations @@@ the Schematron rules should be separated out so that they may be applied independently of choice of <abbr>XSD</abbr> or Relax NG schema language@@@, and are also conservative in that certain permutations of elements are allowed in the normative syntax but are not implemented in the <abbr>XSD</abbr> schemas.@@@-->
		  A procedure for validation against the <abbr>XSD</abbr> schemas is described in <a href="#Appendix-3">Appendix 3</a>.  
		</p>
	  <p>The Relax NG schemas are a new component of the Version 1.0 release, and are intended to replace the hand-written <abbr>XSD</abbr> schemas in future releases. The Relax NG schemas are available for two serializations, "normal" and "relaxed", and follow a lattice-based modularization (<a href="http://www.cs.unb.ca/~boley/papers/RuleMLinRelaxNG.pdf">Rule<abbr>ML</abbr> in Relax NG</a>). The relaxed-form serialization is permissive relative to the grammar given in the &content-models; document, i. e. every Version 1.0 instance that is valid with respect to the &content-models; document will validate against the relaxed serialization Relax NG schemas. The normal serialization Relax NG schemas validate instances in the normal form, which is described in the &normalizer; section. Procedures for validation against the Relax NG schemas is described in <a href="#Appendix-5">Appendix 5</a>.</p>
	  <p>Note that the <a href="http://www.w3schools.com/dtd/"><abbr title="Document Type Definition">DTD</abbr></a> specification of Rule<abbr>ML</abbr> is no longer being maintained, but will continue to be <a href="http://ruleml.org/0.85/dtd">available as an archive</a>. Tools capable of converting between <abbr>XML</abbr> Schema and <abbr>DTD</abbr>s such as <a href="http://www.altova.com/xml-editor/"><abbr>XML</abbr>Spy</a> are always available.</p>
		
	</opening>

<section>
	<header>Overview</header>
  <p>An introduction to Rule<abbr>ML</abbr> is given in our &primer;. 
    <!--Also, the main page's <a href="http://ruleml.org/index.html#Design">design section</a> discusses the upper layer of the Rule<abbr>ML</abbr> hierarchy of rules. -->
    Also, the paper &overarching; discusses the upper layer of the Rule<abbr>ML</abbr> hierarchy of rules.
    In that terminology, the system of Rule<abbr>ML</abbr> languages presented here covers derivation rules, which includes Horn Logic, and part of deliberation rules, in particular, First-Order Logic (FOL) with equality and negation-as-failure.</p>
  <p>This is because we think it is important to start with a subset of simple rules (derivation rules), test and refine our principal strategy using these, and then proceed to more general categories of rules in the hierarchy (deliberation rules), as well as to other kinds of rules (reaction rules).
	  </p>

  <p>A comprehensive &glossary; accompanies this specification.</p>
  
  <p>The grammar of Version 1.0 is partially described in the &content-models; document, where the content model of each individual element is compared across the named sublanguages, as specified within the &xsd-schemas;. The Rule<abbr>ML</abbr> grammar is also partially described by the &relaxng-schemas;.
  </p>
  
  <p>Below is a summary of the changes in Version 1.0:</p>

	<itemize>
	  <item>The terminology "Type" and "role" (when referring to XML tags or elements) has been changed to "Node" and "edge".</item>
		<item>Schematron dependency has been reduced (as comments in the <abbr>XSD</abbr> schema code) </item>	
	  <item>Edge elements <a href="http://ruleml.org/0.91/glossary#gloss-head"><code>&lt;head&gt;</code></a> and <a href="http://ruleml.org/0.91/glossary#gloss-body"><code>&lt;body&gt;</code></a>, replaced with <a href="./glossary#gloss-then"><code>&lt;then&gt;</code></a> and <a href="./glossary#gloss-if"><code>&lt;if&gt;</code></a>, respectively </item>	
	  <item>Edge elements <a href="http://ruleml.org/0.91/glossary#gloss-lhs"><code>&lt;lhs&gt;</code></a> and <a href="http://ruleml.org/0.91/glossary#gloss-rhs"><code>&lt;rhs&gt;</code></a>, replaced with <a href="./glossary#gloss-left"><code>&lt;left&gt;</code></a> and <a href="./glossary#gloss-right"><code>&lt;right&gt;</code></a>, respectively </item>	
	  <item>Node elements <a href="http://ruleml.org/0.91/glossary#gloss-hterm"><code>&lt;Hterm&gt;</code></a> and <a href="http://ruleml.org/0.91/glossary#gloss-Con"><code>&lt;Con&gt;</code></a>, replaced with <a href="./glossary#gloss-uniterm"><code>&lt;Uniterm&gt;</code></a> and <a href="./glossary#gloss-Const"><code>&lt;Const&gt;</code></a> respectively </item>	
	  <item>The attribute <a href="http://ruleml.org/0.91/glossary#gloss-@in"><code>@in</code></a> <code>="no|semi|yes"</code> with respective values, replaced with <a href="./glossary#gloss-@per"><code>@per</code></a> <code>="copy|open|value"</code></item> 
	  <item>The attribute <a href="http://ruleml.org/0.91/glossary#gloss-@uri"><code>@uri</code></a>, for <abbr title="Universal Resource Identifiers">URI</abbr>s, replaced with <a href="./glossary#gloss-@iri"><code>@iri</code></a>, for <abbr title="International Resource Identifiers">IRI</abbr>s </item> 
	  <item>A new edge element <a href="./glossary#gloss-act"><code>&lt;act&gt;</code></a> introduced as optional wrapper of all performatives (e.g. <a href="./glossary#gloss-Assert"><code>&lt;Assert&gt;</code></a>) in the <a href="./glossary#gloss-ruleml"><code>&lt;Rule<abbr>ML</abbr>&gt;</code></a> element </item>
	  <item>A new edge element <a href="./glossary#gloss-meta"><code>&lt;meta&gt;</code></a> is introduced as a non-skippable wrapper of a formula expressing meta-knowledge, allowed zero to many times in the header of non-leaf Node elements.  </item>
	  <item>A new attribute <a href="./glossary#gloss-@node"><code>@node</code></a> is introduced as an optional IRI identifier of a Node element, useful for referencing the element in external meta-knowledge.  </item>
	  <item>The edge element <a href="./glossary#gloss-oid"><code>&lt;oid&gt;</code></a> is no longer allowed on all non-leaf Node elements, but is restricted to <a href="./glossary#gloss-Atom"><code>&lt;Atom&gt;</code></a> and 
	    <a href="./glossary#gloss-Expr"><code>&lt;Expr&gt;</code></a>, for use as an identifier for the object of slotted atoms and expressions.
	  </item>
	  <item>The attributes <code>@xml:base</code> and <code>@xml:id</code> are allowed on all elements.
	  </item>
	  <item>Additional freedom in element order with partial stripe-skipping (see &overarching; for an explanation of stripe-skipping and element order in Rule<abbr>ML</abbr>) has been introduced in the "relaxed-form serialization", as specified in the Relax NG schemas.</item>
	  <item>The Normalizer at <a href="./xslt/normalizer/100_normalizer.quarantine.xslt">http://ruleml.org/1.0/xslt/normalizer/100_normalizer.quarantine.xslt</a> has been deprecated. A refactored Normalizer has been developed at <a href="http://v37s3b4h7dn47s37hg1br4h7rs7n3du7s8nu.unbf.ca/~lbidlak1/">http://v37s3b4h7dn47s37hg1br4h7rs7n3du7s8nu.unbf.ca/~lbidlak1/</a>.</item>
	</itemize>	

  <p>Readers who already know Version 0.91 may want to refer to the <a href="#Changes">Changes</a> section.</p>


</section>   


<section>
	<header>Examples</header>
  <p>Numerous sample Rule<abbr>ML</abbr> documents have been prepared and maintained; some exemplify features of Rule<abbr>ML</abbr> and are useful didactically while others are mostly for testing puposes. Updated examples (e.g., <a href="exa/Datalog/own.ruleml">own.ruleml</a> and <a href="exa/Datalog/reify.ruleml">reify.ruleml</a>) accompany the Version 1.0 release and can be found with all the others in the <a href="exa/">Examples</a> directory.
	  The following examples are new:</p>
	<itemize>
	  <item><a href="exa/Datalog/synohomonyms.ruleml">synohomonyms.ruleml</a>, which clarifies the semantics of the <a href="./glossary#gloss-@iri"><code>@iri</code></a> attribute, </item>
	  <item><a href="exa/Hornlog/hornlogeq/reify-evaluation-hornlogeq.ruleml">reify-evaluation-hornlogeq.ruleml</a>, which clarifies the semantics of the "Reify" element;</item>
	  <item>several examples in the <a href="exa/MYNG"><acronym>MYNG</acronym> examples</a> directory illustrating the new features introduced in the Relax NG schemas, including greater flexibility in stripe-skipping, decreased dependendence on element order and a fine-grained modularization of features.</item>
	</itemize>
	

	<p>Examples from previous versions of Rule<abbr>ML</abbr> are also maintained, e.g. <a href="http://ruleml.org/0.91/exa/">0.91 examples</a>).</p>
</section>

  

<section label="Upgrader">
<header><abbr>XSLT</abbr>-Based Upgrader</header>
	<p>Continuing the practice begun in <a href="http://ruleml.org/0.86">0.86</a>, an <abbr>XSLT</abbr> stylesheet named
	<a href="xslt/upgrader/091-to-100.xslt">091-to-100.xslt</a> has been created to
	  automatically update Version 0.91 documents to Version 1.0.  For instance,
	taking the <a href="xslt/upgrader/discount_091.ruleml">discount example from 0.91</a> as input, the stylesheet outputs
	the following: <a href="xslt/upgrader/discount_100.ruleml">discount_100.ruleml</a>. 
	<!--(See a <a href="xslt/upgrader/discount-diff.htm">comparison of these two files</a> generated using
	<a href="http://www.componentsoftware.com/products/htmldiff/">HTML Diff</a>, noting that the differences are minor since
Version 1.0 mostly builds on top of 0.91.)-->  Additional translation
	output samples are found in the <a href="xslt/upgrader/">Upgrader</a> directory. 
	  <!-- In the <a href="xslt/upgrader/comparison/">comparison</a> directory a comparison between manual and automatic updates of few files from the 0.91 exa directory can be found.-->
	</p>
	
  <p>Upgrader transformation can be accomplished using a web-based <abbr>XSLT</abbr> tool, 
    <a href ="http://www.w3.org/2005/08/online_xslt/">Online XSLT 2.0 Service</a>, 
    provided by <abbr title="World Wide Web Consortium">W3C</abbr>. Instructions for this process can be found in <a href="#Appendix-4">Appendix 4.</a></p>
	<p>The stylesheet has also been tested
	  using <a href="http://www.oxygenxml.com">oXygen version 12.2</a>, 
	  whereby it was confirmed that all examples in the directory <a href="./exa/">http://ruleml.org/1.0/exa</a> are properly upgraded.
	  However, the upgraded instances documents will have the Rule<abbr>ML</abbr> namespace as the default namespace, 
	  independent of the choice of prefix for the Rule<abbr>ML</abbr> namespace in the original instance.
	  A similar <a href="xslt/upgrader/091-to-ruleml100.xslt">091-to-ruleml100.xslt</a> has been developed that uses the prefix "ruleml" for the Rule<abbr>ML</abbr> namespace.
	  <!--and <a href="http://www.altova.com/products_ide.html"><abbr>XML</abbr>Spy</a>-->
	  </p>
	
	<p>An <abbr>XSLT</abbr> processor which may be used to perform these transformations on a whole directory at once is 
	  <a href="http://saxon.sourceforge.net/">Saxon</a>, using the following command:</p>
<p><code><![CDATA[   $ java net.sf.saxon.Transform -o 1.0/exa/ 0.91/exa/ 091-to-100.xslt]]></code></p>

<p>A use example of the Upgrader is described in the <a href="http://ruleml.org/usecases/wineonto/">WineOnto migration path documentation</a>.</p>
	
</section>

<section label="Normalizater">
	<header><abbr>XSLT</abbr>-Based Normalizer</header>

  <p>Rule<abbr>ML</abbr> has always allowed abbreviated encoding (skipped edge tags and default attribute values) and some freedom in the ordering of elements. The new Relax NG schemas allows even more freedom in element ordering than the XSD schemas, with all perturbations possible as long as the missing edge tags may be unambiguously reconstructed. An <abbr>XSLT</abbr> stylesheet has been developed (see <a href="http://v37s3b4h7dn47s37hg1br4h7rs7n3du7s8nu.unbf.ca/~lbidlak1/"><abbr title="RuleML Official Normalizer">RON</abbr></a>, also see the &normalizer; directory) for normalizing the syntax used in a given Version 1.0 instance, undoing the abbreviated encoding and re-ordering of elements.  
    An example of the normal form is the <a href="xslt/normalizer/own_expanded.ruleml">expanded version</a> of the <a href="xslt/normalizer/own_compact.ruleml">compact 'own' example</a>.
	</p>
  <p>
	  The goals of this normalizer include the following:</p>
<itemize>
  <!--<item>Pre-validate to test that all element names, taken individually, belong to Version 1.0. This works for all given child permutations but does not check for syntax unlike the Rule<abbr>ML</abbr> validation.</item>-->
<item>Reconstruct all skipped or optional edge tags to produce a fully striped form;</item>
<item>Perform canonical child ordering of sub-elements;</item>
  <item>Make all default attributes explicit.</item>
</itemize>
<p>We say that using this normalizer followed by schema-based Rule<abbr>ML</abbr> validation performs "normalidation" on Rule<abbr>ML</abbr> instances. That is to say, not only are missing edge tags and attributes with default values inserted into the Version 1.0 instance in order to normalize it, but the general tree structure of the file is also validated syntactically to ensure that Node and edge elements only appear in correct positions.</p>

The following is a list of the operations the Version 1.0 <abbr>XSLT</abbr> Normalizer should perform whenever it is used on an XML instance. Note that the Normalizer is intended to successfully transform XML instances that may not be valid Version 1.0 (validation is the <em>second</em> step of the "Normalidation" process); therefore no assumptions are made about the names or number of child elements in the instance being transformed.

<itemize>
<item><a href="./glossary#gloss-Implies"><code>&lt;Implies&gt;</code></a>, <a href="./glossary#gloss-Entails"><code>&lt;Entails&gt;</code></a>
	<itemize>
	  <item>When <a href="./glossary#gloss-if"><code>&lt;if&gt;</code></a>-<a href="./glossary#gloss-then"><code>&lt;then&gt;</code></a> edge elements are both missing, wrap the first "naked Node" (a Node element that has a Node parent element) child within an <a href="./glossary#gloss-if"><code>&lt;if&gt;</code></a> edge element, and the second naked Node child within a <a href="./glossary#gloss-then"><code>&lt;then&gt;</code></a> edge element.</item>
	  <item>If exactly one of the <a href="./glossary#gloss-if"><code>&lt;if&gt;</code></a>-<a href="./glossary#gloss-then"><code>&lt;then&gt;</code></a> edge elements is missing, wraps the first naked Rule<abbr>ML</abbr> Node element within the missing edge element.</item>
	  <item>Re-orders the elements as 
	    <a href="./glossary#gloss-oid"><code>&lt;oid&gt;</code></a>, then 
	    <a href="./glossary#gloss-if"><code>&lt;if&gt;</code></a>, followed by
	    <a href="./glossary#gloss-then"><code>&lt;then&gt;</code></a>, followed by any other children. </item>
	</itemize>
</item>

<item>
	<a href="./glossary#gloss-Expr"><code>&lt;Expr&gt;</code></a>
	<itemize>
	  <item>Wrap each naked <a href="./glossary#gloss-Fun"><code>&lt;Fun&gt;</code></a> child (if any) with an <a href="./glossary#gloss-op"><code>&lt;op&gt;</code></a> edge element.</item>
	  <item>Add <a href="./glossary#gloss-arg"><code>&lt;arg&gt;</code></a> edge elements (with an index attribute) wrapping each remaining naked Rule<abbr>ML</abbr> Node (if any). The naked Node children that may occur within this element in a valid Version 1.0 instance  include: 
	    <a href="./glossary#gloss-Ind"><code>&lt;Ind&gt;</code></a>, 
	    <a href="./glossary#gloss-Var"><code>&lt;Var&gt;</code></a>, 
	    <a href="./glossary#gloss-Fun"><code>&lt;Fun&gt;</code></a>, 
	    <a href="./glossary#gloss-Plex"><code>&lt;Plex&gt;</code></a>, 
	    <a href="./glossary#gloss-Reify"><code>&lt;Reify&gt;</code></a>, 
	    <a href="./glossary#gloss-Data"><code>&lt;Data&gt;</code></a>, or 
	    <a href="./glossary#gloss-Skolem"><code>&lt;Skolem&gt;</code></a>.
	  </item>
	  <item>Re-order the child elements as 
	    <a href="./glossary#gloss-oid"><code>&lt;oid&gt;</code></a>, followed by 
	    <a href="./glossary#gloss-op"><code>&lt;op&gt;</code></a>, followed by 
	    positional arguemnts (<a href="./glossary#gloss-arg"><code>&lt;arg&gt;</code></a>, then 
	    <a href="./glossary#gloss-repo"><code>&lt;repo&gt;</code></a>)
	    followed by 
	    slotted arguemnts (<a href="./glossary#gloss-slot"><code>&lt;slot&gt;</code></a>, then 
	    <a href="./glossary#gloss-resl"><code>&lt;resl&gt;</code></a>), followed by 
	    any other children.</item>
	</itemize>
</item>

<item>
<a href="./glossary#gloss-Atom"><code>&lt;Atom&gt;</code></a>
	<itemize>
	  <item>Wrap each naked <a href="./glossary#gloss-Rel"><code>&lt;Rel&gt;</code></a> child (if any) with an <a href="./glossary#gloss-op"><code>&lt;op&gt;</code></a>.</item> 
	  <item>Adds <a href="./glossary#gloss-arg"><code>&lt;arg&gt;</code></a> edge elements (with an index attribute) wrapping each naked Node. 
	    The naked Node children that may occur within this element in a valid Version 1.0 instance include: 
	    <a href="./glossary#gloss-Ind"><code>&lt;Ind&gt;</code></a>, 
	    <a href="./glossary#gloss-Var"><code>&lt;Var&gt;</code></a>, 
	    <a href="./glossary#gloss-Fun"><code>&lt;Fun&gt;</code></a>, 
	    <a href="./glossary#gloss-Plex"><code>&lt;Plex&gt;</code></a>, 
	    <a href="./glossary#gloss-Reify"><code>&lt;Reify&gt;</code></a>, 
	    <a href="./glossary#gloss-Data"><code>&lt;Data&gt;</code></a>, or 
	    <a href="./glossary#gloss-Skolem"><code>&lt;Skolem&gt;</code></a>.
	  </item>
	  <item>Re-order the child elements as 
	    <a href="./glossary#gloss-oid"><code>&lt;oid&gt;</code></a>, followed by 
	    <a href="./glossary#gloss-degree"><code>&lt;degree&gt;</code></a>, followed by 
	    <a href="./glossary#gloss-op"><code>&lt;op&gt;</code></a>, followed by 
	    positional arguemnts (<a href="./glossary#gloss-arg"><code>&lt;arg&gt;</code></a>, then 
	    <a href="./glossary#gloss-repo"><code>&lt;repo&gt;</code></a>) followed by 
	    slotted arguemnts (<a href="./glossary#gloss-slot"><code>&lt;slot&gt;</code></a>, then 
	    <a href="./glossary#gloss-resl"><code>&lt;resl&gt;</code></a>), followed by 
	    any other children.</item>
	</itemize>
</item>

<item>
  <a href="./glossary#gloss-Uniterm"><code>&lt;Uniterm&gt;</code></a>
	<itemize>
	  <item>If there is no <a href="./glossary#gloss-op"><code>&lt;op&gt;</code></a> element, wrap the first child that is not 
	    <a href="./glossary#gloss-oid"><code>&lt;oid&gt;</code></a> or 
	    <a href="./glossary#gloss-degree"><code>&lt;degree&gt;</code></a> 
	    within a <a href="./glossary#gloss-op"><code>&lt;op&gt;</code></a> element.
	  </item>
	  <item>Add <a href="./glossary#gloss-arg"><code>&lt;arg&gt;</code></a> edge elements (with an index attribute) to each of the remaining naked child Nodes. 
	    The naked Node children that may occur within this element in a valid Version 1.0 instance  include: 
	    <a href="./glossary#gloss-Const"><code>&lt;Const&gt;</code></a>, 
	    <a href="./glossary#gloss-Var"><code>&lt;Var&gt;</code></a>, 
	    <a href="./glossary#gloss-Reify"><code>&lt;Reify&gt;</code></a>, 
	    <a href="./glossary#gloss-Uniterm"><code>&lt;Uniterm&gt;</code></a>, 
	    <a href="./glossary#gloss-Skolem"><code>&lt;Skolem&gt;</code></a>.
	  </item>
	  <item>Re-order the child elements as 
	    <a href="./glossary#gloss-oid"><code>&lt;oid&gt;</code></a>, followed by 
	    <a href="./glossary#gloss-degree"><code>&lt;degree&gt;</code></a>, followed by 
	    <a href="./glossary#gloss-op"><code>&lt;op&gt;</code></a>, followed by 
	    positional arguemnts (<a href="./glossary#gloss-arg"><code>&lt;arg&gt;</code></a>, then 
	    <a href="./glossary#gloss-repo"><code>&lt;repo&gt;</code></a>,	    followed by 
	    slotted arguemnts (<a href="./glossary#gloss-slot"><code>&lt;slot&gt;</code></a>, then 
	    <a href="./glossary#gloss-resl"><code>&lt;resl&gt;</code></a>), followed by 
	    any other children.</item>
	</itemize>
</item>

<item>
  <a href="./glossary#gloss-Assert"><code>&lt;Assert&gt;</code></a>, 
  <a href="./glossary#gloss-Retract"><code>&lt;Retract&gt;</code></a>, 
  <a href="./glossary#gloss-Query"><code>&lt;Query&gt;</code></a>, 
  <a href="./glossary#gloss-And"><code>&lt;And&gt;</code></a>, 
  <a href="./glossary#gloss-Or"><code>&lt;Or&gt;</code></a>
	<itemize>
		<item>Wrap each naked child Node (if any) with a <a href="./glossary#gloss-formula"><code>&lt;formula&gt;</code></a> edge element.</item>
	</itemize>
</item>
  <item>
    <a href="./glossary#gloss-Forall"><code>&lt;Forall&gt;</code></a>, <a href="./glossary#gloss-Exists"><code>&lt;Exists&gt;</code></a>
    <itemize>
      <item>Wrap each naked <a href="./glossary#gloss-Var"><code>&lt;Var&gt;</code></a> child Node (if any) with a <a href="./glossary#gloss-declare"><code>&lt;declare&gt;</code></a> edge element.</item>
      <item>Wraps any other naked child Nodes with <a href="./glossary#gloss-formula"><code>&lt;formula&gt;</code></a> edge element.</item>
      <item>Re-order the child elements as 
        <a href="./glossary#gloss-oid"><code>&lt;oid&gt;</code></a>, followed by 
        <a href="./glossary#gloss-declare"><code>&lt;declare&gt;</code></a>, followed by
        <a href="./glossary#gloss-formula"><code>&lt;formula&gt;</code></a>, followed by 
        any other children.</item>
    </itemize>
  </item>

<item>
  <a href="./glossary#gloss-Ruleml"><code>&lt;Rule<abbr>ML</abbr>&gt;</code></a>
	<itemize>
	  <item>Wraps each naked child Node (if any) with an <a href="./glossary#gloss-act"><code>&lt;act&gt;</code></a> edge element.</item>
  <item>Re-order the child elements as 
    <a href="./glossary#gloss-oid"><code>&lt;oid&gt;</code></a>, followed by 
    <a href="./glossary#gloss-act"><code>&lt;act&gt;</code></a>, followed by
    any other children.</item>
	</itemize>
</item>

<item>
  <a href="./glossary#gloss-Neg"><code>&lt;Neg&gt;</code></a>
	<itemize>
	  <item>Wraps each naked child Node (if any) with a <a href="./glossary#gloss-strong"><code>&lt;strong&gt;</code></a> edge element.</item>
	  <item>Re-order the child elements as 
	    <a href="./glossary#gloss-oid"><code>&lt;oid&gt;</code></a>, followed by 
	    <a href="./glossary#gloss-strong"><code>&lt;strong&gt;</code></a>, followed by
	    any other children.</item>
	</itemize>
</item>

<item>
  <a href="./glossary#gloss-Naf"><code>&lt;Naf&gt;</code></a>
	<itemize>
	  <item>Wraps each naked child Node (if any) with a <a href="./glossary#gloss-weak"><code>&lt;weak&gt;</code></a> edge element.</item>
	  <item>Re-order the child elements as 
	    <a href="./glossary#gloss-oid"><code>&lt;oid&gt;</code></a>, followed by 
	    <a href="./glossary#gloss-weak"><code>&lt;weak&gt;</code></a>, followed by
	    any other children.</item>
	  
	</itemize>
</item>

<item>
  <a href="./glossary#gloss-Equivalent"><code>&lt;Equivalent&gt;</code></a>
	<itemize>
	  <item>Wraps each naked child Node (if any) with a <a href="./glossary#gloss-torso"><code>&lt;torso&gt;</code></a> edge element.</item>
	  <item>Re-order the child elements as 
	    <a href="./glossary#gloss-oid"><code>&lt;oid&gt;</code></a>, followed by 
	    <a href="./glossary#gloss-torso"><code>&lt;torso&gt;</code></a>, followed by
	    any other children.</item>
	  
	</itemize>	
</item>

<item>
  <a href="./glossary#gloss-Equal"><code>&lt;Equal&gt;</code></a>
	<itemize>
	  <item>If there are two naked child Nodes, wraps first naked Node child with a <a href="./glossary#gloss-left"><code>&lt;left&gt;</code></a> element and second naked Node child with <a href="./glossary#gloss-right"><code>&lt;right&gt;</code></a> element.  </item>
		<item>
		  Partial completion is also accepted. Example: if the first child has a <a href="./glossary#gloss-left"><code>&lt;left&gt;</code></a> edge element, and the second child has no <a href="./glossary#gloss-left"><code>&lt;left&gt;</code></a> or <a href="./glossary#gloss-right"><code>&lt;right&gt;</code></a> edge element, the <abbr>XSLT</abbr> will wrap the second child with the <a href="./glossary#gloss-right"><code>&lt;right&gt;</code></a> edge element.
		</item>
	  <item>Re-order the child elements as 
	    <a href="./glossary#gloss-oid"><code>&lt;oid&gt;</code></a>, followed by 
	    <a href="./glossary#gloss-degree"><code>&lt;degree&gt;</code></a>, followed by 
	    <a href="./glossary#gloss-left"><code>&lt;left&gt;</code></a>, followed by
	    <a href="./glossary#gloss-right"><code>&lt;right&gt;</code></a>, followed by
	    any other children.</item>
	  
	</itemize>
</item>

</itemize>

<p>For example, <a href="./xslt/normalizer/own_compact.ruleml">the compact version of the 'own' example</a>:</p>
  <box><pre><![CDATA[<RuleML>
  <Assert mapClosure="universal">
    <Implies>
      <And>
        <Atom>
          <Rel>buy</Rel>
          <Var>person</Var>
          <Var>merchant</Var>
          <Var>object</Var>
        </Atom>
        <Atom>
          <Var>person</Var>
          <Rel>keep</Rel>
          <Var>object</Var>
        </Atom>
      </And>
      <Atom>
        <Var>person</Var>
        <Rel>own</Rel>
        <Var>object</Var>
      </Atom>
    </Implies>
    ...
    <Atom>
      <Ind>Mary</Ind>
      <Rel>keep</Rel>
      <Ind>XMLBible</Ind>
    </Atom>
  </Assert>
</RuleML>
  ]]></pre></box>
<p>should be normalized to the <a href="xslt/normalizer/own_expanded.ruleml">expanded version</a>:</p>

  <box><pre><![CDATA[<RuleML>
  <act index="1">
  <Assert mapClosure="universal">
      <formula>
        <Implies>
          <if>
            <And>
              <formula>
                <Atom>
                  <op><Rel>buy</Rel></op>
                  <arg index="1"><Var>person</Var></arg>
                  <arg index="2"><Var>merchant</Var>	</arg>
                  <arg index="3"><Var>object</Var></arg>
                </Atom>
              </formula>
              <formula>
                <Atom>
                  <op><Rel>keep</Rel></op>
                  <arg index="1"><Var>person</Var></arg>
                  <arg index="2"><Var>object</Var></arg>
                </Atom>
              </formula>
            </And>
          </if>
          <then>
            <Atom>
              <op><Rel>own</Rel></op>
              <arg index="1"><Var>person</Var></arg>
              <arg index="2"><Var>object</Var></arg>
            </Atom>
          </then>
        </Implies>
      </formula>
      ...
      <formula>
        <Atom>
          <op><Rel>keep</Rel></op>
          <arg index="1"><Ind>Mary</Ind></arg>
          <arg index="2"><Ind>XMLBible</Ind></arg>
        </Atom>
      </formula>
  </Assert>
  </act>
</RuleML>]]></pre></box>
<p>
<!--(See a <a href="xslt/normalizer/own_compare.htm">comparison of these two files</a> generated using
<a href="http://www.componentsoftware.com/products/htmldiff/">HTML Diff</a>.)--></p>

<!--<p>Additional examples are located in the &normalizer; directory.</p>-->

<!--<p> THIS SWITCH IS NOT NEEDED IN THE PUSH-STYLE NORMALIZER @@@ The Version 1.00 normalizer contains a simple tag debugging tool that allows users to find tags that do not belong to Rule<abbr>ML</abbr>. By setting variable DEBUG to true in the <abbr>XSLT</abbr> file, while transforming, the <abbr>XSLT</abbr> wraps the children of the incorrect tag with the PARENTERROR tag. This is significantly better than not having the transformation completed due to errors with no reason given.</p>-->

<p><abbr>XSLT</abbr> processing will be accomplished using procedures identical to those of the <abbr>XSLT</abbr> Upgrader. Instructions for the <abbr>W3C</abbr> web-based process can be found in <a href="#Appendix-4">Appendix 4.</a></p>

</section>


<section>
	<header>Glossary</header>
	<p>The &glossary; for Version 1.0 contains descriptions for every element in Version 1.0.</p>
</section>

<!-- In lieu of a "Semantic Glossary" or detailed "Language Reference" document, this specification contains a few sections explaining abstract concepts that are necessary for a deeper understanding of the language and schemas, beyond what is covered in the Primer. These sections include:
   Attribute Mapping (extant)
   Modularization (extant)
   Node/Edge elements (not yet written)
   
   -->
  <section label="Mapping">
    <header>Attribute Mapping</header>
    <p>As in previous versions of Rule<abbr>ML</abbr>, there are several pairs of attributes in Version 1.0 that have names which differ only by a 'map' prefix: <a href="./glossary#gloss-@closure"><code>@closure</code></a> and <a href="./glossary#gloss-@mapClosure"><code>@mapClosure</code></a>, <a href="./glossary#gloss-@direction"><code>@direction</code></a> and <a href="./glossary#gloss-@mapDirection"><code>@mapDirection</code></a>, and <a href="./glossary#gloss-@material"><code>@material</code></a> and <a href="./glossary#gloss-@mapMaterial"><code>@mapMaterial</code></a>. The naming convention reflects attribute 'mapping' through <abbr>XML</abbr> trees, where</p>
    <pre><![CDATA[<NodeName mapAttribute="..."><C1>. . .</C1>. . .<CN>. . .</CN></NodeName>]]></pre>
    <p>basically acts like</p>
    <pre><![CDATA[<NodeName><NodeChildName1 attribute="...">. . .</NodeChildName1>. . .<NodeChildNameN attribute="...">. . .</NodeChildNameN></NodeName>]]></pre>
    <p>or</p>
    <pre><![CDATA[<NodeName><edgeName1><NodeChildName1 attribute="...">. . .</NodeChildName1></edgeName1>. . .<edgeNameN><NodeChildNameN attribute="...">. . .</NodeChildNameN></edgeNameN></NodeName>]]></pre>
  </section>
  The attribute is mapped uniformly to (only) the first generation of Node elements descended from the (Node) element in which the "map" attribute appears. For this abbreviated encoding to be applicable, the value of the attribute must be homogeneous within a given level of descendant elements.  
  

<section>
	<header>Modularization</header>
	<p>The <abbr>XSD</abbr> schemas use a tree-based modularization strategy. The most current model of the <abbr>XSD</abbr> modularization of Rule<abbr>ML</abbr> is always documented at <a href="http://ruleml.org/modularization/#Model">http://ruleml.org/modularization/#Model</a>.</p>
  <p>The Relax NG schemas use a different modularization approach based on lattices. The details are given in the publication about the re-engineering of <a href="http://www.cs.unb.ca/~boley/papers/RuleMLinRelaxNG.pdf">Rule<abbr>ML</abbr> in Relax NG</a> and the Rule<abbr>ML</abbr> <a href="http://wiki.ruleml.org/index.php/MYNG"><acronym>MYNG</acronym> Wiki</a> page. &myng; is accessible through a <acronym>GUI</acronym> or, for advanced users, a <a href="./relaxng/schema_rnc.php"><abbr title="PHP Hypertext Processor">PHP</abbr> script</a> .</p>
</section>

<section>
	<header><abbr>XSD</abbr>s</header>
	<p>The <!--stable--> &xsd-schemas; specification of Version 1.0 has been created using an <a href="http://ruleml.org/modularization/#Approach">approach</a> that is consistent with that of all earlier <abbr>XSD</abbr>s, and back to that of the (version 0.85) <a href="http://ruleml.org/0.85/dtd"><abbr>DTD</abbr>s</a>.
	  The &content-models; document should be read in parallel to the <abbr>XSD</abbr> schemas, because they give a high-level, complete documentation of the <abbr>XSD</abbr>s.
	  Likewise, the &glossary; can help to find quick descriptions of, and cross-reference between, the Version 1.0 <abbr>XML</abbr> elements.
	 </p>
</section>

  <section label="Acknowledgements">
    <header>Acknowledgements</header>
    
    <!-- 
      Sadnan Al-Manir
      Alexander Cameron
      Monika Machunik
      Omair Shafiq
      Gerd Wagner
      Jae Kyu Lee
      
      co-authors of prior versions:
      Harold Boley
      Said Tabet
      Benjamin Grosof
      Gerd Wagner
      Carlos Damasio
      Michael Kifer
      Michael Sintek
      David Hirtle
      
      Content Model
      Tshering Dema
      
      Glossary
      Doan Dai Duong 
      Le Thi Thu Thuy
      
      Rule<abbr>ML</abbr>, Co-Chairs: 
      Harold Boley 
      Said Tabet
      
      Steering Committee: 
      Yevgen Biletskiy
      Harold Boley
      Mike Dean
      Benjamin Grosof
      Michael Kifer
      Alex Kozlenkov
      Jeff Z. Pan
      Adrian Paschke
      Bruce Spencer
      Giorgos Stamou
      Suzette Stoutenburg
      Said Tabet
      Gerd Wagner
      
      Advisory Board: 
      Asaf Adi
      Andreas Eberhart
      Steve Ross-Talbot
      
      Reaction Rules (Reaction Rule<abbr>ML</abbr>) Technical Group, Co-Chairs: 
      Adrian Paschke
      Alex Kozlenkov
      
      Ontology Combination Technical Group, Co-Chairs: 
      Benjamin Grosof
      Andreas Eberhart
      
      Defeasible Logic in Rule<abbr>ML</abbr> (Defeasible Rule<abbr>ML</abbr>) Technical Group, Co-Chairs: 
      Nick Bassiliades
      Guido Governatori
      
      Frames, Objects, and RUle Markup ( FORUM) Technical Group, Co-Chairs: 
      Michael Kifer
      Jürgen Angele
      Fuzziness in Rule<abbr>ML</abbr> (Fuzzy Rule<abbr>ML</abbr>) Technical Group, Co-Chairs: 
      Giorgos Stamou
      Jeff Z. Pan
      
      Rule<abbr>ML</abbr>-Based Responder (Rule Responder) Technical Group, Co-Chairs: 
      Adrian Paschke
      Harold Boley
    -->    
    We wish to acknowledge the contributions of: 
    Asaf	Adi, 
    Sadnan	Al-Manir, 
    Yevgen	Biletskiy, 
    Alexander	Cameron, 
    Carlos	Damasio, 
    Mike	Dean, 
    Tshering	Dema, 
    Doan Dai	Duong, 
    Andreas	Eberhart, 
    Michael	Kifer, 
    Alex	Kozlenkov, 
    Jae Kyu	Lee, 
    Monika	Machunik, 
    Jeff Z.	Pan, 
    Steve	Ross-Talbot, 
    Omair	Shafiq, 
    Michael	Sintek, 
    Bruce	Spencer, 
    Giorgos	Stamou, 
    Suzette	Stoutenburg, 
    Le Thi Thu	Thuy, and 
    Gerd	Wagner.	
    
    
  </section>

<section>
<header>Appendices</header>

<p>Appended below is a simple example rulebase (<a href="#Appendix-1">Appendix 1</a>), the <abbr>XSD</abbr> Schema for the Datalog sublanguage of Rule<abbr>ML</abbr> to which the rulebase conforms (<a href="#Appendix-2">Appendix 2</a>), instructions for how to validate instances against the <abbr>XSD</abbr> schema (<a href="#Appendix-3">Appendix 3</a>),
  instructions for how to transform with <abbr>XSLT</abbr> stylesheets (<a href="#Appendix-4">Appendix 4</a>),  and
  instructions for how to validate instances against the  Relax NG schema (<a href="#Appendix-5">Appendix 5</a>).
</p>
</section>

<section label="Appendix-1">
<header>Appendix 1: New Example rulebase in Rule<abbr>ML</abbr></header>
<p>Source: <a href="exa/Datalog-xsd/own-xsd.ruleml">own-xsd.ruleml</a></p>
<box bgcolor="#FFFFFF"><pre><![CDATA[

<?xml version="1.0" encoding="UTF-8"?>

<RuleML
xmlns="http://ruleml.org/spec"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ruleml.org/spec http://ruleml.org/1.0/xsd/datalog.xsd"
>

  <Assert mapClosure="universal">

    <!-- start XML comment ...

    This example rulebase contains four rules.
    The first and second rules are implications; the third and fourth ones are facts.

    In English:

    The first rule implies that a person owns an object
    if that person buys the object from a merchant and the person keeps the object.

    As an OrdLab Tree:

    Implies~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              *                                                                            *                       
           if *                                                                       then * 
              *                                                                            *  
             And~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                 Atom~~~~~~~~~~~~~~~~~~
                   |                                   |                                          *     |     |  
                   |                                   |                                      op  *     |     |  
                   |                                   |                                          *     |     |    
                 Atom~~~~~~~~~~~~~~~~~~~~~~~~~~~     Atom~~~~~~~~~~~~~~~~~~                      Rel   Var   Var
                          *     |      |       |              *     |     |                       .     .     .    
                      op  *     |      |       |          op  *     |     |                       .     .     .    
                          *     |      |       |              *     |     |                       .     .     .
                         Rel   Var    Var     Var            Rel   Var   Var                     own  person object
                          .     .      .       .              .     .     . 
                          .     .      .       .              .     .     .
                          .     .      .       .              .     .     .
                         buy  person merchant object        keep  person object

    ... end XML comment -->

    <Implies>
      <if>
        <!-- explicit 'And' -->
        <And>
          <Atom>
            <op><Rel>buy</Rel></op>
            <Var>person</Var>
            <Var>merchant</Var>
            <Var>object</Var>
          </Atom>
          <Atom>
            <op><Rel>keep</Rel></op>
            <Var>person</Var>
            <Var>object</Var>
          </Atom>
        </And>
      </if>
      <then>
        <Atom>
          <op><Rel>own</Rel></op>
          <Var>person</Var>
          <Var>object</Var>
        </Atom>
      </then>
    </Implies>

  <!-- The second rule implies that a person buys an object from a merchant
  if the merchant sells the object to the person. -->

    <Implies>
      <if>
        <Atom>
          <op><Rel>sell</Rel></op>
          <Var>merchant</Var>
          <Var>person</Var>
          <Var>object</Var>
        </Atom>
      </if>
      <then>
        <Atom>
          <op><Rel>buy</Rel></op>
          <Var>person</Var>
          <Var>merchant</Var>
          <Var>object</Var>
        </Atom>
      </then>
    </Implies>
 
  <!-- The third rule is a fact that asserts that
  John sells XMLBible to Mary. -->
 

    <Atom>
      <op><Rel>sell</Rel></op>
      <Ind>John</Ind>
      <Ind>Mary</Ind>
      <Ind>XMLBible</Ind>
    </Atom>

 
  <!-- The fourth rule is a fact that asserts that
  Mary keeps XMLBible.
 
  Observe that this fact is binary - i.e., there are two arguments
  for the relation. RDF viewed as a logical knowledge representation
  is, likewise, binary, although its arguments have type restrictions,
  e.g., the first must be a resource (basically, a URI). -->
 
    <Atom>
      <op><Rel>keep</Rel></op>
      <Ind>Mary</Ind>
      <Ind>XMLBible</Ind>
    </Atom>
  </Assert>
 
</RuleML>]]></pre></box>
</section>

<section label="Appendix-2">
<header>Appendix 2: <abbr>XSD</abbr> for the Datalog sublanguage of Rule<abbr>ML</abbr></header>
<p>Source: <a href="xsd/datalog.xsd">datalog.xsd</a></p>

<box bgcolor="#FFFFFF"><pre><![CDATA[
<?xml version="1.0" encoding="UTF-8"?>

<xs:schema 
xmlns="http://ruleml.org/spec" 
xmlns:xs="http://www.w3.org/2001/XMLSchema" 
targetNamespace="http://ruleml.org/spec"
>

	<xs:annotation>
		<xs:documentation xml:lang="en">
			XML Schema for the RuleML sublanguage "datalog".
			File: datalog.xsd
			Version: 1.0
			Last Modification: 2010-07-16
		</xs:documentation>
	</xs:annotation>

	<!--
		Note that datalog is entirely composed of modules and that all other
		schema drivers rely on it, making it the root of the sublanguage family tree.                 
	-->

	<!--
		Datalog includes the following modules:
		* performative
		* desc
		* quantifier
		* connective
		* atom
		* slot
		* term
		* uri

		For details on each module, including what element and/or attribute declarations                  
		they contain, please refer to them individually.
	-->

	<xs:include schemaLocation="modules/performative_module.xsd"/>
	<xs:include schemaLocation="modules/desc_module.xsd"/>
	<xs:include schemaLocation="modules/quantifier_module.xsd"/>
	<xs:include schemaLocation="modules/connective_module.xsd"/>
	<xs:include schemaLocation="modules/atom_module.xsd"/>
	<xs:include schemaLocation="modules/slot_module.xsd"/>
	<xs:include schemaLocation="modules/term_module.xsd"/>
	<xs:include schemaLocation="modules/uri_module.xsd"/>

</xs:schema>]]></pre></box>
</section>

<section label="Appendix-3">
<header>Appendix 3:  Instructions on validating the example online with <abbr>XSD</abbr></header>
<enumerate>
  <item> Direct your browser to <a href="http://www.w3.org/2001/03/webdata/xsv">http://www.w3.org/2001/03/webdata/xsv</a></item>

  <item>Enter the following <abbr title="Uniform Resource Locator">URL</abbr> of our example Rule<abbr>ML</abbr> file (or any other) into the textfield
    preceded by "Address(es)": http://ruleml.org/1.0/exa/Datalog-xsd/own-xsd.ruleml</item>

  <item>If desired, check the "Show Warnings" box.</item>

  <item>Click the "Get Results" button.</item>
</enumerate>

Note: The validation may take a while, and may require a full
refresh when re-validating to avoid caching.

Also note: Depending on your browser, you may want to select a different
output using the radio buttons just above the "Get Results" button.

<p> 
  You should get the following output (using the default output):</p>

		<h4>Schema validating with <abbr title="XML Schema Validator">XSV</abbr> 3.1-1 of 2007/12/11 16:20:05</h4>
		<itemize>
		  <item><b>Target</b>: <code>http://ruleml.org/1.0/exa/Datalog-xsd/own-xsd.ruleml</code><br/>   (Real name: http://ruleml.org/1.0/exa/Datalog-xsd/own-xsd.ruleml<br/>    Length: 4311 bytes
			  <br/>    Last Modified: Fri, 09 Dec 2011 18:22:28 GMT<br/>    Server: Apache/2.0.55 (Red Hat)) </item>
			<item><b>docElt</b>: <code>{http://ruleml.org/spec}RuleML</code></item>
			<item>Validation was strict, starting with type <code>{http://ruleml.org/spec}:RuleML.type</code></item>
			<item><b>schemaLocs</b>: http://ruleml.org/spec -&gt; http://ruleml.org/1.0/xsd/datalog.xsd</item>
			<item>The schema(s) used for schema-validation had no errors</item>
			<item>No schema-validity problems were found in the target </item>
		</itemize>
		<hr/>
		<h3>Schema resources involved</h3>
		<p style="margin-bottom: 0px">Attempt to load a schema document from

<code>http://ruleml.org/1.0/xsd/datalog.xsd</code>
 (source: <code>schemaLoc</code>) for
   <code>http://ruleml.org/spec</code>,
    succeeded</p>
		<p style="margin-bottom: 0px">Attempt to load a schema document from
<code>http://ruleml.org/1.0/xsd/modules/performative_module.xsd</code>
 (source: <code>include</code>) for
   <code>http://ruleml.org/spec</code>,
    succeeded</p>
		<p style="margin-bottom: 0px">Attempt to load a schema document from
<code>http://ruleml.org/1.0/xsd/modules/desc_module.xsd</code>
 (source: <code>include</code>) for
   <code>http://ruleml.org/spec</code>,
    succeeded</p>
		<p style="margin-bottom: 0px">Attempt to load a schema document from
<code>http://ruleml.org/1.0/xsd/modules/quantifier_module.xsd</code>
 (source: <code>include</code>) for
   <code>http://ruleml.org/spec</code>,
    succeeded</p>
		<p style="margin-bottom: 0px">Attempt to load a schema document from
<code>http://ruleml.org/1.0/xsd/modules/connective_module.xsd</code>
 (source: <code>include</code>) for
   <code>http://ruleml.org/spec</code>,
    succeeded</p>
		<p style="margin-bottom: 0px">Attempt to load a schema document from
<code>http://ruleml.org/1.0/xsd/modules/atom_module.xsd</code>
 (source: <code>include</code>) for
   <code>http://ruleml.org/spec</code>,
    succeeded</p>
		<p style="margin-bottom: 0px">Attempt to load a schema document from
<code>http://ruleml.org/1.0/xsd/modules/slot_module.xsd</code>
 (source: <code>include</code>) for
   <code>http://ruleml.org/spec</code>,
    succeeded</p>
		<p style="margin-bottom: 0px">Attempt to load a schema document from
<code>http://ruleml.org/1.0/xsd/modules/term_module.xsd</code>
 (source: <code>include</code>) for
   <code>http://ruleml.org/spec</code>,
    succeeded</p>
		<p style="margin-bottom: 0px">Attempt to load a schema document from
<code>http://ruleml.org/1.0/xsd/modules/iri_module.xsd</code>
 (source: <code>include</code>) for
   <code>http://ruleml.org/spec</code>,
    succeeded</p>      
		<hr/>
		

</section>

<section label="Appendix-4">
<header>Appendix 4:  Normalizing or Upgrading Rule<abbr>ML</abbr> files with <abbr>XSLT</abbr></header>
  <enumerate>
    <item>Go to the <abbr>W3C</abbr> <abbr>XSLT</abbr> Service at <a href ="http://www.w3.org/2005/08/online_xslt/">http://www.w3.org/2005/08/online_xslt/</a></item>

<item>For the xsl resource insert the <abbr>URL</abbr> for either the Version 1.0 Normalizer <abbr>XSLT</abbr> (<a href="./xslt/normalizer/100_normalizer.xslt">http://ruleml.org/1.0/xslt/normalizer/100_normalizer.xslt</a>)
  or the Rule<abbr>ML</abbr> 0.91-1.0 Upgrader <abbr>XSLT</abbr> (<a href = "../xslt/upgrader/091-to-100.xslt">http://ruleml.org/1.0/xslt/upgrader/091-to-100.xslt</a>).</item>

<item>For the xml resource use a file that is either considered compact Rule<abbr>ML</abbr> (for the normalizer) or a Rule<abbr>ML</abbr> file using an older version of Rule<abbr>ML</abbr> (for the upgrader).
  Compact examples for the normalizer can be found in the &normalizer; directory, while old version examples for the upgrader can be found in the &upgrader; directory.</item>

    <item>Once both <abbr>URL</abbr>'s have been entered, click transform. To see the result, in some browsers you need to do "View | Page Source".</item>
  </enumerate>
</section>

<section label="Appendix-5">
  <header>Appendix 5:  Validating an Instance against a Relax NG schema</header>
  <a href="http://Validator.nu">Validator.nu</a> is an easy-to-use online tool for validating an <abbr>XML</abbr> instance against a Relax NG schema. A basic procedure for using this tool is as follows:
  <enumerate>
    <item>Open the <a href="http://Validator.nu">Validator.nu</a> webpage in your browser.</item>
    <item>Choose how you want to enter the instance:
      <itemize>
        <item>Address - type or past a <abbr>URL</abbr> into the adjacent text field;</item>
        <item>File Upload - use the browse dialog to locate the file on your local hard drive or network;</item>
        <item>Text Field - type or paste text directly into the text area.</item>
      </itemize>
    </item>
    <item>Skip the Encoding field</item>
    <item>Type or paste a <abbr>URL</abbr> to the schema you wish to validate against. Only schemas available from the internet can be used. For example, the <abbr>URL</abbr> <a href="./relaxng/schema_rnc.php">http://ruleml.org/1.0/relaxng/schema_rnc.php</a> may be used to validate all Version 1.0 instances.</item>
    <item>Skip the rest of the fields, and click Validate.</item>
    <item>The result will appear below, followed by a copy of the instance source.</item>
  </enumerate>
  An online demo of validation using the Rule<abbr>ML</abbr> Relax NG schemas with Validator.nu, including more advanced options, is available at the <a href="http://wiki.ruleml.org/index.php/MYNG#Demo">Demo section of the <acronym>MYNG</acronym> Wiki</a>. Other tools that may be used for validation against Relax NG schemas are described in the <a href="http://wiki.ruleml.org/index.php/MYNG#Tools">Tools section of the <acronym>MYNG</acronym> Wiki</a>.
</section>

  <section label="Changes">
    
    <header>Appendix 6: Changes</header>
    
    <p>Changes in the Version 1.0 <abbr>XSD</abbr> release relative to the previous <abbr>XSD</abbr> version <a href="http://ruleml.org/0.91/">0.91</a> are detailed below, including examples where appropriate.</p>
    
    <p>The terminology "Type" and "role" (when referring to XML tags or elements) has been changed to "Node" and "edge", in order to avoid the confusion caused by simultaneous usage of multiple meanings of these words, as well as to emphasize the connection to graphs, especially the <a href="http://www.w3.org/TR/rdf-concepts/#section-data-model">RDF graph model</a>.  </p>
    
    <p>Schematron dependency has been reduced (as comments in the code). For example, the following code provides annotation related to restrictions 
      on the interpretation attribute of nested functions.</p>
    <box><pre><![CDATA[<xs:annotation>
  <xs:appinfo>
    <sch:pattern name="Uninterpreted functions">
      <sch:rule context="r:Expr/r:Fun[@per='no']">
        <sch:assert test=
          "not(../r:Expr/r:Fun[@per='yes'] or
           ../r:arg/r:Expr/r:Fun[@per='yes'] or
           ../r:Expr/r:op/r:Fun[@per='yes'] or 
           ../r:arg/r:Expr/r:op/r:Fun[@per='yes'])">
          Functions nested within an uninterpreted function must also be uninterpreted.
        </sch:assert>
      </sch:rule>
    </sch:pattern>
  </xs:appinfo>
</xs:annotation>]]></pre></box>  
    
    <p>Edge elements <a href="http://ruleml.org/0.91/glossary#gloss-head"><code>&lt;head&gt;</code></a> and <a href="http://ruleml.org/0.91/glossary#gloss-body"><code>&lt;body&gt;</code></a> are replaced with <a href="./glossary#gloss-then"><code>&lt;then&gt;</code></a> and <a href="./glossary#gloss-if"><code>&lt;if&gt;</code></a>, respectively.
      These elements appear as children of <a href="./glossary#gloss-Implies"><code>&lt;Implies&gt;</code></a> and <a href="./glossary#gloss-entails"><code>&lt;Entails&gt;</code></a>.
      For example, the following implication:</p>
    <box><pre><![CDATA[<Implies>
  <if>
    <And>
      <Atom>
        <Rel>premium</Rel>
        <Var>cust</Var>
      </Atom>
      <Atom>
        <Rel>regular</Rel>
        <Var>prod</Var>
      </Atom>
    </And>
  </if>
  <then>
    <Atom>
      <Rel>discount</Rel>
      <Var>cust</Var>
      <Var>prod</Var>
      <Data>5.0 percent</Data>
    </Atom>
  </then>
</Implies>]]></pre></box>
    <p> expresses the statement "A premium customer recieves a 5% discount on regular products."</p>
    <p>Edge elements <a href="http://ruleml.org/0.91/glossary#gloss-lhs"><code>&lt;lhs&gt;</code></a> and 
      <a href="http://ruleml.org/0.91/glossary#gloss-rhs"><code>&lt;rhs&gt;</code></a> 
      are replaced with <a href="./glossary#gloss-left"><code>&lt;left&gt;</code></a>
      and <a href="./glossary#gloss-right"><code>&lt;right&gt;</code></a>, respectively. 
      These elements appear as children of <a href="./glossary#gloss-equal"><code>&lt;Equal&gt;</code></a>. 
      As an example consider the statement:</p>
    <box><pre><![CDATA[<Equal>    
  <left>
    <Ind>Lady Gaga</Ind>
  </left>
  <right>
    <Ind>Stefani Joanne Angelina Germanotta</Ind>
  </right>
</Equal>]]></pre></box>
    <p> which expresses that the individuals named "Lady Gaga" and "Stefani Joanne Angelina Germanotta" are the same.</p>
    
    <p>In the SWSL languages, which are implemented only in the <abbr>XSD</abbr>s, Node elements 
      <a href="http://ruleml.org/0.91/glossary#gloss-hterm"><code>&lt;Hterm&gt;</code></a> and 
      <a href="http://ruleml.org/0.91/glossary#gloss-con"><code>&lt;Con&gt;</code></a> are replaced with 
      <a href="./glossary#gloss-uniterm"><code>&lt;Uniterm&gt;</code></a> and 
      <a href="./glossary#gloss-const"><code>&lt;Const&gt;</code></a> respectively. </p>	
    
    <p>Attribute <a href="./glossary#gloss-@in"><code>@in</code></a><code>="no|semi|yes"</code> with respective values are 
      replaced with <a href="./glossary#gloss-@per"><code>@per</code></a><code>="copy|open|value"</code>.
      For example, the following functional expression uses the default value ("copy") of the attribute "per" </p>
    <box><pre><![CDATA[<Expr per="copy">
  <op><Fun>MultiplyFn</Fun></op>
  <arg index="1"><Data xsi:type="xs:integer">3</Data></arg>
  <arg index="2"><Var>X</Var></arg>
</Expr>]]></pre></box>
    <p> to generate an algebraic expression that may be evaluated after the variable X is bound to a numerical value.
      In contrast, the expression</p>
    <box><pre><![CDATA[<Expr per="value">
  <op><Fun>MultiplyFn</Fun></op>
  <arg index="1"><Data xsi:type="xs:integer">3</Data></arg>
  <arg index="2"><Data xsi:type="xs:integer">4</Data></arg>
</Expr>]]></pre></box>
    <p> will be evaluated (to <a href="./glossary#gloss-data"><code>&lt;Data xsi:type="xs:integer"&gt;12&lt;/Data&gt;</code></a>) 
      before inference is performed.</p>
    
    <p>Attribute <a href="http://ruleml.org/0.91/glossary#gloss-@uri"><code>@uri</code></a> is replaced with 
      <a href="./glossary#gloss-@iri"><code>@iri</code></a>.
      This attribute is used to identify, by Internationalized Resource Identifier (IRI),
      the elements <a href="./glossary#gloss-ind"><code>&lt;Ind&gt;</code></a>, 
      <a href="./glossary#gloss-rel"><code>&lt;Rel&gt;</code></a> and 
      <a href="./glossary#gloss-fun"><code>&lt;Fun&gt;</code></a> as individuals,
      relations and functions, respectively. For example: </p>
    <box><pre><![CDATA[<Atom>
  <op>
    <Rel iri="http://dublincore.org/documents/dces/index.shtml.rdf#Creator"/>
  </op>
  <Ind iri="http://www.w3.org/Home/Lassila"/>
  <Data xsi:type="xs:string">Ora Lassila</Data>
</Atom>]]></pre></box>
    <p>expresses a fact equivalent to the <a href="http://www.w3schools.com/rdf/"><abbr title="Resource Description Framework">RDF</abbr></a> triple:    </p>  
    <box><pre><![CDATA[<rdf:RDF xmlns:s="http://dublincore.org/documents/dces/index.shtml.rdf">
  <rdf:Description about="http://www.w3.org/Home/Lassila">
    <s:Creator>Ora Lassila</s:Creator>
  </rdf:Description>
</rdf:RDF>]]></pre></box>
    
    <p>A new edge element <a href="./glossary#gloss-act"><code>&lt;act&gt;</code></a>, 
      with a required <a href="./glossary#gloss-@index"><code>@index</code></a> attribute, 
      is introduced as an optional wrapper for all performatives of the <a href="./glossary#gloss-ruleml"><code>&lt;RuleML&gt;</code></a> element, 
      as shown here:</p>
    
    <box><pre><![CDATA[<RuleML>
  <act index="1">
    <Assert/>
  </act>
</RuleML>]]></pre></box>


    <p>A new attribute <a href="./glossary#gloss-@node"><code>@node</code></a> is introduced as an optional IRI identifier of a Node element, useful for referencing the element in external meta-knowledge. It is allowed on all Nodes, including leaf Nodes such as <a href="./glossary#gloss-Data"><code>&lt;Data&gt;</code></a>, <a href="./glossary#gloss-Reify"><code>&lt;Reify&gt;</code></a> and <a href="./glossary#gloss-Rel"><code>&lt;Rel&gt;</code></a>.  </p>

<box><pre><![CDATA[<Implies node = "#rule1">
  <if>...</if><then>...</then>
</Implies>]]></pre></box>
    

    <p>A new edge element <a href="./glossary#gloss-meta"><code>&lt;meta&gt;</code></a> is introduced as a non-skippable wrapper of a formula expressing meta-knowledge, allowed zero to many times in the header of non-leaf Node elements. When a slotted  
      <a href="./glossary#gloss-Atom"><code>&lt;Atom&gt;</code></a> is wrapped in <a href="./glossary#gloss-meta"><code>&lt;meta&gt;</code></a>, the object of the slotted frame is
      assumed (unless specified otherwise) to be the reification of the parent Node, which may be specified with the 
      <a href="./glossary#gloss-@node"><code>@node</code></a> attribute, or may be anonymous.</p>
    
<box><pre><![CDATA[<Implies node="rule2">
  <meta>
    <Atom>
      <oid><Ind iri="#rule2"/></oid>
      <Rel iri="&ruleml;Override"/>
      <Ind iri="#rule1"/>
    </Atom>  
  </meta>
  <if>...</if><then>...</then>
</Implies>]]></pre></box>
    
    
    <p>The edge element <a href="./glossary#gloss-oid"><code>&lt;oid&gt;</code></a> is no longer allowed on all non-leaf Node elements, but is restricted to <a href="./glossary#gloss-Atom"><code>&lt;Atom&gt;</code></a> and 
      <a href="./glossary#gloss-Expr"><code>&lt;Expr&gt;</code></a> (and <a href="./glossary#gloss-Uniterm"><code>&lt;Uniterm&gt;</code></a> in the SWSL branch,) for use as an identifier for the object of slotted atoms and expressions. The functionality of providing an identifier for attaching meta-knowledge, such as the defeasible priority of rules, is
      transferred to the <a href="./glossary#gloss-@node"><code>@node</code></a> attribute.
    </p>
    
    <p>The attributes <code>@xml:base</code> and <code>@xml:id</code> are allowed on all elements. The base for resolving relative IRI references is explicitly declared with <code>@xml:base</code>. The attribute <code>@xml:id</code> provides an alternate means of identifying elements, and is applicable to edges as well as nodes. The semantics of the <code>@xml:id</code> identifier, which denotes the information resource fragment that is the element and is referentially opaque, differs from that of the <a href="./glossary#gloss-@node"><code>@node</code></a> identifier, which denotes a reification of the logical or extra-logical entity associated with the element and is referentially transparent. 
    </p>

<box><pre><![CDATA[<Atom>
  <op xml:base="http://example.org" xml:id = "op1">
    <Rel iri="#rel2"/>
  </op>
</Atom>]]></pre></box>
    

    <p>Additional freedom in element order with partial stripe-skipping has been introduced in the "relaxed form serialization", as specified in the Relax NG schemas.
      In particular, infix and postfix operator notation is now allowed in the relaxed form serialization as long as the <a href="./glossary#gloss-op"><code>&lt;op&gt;</code></a> element is not skipped.</p>
    
  </section>
  

  <section label="Issues">
    <header>Appendix 7: Issues</header>
    <p>Features that are "deprecation candidates", i.e. that may be deprecated in future releases, include: 
      <itemize>
        <item><a href="./glossary#gloss-reify"><code>&lt;Reify&gt;</code></a> at Datalog and lower, as this introduces the possibility of nesting reification to an arbitrary level ;</item>
        <item> the default values of attributes which indicate semantics variants: 
          <a href="./glossary#gloss-@direction"><code>@direction</code></a>, 
          <a href="./glossary#gloss-@mapDirection"><code>@mapDirection</code></a>,
          <a href="./glossary#gloss-@material"><code>@material</code></a>,
          <a href="./glossary#gloss-@mapMaterial"><code>@mapMaterial</code></a>,
          <a href="./glossary#gloss-@oriented"><code>@oriented</code></a>,
          <a href="./glossary#gloss-@val"><code>@val</code></a>,
          <a href="./glossary#gloss-@per"><code>@per</code></a>, as it may be more effective to use the absence of the attribute to indicate a "neutral" semantics;
        </item>
        <item> the (<a href="http://www.w3.org/Submission/SWSF-SWSL/"><acronym title="Semantic Web Services Language">SWSL</acronym></a>) syntax, whose current syntax may be deprecated in favor of better integration with the rest of the Rule<abbr>ML</abbr> syntax.
        </item>
       <!-- <item><a href="./glossary#gloss-oid"><code>&lt;oid&gt;</code></a> as a child of Nodes other than <a href="./glossary#gloss-Atom"><code>&lt;Atom&gt;</code></a> or certain cases of <a href="./glossary#gloss-Expr"><code>&lt;Expr&gt;</code></a> and <a href="./glossary#gloss-Uniterm"><code>&lt;Uniterm&gt;</code></a> does not have commonly accepted semantics (in particular, F-logic's object semantics, as adapted in W3C RIF and developed in PSOA Rule<abbr>ML</abbr>),  although it has been informally used in earlier Rule<abbr>ML</abbr> instances for labels, which sometimes have consisted of entire comment lines (Version 1.0 instances use <abbr>XML</abbr>-level comments instead, while a future Rule<abbr>ML</abbr> version is expected to introduce/adopt a separate metadata mechanism.) 
        </item>-->
      </itemize>
    </p>
    
    <p>
    During the review of the Version 0.91 XSD schemas that was conducted in conjunction with the re-engineering of  
    <a href="http://www.cs.unb.ca/~boley/papers/RuleMLinRelaxNG.pdf">Rule<abbr>ML</abbr> in Relax NG</a>, a number of shortcomings and defects <!--(jointly referred to as <a href="http://wiki.ruleml.org/index.php/XSD-Errata0.91">Errata</a>)--> were identified.
    A number of these issues were patched in the <a href="http://ruleml.org/0.91/#Patches">Version 0.91 Patched</a> release, and these patched <abbr>XSD</abbr>s form the basis of the hand-written <abbr>XSD</abbr>s for Version 1.0. There are several issues that could not be resolved in the handwritten <abbr>XSD</abbr>s, including:
    <itemize>
      <item><a href="http://wiki.ruleml.org/index.php/XSD-Errata0.91#Err4">Reification in Languages Below Datalog</a>:
        the Binary sublanguages have an overly-permissive schema for reification
        (<a href="./glossary#gloss-Reify"><code>&lt;Reify&gt;</code></a>). For example, in bindatagroundfact, it is valid to reify a universal quantification (<a href="./glossary#gloss-Forall"><code>&lt;Forall&gt;</code></a>
), while it is not allowed to construct a universal quantification in the language. It is not possibly to fix this issue without discarding the tree-based modularization approach of the hand-written schemas. Because Version 1.0 is a "Rosetta" release, we have retained the hand-written <abbr>XSD</abbr> schemas that contain this issue for consistency with legacy schemas. However, the Relax NG schemas are not affected by this issue, and thus there is a discrepancy between the <abbr>XSD</abbr> and Relax NG schemas in these unusual cases. 
      </item>
    <item><a href="http://wiki.ruleml.org/index.php/XSD-Errata0.91#Err5">Circular Group Definitions</a>:
      all schemas that redefine the Datalog <abbr>XSD</abbr> schema use circular group definitions, leading to an inability to validate against these schemas using some validators, such as <a href="http://xerces.apache.org/xerces-j/schema.html">Xerces</a>. Similar to the issue above, it is not possible to fix this issue within the modularization approach of the hand-written <abbr>XSD</abbr> schemas. However, <a href="http://www.w3.org/2001/03/webdata/xsv"><abbr>XSV</abbr></a> and <a href="http://saxon.sourceforge.net/">Saxon</a> validators are lax in enforcing <a href="http://www.w3.org/TR/xmlschema-1/#coss-modelGroup">Constraints on Model Group Schema Components (§3.8.6)</a> of the <a href="http://www.w3.org/TR/xmlschema-1/"><abbr>XSD</abbr> specification, Part 1</a>, and are able to work around it. Relax NG schemas and the XSD schemas automatically generated from the Relax NG schemas are not affected by this issue.
    </item>
    </itemize>
    
    The latter two issues will be resolved in Version 1.1 by discontinuing support of the handwritten XSDs, relying instead on XSD schemas automatically generated from the Relax NG schemas.
    
    </p>
  </section>


	<closing>
		<p>
		Site Contact:
		<a href="http://athant.com">Tara Athan</a>.
		Page Version: 2012-04-03
		
		<br/>
		<br/>
		<br/>
		<a name="Practice-Preach"/>
		<small>"Practice what you preach": <abbr>XML</abbr> source of this homepage at <a href="index.xml">index.xml</a>;
	      <br/>
	      transformed to HTML via the adaptation of <a href="http://www.dfki.uni-kl.de/~sintek/">Michael Sintek</a>'s SliML <a href="http://www.w3.org/TR/xslt"><abbr>XSLT</abbr></a> stylesheet at <a href="http://www.dfki.uni-kl.de/~boley/xslt/homepage.xsl">homepage.xsl</a> (View | Page Source)
	   </small>
		</p>
	</closing>

</homepage>

