[RuleML-all] Re: Need help to define to understand RuleML
Baher Omar
baher.omar at gmail.com
Wed Aug 1 08:43:36 ADT 2007
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] 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
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.ruleml.org/pipermail/ruleml-all/attachments/20070801/53243bb9/attachment.htm
More information about the RuleML-all
mailing list