Updated: CONCRETE SYNTAX FOR RULES LITE

From: Harold Boley (boley@informatik.uni-kl.de)
Date: 09/16/03

  • Next message: Mike Dean: "Re: Updated: CONCRETE SYNTAX FOR RULES LITE"
    Hi All,
    
    below, please find our  CONCRETE SYNTAX FOR RULES LITE
    update, as asked for in the action items from last Tuesday
    (http://www.daml.org/listarchive/joint-committee/1446.html).
    
    It will be discussed today. There now also is an HTML version
    (http://www.ruleml.org/submission/ruleslite/concretesyntax.html)
    This will be used for the next updates.
    
    Best,
    Harold and Said
    -----------------------------------------------------------------
    
    
    CONCRETE SYNTAX FOR RULES LITE
    
    Draft 16 Sept 2003
    
    Harold Boley and Said Tabet
    
    
    
    Abstract
    --------
    
    A new Abridged RuleML/XML Syntax compatible with RDF and OWL-DL is
    developed into the Rules Lite Concrete Syntax. This covers webized
    unary and binary Datalog facts, rules, and queries. Principles,
    Prolog-like and XML examples, as well as a DTD are given.
    
    
    
    Introduction
    ============
    
    This is our report on the Rules Lite Concrete Syntax work for
    Datalog facts, rules, and queries, envisaged in recent JC telecons
    (http://www.daml.org/listarchive/joint-committee/1431.html).
    
    In this work all predicates are now going to be unary or binary
    (compatible with OWL-DL). Certain unary predicates could also be
    employed for typing some of the rule variables (the others being
    of type 'any'), as discussed in an earlier series of JC telecons
    (http://www.daml.org/listarchive/joint-committee/1230.html).
    
    By allowing OWL's allValuesFrom and someValuesFrom restrictions
    (http://www.w3.org/TR/owl-guide/#allValuesFrom) in Rules Lite's
    bodies and (perhaps) heads, the concrete syntax could be further
    adapted to the recent OWL Rules proposal:
    http://www.daml.org/listarchive/joint-committee/1430.html
    
    A new Abridged RuleML/XML Syntax is employed here except for
    Herbrand Models, which are represented using Deep Markup:
    
    *1* The earlier <_opr><rel>relation</rel></_opr> will be
        abridged to      <_opr>relation</_opr>.
    
    *2* The earlier <_body><and>atom1...atomK</and></_body> will be
        abridged to      <_body>atom1...atomK</_body>.
    
    *3* Similarly,  <_head><and>atom1...atomK</and></_head> could be
        abridged to      <_head>atom1...atomK</_head> (for OWL Rules).
    
    *4* Prefix form <atom><_opr>relation</_opr>term1...termN</atom>
        will be allowed;
        Postfix form <atom>term1...termN<_opr>relation</_opr></atom>
        will be forbidden.
    
    *5* The earlier <fact><_head><atom>...</atom></_head></fact> will
        be further abridged to  <facto>...</facto>.
    
    While this is a concrete XML syntax, it builds on a data model
    integrating the data models of XML and RDF: A role like _opr
    corresponds to an RDF property (used as an arc label in its DLG
    model). The concrete syntax in *4* becomes an 'atom'-rooted tree
    with the operator and a sequence of the N argument terms as
    subtrees in the abstract syntax.
    
    In the next main sections PR-Prolog examples will be followed by
    Abridged RuleML/XML syntax (except for the Deep RuleML/XML Markup
    of Models):
    
    * PR-Prolog: Uses a Prolog-like presentation syntax as proposed in
      http://www.daml.org/listarchive/joint-committee/1406.html.
    
    * XML: Uses a version of the Abridged RuleML/XML syntax proposed in
      http://www.daml.org/listarchive/joint-committee/1411.html.
    
    The following sections discuss Facts, Rules, Queries (also usable
    as 'positive' or 'negative' integrity constraints), and Models.
    A general form of webizing will then be introduced for individuals
    as well as for for unary and binary predicates.
    
    
    
    Facts
    =====
    
    Since an N-ary relation can always be reduced to a conjunction of
    binary predicates, we will not go beyond binary here.
    
    For instance, the fact
    
    "North America is flanked by the Atlantic and the Pacific"
    
    may initially seem to express a ternary relationship, but it can,
    e.g., be re-expressed using three binary facts glued together by a
    new individual, Oceanics, as shown below.
    
    
    PR-Prolog:
    
    continent(North_America).
    country(Canada).
    province(Ontario).
    oceanpair(Oceanics).
    ocean(Atlantic).
    ocean(Pacific).
    
    has_as_part(North_America,Canada).
    has_as_part(Canada,Ontario).
    
    flanked_by(North_America,Oceanics).
    eastern(Oceanics,Atlantic).
    western(Oceanics,Pacific).
    
    
    XML:
    
    <rulebase>
    
      <facto>
        <_opr>continent</_opr>
        <ind>North America</ind>
      </facto>
    
      <facto>
        <_opr>country</_opr>
        <ind>Canada</ind>
      </facto>
    
      <facto>
        <_opr>province</_opr>
        <ind>Ontario</ind>
      </facto>
    
      <facto>
        <_opr>oceanpair</_opr>
        <ind>Oceanics</ind>
      </facto>
    
      <facto>
        <_opr>ocean</_opr>
        <ind>Atlantic</ind>
      </facto>
    
      <facto>
        <_opr>ocean</_opr>
        <ind>Pacific</ind>
      </facto>
    
      <facto>
        <_opr>has as part</_opr>
        <ind>North America</ind>
        <ind>Canada</ind>
      </facto>
    
      <facto>
        <_opr>has as part</_opr>
        <ind>Canada</ind>
        <ind>Ontario</ind>
      </facto>
    
      <facto>
        <_opr>flanked by</_opr>
        <ind>North America</ind>
        <ind>Oceanics</ind>
      </facto>
    
      <facto>
        <_opr>eastern</_opr>
        <ind>Oceanics</ind>
        <ind>Atlantic</ind>
      </facto>
    
      <facto>
        <_opr>western</_opr>
        <ind>Oceanics</ind>
        <ind>Pacific</ind>
      </facto>
    
    </rulebase>
    
    
    
    Rules
    =====
    
    PR-Prolog (to be executed bottom-up or with iterative deepening):
    
    has_as_part(?x,?z) :- has_as_part(?x,?y), has_as_part(?y,?z).
    
    flanks(?x,?y) :- flanked_by(?y,?x).
    
    
    XML:
    
    <rulebase>
    
      <imp>
        <_head>
          <atom>
            <_opr>has as part</_opr>
            <var>x</var>
            <var>z</var>
          </atom>
        </_head>
        <_body>
          <atom>
            <_opr>has as part</_opr>
            <var>x</var>
            <var>y</var>
          </atom>
          <atom>
            <_opr>has as part</_opr>
            <var>y</var>
            <var>z</var>
          </atom>
        </_body>
      </imp>
    
      <imp>
        <_head>
          <atom>
            <_opr>flanks</_opr>
            <var>x</var>
            <var>y</var>
          </atom>
        </_head>
        <_body>
          <atom>
            <_opr>flanked by</_opr>
            <var>y</var>
            <var>x</var>
          </atom>
        </_body>
      </imp>
    
    </rulebase>
    
    
    
    Conjunctive Queries (as 'Negative' Integrity Constraints)
    =========================================================
    
    PR-Prolog:
    
    continent(x), ocean(x)
    
    
    XML (prefix operators):
    
    <query>
      <_body>
        <atom>
          <_opr>continent</_opr>
          <var>x</var>
        </atom>
        <atom>
          <_opr>ocean</_opr>
          <var>x</var>
        </atom>
      </_body>
    </query>
    
    
    
    Least Herbrand Models (as Deep Markup Ground Facts)
    ===================================================
    
    Herbrand Models are represented using the unabridged Deep Markup
    (close to the abstract syntax).
    
    
    PR-Prolog:
    
    continent(North_America).
    country(Canada).
    province(Ontario).
    oceanpair(Oceanics).
    ocean(Atlantic).
    ocean(Pacific).
    
    has_as_part(North_America,Canada).
    has_as_part(Canada,Ontario).
    has_as_part(North_America,Ontario).
    
    flanked_by(North_America,Oceanics).
    flanks(Oceanics,North_America).
    eastern(Oceanics,Atlantic).
    western(Oceanics,Pacific).
    
    
    XML:
    
    <rulebase>
    
      <fact>
        <_head>
          <atom>
            <_opr><rel>continent</rel></_opr>
            <ind>North America</ind>
          </atom>
        </_head>
      </fact>
    
      <fact>
        <_head>
          <atom>
            <_opr><rel>country</rel></_opr>
            <ind>Canada</ind>
          </atom>
        </_head>
      </fact>
    
      <fact>
        <_head>
          <atom>
            <_opr><rel>province</rel></_opr>
            <ind>Ontario</ind>
          </atom>
        </_head>
      </fact>
    
      <fact>
        <_head>
          <atom>
            <_opr><rel>oceanpair</rel></_opr>
            <ind>Oceanics</ind>
          </atom>
        </_head>
      </fact>
    
      <fact>
        <_head>
          <atom>
            <_opr><rel>ocean</rel></_opr>
            <ind>Atlantic</ind>
          </atom>
        </_head>
      </fact>
    
      <fact>
        <_head>
          <atom>
            <_opr><rel>ocean</rel></_opr>
            <ind>Pacific</ind>
          </atom>
        </_head>
      </fact>
    
      <fact>
        <_head>
          <atom>
            <_opr><rel>has as part</rel></_opr>
            <ind>North America</ind>
            <ind>Canada</ind>
          </atom>
        </_head>
      </fact>
    
      <fact>
        <_head>
          <atom>
            <_opr><rel>has as part</rel></_opr>
            <ind>Canada</ind>
            <ind>Ontario</ind>
          </atom>
        </_head>
      </fact>
    
      <fact>
        <_head>
          <atom>
            <_opr><rel>has as part</rel></_opr>
            <ind>North America</ind>
            <ind>Ontario</ind>
          </atom>
        </_head>
      </fact>
    
      <fact>
        <_head>
          <atom>
            <_opr><rel>flanked by</rel></_opr>
            <ind>North America</ind>
            <ind>Oceanics</ind>
          </atom>
        </_head>
      </fact>
    
      <fact>
        <_head>
          <atom>
            <_opr><rel>flanks</rel></_opr>
            <ind>Oceanics</ind>
            <ind>North America</ind>
          </atom>
        </_head>
      </fact>
    
      <fact>
        <_head>
          <atom>
            <_opr><rel>eastern</rel></_opr>
            <ind>Oceanics</ind>
            <ind>Atlantic</ind>
          </atom>
        </_head>
      </fact>
    
      <fact>
        <_head>
          <atom>
            <_opr><rel>western</rel></_opr>
            <ind>Oceanics</ind>
            <ind>Pacific</ind>
          </atom>
        </_head>
      </fact>
    
    </rulebase>
    
    
    
    Webizing
    ========
    
    Individuals as well as unary and binary predicates can be webized
    by augmenting or replacing their symbolic names by URIs, so that
    three possibilities result (omitting the fourth possibility of
    anonymous individuals/predicates that have neither symbolic names
    nor URIs):
    
    *1* Only symbolic names (the pre-webized situation).
    
    *2* Both symbolic names and URIs.
    
    *3* Only URIs (the RDF situation).
    
    In any given rulebase, the same URI can occur with different
    symbolic names, but the same symbolic name cannot occur with
    different URIs.
    
    
    PR-Prolog (with N3-like URIs):
    
    continent(North_America<http://www.northamericaninstitute.org>).
    ...
    oceanpair<http://www.pairs.org/ocean>(<http://www.oceanics.org>).
    ...
    <http://www.mereology.org/has_as_part>(North_America,Canada).
    ...
    <http://www.direction.org/west>(<http://www.oceanics.org>,Pacific).
    
    
    XML:
    
    <rulebase>
    
      <facto>
        <_opr>continent</_opr>
        <ind href="http://www.northamericaninstitute.org">North America</ind>
      </facto>
    
      ...
    
      <facto>
        <_opr href="http://www.pairs.org/ocean">oceanpair</_opr>
        <ind href="http://www.oceanics.org"/>
      </facto>
    
      ...
    
      <facto>
        <_opr href="http://www.mereology.org/has_as_part"/>
        <ind>North America</ind>
        <ind>Canada</ind>
      </facto>
    
      ...
    
      <facto>
        <_opr href="http://www.direction.org/west"/>
        <ind href="http://www.oceanics.org"/>
        <ind>Pacific</ind>
      </facto>
    
    </rulebase>
    
    
    
    Conclusions
    ===========
    
    After the definition of the Rules Lite Concrete Syntax, the next
    step is to modify existing parsers (and generators), allowing this
    syntax to be used for rule interchange. Possible implementations
    have been envisaged for cwm, Jena 2, OWL engines, jDREW, and Jess
    adaptations.
    
    Ternary, ... predicates could be added later as exemplified in
    http://www.daml.org/listarchive/joint-committee/1444.html
    (demonstrating the extension path to N-ary relations); as an
    alternative or complement, the transition to full Horn logic could
    be attempted.
    
    
    
    Appendix: DTD for Rules Lite (Facts and Rules)
    ==============================================
    
    
    <!ELEMENT rulebase ((imp | facto)*)>
    
    
    <!ELEMENT imp ((_head, _body) | (_body, _head))>
    
    <!ELEMENT facto ((_opr, (ind | var)) |
                     (_opr, (ind | var), (ind | var)))>
    
    
    <!ELEMENT _head (atom)>
    
    <!ELEMENT _body (atom*)>
    
    <!ELEMENT atom ((_opr, (ind | var)) |
                    (_opr, (ind | var), (ind | var)))>
    
    
    <!ELEMENT _opr (#PCDATA)>
    
    <!ELEMENT ind  (#PCDATA)>
    
    <!ELEMENT var  (#PCDATA)>
    
    
    <!ATTLIST _opr href CDATA #IMPLIED>
    
    <!ATTLIST ind href CDATA #IMPLIED>
    


    This archive was generated by hypermail 2.1.4 : 09/16/03 EST