Specification of Reaction RuleML 1.02

From RuleML Wiki
Jump to: navigation, search

Authors: Adrian Paschke, Tara Athan, Harold Boley, Alexander Kozlenkov


Quick links:

RuleML Families : Specification of RuleML 1.02

Prerequisites: None, Level: Semi-formal

Reaction RuleML : Specification of Reaction RuleML

Prerequisites: None, Level: Semi-formal

Primer : Tutorial on RuleML

Prerequisites: None, Level: Informative

XSD Schemas : Machine-readable schemas in XSD

Prerequisites: XSD, Level: Formal

Examples : Illustrative Instances of the Version 1.02 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

Implementations : Implemented RuleML tools

Prerequisites: None, Level: Informative

This version: reaction.ruleml.org/1.02

Latest version: reaction.ruleml.org/spec

Development version: reaction.ruleml.org/1.02
Companion version: Deliberation RuleML 1.02

Version history:
Date Version
2005-04-15 -

Version ECA RuleML 0.01 HTML

2005-08-15 -

Version ECA RuleML 0.1 HTML

2005-10-30 -

Version ECA RuleML 0.2 (pre-release) PDF

2005-11-01 -

Version ECA RuleML 0.2 (pre-release) PDF

2005-12-15 -

Version ECA RuleML 0.2 HTML

2006-10-30 -

Version ECA RuleML 0.3 HTML

2006-11-10 -

Version (ECA) Reaction RuleML 0.1 (pre-release) PDF

2006-10-12 -

Version Reaction RuleML 0.1 HTML

2007-07-22 -

Version Reaction RuleML 0.2 HTML

2007-07-22 -

Version Reaction RuleML 0.3 HTML

2010-10-21 -

Version Reaction RuleML 1.0 (pre-release) PDF

2012-08-27 -

Version Reaction RuleML 1.0 (pre-release) PDF

2014-05-23 -

Version Reaction RuleML 1.0 Wiki

2017-02-19 -

Version Reaction RuleML 1.02 Wiki


Copyright © RuleML Inc. 2015 - 2016 -- Licensed under the RuleML Specification License 1.0 (http://ruleml.org/licensing/RSL1.0-RuleML)


This specification defines Version 1.02 of Reaction RuleML as a language family of RuleML, a knowledge representation architecture designed for the uniform interchange of the major kinds of Web rules across various rule logics and platforms. RuleML has broad coverage as a system of families of languages for Web rules, also including the Consumer RuleML and Deliberation RuleML families.

Reaction RuleML is a standard language family for the syntactic serialization and semantics-preserving interchange of reaction rules, e.g., for rule-based reactive agents, rule-based event processing and rule-based analytics. Reaction rules include spatio-temporal Derivation Rules (DR), Knowledge Representation (KR) calculi / logics for temporal/event/action/state/situation reasoning, as well as Event-Condition-Action (ECA) rules, Production (CA) rules, Trigger (EA) rules, and distributed rule-based Complex Event Processing (CEP).

The scope of this specification covers the following components:

  • (Informative) Glossary of the language components[1]
  • Schemas in the following formats:
    • (Normative) XSD anchor schemas[2]
    • (Informative) Relax NG schemas [3]
  • (Informative) Schema docs[4]

Excluded from the scope of the specification 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.

The Reaction RuleML specification makes use of the family-independent Predefined Semantic Styles of RuleML 1.02.

This specification is itself a component of the specification of the RuleML 1.02 System, along with the specifications of the other families and the family-independent Semantic Styles of RuleML 1.02.

Readers who are already familiar with Reaction RuleML may want to refer to the Changes section. The RuleML 1.02 System as a whole is described in RuleML 1.02: Deliberation, Reaction and Consumer Families[5].

1 Overview

1.1 Reaction RuleML Features

The Reaction RuleML family includes the following features:

  • Terms, including individuals, data terms, variables, skolem constants, reified terms, generalized lists, functional expressions, and event, situation, action, and fluent terms, formulas, and algebra operators
  • Extensibility through foreign namespaces (content)
  • Atomic formulas, including variably polyadic positional arguments, slots, rest variables, and object identifiers
  • Rules (Rule) generalizing Implies, e.g., Production (CA) rules, Trigger (EA) and Event-Condition-Action (ECA) rules, distributed rule-based Complex Event Processing (CEP)
  • Specialized syntax dedicated to spatial, temporal, and interval terms and formulas
  • Temporal, interval, event, action algebra operators and generic operations (Operation), e.g. for modal logic
  • Quantifiers (Forall, Exists and generic Quantifier) and definitions of quantifications
  • Equations with orientation modifiers
  • Negations, including classical (strong) and negation-as-failure (weak) forms, with, e.g., well-founded or answer-set semantics, and generic negations
  • Degree of uncertainty modifiers, which may be used, e.g., for fuzzy or probabilistic logics
  • Type modifiers, which may be used, e.g., for sorted logics or as an abbreviation for classification through unary predicates
  • Material or non-material implications
  • IRIs as constants and CURIE abbreviations
  • Implicit quantification (closure), including references to externally defined extended quantifiers such as numerical quantification
  • Mechanism for distributed definitions (@key and @keyref)
  • Metadata annotations, definitions of interface, signature, scopes (for scoped reasoning), semantic evaluation/interpretation profiles, qualifications (e.g., for time window definitions, priorities, ratings and other qualifying constraints), quantification, and referencing attributes for scope, mode, safety, arity, cardinality, qualifications, quantification
  • Basic performatives (Assert, Retract, Query) and further complex actions/performatives for semantic import/consult, updates, answers, justifications, tests
  • Rulebase containers and Message descriptors
  • Metalogic, e.g. entailment assertions
  • Functional expression interpretation modifiers (per), which may be used, e.g., to specify that a built-in functional expression should be replaced by its value
  • Cardinality modifiers, which may be used, e.g., to specify that a functional expression or slot has a certain multiplicity of its values
  • Slot weights
  • Syntax for indicating the semantic profile (style)


1.2 Background

2 Examples

Numerous sample RuleML documents have been prepared and maintained in the Examples directory.

3 Glossary

The Reaction RuleML Glossary contains descriptions for every element, attribute, and syntactic category in Reaction RuleML.

4 Additional Restrictions

IRIs occurring as attribute values, whether originally expressed as an IRI or a CURIE, are required to be fully conformant to RFC 3987[6]. In the case of CURIEs, this restriction applies after expansion to an IRI according to the prefix.

5 Acknowledgements

We wish to acknowledge the contributions of the members of the Reaction RuleML technical group.

6 Appendices

6.1 Appendix 1: Example in Reaction RuleML 1.02

Source: http://reaction.ruleml.org/1.02/exa/cep/SimpleCEPRule.rrml

Note: other serializations of this example are available.

<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="http://reaction.ruleml.org/1.02/relaxng/kr-cep.rnc" type="application/relax-ng-compact-syntax"?>
<RuleML xmlns="http://ruleml.org/spec" xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://ruleml.org/spec http://reaction.ruleml.org/1.02/xsd/cep.xsd">
  <!-- 

    This example defines a messaging reaction rule which is triggered by receiving a matching event message.
    A matching event instance is sent and received by the rule which triggers it. If the condition holds a message is send.

   -->

  <!-- assert rule -->

  <Assert>
    <!-- rule "on receiving the order of a person for a drink if the drink is wine do tell person (=send to person message) that John likes the person" --> 
    <Rule style="active">
      <on>
        <Receive> <!-- receive action waiting for incoming messages -->
          <enclosed>
            <Message>   <!-- message pattern definition matching against incoming messages --> 
              <signature> <!-- define the message's signature as event pattern for the detection -->
                <Atom>
                  <Rel>orders</Rel>
                  <Var>Person</Var>
                  <Var>Drink</Var>
                </Atom>     
              </signature>
            </Message>
          </enclosed>
        </Receive>
      </on>
        
      <if>
        <Atom>
          <Rel>wine</Rel>
          <Var>Drink</Var>
        </Atom>
      </if>
        
      <do>
        <Send>
          <enclosed>
            <Message>
              <receiver><Var>Person</Var></receiver> <!-- receiver is THE "Person" -->
              <payload> <!-- payload of message is a RuleML knowledge base -->
                <RuleML>
                  <Assert>
                    <Atom>
                    <Rel>likes</Rel> 
                    <Ind>John</Ind>
                    <Var>Person</Var>
                    </Atom>
                  </Assert>
                </RuleML>
              </payload>
            </Message>
          </enclosed>
        </Send>
      </do>
    </Rule>
    
    <Atom>
      <Rel>wine</Rel>
      <Ind>merlot</Ind>
    </Atom>
    
  </Assert> 
  
  <!-- send message that "Mary orders wine" which triggers the messaging reaction rule which is waiting for orders -->
  
  <Send>
    <enclosed>
      <Message>
        <cid><Ind>cid1</Ind></cid> <!-- conversation identifier -->
        <sender><Ind>Mary</Ind></sender> <!-- sender -->
        <receiver><Ind>John</Ind></receiver> <!-- receiver -->
        <payload> <!-- payload -->
          <RuleML>
            <Assert>
              <Atom>
                <Rel>orders</Rel>
                <Ind>Mary</Ind>
                <Ind>merlot</Ind>
              </Atom>
            </Assert>
          </RuleML>
        </payload>
      </Message>
    </enclosed>
  </Send>

</RuleML>

6.2 Appendix 2: Bash Scripts for Testing and Artifact Generation

The RuleML documents in the exa directory are used to test the kr-cep.rnc Relax NG schema, while the Bash scripts for testing are in the bash directory. The script used to validate against the Relax NG schema is batch_rnc-test-suite.sh . All the scripts for testing the Relax NG schema are designed to run offline in a clone of the Github repository, using the Jing[7] engine to validate the test documents against local copies of the Relax NG schema. The build_rnc.sh master script executes the test script as well as the following additional tasks:

Similarly, a script is available to test the XSD schemas, batch_xsd-test-suite.sh. The build_xsd.sh master script executes the test script as well as the following additional test:

Independently, a script is available to generate the XSD Schema Docs:

6.3 Appendix 3: Changes

  • renaming of <act> into <do>
  • renaming of <Operator> into <Operation>
  • removal of <Interval> wrapper on Allen operators
  • removal of <Event> wrapper on Event algebra operators
  • removal of <Action> wrapper on Action algebra operators
  • using a uniform content model for <Equal> as Allen Operator and <Equal> as logical connective (<left> and <right> edges instead of <arg>)
  • allow explicit conjunction and disjunction connectives (besides <Operation>) as head connectives
  • allow <degree> in all formulas

6.3.1 Changelog

The issues that have been resolved through the changes between Reaction RuleML version 1.0 and 1.02 are listed at Category:Changes for Reaction RuleML 1.02 and committed to the Reaction RuleML Github repository. Backward incompatible changes are listed at Category:Backward-Incompatible Changes for Reaction RuleML 1.02


6.4 Appendix 4: Issues

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

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


7 References

  1. Reaction RuleML Version 1.02 Glossary: http://reaction.ruleml.org/1.02/glossary/ Glossary
  2. Reaction RuleML Version 1.02 XSD Schemas: http://reaction.ruleml.org/1.02/xsd/
  3. Reaction RuleML Version 1.02 Relax NG Schemas: http://reaction.ruleml.org/1.02/relaxng/
  4. Schema docs http://reaction.ruleml.org/1.02/doc/
  5. RuleML 1.02: Deliberation, Reaction and Consumer Families http://ceur-ws.org/Vol-1417/paper6.pdf
  6. RFC 3987: https://www.ietf.org/rfc/rfc3987.txt
  7. Jing: http://www.thaiopensource.com/relaxng/jing.html


Site Contact: User:Paschkea