<br>   Nelson,<br><br>   Can you provide details on which exact version of drools (5.0.1?) you are using and what is the error/stack trace you are receiving?<br><br>   Thanks,<br>      Edson<br><br><div class="gmail_quote">
2010/1/19 Axelrod, Nelson <span dir="ltr">&lt;<a href="mailto:naxelrod@jcvi.org">naxelrod@jcvi.org</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">









<div link="blue" vlink="purple" lang="EN-US">

<div>

<p class="MsoNormal">Hi,</p>

<p class="MsoNormal"> </p>

<p class="MsoNormal">I’ve encountered problems constructing nested Boolean
expressions in Drools 5.0 using the prefixOr syntax.  We’re using
Drools to build a genome annotation system at the Venter Institute. 
   The following example rule assigns an annotation if there is
a blast hit to a gene GB|AAQ16631.1, or either a blast hit to gene GB|AAQ16631.1,
or to any gene within 500 bases of a gene with an HMM hit to TIGR00905. 
I’ve left off some details to focus on how we are structuring the syntax
of our prefixOr and prefixAnd expressions.</p>

<p class="MsoNormal"> </p>

<p class="MsoNormal">The Drools parser throws errors when it encounters the 2<sup>nd</sup>
“blast_hit” statement in the example below.  Our prefixOr and
prefixAnd expressions work as expected when we use similar syntax, at least
until we attempt to use nested or expressions.</p>

<p class="MsoNormal"> </p>

<p class="MsoNormal" style=""><b><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0);">rule</span></b><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&quot;2645|lysine decarboxylase
CadA&quot;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></p>

<p class="MsoNormal" style=""><b><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0);">when</span></b><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></p>


<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">      (</span><b><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0);">or</span></b><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></p>


<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">            (</span><b><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0);">and</span></b><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></p>


<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">                  blast_hit
: BlastHit( hitId==</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&#39;GB|AAQ16631.1&#39;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">)</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></p>


<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">                  gene1
: Feature( featureId == blast_hit.queryId )</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">            )</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">            (</span><b><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0);">or</span></b><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></p>


<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">                  (</span><b><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0);">and</span></b><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></p>


<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">                        blast_hit
: BlastHit( hitId==</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&#39;GB|AAQ16631.1&#39;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> )</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></p>


<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">                        gene1
: Feature( featureId == blast_hit.queryId )</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">                  )</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">                  (</span><b><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0);">and</span></b><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></p>


<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">                        hmm_hit1
: HmmHit( hitId==</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&#39;TIGR00905&#39;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> )</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></p>


<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">                        gene1
: Feature( featureId == hmm_hit1.queryId )</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">                        gene2
: Feature( </span><b><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0);">eval</span></b><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">(gene2.isWithin(gene1, 500)) )</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></p>


<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">                  )</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">            )</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">      )</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></p>

<p class="MsoNormal" style=""><b><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0);">then</span></b><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">      </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></p>


<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">      Annotation
a = </span><b><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0);">new</span></b><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> Annotation(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&quot;lysine decarboxylase CadA&quot;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">);</span></p>


<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">      gene1.addAnnotation(a);</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></p>


<p class="MsoNormal" style=""><b><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0);">end</span></b><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></p>

<p class="MsoNormal"> </p>

<p class="MsoNormal">Any suggestions are much appreciated.</p>

<p class="MsoNormal">Thanks,</p>

<p class="MsoNormal">Nelson</p>

<p class="MsoNormal"> </p>

</div>

</div>


<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>  Edson Tirelli<br>  JBoss Drools Core Development<br>  JBoss by Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>