Specification of Deliberation RuleML 1.01

From RuleML Wiki
Jump to: navigation, search

Authors: Harold Boley, Tara Athan, Adrian Paschke, Adrian Giurca, Nick Bassiliades, Guido Governatori, Monica Palmirani, Adam Wyner, Gen Zou, Zhili Zhao


Quick links:

Homepage : Parent Specification of RuleML

Prerequisites: None, Level: Informal

Overarching : Overarching Specification of Web Rules

Prerequisites: None, Level: Semi-formal

Deliberation RuleML : Specification of Deliberation RuleML

Prerequisites: None, Level: Semi-formal

Primer : Introduction to the RuleML Language

Prerequisites: None, Level: Informative

Relax NG Schemas : Machine-readable grammar in the Relax NG language

Prerequisites: Relax NG, Level: Formal

MYNG : Modular sYNtax confiGurator, a GUI for customizing Relax NG schemas

Prerequisites: None, Level: Formal

XSD Schemas : Machine-readable schemas in XSD

Prerequisites: XSD, Level: Formal

Normalizer : Stylesheet for transforming into the normal-form serialization

Prerequisites: XSLT, Level: Formal

Upgrader : Stylesheet for transforming from Version 0.91 into Version 1.01

Prerequisites: XSLT, Level: Formal

Examples : Illustrative Instances of the Version 1.01 Language

Prerequisites: Primer, Level: Informative

Glossary : Definitions of Elements and Attributes

Prerequisites: Primer, Level: Semi-formal

Content Models : Simplified XML Element and Attribute Definitions

Prerequisites: Primer, Level: Semi-formal

Schema Docs : Diagrammatic Presentation of Content Models

Prerequisites: Primer, Level: Semi-formal

OO jDREW : Reference Implementation of RuleML Operational Semantics

Prerequisites: Naf Hornlog RuleML, Level: Formal

Implementations : Implemented RuleML tools

Prerequisites: None, Level: Informative

This version: deliberation.ruleml.org/1.01

Latest version: deliberation.ruleml.org/spec

Version history:
Date Version
2001-01-25 -

Version 0.7 HTML

2001-07-11 -

Version 0.8 HTML

2003-12-09 -

Version 0.85 HTML

2004-06-23 -

Version 0.86 HTML

2004-08-12 -

Version 0.87 HTML

2005-03-01 -

Version 0.88 HTML

2005-05-27 -

Version 0.89 HTML

2005-11-09 -

Version 0.9 HTML

2006-08-24 -

Version 0.91 HTML

2011-09-27 -

Version 0.91 Patched HTML

2012-04-03 -

Version 1.0 HTML

2012-04-03 -

Version 1.0 Wiki

2014-07-25 -

Version 1.01 Wiki


RuleML is a knowledge representation language designed for the interchange of the major kinds of Web rules in an XML format that is uniform across various rule logics and platforms. It has broad coverage and is defined as an extensible family of sublanguages, whose modular system of schemas permits rule interchange with high precision. RuleML 1.0 encompasses both Deliberation RuleML 1.0 and Reaction RuleML 1.0.

The immediate Deliberation RuleML 1.0 successor Deliberation RuleML 1.01 introduces several new options for obtaining a more fine-grained customization of sublanguages. A small set of extensions of Datalog yields a major payoff: a standard XML serialization of Datalog+ (book), a superlanguage of the decidable Datalog+/-. The highlight of Deliberation RuleML 1.01 is the ability to combine one or more of the following Datalog extensions which together define Datalog+:

In Deliberation RuleML 1.01, each of these Datalog+ features can now also be combined with a conjunction (e.g., an "And" of "Atoms", rather than just one "Atom") in the "then" part, as used, e.g., in SWRL. Moreover, Deliberation RuleML 1.01 permits mixing in the characteristic Disjunctive Datalog feature of disjunction (e.g., an "Or" of "Atoms") in the "then" part, as used for implementing description logics.

An instructive example illustrates the syntax and semantics of Datalog+ with annotated rules about a business scenario.

An expanded range of options regarding the length of term sequences allows closer approximations to important Semantic Web languages: Unary (length-one) term sequences in relations and functions, orthogonally combinable with binary (length-two) term sequences, useful for graph logics (RDF) and description logics (OWL).

Because of the orthogonality of the design, all of these features are freely combinable with each other and with the existing RuleML sublanguages. In particular, the new features are available for other logics in Deliberation RuleML 1.01, including Horn logic (Hornlog RuleML 1.01), e.g. allowing Hornlog Existential Rules, Hornlog Equality Rules, and Hornlog Integrity Rules.

Customized serialization schemas for each combination of features can be generated on-the-fly through MYNG, the RuleML Modular sYNtax confiGurator. Following GUI-based feature selections by the designer, MYNG creates systematically-named RELAX NG Compact Syntax (RNC) schemas. For select anchor sublanguages, including the original fifteen sublanguages of Version 1.0 as well as several Datalog+ sublanguages, the MYNG-created RNC schemas have been used as pivot schemas for conversion (by Jing/Trang) to corresponding JAXB-compatible XSDs. The algorithm employed in the improved MYNG 1.01 GUI uses mathematical properties of the RuleML language lattice to find the closest lenient XSD anchor schema whenever a custom sublanguage is generated; this is then provided for separate download. Generally, MYNG makes the full Deliberation RuleML 1.01 feature systematics available to designers of custom RuleML sublanguages, some of which may be proposed as new anchor sublanguages in future releases.


The scope of this specification covers:

  • Glossary of the language components[1];
  • Schemas, including
    • Relax NG schemas [2];
    • XSD anchor schemas[3], generated using Trang[4] from the Relax NG schemas;
  • MYNG GUI[5] and MYNG engine[6]. MYNG is an acronym for "Modular sYNtax confiGurator", or "Modularize Your NG", and may be pronounced either "ming" or "my N G";
  • Schema docs[7];
  • Mappings from the "relaxed" Version 1.01 syntax to the "normalized" Version 1.01 syntax as given by XSLT stylesheets in the Normalizer directory[8].

The scope of this specification does not cover DTDs. Note that while the DTD[9] specification of RuleML has not been maintained since RuleML 0.85[10], the DTDs of these earlier versions of RuleML will continue to be available as an archive[11]. Tools capable of converting Relax NG or XML schemas into DTDs such as XMLSpy[12] are always available. Also excluded from the scope are tools that make use of RuleML languages, such as editors or engines. For a listing of tools for working with RuleML, see the Implementations page.

Note that while the DTD[9] specification of RuleML has not been maintained since RuleML 0.85[10], the DTDs of these earlier versions of RuleML will continue to be available as an archive[11]. Tools capable of converting Relax NG or XML schemas into DTDs such as XMLSpy[12] are always available.

1 Overview

An introduction to RuleML is given in our Primer. Also, the paper Overarching discusses the upper layer of the RuleML hierarchy of rules. In that terminology, the system of RuleML 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.

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).

A comprehensive Glossary accompanies this specification.

The grammar of Deliberation RuleML 1.01 is partially described by the RuleML grammar Relax NG Schemas, with the exception of some restrictions that cannot easily be captured in a Relax NG schema.

Below is a summary of the changes in Version 1.01 relative to Version 1.0. Readers who already know Version 1.0 may want to refer to the Changes section. It should be helpful for all readers to visit the Demo of MYNG 1.01 page.

1.1 Unary Term Sequences

Relax NG modules are added to MYNG customization to allow more flexibility in the length of term sequences. In particular, a unary sequences modules was created, which can be used on its own or together with the binary sequences modules. These options were integrated into MYNG, but no new names were coined for these sublanguages.

1.2 Minimal Datalog-like Sublanguages

Two anchor sublanguages, called datalogplus_min and disdatalogplus_min, are introduced in Version 1.01. These sublanguages include the essential Datalog expressivity: positive facts and universally quantified implications but do not include many RuleML "extras", such as slots, oids, fuzzy logic, etc.

In addition, datalogplus_min allows:

  • Existentials in the heads of implications;
  • Equations throughout the language, including in the heads of implications;
  • Falsity in the heads of implications (as an empty disjunction);
  • Conjunctions in the heads of implications, including within existentials.

The sublanguage disdatalogplus_min allows all of the above as well as:

  • Non-empty disjunction in the heads of implications, arbitrarily nested with existentials and conjunctions.

1.3 Datalog-like Sublanguages Expanded to "mid" Level

An additional two anchor sublanguages, called datalogplus_mid and disdatalogplus_mid, are introduced in Version 1.01. In addition to the expressivity of datalogplus_min and disdatalogplus_min, resp., these sublanguages have inference direction, non-material implication, oriented equations, term typing (sorts), skolem and reified constants, as well as annotation syntax.

1.4 Datalog Plus Options in MYNG

To accommodate the new sublanguages described above, several modification have been made to the MYNG GUI. These changes are illustrated with the following "before"/"after" snapshots.

1.4.1 Expressivity Facet

1.4.2 Term Sequences Facet

1.4.3 Implication Options Facet

2 Examples

Numerous sample RuleML documents have been prepared and maintained in the Examples directory. Some exemplify features of RuleML and are useful didactically (e.g., own.ruleml) while others are mostly for testing purposes. The following examples are new:

Examples from previous versions of RuleML are also maintained, e.g. 1.0 examples). Deliberation RuleML 1.01 is backward compatible, so all Version 1.0 examples are also valid with respect to the Version 1.01 schemas.

3 XSLT-Based Upgrader

Deliberation RuleML Version 1.01 is backward compatible with Version 1.0. Therefore, no Upgrader is needed.

4 XSLT-Based Normalizer

RuleML has always allowed abbreviated encoding (skipped edge tags and default attribute values) and some freedom in the ordering of elements. From Version 1.0 and up, Relax NG schemas allow 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.

XSLT stylesheets have been developed (see the Version 1.01 Normalizer directory) for normalizing the syntax used in a given Version 1.01 instance, undoing the abbreviated encoding and re-ordering of elements. A (new for Version 1.01) example of the normal form is the expanded version of the Datalog+ example.

The goals of the RuleML normalizers include the following:

  • Reconstruct all skipped edge tags to produce a fully striped form;
  • Perform canonical child ordering of sub-elements;
  • Make all attributes with default values (that are appropriate for the sublanguage) explicit.

We say that using this normalizer followed by schema-based RuleML validation performs "normalidation" on RuleML instances. That is, not only are children reordered and missing edge elements and attributes with default values inserted into the Version 1.01 instance to create its normal form, but this transformed instance is subsequently validated syntactically to ensure that Node and edge elements only appear in correct positions. Normalidation is required when using the XSD schemas for validation, because the positional independence allowed by the Relax NG schemas is beyond the expressivity of XSD.

The following is a list of the operations the Version 1.01 XSLT 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 in Version 1.01 (validation is the second step of the "Normalidation" process); therefore no assumptions are made about the names or number of child elements in the instance being transformed.

  • <Implies>, <Entails>
    • When <if>-<then> edge elements are both missing, wrap the first "naked Node" (a Node element that has a Node parent element) child within an <if> edge element, and the second naked Node child within a <then> edge element.
    • If exactly one of the <if>-<then> edge elements is missing, wrap the naked Node element within the missing edge element.
    • Re-order the elements as <oid>, then <if>, followed by <then>, followed by any other children.
  • <Expr>
    • Wrap each naked <Fun> child (if any) with an <op> edge element.
    • Wrap each remaining naked Node (if any) into <arg> edge elements (with an index attribute). The naked Node children that may occur within this element in a valid Version 1.01 instance are: <Ind>, <Data>, <Var>, <Fun>, <Plex>, <Reify>, or <Skolem>.
    • Re-order the child elements as <oid>, followed by <op>, followed by positional arguments (<arg>, then <repo>), followed by slotted arguments (<slot>, then <resl>), followed by any other children.
  • <Atom>
    • Wrap each naked <Rel> child (if any) with an <op>.
    • Wrap each remaining naked Node (if any) into <arg> edge elements (with an index attribute). The naked Node children that may occur within this element in a valid Version 1.01 instance are: <Ind>, <Data>, <Var>, <Fun>, <Plex>, <Reify>, or <Skolem>.
    • Re-order the child elements as <oid>, followed by <degree>, followed by <op>, followed by positional arguments (<arg>, then <repo>), followed by slotted arguments (<slot>, then <resl>), followed by any other children.
  • <Uniterm>
    • If there is no <op> element, wrap the first child that is not <oid> or <degree> within an <op> element.
    • Wrap each remaining naked Node (if any) into <arg> edge elements (with an index attribute). The naked Node children that may occur within this element in a valid Version 1.01 instance are: <Const>, <Var>, <Reify>, <Uniterm>, or <Skolem>.
    • Re-order the child elements as <oid>, followed by <degree>, followed by <op>, followed by positional arguments (<arg>, then <repo>), followed by slotted arguments (<slot>, then <resl>), followed by any other children.
  • <Assert>, <Retract>, <Query>, <And>, <Or>
    • Wrap each naked child Node (if any) with a <formula> edge element.
  • <Forall>, <Exists>
    • Wrap each naked <Var> child Node (if any) with a <declare> edge element.
    • Wrap any other naked child Nodes with <formula> edge element.
    • Re-order the child elements as <oid>, followed by <declare>, followed by <formula>, followed by any other children.
  • <RuleML>
    • Wrap each naked child Node (if any) with an <act> edge element.
    • Re-order the child elements as <oid>, followed by <act>, followed by any other children.
  • <Neg>
    • Wrap each naked child Node (if any) with a <strong> edge element.
    • Re-order the child elements as <oid>, followed by <strong>, followed by any other children.
  • <Naf>
    • Wrap each naked child Node (if any) with a <weak> edge element.
    • Re-order the child elements as <oid>, followed by <weak>, followed by any other children.
  • <Equivalent>
    • Wrap each naked child Node (if any) with a <torso> edge element.
    • Re-order the child elements as <oid>, followed by <torso>, followed by any other children.
  • <Equal>
    • If there are two naked child Nodes, wrap first naked Node child with a <left> element and second naked Node child with <right> element.
    • Partial completion is also accepted. Example: if the first child has a <left> edge element, and the second child has no <left> or <right> edge element, then wrap the second child with the <right> edge element.
    • Re-order the child elements as <oid>, followed by <degree>, followed by <left>, followed by <right>, followed by any other children.

For example, the compact version of the Datalog+ example (with a focus on the manager/department rule):

 <?xml version="1.0" encoding="UTF-8"?>
  <?xml-model href="http://deliberation.ruleml.org/1.01/relaxng/datalogplus_min_relaxed.rnc"?>
  <RuleML xmlns="http://ruleml.org/spec">
      ...
    <Assert>
      <!-- Existential Rules -->
      <!-- Every manager directs at least one department. -->
      <Forall>
        <Var>M</Var>
        <Implies>
          <if>
            <Atom>
              <Rel>manager</Rel>
              <Var>M</Var>
            </Atom>
          </if>
          <then>
            <Exists>
              <Var>P</Var>
              <Atom>
                <Rel>directs</Rel>
                <Var>M</Var>
                <Var>P</Var>
              </Atom>
            </Exists>
          </then>
        </Implies>
      </Forall>
    </Assert>  
      ...
  </RuleML>

should be normalized to the expanded version:

 <?xml version="1.0" encoding="UTF-8"?>
  <?xml-model href="http://deliberation.ruleml.org/1.01/relaxng/datalogplus_min_normal.rnc"?>
  <RuleML xmlns="http://ruleml.org/spec">
        ...
    <act index="17">
      <Assert mapMaterial="yes" mapDirection="bidirectional">
        <!-- Existential Rules -->
        <!-- Every manager directs at least one department. -->
        <formula>
          <Forall>
            <declare>
              <Var>M</Var>
            </declare>
            <formula>
              <Implies material="yes" direction="bidirectional">
                <if>
                  <Atom>
                    <op><Rel>manager</Rel></op>
                    <arg index="1"><Var>M</Var></arg>
                  </Atom>
                </if>
                <then>
                  <Exists>
                    <declare>
                      <Var>P</Var>
                    </declare>
                    <formula>
                      <Atom>
                        <op><Rel>directs</Rel></op>
                        <arg index="1"><Var>M</Var></arg>
                        <arg index="2"><Var>P</Var></arg>
                      </Atom>
                    </formula>
                  </Exists>
                </then>
              </Implies>
            </formula>
          </Forall>
        </formula>
      </Assert>
    </act>
        ...
  </RuleML>

Due to differences in attributes with default values (which are made explicit in the normal form), in Versions 1.0 and 1.01 there has been a need for multiple Deliberation RuleML Normalizer XSLT stylesheets, each appropriate for a group of sublanguages. This need is met in Version 1.01 as follows:

  • 101_naffologeq_normalizer.xslt for sublanguages with FOL expressivity and equality (e.g. fologeq);
  • 101_naffolog_normalizer.xslt for sublanguages with FOL expressivity but no equality (e.g. folog);
  • 101_nafneghornlogeq_normalizer.xslt [abridging the more precise name nafnegdishornlogplus_relaxed.xslt which would correspond to the existing schema nafnegdishornlogplus_relaxed.rnc] for sublanguages with less than FOL expressivity and equality (e.g. hornlogeq);
  • 101_nafneghornlog_normalizer.xslt [abridging the more precise name nafnegdishornlogexcon_relaxed.xslt which would correspond to the existing schema nafnegdishornlogexcon_relaxed.rnc] for all other sublanguages (e.g. hornlog).

These stylesheets are identical except for the Phase III templates that make the attributes with default values explicit.

XSLT processing using the RuleML Normalizer is accomplished in the usual way. Instructions for the W3C web-based process can be found in Appendix 4.

Earlier versions of the RuleML Normalizer are maintained: see RON, as well as the more recent RuleML Version 1.0 Normalizer directory.

5 Glossary

The Glossary for Version 1.01 contains descriptions for every element in Version 1.01.

6 Attribute Mapping

As in previous versions of RuleML, there are several pairs of attributes in Version 1.01 that have names which differ only by a 'map' prefix: @closure and @mapClosure, @direction and @mapDirection, and @material and @mapMaterial. The naming convention reflects attribute 'mapping' through XML trees, where

<NodeName mapAttribute="...">
  <C1>. . .</C1>
  . . .
  <CN>. . .</CN>
</NodeName>

basically acts like

<NodeName>
  <NodeChildName1 attribute="...">. . .</NodeChildName1>
  . . .
  <NodeChildNameN attribute="...">. . .</NodeChildNameN>
</NodeName>

or

<NodeName>
  <edgeName1>
    <NodeChildName1 attribute="...">. . .</NodeChildName1>
  </edgeName1>
  . . .
  <edgeNameN>
    <NodeChildNameN attribute="...">. . .</NodeChildNameN>
  </edgeNameN>
</NodeName>

Whenever a map attribute is present on a (grand)parent that is in conflict with the corresponding attribute of a (grand)child element,

  1. the default value, if there is one, yields precedence to any non-default value;
  2. if both values are non-default, the descendant element takes precedence.

The former situation arises in the normal form, where all attributes with default values must be explicit.

7 Modularization

The Deliberation RuleML Relax NG schemas use a modularization approach based on lattices. The details are given in the publication about the re-engineering of RuleML in Relax NG and the RuleML MYNG Wiki page. MYNG is accessible through a GUI or, for advanced users, a PHP script.

The XSD schemas for Deliberation RuleML 1.01 are derived from the Relax NG schemas using Jing/Trang, and are not themselves modular. These monolithic XSD schemas have advantages over previous versions in that they are compatible with most XML IDEs (e.g. editors) and they validate with respect to JAXB.

8 Acknowledgements

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, Benjamin Grosof, David Hirtle, Michael Kifer, Alex Kozlenkov, Jae Kyu Lee, François Lévy, Monika Machunik, Frank Olken, Jeff Z. Pan, Steve Ross-Talbot, Omair Shafiq, Michael Sintek, Bruce Spencer, Giorgos Stamou, Suzette Stoutenburg, Said Tabet, Le Thi Thu Thuy, and Gerd Wagner.

9 Appendices

9.1 Appendix 1: Datalog+ Example Rulebase in RuleML

Source: http://deliberation.ruleml.org/1.01/exa/DatalogPlus/datalogplus_min.ruleml

<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="http://deliberation.ruleml.org/1.01/relaxng/datalogplus_min_relaxed.rnc"?>
<RuleML xmlns="http://ruleml.org/spec">
  <!-- Some of these examples are from
    "A general Datalog-based framework for tractable query answering 
    over ontologies",
    Andrea Calì,
    Georg Gottlob
    Thomas Lukasiewicz  
    http://dx.doi.org/10.1016/j.websem.2012.03.001
  	(preprint at http://www.websemanticsjournal.org/index.php/ps/article/view/289)
    -->

  <!-- This RuleML Document incrementally asserts into, retracts from and 
       queries a rulebase (within the <RuleML> element) for a total of
       28 transactions: 13 Asserts, 2 Retracts and 13 Queries.
       Each Query demonstrates the semantics of the previous Assert or Retract
       by providing (in the XML comments) the expected answer to the Query.
    -->
  <Assert>
    <!-- Equations are allowed as facts:
         William is an employee.
         "Bill" is an alias for "William".
      -->
    <Atom>
      <Rel>employee</Rel>
      <Ind>William</Ind>
    </Atom>
    <Equal>
      <Ind>Bill</Ind>
      <Ind>William</Ind>
    </Equal>
  </Assert>
  <Query>
    <!-- 
        Who are the employees?
        Answers: 
        x: <Ind>Bill</Ind>
        x: <Ind>William</Ind>
      -->
    <Atom>
      <Rel>employee</Rel>
      <Var>x</Var>
    </Atom>
  </Query>
  
  <Assert>
    <!-- Equations may be universally quantified.
         This fact is a degenerate case, corresponding to the body of an implication being empty.
         The following makes the reflexive property of equality explicit (as built into most systems):
         Everything is equal to itself.
      -->
    <Forall>
      <Var>x</Var>
      <Equal>
        <Var>x</Var>
        <Var>x</Var>
      </Equal>
    </Forall>
  </Assert>
  <Query>
    <!--
        What is equal to itself?
        Answers:
        x: <Ind>Bill</Ind>
        x: <Ind>William</Ind>
      -->
    <Equal>
      <Var>x</Var>
      <Var>x</Var>
    </Equal>
  </Query>

  <Assert>
    <!-- Non-ground facts are allowed. 
         John is the CEO.
         John is responsible for everything.
      -->
    <Atom>
      <Rel>CEO</Rel>
      <Ind>John</Ind>
    </Atom>
    <Forall>
      <Var>x</Var>
      <Atom>
        <Rel>responsible_for</Rel>
        <Ind>John</Ind>
        <Var>x</Var>
      </Atom>
    </Forall>
  </Assert>
  <Query>
    <!-- 
        Is John responsible for Bill?
        Answers:
        Succeeds.
      -->
    <Atom>
      <Rel>responsible_for</Rel>
      <Ind>John</Ind>
      <Ind>Bill</Ind>
    </Atom>
  </Query>
  
  <Assert>
    <!-- Rules are expressed as universally-quantified implications.
         A simple rule can be used to assert a subclass relationship:
         Every manager is an employee.         
      -->
    <Forall>
      <Var>x</Var>
      <Implies>
        <if>
          <Atom>
            <Rel>manager</Rel>
            <Var>x</Var>
          </Atom>
        </if>
        <then>
          <Atom>
            <Rel>employee</Rel>
            <Var>x</Var>
          </Atom>
        </then>
      </Implies>
    </Forall>
    <Atom>
      <Rel>manger</Rel>
      <Ind>John</Ind>
    </Atom>
  </Assert>
  <Query>
    <!-- 
        Who are the employees?
        Answers: 
        x: <Ind>Bill</Ind>
        x: <Ind>William</Ind>
        x: <Ind>John</Ind>
      -->
    <Atom>
      <Rel>employee</Rel>
      <Var>x</Var>
    </Atom>
  </Query>
  
  <Assert>
    <!-- Equations are allowed in the body of (existential) implications. 
         If anyone is the same as Margaret, then they supervise someone.
         (Note that this rule could be semantically simplified 
         to an existential fact relying on axioms of equality.)
      -->
    <Forall>
      <Var>x</Var>
      <Implies>
        <if>
          <Equal>
            <Ind>Margaret</Ind>
            <Var>x</Var>
          </Equal>
        </if>
        <then>
          <Exists>
            <Var>y</Var>
            <Atom>
              <Rel>supervises</Rel>
              <Var>x</Var>
              <Var>y</Var>
            </Atom>
          </Exists>
        </then>
      </Implies>
    </Forall>
  </Assert>
  <Query>
    <!-- 
        Does Margaret supervise someone?
        Answer:
        Succeeds      
      -->
    <Exists>
      <Var>y</Var>
      <Atom>
        <Rel>supervises</Rel>
        <Ind>Margaret</Ind>
        <Var>y</Var>
      </Atom>
    </Exists>
  </Query>

  <Assert>
    <!-- Pairwise Disjoint Classes
         Nothing is both an employee and a department.
      -->
    <Forall>
      <Var>x</Var>
      <Implies>
        <if>
          <And>
            <Atom>
              <Rel>employee</Rel>
              <Var>x</Var>
            </Atom>
            <Atom>
              <Rel>department</Rel>
              <Var>x</Var>
            </Atom>
          </And>
        </if>
        <then>
          <Or/>
        </then>
      </Implies>
    </Forall>
  </Assert>
  <Assert>
    <!-- HR is an employee.
         HR is a department.
         These facts together with the previous rule create an inconsistency.
      -->
    <Atom>
      <Rel>employee</Rel>
      <Ind>HR</Ind>
    </Atom>
    <Atom>
      <Rel>department</Rel>
      <Ind>HR</Ind>
    </Atom>
  </Assert>
  <Query>
    <!-- Is there any inconsistency?
        Succeeds, indicating inconsistency. 
      -->
    <Or/>
  </Query>
  <Retract>
    <!-- Remove that HR is an employee. -->
    <Atom>
      <Rel>employee</Rel>
      <Ind>HR</Ind>
    </Atom>
  </Retract>
  <Query>
    <!-- Is there any inconsistency?
        Fails, indicating consistency. 
      -->
    <Or/>
  </Query>
  <Assert>
    <!-- Functionality Constraint: 
        Everyone (or everything) has at most one supervisor. 
      -->
    <Forall>
      <Var>x</Var>
      <Var>y</Var>
      <Var>z</Var>
      <Implies>
        <if>
          <And>
            <Atom>
              <Rel>supervises</Rel>
              <Var>x</Var>
              <Var>z</Var>
            </Atom>
            <Atom>
              <Rel>supervises</Rel>
              <Var>y</Var>
              <Var>z</Var>
            </Atom>
          </And>
        </if>
        <then>
          <Equal>
            <Var>x</Var>
            <Var>y</Var>
          </Equal>
        </then>
      </Implies>
    </Forall>
    <Atom>
      <Rel>supervises</Rel>
      <Ind>Margaret</Ind>
      <Ind>Bill</Ind>
    </Atom>
    <Atom>
      <Rel>supervises</Rel>
      <Ind>Peggy</Ind>
      <Ind>Bill</Ind>
    </Atom>
  </Assert>
  <Query>
    <!-- 
        Is Peggy the same as Margaret?
        Answer:
        Succeeds.
      -->
    <Equal>
      <Ind>Peggy</Ind>
      <Ind>Margaret</Ind>
    </Equal>
  </Query>

  <Assert>
    <!-- Negative Constraints are allowed.
         No one (or no thing) is their own supervisor. 
      -->
    <Forall>
      <Var>x</Var>
      <Implies>
        <if>
          <Atom>
            <Rel>supervises</Rel>
            <Var>x</Var>
            <Var>x</Var>
          </Atom>
        </if>
        <then>
          <Or/>
        </then>
      </Implies>
    </Forall>
  </Assert>
  <Assert>
    <!-- Margaret supervises Peggy. -->
    <Atom>
      <Rel>supervises</Rel>
      <Ind>Margaret</Ind>
      <Ind>Peggy</Ind>
    </Atom>
  </Assert>
  <Query>
    <!-- Is there any inconsistency?
        Succeeds, indicating inconsistency. -->
    <Or/>
  </Query>
  <Retract>
    <!-- Remove that Margaret supervises Peggy. -->
    <Atom>
      <Rel>supervises</Rel>
      <Ind>Margaret</Ind>
      <Ind>Peggy</Ind>
    </Atom>
  </Retract>
  <Query>
    <!-- Is there any inconsistency?
        Fails, indicating consistency. -->
    <Or/>
  </Query>
  <Assert>
    <!-- Equations may appear in the body of negative constraints.
         The simplest case is the assertion that two individuals
         are different (as built into systems making the unique name assumption).
      -->
    <Implies>
      <if>
        <Equal>
          <Ind>Sue</Ind>
          <Ind>Maria</Ind>
        </Equal>
      </if>
      <then>
        <Or/>
      </then>
    </Implies>
  </Assert>
  <Query>
    <!-- 
        Is Sue the same as Maria?
        Answer:
        Fails.
      -->
    <Equal>
      <Ind>Sue</Ind>
      <Ind>Maria</Ind>
    </Equal>
  </Query>

  <Assert>
    <!-- Existential Rules -->
    <!-- Every manager directs at least one department.
         Maria is a manager.
      -->
    <Forall>
      <Var>M</Var>
      <Implies>
        <if>
          <Atom>
            <Rel>manager</Rel>
            <Var>M</Var>
          </Atom>
        </if>
        <then>
          <Exists>
            <Var>P</Var>
            <Atom>
              <Rel>directs</Rel>
              <Var>M</Var>
              <Var>P</Var>
            </Atom>
          </Exists>
        </then>
      </Implies>
    </Forall>
    <Atom>
      <Rel>manager</Rel>
      <Ind>Maria</Ind>
    </Atom>
  </Assert>
  <Query>
    <!-- 
        Does Maria direct a department?
        Answer:
        Succeeds.
      -->
    <Exists>
      <Var>P</Var>
      <Atom>
        <Rel>directs</Rel>
        <Ind>Maria</Ind>
        <Var>P</Var>
      </Atom>
    </Exists>
  </Query>

  <Assert>
    <!-- The heads and bodies of existential rules can contain conjunctions.
         Every employee who directs a department is a manager, and supervises at 
         least another employee who works in the same department.
      -->
    <Forall>
      <Var>E</Var>
      <Var>P</Var>
      <Implies>
        <if>
          <And>
            <Atom>
              <Rel>employee</Rel>
              <Var>E</Var>
            </Atom>
            <Atom>
              <Rel>directs</Rel>
              <Var>E</Var>
              <Var>P</Var>
            </Atom>
          </And>
        </if>
        <then>
          <Exists>
            <Var>E'</Var>
            <And>
              <Atom>
                <Rel>manager</Rel>
                <Var>E</Var>
              </Atom>
              <Atom>
                <Rel>supervises</Rel>
                <Var>E</Var>
                <Var>E'</Var>
              </Atom>
              <Atom>
                <Rel>works_in</Rel>
                <Var>E'</Var>
                <Var>P</Var>
              </Atom>
            </And>
          </Exists>
        </then>
      </Implies>
    </Forall>
  </Assert>
  <Query>
    <!-- 
        Does Maria supervise someone?
        Answer:
        Succeeds.
      -->
    <Exists>
      <Var>E'</Var>
      <Atom>
        <Rel>supervises</Rel>
        <Ind>Maria</Ind>
        <Var>E'</Var>
      </Atom>
    </Exists>
  </Query>
</RuleML>

9.2 Appendix 2: XSD for the Minimal Disjunctive Datalog+ Sublanguage (disdatalog_min) of RuleML

Below is the XSD schema for the normalized serialization of the minimal Disjunctive Datalog+ sublanguage of RuleML. This schema is automatically generated from the corresponding Relax NG schema http://deliberation.ruleml.org/1.01/relaxng/disdatalogplus_min_normal.rnc by Jing/Trang conversion and XSLT post-processing, as described in the Modularization section of the specification.

Since the schema defines only the normal form of this sublanguage, make sure instance documents are normalized before trying to validate them. The standard way of doing this is normalidation: applying the XSLT normalizer first, and only then validating with respect to the below schema.

The (new in Version 1.01) constraints on Datalog+ require us to use different content models (XSD types) for some elements, e.g. "And", depending on whether the element appears in the premises or conclusion of an implication. If stripe-skipping were permitted for the "if" and "then" edges, the content model for an "Implies" would allow a sequence of elements with the same name but different types. This is not allowed in XSD -- therefore, only the (fully striped) normal form can be validated.

Source: http://deliberation.ruleml.org/1.01/xsd/disdatalogplus_min_normal.xsd

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:spec="http://ruleml.org/spec"
  elementFormDefault="qualified" targetNamespace="http://ruleml.org/spec">
  <xs:element name="RuleML">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="spec:act"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="Assert">
    <xs:complexType>
      <xs:group minOccurs="0" maxOccurs="unbounded" ref="spec:formula"/>
      <xs:attribute name="mapMaterial" use="required">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="yes"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="mapDirection" use="required">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="bidirectional"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
  <xs:element name="Retract">
    <xs:complexType>
      <xs:group minOccurs="0" maxOccurs="unbounded" ref="spec:formula"/>
      <xs:attribute name="mapMaterial" use="required">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="yes"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="mapDirection" use="required">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="bidirectional"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
  <xs:element name="Query">
    <xs:complexType>
      <xs:group minOccurs="0" maxOccurs="unbounded" ref="spec:formula_2"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="Atom">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="spec:op"/>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="spec:arg"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="Rel">
    <xs:complexType mixed="true">
      <xs:attribute name="iri" type="xs:anyURI"/>
    </xs:complexType>
  </xs:element>
  <xs:group name="And">
    <xs:sequence>
      <xs:element name="And">
        <xs:complexType>
          <xs:group minOccurs="0" maxOccurs="unbounded" ref="spec:formula_3"/>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:group>
  <xs:group name="Or">
    <xs:sequence>
      <xs:element name="Or">
        <xs:complexType>
          <xs:group minOccurs="0" maxOccurs="unbounded" ref="spec:formula_4"/>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:group>
  <xs:element name="Implies">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="spec:if"/>
        <xs:element ref="spec:then"/>
      </xs:sequence>
      <xs:attribute name="direction" use="required">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="bidirectional"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="material" use="required">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="yes"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
  <xs:element name="Forall">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="spec:declare"/>
        <xs:group ref="spec:formula_5"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:group name="Exists">
    <xs:sequence>
      <xs:element name="Exists">
        <xs:complexType>
          <xs:sequence>
            <xs:element maxOccurs="unbounded" ref="spec:declare"/>
            <xs:group ref="spec:formula_6"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:group>
  <xs:element name="Equal">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="spec:left"/>
        <xs:element ref="spec:right"/>
      </xs:sequence>
      <xs:attribute name="oriented" use="required">
        <xs:simpleType>
          <xs:restriction base="xs:token">
            <xs:enumeration value="no"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
  <xs:element name="Data" type="xs:anyType"/>
  <xs:element name="Ind">
    <xs:complexType mixed="true">
      <xs:attribute name="iri" type="xs:anyURI"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="Var" type="xs:string"/>
  <xs:group name="formula">
    <xs:sequence>
      <xs:element name="formula">
        <xs:complexType>
          <xs:choice>
            <xs:element ref="spec:Atom"/>
            <xs:element ref="spec:Equal"/>
            <xs:element ref="spec:Implies"/>
            <xs:element ref="spec:Forall"/>
          </xs:choice>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:group>
  <xs:group name="formula_2">
    <xs:sequence>
      <xs:element name="formula">
        <xs:complexType>
          <xs:choice>
            <xs:element ref="spec:Atom"/>
            <xs:element ref="spec:Equal"/>
            <xs:group ref="spec:And"/>
            <xs:group ref="spec:Or"/>
            <xs:group ref="spec:Exists"/>
          </xs:choice>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:group>
  <xs:element name="op">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="spec:Rel"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:group name="formula_3">
    <xs:sequence>
      <xs:element name="formula">
        <xs:complexType>
          <xs:choice>
            <xs:element ref="spec:Atom"/>
            <xs:element ref="spec:Equal"/>
            <xs:group ref="spec:And_2"/>
            <xs:group ref="spec:Or_2"/>
          </xs:choice>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:group>
  <xs:group name="formula_4">
    <xs:sequence>
      <xs:element name="formula">
        <xs:complexType>
          <xs:choice>
            <xs:element ref="spec:Atom"/>
            <xs:element ref="spec:Equal"/>
            <xs:group ref="spec:And_2"/>
            <xs:group ref="spec:Or_2"/>
          </xs:choice>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:group>
  <xs:element name="then">
    <xs:complexType>
      <xs:choice>
        <xs:element ref="spec:Atom"/>
        <xs:element ref="spec:Equal"/>
        <xs:group ref="spec:And_3"/>
        <xs:group ref="spec:Or_3"/>
        <xs:group ref="spec:Exists_2"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
  <xs:element name="if">
    <xs:complexType>
      <xs:choice>
        <xs:element ref="spec:Atom"/>
        <xs:element ref="spec:Equal"/>
        <xs:group ref="spec:And_2"/>
        <xs:group ref="spec:Or_2"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
  <xs:element name="declare">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="spec:Var"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:group name="formula_5">
    <xs:sequence>
      <xs:element name="formula">
        <xs:complexType>
          <xs:choice>
            <xs:element ref="spec:Atom"/>
            <xs:element ref="spec:Equal"/>
            <xs:element ref="spec:Implies"/>
            <xs:element ref="spec:Forall"/>
          </xs:choice>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:group>
  <xs:group name="formula_6">
    <xs:sequence>
      <xs:element name="formula">
        <xs:complexType>
          <xs:choice>
            <xs:element ref="spec:Atom"/>
            <xs:element ref="spec:Equal"/>
            <xs:group ref="spec:And_2"/>
            <xs:group ref="spec:Or_2"/>
            <xs:group ref="spec:Exists"/>
          </xs:choice>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:group>
  <xs:element name="left">
    <xs:complexType>
      <xs:choice>
        <xs:element ref="spec:Ind"/>
        <xs:element ref="spec:Data"/>
        <xs:element ref="spec:Var"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
  <xs:element name="right">
    <xs:complexType>
      <xs:choice>
        <xs:element ref="spec:Ind"/>
        <xs:element ref="spec:Data"/>
        <xs:element ref="spec:Var"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
  <xs:element name="arg">
    <xs:complexType>
      <xs:choice>
        <xs:element ref="spec:Ind"/>
        <xs:element ref="spec:Data"/>
        <xs:element ref="spec:Var"/>
      </xs:choice>
      <xs:attribute name="index" use="required" type="xs:positiveInteger"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="act">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="spec:Assert"/>
        <xs:element ref="spec:Retract"/>
        <xs:element ref="spec:Query"/>
      </xs:choice>
      <xs:attribute name="index" use="required" type="xs:positiveInteger"/>
    </xs:complexType>
  </xs:element>

  <xs:group name="And_2">
    <xs:sequence>
      <xs:element name="And">
        <xs:complexType>
          <xs:group minOccurs="0" maxOccurs="unbounded" ref="spec:formula_3"/>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:group>
  <xs:group name="Or_2">
    <xs:sequence>
      <xs:element name="Or">
        <xs:complexType>
          <xs:group minOccurs="0" maxOccurs="unbounded" ref="spec:formula_4"/>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:group>
  <xs:group name="And_3">
    <xs:sequence>
      <xs:element name="And">
        <xs:complexType>
          <xs:group minOccurs="0" maxOccurs="unbounded" ref="spec:formula_7"/>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:group>
  <xs:group name="Or_3">
    <xs:sequence>
      <xs:element name="Or">
        <xs:complexType>
          <xs:group minOccurs="0" maxOccurs="unbounded" ref="spec:formula_8"/>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:group>
  <xs:group name="Exists_2">
    <xs:sequence>
      <xs:element name="Exists">
        <xs:complexType>
          <xs:sequence>
            <xs:element maxOccurs="unbounded" ref="spec:declare"/>
            <xs:group ref="spec:formula_9"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:group>
  <xs:group name="formula_7">
    <xs:sequence>
      <xs:element name="formula">
        <xs:complexType>
          <xs:choice>
            <xs:element ref="spec:Atom"/>
            <xs:group ref="spec:And_3"/>
            <xs:group ref="spec:Or_3"/>
            <xs:group ref="spec:Exists_2"/>
          </xs:choice>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:group>
  <xs:group name="formula_8">
    <xs:sequence>
      <xs:element name="formula">
        <xs:complexType>
          <xs:choice>
            <xs:element ref="spec:Atom"/>
            <xs:group ref="spec:And_3"/>
            <xs:group ref="spec:Or_3"/>
            <xs:group ref="spec:Exists_2"/>
          </xs:choice>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:group>
  <xs:group name="formula_9">
    <xs:sequence>
      <xs:element name="formula">
        <xs:complexType>
          <xs:choice>
            <xs:element ref="spec:Atom"/>
            <xs:group ref="spec:And_3"/>
            <xs:group ref="spec:Or_3"/>
            <xs:group ref="spec:Exists_2"/>
          </xs:choice>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:group>
</xs:schema>

9.3 Appendix 3: Instructions on Validating the Example Online with XSD

  1. Direct your browser to http://www.validome.org/xml/validate/
  2. Enter the following:
    1. Source: a URL such as http://deliberation.ruleml.org/1.01/exa/DatalogPlus/datalogplus_min_normal.ruleml, or upload a local RuleML file, or paste the Sourcecode into the text area.
      1. Note: the RuleML file must contain an xsi:schemaLocation attribute referencing a RuleML XSD schema such as http://deliberation.ruleml.org/1.01/xsd/datalogplus_min_normal.xsd
    2. Check the View Sourcecode checkbox.
    3. Click Validate.

9.4 Appendix 4: Normalizing or Upgrading RuleML Files with XSLT

  1. Go to the W3C XSLT Service at http://www.w3.org/2005/08/online_xslt/
  2. Enter URLs for the XSL resource and the XML resource according to the following cases:
    1. Normalization
      1. For the xml resource (the second field) enter the URL for a RuleML Version 1.0 or 1.01 file, e.g.
        1. http://deliberation.ruleml.org/1.01/exa/Hornlog/hornlog/authenticate.ruleml
        2. http://deliberation.ruleml.org/1.01/exa/Hornlog/hornlogeq/ackermann-typecond.ruleml
        3. http://deliberation.ruleml.org/1.01/exa/Folog/constraint.ruleml
        4. http://deliberation.ruleml.org/1.01/exa/FOLPlus/fologeq/fologeq.ruleml
      2. For the xsl resource (the first field) insert the URL as appropriate:
        1. If the RuleML file validates against the myng-b1f-d7-a7-l1-p3ff-i7f-tf0f-q7-e3-sf (relaxed serialization Disjunctive Hornlog with Existential Rules, Naf and Neg) Relax NG schema,
          enter the RuleML 1.01 nafneghornlog Normalizer XSLT
          (http://deliberation.ruleml.org/1.01/xslt/normalizer/101_nafneghornlog_normalizer.xslt)
        2. If the RuleML file validates against the myng-b1f-d7-a7-l1-p3ff-i7f-tf3f-q7-ef-sf (relaxed serialization Disjunctive Hornlog+ with Naf and Neg) Relax NG schema,
          enter the RuleML 1.01 nafneghornlogeq Normalizer XSLT
          (http://deliberation.ruleml.org/1.01/xslt/normalizer/101_nafneghornlogeq_normalizer.xslt)
        3. If the RuleML file validates against the naffolog_relaxed Relax NG schema,
          enter the RuleML 1.01 naffolog Normalizer XSLT
          (http://deliberation.ruleml.org/1.01/xslt/normalizer/101_naffolog_normalizer.xslt)
        4. Otherwise,
          enter the RuleML 1.01 naffologeq Normalizer XSLT
          (http://deliberation.ruleml.org/1.01/xslt/normalizer/101_naffologeq_normalizer.xslt)
    2. Upgrading
      1. From Version 1.0: No change is required for RuleML files in Version 1.0. Optionally, version information in xml-model processing instructions or xsi:schemaLocation attributes may be changed in individual files or in batch mode with the find/replace tool of any plain text editor.
      2. From Verion 0.91:
        1. For the xsl resource, insert the URL for the RuleML 0.91-1.0 Upgrader XSLT (http://ruleml.org/1.0/xslt/upgrader/091-to-100.xslt).
        2. For the xml resource, use a RuleML version 0.91 file, e.g. http://ruleml.org/0.91/exa/Datalog/own.ruleml.
  3. Once both URLs have been entered, click transform. To see the result, in some browsers you need to do "View | Page Source".

9.5 Appendix 5: Validating an Instance Against a Relax NG Schema

Validator.nu is an easy-to-use online tool for validating an XML instance against a Relax NG schema. A basic procedure for using this tool is as follows:

  1. Open the Validator.nu webpage in your browser.
  2. Choose how you want to enter the instance:
    • Address -- type or paste a URL into the adjacent text field;
    • File Upload -- use the browse dialog to locate the file on your local hard drive or network;
    • Text Field -- type or paste text directly into the text area.
  3. Skip the Encoding field
  4. Type or paste a URL to the schema you wish to validate against. Only schemas available from the internet can be used. For example, the URL http://deliberation.ruleml.org/1.01/relaxng/schema_rnc.php may be used to validate all Deliberation RuleML 1.01 instances.
  5. Skip the rest of the fields, and click Validate.
  6. The result will appear below, followed by a copy of the instance source.

An online demo of validation using the RuleML Relax NG schemas with Validator.nu, including more advanced options, is available at the Demo section of the MYNG Wiki. Other tools that may be used for validation against Relax NG schemas are described in the Tools section of the MYNG Wiki.

9.6 Appendix 6: Changes

9.6.1 Issues Resolved

Please see Category:Changes for Deliberation RuleML 1.01 for a listing of all Wiki Issues resolved in Deliberation RuleML 1.01.

Of these changes, the following three were the enhancements requests that motivated this release:

An additional five issues were raised and resolved during the implementation of the motivating issues above:

  • A Minimal Datalog Sublanguage: This new anchor sublanguage provides a basis for extension to a minimal DatalogPlus sublanguage, allowing better modeling of Datalog+/-.
  • Conjunction in Heads of Datalog Rules: Known since Version 1.0, this enhancement request was considered low priority because the absence of conjunctions in the heads of Datalog Rules did not affect semantic expressivity, as such rules can always be expressed as multiple rules without conjunctive heads. However, due to interaction with the motivating issue Existential in Heads of Rules, the priority of this issue was raised -- the absence of conjunction inside existentials in the head of a rule does affect semantic expressivity.
  • Disjunctive Heads as an Implication Option: As part of a known issue, MYNG_Expressivity, the priority of this issue was raised due to interaction with the motivating issue Falsity in Heads of Datalog Rules -- falsity is represented as an empty disjunction.
  • MYNG GUI makes XSD Available: A refactoring of the MYNG GUI was required by the introduction of new schema modules in the resolution of the motivating issues. The opportunity was taken to resolve this enhancement request at the same time.
  • Normalizer Inserts Map Attributes Too Much: With the emphasis in Version 1.01 on sublanguages near the Datalog level of expressivity, testing revealed the significance of this known enhancement request for a Normalizer XSLT that correctly handles attributes with default values for these sublanguages.

A further two issues were resolved due to comments made during the Public Review:

  • Data Elements with both node and xsi:type Attributes: A known erratum in the XSDs since Version 1.0, the re-discovery of this issue during the Public Review encouraged us to apply a fix that was facilitated by the change to auto-generated XSDs in Version 1.01. Thanks to Sadnan Al Manir for raising this issue in the Public Review.
  • Oriented-Only Equations: Sublanguages having equations that are required to be oriented have already been available through manual configuration of existing Relax NG schema modules since Version 1.0. As an enhancement, in Version 1.01, these sublanguages have been made available through the MYNG REST interface by a modification of the interpretation of the myng-code. This special case of rules with equality can have fast performance for inference. Thanks to Jürgen Angele for raising this issue in the Public Review.

Three issues of the Version 1.0 manually-generated XSDs were resolved by the change to auto-generated XSDs in Version 1.01:

Finally, there were editorial changes made to the Glossary:

9.6.2 Github Changelog

https://github.com/RuleML/deliberation-ruleml/commit/093864ada52ae1e85e7b4fd71c540d2b027eb1e9 Author: greenTara <taraathan@gmail.com> Date: Fri Jul 18 16:19:07 2014 -0400

   making the MYNG REST option for oriented equations live, fixing test suite

See all...

9.7 Appendix 7: Issues

The redundant myng-code and MYNG REST interface parameters for Disjunctive Horn Logic on the backbone are supported in 1.01 only for backward compatibility, and so are newly classified as Deprecation Candidates in Version 1.01. See Wiki Issue Disjunctive_Heads_as_an_Implication_Option#Resolution.

For Deprecations Candidates of Deliberation RuleML 1.0, see Specification_of_Deliberation_RuleML_1.0#Appendix_7:_Issues.

See Category:Errata of Deliberation RuleML 1.01 for a summary of reported errata of Deliberation RuleML 1.01, including errata of Deliberation RuleML 1.01, and errata of earlier versions of Deliberation RuleML that have not been resolved as of Version 1.01.

See Category:Enhancements of Deliberation RuleML 1.01 for a summary of requests for enhancement of Deliberation RuleML, including enhancements of Deliberation RuleML 1.01, and enhancements of earlier versions of Deliberation RuleML that have not been resolved as of Version 1.01.

The Version 1.0 Content Models document is still valid for Version 1.01 of the anchor sublanguages considered there. However, new anchors have been introduced in Version 101, so this document is no longer exhaustive. A revised Content Models document is not included in the Version 1.01 Specification because it is being replaced by other forms of presentation, such as Schema Docs.

10 References

  1. Deliberation RuleML Version 1.01 Glossary: http://ruleml.org/1.0/glossary/ Glossary
  2. Deliberation RuleML Version 1.01 Relax NG Schemas: http://deliberation.ruleml.org/1.01/relaxng/
  3. Deliberation RuleML Version 1.01 XSD Schemas: http://deliberation.ruleml.org/1.01/xsd/
  4. Trang: http://www.thaiopensource.com/relaxng/trang.html
  5. MYNG GUI http://deliberation.ruleml.org/1.01/myng
  6. MYNG engine https://github.com/RuleML/deliberation-ruleml/blob/1.01-dev/relaxng/schema_rnc.php
  7. Schema docs http://deliberation.ruleml.org/1.01/doc/
  8. Deliberation RuleML Version 1.01 Normalizer Directory: http://deliberation.ruleml.org/1.01/xslt/normalizer/
  9. DTD: http://www.w3schools.com/dtd/
  10. RuleML 0.85: http://ruleml.org/0.85
  11. Deliberation RuleML Version 0.85 DTDs: http://ruleml.org/0.85/dtd
  12. XMLSpy http://www.altova.com/xml-editor/


Site Contact: Tara Athan