[rules-dev] RIF PRD translation effort to/from Drools & Jess

Wolfgang Laun wolfgang.laun at gmail.com
Thu Feb 10 05:36:33 EST 2011


What about these DRL CEs and CE phrases:
   forall
   from
   from collect
   from accumulate with function
   from accumulate with init/action/result

Then, some rule attributes
   no-loop
   agenda-group
   salience ( <expression> )   // not a *literal* expression

What about temporal operators and other CEP features?

And I'm not even going to be mean and discuss plugins such as user-defined
evaluators
or user-defined accumulate functions.


As for DRL in XML, one might simply add JAXB annotations to the classes
representing a DRL Package and its constiuents. And then marshal and
schemagen. Piece of cake, theoretically ;-)

-W


On 10 February 2011 10:21, <pdl at agh.edu.pl> wrote:

> Adrian, Wolfgang, all,
>
> I've had issues translating the RHS java code for instance (c.f. XSLT
> stylesheet).
>
> It would be nice to have the translation protocol to/from RIF provided
> with the specification, at least for the main rule engines.
>
> All the best,
> Pierre
>
> On 2/10/2011 8:07 AM, Wolfgang Laun wrote:
>
>
>     On 9 February 2011 22:11, Edson Tirelli <ed.tire... at gmail.com
> <mailto:ed.tire... at gmail.com>> wrote:
>
>
>           Pierre,
>
>           Good to see works like yours being done.
>
>           Drools has an internal canonical model that we use to round
>        trip rules between the syntaxes we support. The best way of
>        supporting "RIF" in Drools is to simply add a parser that parses
>        RIF and populates the canonical model. From that we have a DRL
>        "dumper" that generates DRL, enabling the RIF->DRL translation.
>        Also, if we create a RIF "dumper", one can then generate RIF rules
>        from the canonical model, enabling DRL->RIF translation. That
>        assumes that there is a 1-to-1 semantic mapping between RIF and
>        DRL (I believe there is, but didn't checked).
>
>
>
>     Do you mean that all of RIF can be expressed in DRL? Then I'd agree.
> But you can't express all of DRL in RIF.
>
>    -W
>
>
> A translator RIF-PRD2DRL should be "conformant RIF-PRD consumer" as in the
> recommendation
> <
> http://www.w3.org/TR/2010/REC-rif-prd-20100622/#Semantics-preserving_transformations
> >.
> A translator DRL2RIF-PRD should be a "conformant RIF-PRD producer".
>
> For example, a heuristic validation (test-based) may work in a
> "round-trip" i.e. take a Drools ruleset R, do R_RIF= DRL2RIF-PRD(R) then
> R1= RIF-PRD2DRL(R_RIF) and compare answers by running Drools on R and R1
>
>
> When Wolfgang said that not all Drools constructs can translate to RIF-PRD
> I assume he is thinking to some lets say "nonlogical" or "procedural"
> Drools constructs. However, because RIF can encode any partial recursive
> function, DRL2RIF should be always possible i.e. when translating a ruleset
> from Drools, one may obtain not only PR rules but, in addition some RIF-BLD
> rules too.
>
> Therefore  I assume that there is  very nice work to do.
>
> -.Adrian Giurca
>
>
> _______________________________________________
> rules-dev mailing list
> rules-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20110210/bbd68073/attachment.html 


More information about the rules-dev mailing list