OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

legalruleml message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [legalruleml] [XML] source example


Attached and below is a possible representation of an example with defeasible rules and referencing of sources. I have used to some extent Attempto Controlled English (ACE) and the tools published at http://attempto.ifi.uzh.ch/site/

I have not used the full translation from ACE into RuleML that is available, in principle, from tools such as http://www.ruleml.org/translator/ (which is not working now because of changes in the ACE webservice API). However, we may need to use such a translation as the examples become more realistic. The Discourse Representation Structure (DRS) which is obtained from ACE expressions uses an approach that relies on existential quantification to glue together complex grammatical structures. When these existentials appear in the head they move the expressivity beyond Horn Logic, and may increase the complexity of reasoning. On the other hand they assist in cross-referencing. For example, when someone violates a norm, then in DRS an existentially quantified variable denotes the violation, and this violation can become a term in other expressions.

I have a few general recommendations:
1. when referencing an attribute value that was define as an attribute with values of datatype xs:ID (usually named "id" or something similar), then using an attribute (usually named something like "idref") with values of datatype xs:IDREF allows validators to check that the values are actually defined as a value of some @id attribute in the document as well as checking that id values are not duplicated. 2. Data - such as numerical values, dateTimes, character sequences for someones name may be constrained with built-in xsd datatypes, or user-defined restrictions of them, using the xsi:type attribute, but only if the data appears as simple content inside an element. It the data is in an attribute value, it can only be datatyped from the schema and this is less amenable to user extension. 3. Local constants, such as <Ind>a</Ind> are useful as parameters whose values can be assigned, and modified, from metadata. I have repurposed the source metadata element to provide such a parameter value assignment. 4. The @node attribute on RuleML Node elements provides a mechanism for assigning IRIs as labels to propositions and similar reified RuleML entities. The @node attribute must have non-repeating values, similar to @id attributes. To reference an IRI created using the @node attribute, it is recommended to use @iri, for IRIs when possible.

5. I have done my best to comply with the guidelines to separate medata from the rules and formulas. To this end, I have not included any attributes on the rules pointing back to metadata identifiers. To allow N:M association, the @iri element on <ruleInfo> is replaced with an @applysTo, which is allowed to contain a list of IRIs, separated by whitespace. 6. I have moved the point at which sources are referenced from the <Atom> wrapper element inward to the terms where the reference would appear in a natural language (ACE) expression, allowing greater specificity of reference as well as facilitating the construction of complex expressions with multiple references and multiple free variables. 7. Whenever a free variable appears in an element that is referenced by its @node value, it must be referenced as a function, with arguments providing the substitutions for free variables, in lexicographic order of the variable names. Because the representation of the referenced text is unknown, we can't provide in this example the proper arguments that establish the links between the individuals mentioned in the two texts.

8. I have included comments in the attached XML text to help explain the examples.

9. Establishing a naming convention for IDs, IRIs, variables and local constants will help make the examples more readable. I have made a preliminary attempt, further suggestions are welcome.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Document [
<!ENTITY xs "http://www.w3.org/2001/XMLSchema";>
<!ENTITY dc "http://purl.org/dc/elements/1.1/";>  
<!ENTITY dcterms "http://purl.org/dc/terms/";>  
<!ENTITY ruleml "http://ruleml.org/";>  
<!ENTITY dfs "http://ruleml.org/dfs/";>  
<!ENTITY dfsont "/ontology/defeasible.owl">  
<!ENTITY legalruleml "http://legalruleml.example.org/";>  
<!ENTITY regions "http://example.org/regions.owl";>  
<!ENTITY authorities "http://example.org/authorities.owl";>  
<!ENTITY ACT20 "http://example.org/ACT20/2011/06/21/text.lrml";>
<!ENTITY ACT30-2011-12-20  "http://example.org/ACT20/2011/12/20/text.lrml";>
<!ENTITY ACT30 "http://example.org/ACT30/2011/11/05/text.lrml";>

]>
<!--<?xml-model href="http://ruleml.org/1.0/relaxng/naffologeq_relaxed.rnc"; type="application/relax-ng-compact-syntax"?>-->
<?xml-model href="../../WP1/schema/nrc_mirror/1.0/relaxng/legalruleml_ordered.rnc" type="application/relax-ng-compact-syntax"?>
<RuleML xmlns="http://ruleml.org/spec"; xmlns:dfs="&dfs;"
  xmlns:xsi="&xs;-instance" xmlns:xs="&xs;"
  xmlns:legalruleml="&legalruleml;" xmlns:dc="&dc;"
  xmlns:dcterms="&dcterms;"
  xml:base="http://example.org/ACT40/2012/05/10/text.lrml";>
  <Assert>

    <metadata xmlns="http://legalruleml.example.org";>
      <references id="referenceBlock1">
        <reference id="ID1" iri="&ACT20;art1"
          refType="/ontology/legalText"/>
        <!-- I have change @uri to @iri, for consistency with RuleML, and to best reflect the content model. -->
        <reference id="ID4" iri="&ACT20;art4"
          refType="/ontology/legalText"/>
        <reference id="ID5" iri="&ACT20;art5"
          refType="/ontology/legalText"/>
        <reference id="ID7" iri="&ACT20;art7"
          refType="/ontology/legalText"/>
        <reference id="ID15" iri="&ACT20;art15"
          refType="/ontology/legalText"/>
        <reference id="ID23" iri="&ACT30-2011-12-20;art23"
          refType="/ontology/legalText"/>
        <reference id="ID27" iri="&ACT30;art27"
          refType="/ontology/legalText"/>
        <reference id="ID28" iri="&ACT30;art28"
          refType="/ontology/legalText"/>
        <reference id="ID29" iri="&ACT30;art29"
          refType="/ontology/legalText"/>
        <reference id="ID2334"
          iri="http://example.org/judgements#case-law2334";
          refType="/ontology/judgement"/>
      </references>

      <!-- The temporal blocks have been omitted for now as these are not pertinent to the representation of sources. -->

      <ruleInfo id="ruleInfo1"
        applysTo="#art1-rule1 #art2-rule1">
        <sources id="sourceBlock1">
          <source param="Art_a" idref="ID1"/>
          <!-- the attribute @param on <source> identifies the name of the local constant,
             also called "parameter", whose value is being "assigned."
             The value is identified by the @idref attribute.
             Note that using @idref (with content model xs:IDREF) signals
             most validators to check that the idref value actually belongs to
             some @id in the document.
             -->
          <source param="Art_b" idref="ID5"/>
          <source param="Art_c" idref="ID7"/>
          <source param="Art_d" idref="ID15"/>
          <source param="Art_e" idref="ID23"/>
          <source param="Art_f" idref="ID29"/>
        </sources>
        <capability iri="&dfs;defeasible"/>
        <author idref="aut1"/>
        <creationDateTime idref="e5"/>
        <!-- I changed the name of this element to "creationDataTime" to emphasize that it has a value of datatype xs:dateTime. -->
      </ruleInfo>

      <ruleInfo id="ruleInfo2" applysTo="#art2-rule2">
        <sources idref="sourceBlock1"/>
        <capability iri="&dfs;defeater"/>
        <author idref="aut1"/>
        <creationDateTime idref="e5"/>
      </ruleInfo>

      <ruleInfo id="ruleInfo3" applysTo="#art1-rule1">
        <sources id="sourceBlock2">
          <source param="Art_a" idref="ID4"/>
          <source param="Art_b" idref="ID5"/>
          <source param="Art_c" idref="ID7"/>
          <source param="Art_d" idref="ID15"/>
          <source param="Art_e" idref="ID27"/>
        </sources>
        <capability iri="&dfs;strict"/>
        <author idref="aut2"/>
        <creationDateTime idref="e6"/>
      </ruleInfo>

    </metadata>

    <Rulebase node="#art1" mapClosure="universal">
      <Implies material="no" node="#art1-rule1">
        <!-- Attempto Controlled Enlish (ACE):
        For every	legal-person who violates Art_a	and who violates Art_b and who violates Art_c and who violates Art_d 
        the	legal-person shall_be_punished_following Art_e.
        Note: The phrase "shall be punished following" is really not a transitive verb. We are hiding deontic aspects.       
        -->
        <if>
          <And>
            <Atom>
              <Rel iri="&legalruleml;violates"/>
              <Var type="&legalruleml;legal-person">X</Var>
              <Ind>Art_a</Ind>
            </Atom>
            <Atom>
              <Rel iri="&legalruleml;violates"/>
              <Var>X</Var>
              <Ind>Art_b</Ind>
            </Atom>
            <Atom>
              <Rel iri="&legalruleml;violates"/>
              <Var>X</Var>
              <Ind>Art_c</Ind>
            </Atom>
            <Atom>
              <Rel iri="&legalruleml;violates"/>
              <Var>X</Var>
              <Ind>Art_d</Ind>
            </Atom>
          </And>
        </if>

        <then>
          <Atom>
            <Rel>shall_be_punished_following</Rel>
            <Var>X</Var>
            <Ind>Art_e</Ind>
          </Atom>
        </then>
      </Implies>
    </Rulebase>

    <Rulebase node="#art2" mapClosure="universal">
      <!-- Attempto Controlled Enlish (ACE):
        For every	legal-person who violates Art_a	or who violates Art_b or who violates Art_c or who violates Art_d the	legal-person shall_be_punished_following Art_f
        unless there is at least 1 circumstance such that the circumstance is mitigating for the violations and the circumstance 
        satisfies a definition of term_mitigating_circumstance from Art_h. 
      
        Note that we can re-use some of the parameters (<Ind>Art_a</Ind>, etc) that were used in #art1_rule1.
        This allows fewer parameter assignments in <ruleInfo> blocks.
        
      -->
      <Implies material="no" node="#art2-rule1">
        <if>
          <Or node="#art2-rule1-body">
            <Atom>
              <Rel iri="&legalruleml;violates"/>
              <Var type="&legalruleml;legal-person">X</Var>
              <Ind>Art_a</Ind>
            </Atom>
            <Atom>
              <Rel iri="&legalruleml;violates"/>
              <Var>X</Var>
              <Ind>Art_b</Ind>
            </Atom>
            <Atom>
              <Rel iri="&legalruleml;violates"/>
              <Var>X</Var>
              <Ind>Art_c</Ind>
            </Atom>
            <Atom>
              <Rel iri="&legalruleml;violates"/>
              <Var>X</Var>
              <Ind>Art_d</Ind>
            </Atom>
          </Or>
        </if>

        <then>
          <Atom node="#art2-rule2-head">
            <Rel>shall_be_punished_following</Rel>
            <Var>X</Var>
            <Ind>Art_f</Ind>
          </Atom>
        </then>
      </Implies>

      <Implies xmlns="http://ruleml.org/spec";
        node="#art2-rule2">
        <if>
          <Exists>
            <Var type="&legalruleml;circumstance">J</Var>
            <Var type="&legalruleml;definition">K</Var>
            <And>
              <Atom>
                <Rel iri="legalruleml;is-mitigating-for"/>
                <Expr>
                  <!-- The Atom identified as #art2-rule1-body has a free variable in it, so it has to be referenced as an
                      expression (application of a function) rather than an individual.
                      In general, there may be more than one free variable. We assume the positional arguments
                      of the expression refer to the free variables in the original formula or rule 
                      according to lexicographic order.-->
                  <Fun iri="#art2-rule1-body"/>
                  <Var>Y</Var>
                </Expr>
              </Atom>
              <Atom>
                <Rel iri="&legalruleml;satisfies"/>
                <Var>J</Var>
                <Var>K</Var>
              </Atom>
              <Atom>
                <Rel iri="legalruleml;part-of"/>
                <Var>K</Var>
                <Ind>Art_h</Ind>
              </Atom>
            </And>
          </Exists>
        </if>

        <then>
          <Neg>
            <Atom>
              <Rel iri="ruleml;IsTrue"/>
              <Expr>
                <Fun iri="#art2-rule1-head"/>
                <Var>Y</Var>
              </Expr>
            </Atom>
          </Neg>
        </then>
      </Implies>

      <Overrides>
        <Expr>
          <Fun iri="#art2-rule2"/>
          <Var>Z</Var>
        </Expr>
        <Expr>
          <Fun iri="#art2-rule1"/>
          <Var>Z</Var>
        </Expr>
      </Overrides>

    </Rulebase>
  </Assert>
</RuleML>


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]