R2ML provides a set of annotation elements for specifying information about a rule. The container element for rule annotations in R2ML is r2ml:Documentation. The
following R2ML optional (sub)elements are defined:
-
r2ml:RuleText is the rule text. Additionally three optional attributes are provided:
r2ml:textFormat express the element content format (the usual values for this attributes
are
plain, xml, and xhtml), r2ml:ruleVocabularyDiagram, which is denoted by a URI
reference to the UML diagram with rule vocabulary and r2ml:ruleDiagram, which denotes a URI reference to the Strelka rule;
-
r2ml:SourceCode provides an optional attribute r2ml:language, which has as a string
value with the source language of the rule. The content of this element is the code of the rule, usually in a <![CDATA[....]]> section in order to avoid problems with the parsing of the rule.
In addition R2ML allows the usage of all Dublin Core elements inside r2ml:Documentation.
See r2ml:Documentation.
See r2ml:Documentation.
A container for a collection of rule sets.
The collection contains derivation rules in a form of a
Derivation Rule Set,
production rules in a form of a Production Rule Set
or reaction rules in a form of Reaction Rule Set.
Any rule base may have an ID for unique identification by means of
r2ml:ruleBaseID attribute.
The UML metamodel is:
The abstract concept of rule set.
It specializes in
r2ml:IntegrityRuleSet,
r2ml:DerivationRuleSet,
r2ml:ProductionRuleSet
and r2ml:ReactionRuleSet.
Any rule set may have an ID
(the r2ml:ruleID attribute) for unique identification.
A rule set may declare global variables. These variables are available through all the rules
from the rule set. A rule set may refer to a specific
internal (R2ML) vocabulary with the help of the optional element r2mlv:Vocabulary. If exists, this vocabulary is intended to be the one the rule set uses. The UML metamodel is:
In addition the rule set may refer to an external vocabulary with the help of attributes
r2ml:externalVocabulary and
r2ml:externalVocabularyLanguage. The first attribute is
the URI of the vocabulary while the second describe the external vocabulary language. R2ML supports three external vocabularies: RDFS, OWL and UML.
An unordered container for the collection of global variables declarations of the rule set.
It must not be empty i.e. it contains at least one of r2ml:GenericVariable, r2ml:ObjectVariable
or r2ml:DataVariable.
This element is designed to capture a set of integrity rules (integrity constraints). See r2ml:RuleSet.
This element is designed to capture a set of derivation rules. See r2ml:RuleSet.
This element is designed to capture a set of production rules. See r2ml:RuleSet.
This element is designed to capture a set of reaction rules. See r2ml:RuleSet.
The abstract concept of rule.
constraint must not contain any free variable.
Abstract Integrity Rule. It specialize into two kind of constraints r2ml:AlethicIntegrityRule
and r2ml:DeonthicIntegrityRule.
The UML metamodel is:
constraint
Encodes an alethic integrity rule. See r2ml:IntegrityRule.
Encodes a deonthic integrity rule. See r2ml:IntegrityRule.
Encodes a derivation rule. Any derivation rule consists from a condition part (see r2ml:conditions )
and a conclusion part (r2ml:conclusion).
In R2ML the conditions of a derivation rule are r2ml:qf.AndOrNafNegFormula.
Conclusions are restricted to quantifier-free disjunctive normal forms without NAF
(See also r2ml:qf.LiteralConjunction).
The UML metamodel is:
A container for a collection of r2ml:qf.AndOrNafNegFormula
appearing in the condition part of a rule. Any R2ML processor must interpret a collection of
r2ml:AndOrNafNegFormula as conjunction
(See also r2ml:qf.Conjunction).
A conclusion is either a r2ml:Atom or a
r2ml:qf.LiteralConjunction.
It appears in r2ml:DerivationRule.
Represents a production rule. Any production rule has a condition part (by means of r2ml:conditions)
a produced action expression part (by means of r2ml:producedActionExpr) and an optional
r2ml:postcondition. The UML metamodel is:
A postcondition is a collection r2ml:qf.AndOrNafNegFormula. If there are more
than one formula them they must be interpreted as conjunction (r2ml:qf.Conjunction).
A role for a list of r2ml:AtomicActionEventExpr.
If there is more than one action then they must be interpreted sequentially in the DOM order.
The R2ML model of a reaction rule (ECA rule) consists in a rule trigerring event expression
(See r2ml:triggeringEventExpr)
a condtion part (see r2ml:conditions) a produced action expression part
(by means of r2ml:producedActionExpr) and an optional
r2ml:postcondition. Both action expression and postcondition have the same meaning as
in r2ml:ProductionRule.
The UML metamodel is:
A role element for event expressions. It contains one event expression. See r2ml:EventExpression.
triggeredEventExpr
The general concept of a logical formula.
Among basic constructs r2ml:Atom,
r2ml:Conjunction, r2ml:Disjunction,
r2ml:Implication, r2ml:NegationAsFailure
and r2ml:StrongNegation it also encodes quantified formulas
(See r2ml:QuantifiedFormula).
The UML metamodel is:
General implication. It consists from one r2ml:antecedent
and one r2ml:consequent.
A role for one r2ml:LogicalFormula.
It appears in r2ml:Implication.
A role for one r2ml:LogicalFormula.
It appears in r2ml:Implication.
Encodes the general concept of a logical conjunction. It contains two or more r2ml:LogicalFormula.
Encodes the general concept of a logical disjunction. It contains two or more
r2ml:LogicalFormula.
Negation.
Encodes a strong (explicit) negation. Its content model is a r2ml:LogicalFormula.
See also r2ml:Negation.
Encode negation sa failure (or weak negation) i.e. the absence of the positive information.Its content model is a
r2ml:LogicalFormula. See also r2ml:Negation.
Abstract concept of QuantifiedFormula. All variables from the consituent r2ml:LogicalFormula
are supoposed to be quantified (related to a quantifier).
R2ML implements universal quantified formulas
(in the form of r2ml:UniversallyQuantifiedFormula) ,
existential quantified formulas (in the form of r2ml:ExistentiallyQuantifiedFormulas)
as well as restricted existential quantified formulas
i.e. r2ml:AtLeastQuantifiedFormula,
r2ml:AtMostQuantifiedFormula and
r2ml:AtLeastAndAtMostQuantifiedFormula.
Encodes an universally quantified formula. All variables from the consituent r2ml:LogicalFormula
are supposed to be universally quantified. See also r2ml:QuantifiedFormula.
Encodes an existentially quantified formula.
All variables from the consituent r2ml:LogicalFormula
are supposed to be existentially quantified. See also r2ml:QuantifiedFormula.
The concept of AtLeastQuantifiedFormula. All variables from the consituent
r2ml:LogicalFormula are supposed to be existentially quantified
and they must have at least r2ml:minCardinality instances.
See also r2ml:QuantifiedFormula.
The concept of AtLeastQuantifiedFormula. All variables from the consituent
r2ml:LogicalFormula are supposed to be existentially quantified
and they must have at most r2ml:minCardinality instances.
See also r2ml:QuantifiedFormula.
AtLeastAndAtMostQuantifiedFormula. See also r2ml:QuantifiedFormula.
LiteralConjunction.
The UML metamodel is:
Quantifier free formulas. The UML metamodel is:
Quantifier free conjunction. See also r2ml:qf.AndOrNafNegFormula.
Quantifier free disjunction. See also r2ml:qf.AndOrNafNegFormula.
Quantifier free negation. See also r2ml:qf.AndOrNafNegFormula.
Quantifier free strong negation. See also r2ml:qf.AndOrNafNegFormula and
r2ml:StrongNegation.
Quantifier free negation as failure. See also r2ml:qf.AndOrNafNegFormula
and r2ml:NegationAsFailure.
The abstract concept of Atom e.g. the superclass of all R2ML atoms.
Its content model contains an optional attribute r2ml:isNegated, a convenient construct for obtaining
sentence literals. The UML metamodel is:
It encodes the classical concept of atom. Any generic atom has a predicate name
by means of the value of the attribute r2ml:predicate) and a
list of terms as arguments (See r2ml:arguments).
An optional attribute r2ml:predicateType can be used to classify
the generic atom against R2ML classification of atoms. The UML metamodel is:
See also r2ml:Atom.
A container for the generic atom arguments. It encodes a (possible empty) list of r2ml:Term.
The abstract concept of ObjectAtom. All arguments of this atom are object terms. See r2ml:Atom
for the metamodel and r2ml:ObjectTerm for the content.
The abstract concept of DataAtom. All arguments of this atom are data terms. See r2ml:Atom
for the metamodel and and r2ml:DataTerm for the content.
self.ObjectTerm.termTypeCategory="individual"
Is an object atom (see r2ml:ObjectAtom) which classifies
an object term against a class. The UML metamodel is:
Is an object atom (see r2ml:ObjectAtom)
encoding the object term equality. If there are more than two object terms they
are supposed to be two-pair equals. The UML metamodel is:
An object atom (see r2ml:ObjectAtom)
encoding object inequality. If there are more than two object terms they are
supposed to be two-pair different. See also r2ml:EqualityAtom.
self.DataTerm.termTypeCategory="individual"
A data atom (see r2ml:DataAtom) which
classifies a data term against a datatype.
The UML metamodel is:
A data atom (see r2ml:DataAtom) encoding all datatype predicates such as relational >, <, ...
R2ML uses the SWRL builtins as a default. The UML metamodel is:
A container for a (possible empty) ordered list of data terms. See r2ml:DataTerm.
subject.termTypeCategory="individual"
The property atom. It specialize in r2ml:ReferencePropertyAtom
and r2ml:AttributionAtom. A property atom is a binary atom
with a predicate name by means of the r2ml:property attribute,
an r2ml:ObjectTerm as a subject
(see r2ml:subject) and a r2ml:Term
as the property value (r2ml:value). This atom corresponds to the concept of RDF triple.
A role element for an object term appearing as subject in a property atom. Similar with the subject from RDF triples.
See also r2ml:PropertyAtom and and r2ml:ObjectTerm.
A term appearing in a property atom as a value for that property.
See r2ml:PropertyAtom and r2ml:Term.
subject.termTypeCategory="individual"
A specialization of r2ml:PropertyAtom covering
just property atoms having pbject terms as values. A reference property atom has a r2ml:subject
and a r2ml:object as a value. The reference property is encoded by means of
the r2ml:referenceProperty attribute.
This atom corresponds to the concept of an RDF triple with a non-literal object.
The UML metamodel is:
An object term appearing in a reference property atom as a value for the reference property.
See and r2ml:objectTerm
subject.termTypeCategory="individual"
Similar with r2ml:ReferencePropertyAtom
just the value of the property is a r2ml:DataTerm
(the content of r2ml:dataValue role element).
The UML metamodel is:
A role element for a data term appearing in an attribution atom as a value for the attribute.
See also r2ml:AttributionAtom and r2ml:DataTerm .
subject.termTypeCategory="individual"
A convenience construct to encode a conjunction of property atoms referring to the same subject.
An object description atom refers to a class as a type (by means of the r2ml:class
attribute) and consists of a number of slots (r2ml:ObjectSlot
and/or r2ml:DataSlot). Any instance of such atom refers
to one particular object by means of r2ml:subject value.
The UML metamodel is:
The abstract concept of slot. It specialize in r2ml:ObjectSlot
and r2ml:DataSlot.
ObjectSlot
DataSlot
An association atom is constructed using an nary predicate as association predicate, a collection of data terms
as "data arguments" and a collection of object terms as "object arguments". The UML metamodel is:
A container for a (possible empty) ordered list of object terms. See r2ml:ObjectTerm.
EventExpression. The UML metamodel is:
The main characteristic of an atomic event expression
is that it has no duration. An atomic event expression refers to an event type, which is its classifier
(by means of r2ml:eventType attribute), is composed from a set of r2ml:Slot or
one r2ml:contextArgument. R2ML distinguishes between two main classes of atomic event expressions:
atomic action event expressions (r2ml:AtomicActionEventExpr)
and time event expressions (r2ml:TimeEventExpr).
See also r2ml:EventExpression
An ordered list of al least two event expressions, which are processed in a sequence of events,
following the existent order and considering a finite value of time window observation(by means of the
r2ml:timeWindow attribute). See also r2ml:EventExpression
It contains two event expressions as arguments (EvtExpr1 and EvtExpr2).
It describes a complex event where an instance of EvtExpr1 but no instance of EvtExpr2 occurs.
The required r2ml:timeWindow attribute sets the time frame inside the event must occur.
See also r2ml:EventExpression.
Contains a collection of event expressions that requires processing of at least
one event expression from the collection inside of the corresponding timeWindow.
The values of attributes r2ml:minOccurs and
r2ml:maxOccurs setup the number of events in the collection that may occur and
the required r2ml:timeWindow attribute sets the time frame inside the events must occur.
which they must occur. See also r2ml:EventExpression.
Contains to a collection of event expressions that are concurrently processed inside
of a specific time window (by means of the required r2ml:timeWindow attribute).
See also r2ml:EventExpression.
The REWERSE I1 Rule Markup Language (R2ML) supports production rules therefore it defines the concept of an action.
Following the OMG Production Rule Representation submission, an action is either an r2ml:InvokeActionExpression
or an r2ml:UpdateStateActionExpr. The second is the abstract superclass for the actions:
r2ml:UpdateActionExpr,
an r2ml:AssertActionExpr
and a r2ml:RetractActionExpr.
The UML metamodel is:
See r2ml:ProgramActionExpression.
InvokeActionExpression models the receipt by an object of a request to invoke an operation (
by means of the r2ml:operation attribute). It refers to an operation and contains an ordered,
possible empty list of arguments represented as R2ML terms. The execution of this action is done by the corresponding operation-call.
Updates the value of a property.
AssertActionExpr
contains a collection of slots i.e. property-value pairs (|See r2ml:Slot).
The intended meaning of this action is the assertion of these facts into the working memory.
r2ml:contextArgument encodes the context of the action call.
Deleting an object.
r2ml:contextArgument always evaluates to an object name.
Term. The UML metamodel is:
ObjectTerm. The UML metamodel is:
DataTerm. The UML metamodel is:
GenericTerm. The UML metamodel is:
contextArgument.termTypeCategory="individual"
ObjectOperationTerm
contextArgument.termTypeCategory="individual"
ReferencePropertyFunctionTerm
contextArgument.termTypeCategory="individual"
DataOperationTerm
contextArgument.termTypeCategory="individual"
AttributeFunctionTerm
contextArgument