[RuleML-all] Re: Need help to define to understand RuleML
Boley, Harold
Harold.Boley at nrc-cnrc.gc.ca
Tue Aug 7 17:14:11 ADT 2007
Hi Baher,
Some reasons for embedding a (business) rule engine in Java
can be extracted from "The Principles of Rule Independence"
<http://www.businessrulesgroup.org/brmanifesto.htm>.
Prova and OO jDREW allow you to run subsets of RuleML 0.91
<http://www.ruleml.org/0.91> as part of an enclosing Java
environment, with the advantage that RuleML rules are kept
in separate, easier-to-maintain XML rulebases.
Can you show us some of your (simpler :-) rules in Java, so
we have a challenge to do them more declaratively in RuleML?
Prova also supports the evolving Reaction RuleML, for which
OO jDREW may come up with extensions, too. While findall is
not yet in RuleML, this and other aggregation operators are
certainly quite important for future releases. In bottom-up
mode, OO jDREW does a kind of findall, but this is not yet
integrated into the top-down mode.
Your original example could of course also be implemented in
other ways. If your data table is represented as a list of
pair lists <http://www.ruleml.org/0.91/glossary/#gloss-Plex>
(which could also be the result of a findall call), then an
integrity rule could alert users of duplicate pairs in the
outer list.
Best,
Harold
________________________________
From: ruleml-all-bounces at ruleml.org
[mailto:ruleml-all-bounces at ruleml.org] On Behalf Of Baher Omar
Sent: Friday, August 03, 2007 1:01 AM
To: ruleml-all at ruleml.org
Subject: [RuleML-all] Re: Need help to define to understand RuleML
Thanks Adrian for your help..
I read more about Prova and it's a very powerful engine.
However, I don't know why I should choose Prova over Java language as my
language to write my rules!! Java could provide most of the capabilities
that Prova supports (with a little more development for sure).
In the matter of fact, all my rules today are implemented in Java.. and
I want to move away from that by selecting a simple xml based rule
definitions and a supported engine..
jDREW seems to be simple enough for my needs, but does jDREW support
Reaction RuleML and maybe generic functions like (findall)?!
Thanks,
-b
On 8/1/07, Adrian Paschke <paschke at in.tum.de> wrote:
Hi Baher,
A quick answer, since I m currently travelling.
You may take a look at the Prova documentation:
http://www.prova.ws/etc/provauserguide_2_0.pdf
Chapter 4 describes several built-ins. Prova is an open-source
engine
capable of executing Reaction RuleML and in particular supports
interchange of event messages.
We will soon release the next version of Reaction RuleML:
http://ibis.in.tum.de/research/ReactionRuleML/0.2/
Reaction RuleML supports messages and messaging reaction rules
(rules
which send and receive messages), e.g.:
http://ibis.in.tum.de/research/ReactionRuleML/0.2/examples/message.rrml
<http://ibis.in.tum.de/research/ReactionRuleML/0.2/examples/message.rrml
>
http://ibis.in.tum.de/research/ReactionRuleML/0.2/examples/MessagingRule
.rrml
I will send you are more detailed answer when I m back.
BTW the deadline for demo submissions to RuleML-2007 has been
extended:
http://2007.ruleml.org/
This could be interesting for you to submit a demo to the
Challenge and
meet the business rules and rules standardization community
Best,
Adrian
________________________________________
Von: ruleml-all-bounces at ruleml.org
[mailto:ruleml-all-bounces at ruleml.org] Im Auftrag von Baher Omar
Gesendet: Mittwoch, 1. August 2007 13:44
An: ruleml-all at ruleml.org
Betreff: [RuleML-all] Re: Need help to define to understand
RuleML
Thanks Adrian,
Your answers will certainly help to put me on on the right
track!
I don't think my table has a single key, it might be an
aggregate key..
Nevertheless, I like the idea of findall function.. I basically
need a
search mechanism in my data set..
Is there a place where I can find more information about
well-known
functions?
I was reading on the Reaction RuleML, and I thought that was the
right
RuleML variation for my application.. (Hence I need message
based actions).
However, I had difficulty finding the correct reading materials
to learn
more about Reaction RuleML, so I decided to go back to the basic
RuleML
and exercise more of it..
Is there any open-source rule engine for Reaction RuleML?!
To answer your last question, I think my system is more of a
verification system. It should have business rules and a
database. I
want to use RuleML to verify the business rules aganist a data
data
before committing data to the database.. Therefore, I need to
use
message based actions to report errors to the end-user.
Ultimately, I want to share my business rule with other
applications and
maybe other parties..
Thanks again,
-b
On 8/1/07, Adrian Paschke <paschke at in.tum.de> wrote:
Hi Baher,
The solution depends on how the table data is represented.
Assume each row (data set) in the table has a unique id (like a
primary
key) then the fact representation could be tableName(ID,X,Y),
e.g.
pair(1,x1,y1).
pair(2,x2,y2).
&
A backward-reasoning derivation rule to detect the error could
then be
as follows:
error(X1,Y2) :- pair(ID1, X1,Y1), pair(ID2, X2,Y2), ID1!= ID2,
X1=X2,
Y1=Y2.
The RuleML serialization is:
<Implies>
<head>
<Atom><Rel>error</Rel></Atom>
<Var>X1</Var>
<Var>X2</Var>
</head>
<body>
<And>
<Atom>
<Rel>pair</Rel>
<Var>ID1</Var>
<Var>X1</Var>
<Var>Y1</Var>
</Atom>
<Atom>
<Rel>pair</Rel>
<Var>ID2</Var>
<Var>X2</Var>
<Var>Y2</Var>
</Atom>
<Not>
<Equals>
<Var>ID1</Var><Var>ID2</Var>
</Equals>
</Not>
<Equals>
<Var>X1</Var>
<Var>X2</Var>
</Equals>
<Equals>
<Var>Y1</Var>
<Var>Y2</Var>
</Equals>
</body>
<Implies>
If you don t have an ID, then you might use a function like
findall(pair(X,Y),pair(X,Y),List) which aggregates all pairs in
a list
which you might traverse and look for repeated members. However,
your
execution environment needs to support findall (many derivation
rule
engines support it, e.g. Prova).
You might also use assert and retract update primitives (if
supported)
to implement a global solution. Reaction RuleML
( http://ibis.in.tum.de/research/ReactionRuleML) is supporting
derivation
rules with update primitives.
Or is your execution environment a production rule system? XML
serialization of production rules are also addressed by Reaction
RuleML.
Best,
Adrian
________________________________________
Von: ruleml-all-bounces at ruleml.org
<mailto:ruleml-all-bounces at ruleml.org>
[mailto: ruleml-all-bounces at ruleml.org] Im Auftrag von Baher
Omar
Gesendet: Mittwoch, 1. August 2007 06:30
An: ruleml-all at ruleml.org
Betreff: [RuleML-all] Need help to define to understand RuleML
I'm new to RuleML and I have difficultly coming up with an
equivalent
RuleML for the following rule:
"if X is repeated in a sequence of variables then that's an
error"
Suppose I have the following table data:
X Y
----------
x1 y1
x2 y2
x3 y2
x1 y1
x2 y3
x1 occurs twice under y1, that's the violation I'm looking for..
How can I describe this rule in RuleML?!
Thanks,
-b
More information about the RuleML-all
mailing list