Unary Term Sequences

From RuleML Wiki
Jump to: navigation, search
--Athant (talk) 22:40, 4 March 2014 (AST)

1 Issue Description

To emulate the expressivity of Description Logic (DL) languages like OWL, predicates need to be either binary or unary. The existing "bindatalog", and other languages in the "Binary RuleML" family", have arity of either zero or two, emulating the expressivity of triples. Therefore there is no explicit sublanguage (defined by a set of RuleML modules) that approximates DL expressivity.

2 Resolution

Introduce a unary term sequences option (zero or one terms in predicates and functions), similar to the binary term sequences option. Also add a unary/binary option (zero to two terms). Note that current modularization does not allow complete control of arity, because the option for binary term sequences has the nullary case (propositions) built in. This is a larger issue requiring a more extensive refactoring of the modularization and MYNG.

2.1 Relax NG Modules

A new module called termseq_un_expansion_module.rnc [1] contains the following Relax NG [2].

  termsForAtoms.sequence |= positionalArgument-edge.choice?
  termsForExpressions.sequence |= positionalArgument-edge.choice?

2.2 Relax NG Drivers

The drivers all_ordered.rnc [3] and all_unordered.rnc [4] used to test module compatibility are augmented with the following Relax NG[2].

  include "modules/termseq_un_expansion_module.rnc" inherit = ruleml {start |= notAllowed}

Also, a driver[5] is added to test the independent validity of this module[2].

2.3 MYNG Engine

The MYNG engine[6] is augmented with the following lines[7].

  $needUn  = extractBit($btermseq, $termseq_unary)  * (1-$needPoly);

  if ($needUn){
      echo "#\n# UNARY TERM (ONE TERM ONLY) SEQUENCES INCLUDED\n";
      echo "#\n".'include "' . $modulesLocation .
        'termseq_un_expansion_module.rnc"'."$end\n";
  }

2.4 MYNG GUI

The MYNG GUI[8] is augmented with additional options in the "Term Sequences" facet [9]. The encoding is not changed, as it was designed in Version 1.0 to allow for the future addition of a Unary option.

Screen Shot 2014-03-05 at 10.44.22 AM.png

2.5 XSDs

An XSD for the Unary Propositions sublanguage

unprop_normal.xsd [10]

was auto-generated using Jing/Trang and added to the xsd directory[9].

2.6 Unit Tests

Several unit tests were added to the test suite folder. The unit tests were implemented in the following commits: [11] [2] [12], including

  <RuleML xmlns="http://ruleml.org/spec">
    <Assert>
      <Atom>
        <Rel>mother</Rel>
        <Ind>x</Ind>
      </Atom>
    </Assert>
  </RuleML>

3 References

  1. termseq_un_expansion_module.rnc
  2. 2.0 2.1 2.2 2.3 commit edab1b1
  3. all_ordered.rnc
  4. all_unordered.rnc
  5. https://github.com/RuleML/deliberation-ruleml/blob/1.01-dev/relaxng/indep_valid_modules/termseq_un_expansion_module.rnc
  6. MYNG engine
  7. commit 434178e
  8. MYNG GUI
  9. 9.0 9.1 commit b3d90b4
  10. unprop_normal.xsd
  11. commit b40313e
  12. commit b43af30d