You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@oodt.apache.org by Sean Kelly <ke...@apache.org> on 2011/10/13 17:55:55 UTC

Re: DIS-style query error

>> DIS-style query2:
>> prod?q=RETURN = mrn AND RETURN = birth_dt_tm AND loc_nurse_unit_cd_desc_1 = 'PICU' OR loc_nurse_unit_cd_desc_1 = 'PICU2'
> 
> This isn't a valid DIS-tyle query. Note that you can't do RETURN = a *AND* b. It's RETURN = a AND RETURN = b.

I think it is valid. The constraint is "loc_nurse_unit_cd_desc_1 = 'PICU' OR loc_nurse_unit_cd_desc_1 = 'PICU2'" and the range is "mrn" and "birth_dt_tm".

We usually write all the RETURNs at the end:

	loc_nurse_unit_cd_desc_1 = 'PICU' OR loc_nurse_unit_cd_desc_1 = 'PICU2' AND RETURN = mrn AND RETURN = birth_dt_tm

But if I remember how the parser works, it doesn't matter where the RETURNs appear, or what conjunctive is used to attach them in. Or, at least, it shouldn't. (We have a bug?)

--k

Re: DIS-style query error

Posted by "Mattmann, Chris A (388J)" <ch...@jpl.nasa.gov>.
On Oct 13, 2011, at 8:55 AM, Sean Kelly wrote:

>>> DIS-style query2:
>>> prod?q=RETURN = mrn AND RETURN = birth_dt_tm AND loc_nurse_unit_cd_desc_1 = 'PICU' OR loc_nurse_unit_cd_desc_1 = 'PICU2'
>> 
>> This isn't a valid DIS-tyle query. Note that you can't do RETURN = a *AND* b. It's RETURN = a AND RETURN = b.
> 
> I think it is valid. The constraint is "loc_nurse_unit_cd_desc_1 = 'PICU' OR loc_nurse_unit_cd_desc_1 = 'PICU2'" and the range is "mrn" and "birth_dt_tm".
> 
> We usually write all the RETURNs at the end:
> 
> 	loc_nurse_unit_cd_desc_1 = 'PICU' OR loc_nurse_unit_cd_desc_1 = 'PICU2' AND RETURN = mrn AND RETURN = birth_dt_tm
> 
> But if I remember how the parser works, it doesn't matter where the RETURNs appear, or what conjunctive is used to attach them in. Or, at least, it shouldn't. (We have a bug?)

Good question; for whatever reason I was parsing the above as RETURN = a *AND* b when in fact it's RETURN = a *AND* b = c. That *is* valid, yes.

Cheers,
Chris

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Chris Mattmann, Ph.D.
Senior Computer Scientist
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 171-266B, Mailstop: 171-246
Email: chris.a.mattmann@nasa.gov
WWW:   http://sunset.usc.edu/~mattmann/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adjunct Assistant Professor, Computer Science Department
University of Southern California, Los Angeles, CA 90089 USA
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


Re: DIS-style query error

Posted by Sheryl John <sh...@gmail.com>.
Thanks for filing the issue, Ricky. I'll comment on the issue.

On Thu, Oct 13, 2011 at 11:01 AM, Nguyen, Ricky <rn...@chla.usc.edu>wrote:

> Filed OODT-333
> https://issues.apache.org/jira/browse/OODT-333
>
> On Oct 13, 2011, at 10:53 AM, Sean Kelly wrote:
>
> >> Theoretically, could we also do this?:
> >> RETURN = foo AND (foo = 'yes' OR bar = 'no') AND RETURN = bar
> >
> > I haven't looked at the code in a while (and I tend to drink heavily ^_^)
> but I believe that should be valid, yielding:
> >
> > - A constraint of "foo = 'yes' or bar = 'no'"
> > - A range of 'foo', 'bar'.
> >
> > --k
> >
>
>
>
>
> ---------------------------------------------------------------------
> CONFIDENTIALITY NOTICE: This e-mail message, including any attachments,
> is for the sole use of the intended recipient(s) and may contain
> confidential
> or legally privileged information. Any unauthorized review, use, disclosure
> or distribution is prohibited. If you are not the intended recipient,
> please
> contact the sender by reply e-mail and destroy all copies of this original
> message.
>
> ---------------------------------------------------------------------
>
>


-- 
-Sheryl

Re: DIS-style query error

Posted by "Mattmann, Chris A (388J)" <ch...@jpl.nasa.gov>.
On Oct 13, 2011, at 2:33 PM, Nguyen, Ricky wrote:

> I submitted a patch for OODT-333, but also filed OODT-334.

Thanks Ricky, I'm taking a look.

> 
> A fix for 334 could potentially affect backwards compatibility for XMLQuery. The workaround is to always group your criteria and put RETURNs at the end. Since this workaround is sufficient for now, I'll hold off on this issue until the PMC's can comment on the correct syntax.

Good question on OODT-334. Let me read more on the issue and think about it.

Back compat is definitely a big concern...

Cheers,
Chris

> 
> Thanks,
> Ricky
> 
> On Oct 13, 2011, at 11:01 AM, Nguyen, Ricky wrote:
> 
>> Filed OODT-333
>> https://issues.apache.org/jira/browse/OODT-333
>> 
>> On Oct 13, 2011, at 10:53 AM, Sean Kelly wrote:
>> 
>>>> Theoretically, could we also do this?:
>>>> RETURN = foo AND (foo = 'yes' OR bar = 'no') AND RETURN = bar
>>> 
>>> I haven't looked at the code in a while (and I tend to drink heavily ^_^) but I believe that should be valid, yielding:
>>> 
>>> - A constraint of "foo = 'yes' or bar = 'no'"
>>> - A range of 'foo', 'bar'.
>>> 
>>> --k
>>> 
>> 
>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, 
>> is for the sole use of the intended recipient(s) and may contain confidential
>> or legally privileged information. Any unauthorized review, use, disclosure
>> or distribution is prohibited. If you are not the intended recipient, please
>> contact the sender by reply e-mail and destroy all copies of this original message.  
>> 
>> ---------------------------------------------------------------------
>> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, 
> is for the sole use of the intended recipient(s) and may contain confidential
> or legally privileged information. Any unauthorized review, use, disclosure
> or distribution is prohibited. If you are not the intended recipient, please
> contact the sender by reply e-mail and destroy all copies of this original message.  
> 
> ---------------------------------------------------------------------
> 


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Chris Mattmann, Ph.D.
Senior Computer Scientist
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 171-266B, Mailstop: 171-246
Email: chris.a.mattmann@nasa.gov
WWW:   http://sunset.usc.edu/~mattmann/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adjunct Assistant Professor, Computer Science Department
University of Southern California, Los Angeles, CA 90089 USA
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


Re: DIS-style query error

Posted by "Mattmann, Chris A (388J)" <ch...@jpl.nasa.gov>.
On Oct 13, 2011, at 2:33 PM, Nguyen, Ricky wrote:

> I submitted a patch for OODT-333, but also filed OODT-334.

Thanks Ricky, I'm taking a look.

> 
> A fix for 334 could potentially affect backwards compatibility for XMLQuery. The workaround is to always group your criteria and put RETURNs at the end. Since this workaround is sufficient for now, I'll hold off on this issue until the PMC's can comment on the correct syntax.

Good question on OODT-334. Let me read more on the issue and think about it.

Back compat is definitely a big concern...

Cheers,
Chris

> 
> Thanks,
> Ricky
> 
> On Oct 13, 2011, at 11:01 AM, Nguyen, Ricky wrote:
> 
>> Filed OODT-333
>> https://issues.apache.org/jira/browse/OODT-333
>> 
>> On Oct 13, 2011, at 10:53 AM, Sean Kelly wrote:
>> 
>>>> Theoretically, could we also do this?:
>>>> RETURN = foo AND (foo = 'yes' OR bar = 'no') AND RETURN = bar
>>> 
>>> I haven't looked at the code in a while (and I tend to drink heavily ^_^) but I believe that should be valid, yielding:
>>> 
>>> - A constraint of "foo = 'yes' or bar = 'no'"
>>> - A range of 'foo', 'bar'.
>>> 
>>> --k
>>> 
>> 
>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, 
>> is for the sole use of the intended recipient(s) and may contain confidential
>> or legally privileged information. Any unauthorized review, use, disclosure
>> or distribution is prohibited. If you are not the intended recipient, please
>> contact the sender by reply e-mail and destroy all copies of this original message.  
>> 
>> ---------------------------------------------------------------------
>> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, 
> is for the sole use of the intended recipient(s) and may contain confidential
> or legally privileged information. Any unauthorized review, use, disclosure
> or distribution is prohibited. If you are not the intended recipient, please
> contact the sender by reply e-mail and destroy all copies of this original message.  
> 
> ---------------------------------------------------------------------
> 


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Chris Mattmann, Ph.D.
Senior Computer Scientist
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 171-266B, Mailstop: 171-246
Email: chris.a.mattmann@nasa.gov
WWW:   http://sunset.usc.edu/~mattmann/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adjunct Assistant Professor, Computer Science Department
University of Southern California, Los Angeles, CA 90089 USA
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


Re: DIS-style query error

Posted by "Nguyen, Ricky" <rn...@chla.usc.edu>.
I submitted a patch for OODT-333, but also filed OODT-334.

A fix for 334 could potentially affect backwards compatibility for XMLQuery. The workaround is to always group your criteria and put RETURNs at the end. Since this workaround is sufficient for now, I'll hold off on this issue until the PMC's can comment on the correct syntax.

Thanks,
Ricky

On Oct 13, 2011, at 11:01 AM, Nguyen, Ricky wrote:

> Filed OODT-333
> https://issues.apache.org/jira/browse/OODT-333
> 
> On Oct 13, 2011, at 10:53 AM, Sean Kelly wrote:
> 
>>> Theoretically, could we also do this?:
>>> RETURN = foo AND (foo = 'yes' OR bar = 'no') AND RETURN = bar
>> 
>> I haven't looked at the code in a while (and I tend to drink heavily ^_^) but I believe that should be valid, yielding:
>> 
>> - A constraint of "foo = 'yes' or bar = 'no'"
>> - A range of 'foo', 'bar'.
>> 
>> --k
>> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, 
> is for the sole use of the intended recipient(s) and may contain confidential
> or legally privileged information. Any unauthorized review, use, disclosure
> or distribution is prohibited. If you are not the intended recipient, please
> contact the sender by reply e-mail and destroy all copies of this original message.  
> 
> ---------------------------------------------------------------------
> 




---------------------------------------------------------------------
CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, 
is for the sole use of the intended recipient(s) and may contain confidential
or legally privileged information. Any unauthorized review, use, disclosure
or distribution is prohibited. If you are not the intended recipient, please
contact the sender by reply e-mail and destroy all copies of this original message.  

---------------------------------------------------------------------


Re: DIS-style query error

Posted by Sheryl John <sh...@gmail.com>.
Thanks for filing the issue, Ricky. I'll comment on the issue.

On Thu, Oct 13, 2011 at 11:01 AM, Nguyen, Ricky <rn...@chla.usc.edu>wrote:

> Filed OODT-333
> https://issues.apache.org/jira/browse/OODT-333
>
> On Oct 13, 2011, at 10:53 AM, Sean Kelly wrote:
>
> >> Theoretically, could we also do this?:
> >> RETURN = foo AND (foo = 'yes' OR bar = 'no') AND RETURN = bar
> >
> > I haven't looked at the code in a while (and I tend to drink heavily ^_^)
> but I believe that should be valid, yielding:
> >
> > - A constraint of "foo = 'yes' or bar = 'no'"
> > - A range of 'foo', 'bar'.
> >
> > --k
> >
>
>
>
>
> ---------------------------------------------------------------------
> CONFIDENTIALITY NOTICE: This e-mail message, including any attachments,
> is for the sole use of the intended recipient(s) and may contain
> confidential
> or legally privileged information. Any unauthorized review, use, disclosure
> or distribution is prohibited. If you are not the intended recipient,
> please
> contact the sender by reply e-mail and destroy all copies of this original
> message.
>
> ---------------------------------------------------------------------
>
>


-- 
-Sheryl

Re: DIS-style query error

Posted by "Nguyen, Ricky" <rn...@chla.usc.edu>.
I submitted a patch for OODT-333, but also filed OODT-334.

A fix for 334 could potentially affect backwards compatibility for XMLQuery. The workaround is to always group your criteria and put RETURNs at the end. Since this workaround is sufficient for now, I'll hold off on this issue until the PMC's can comment on the correct syntax.

Thanks,
Ricky

On Oct 13, 2011, at 11:01 AM, Nguyen, Ricky wrote:

> Filed OODT-333
> https://issues.apache.org/jira/browse/OODT-333
> 
> On Oct 13, 2011, at 10:53 AM, Sean Kelly wrote:
> 
>>> Theoretically, could we also do this?:
>>> RETURN = foo AND (foo = 'yes' OR bar = 'no') AND RETURN = bar
>> 
>> I haven't looked at the code in a while (and I tend to drink heavily ^_^) but I believe that should be valid, yielding:
>> 
>> - A constraint of "foo = 'yes' or bar = 'no'"
>> - A range of 'foo', 'bar'.
>> 
>> --k
>> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, 
> is for the sole use of the intended recipient(s) and may contain confidential
> or legally privileged information. Any unauthorized review, use, disclosure
> or distribution is prohibited. If you are not the intended recipient, please
> contact the sender by reply e-mail and destroy all copies of this original message.  
> 
> ---------------------------------------------------------------------
> 




---------------------------------------------------------------------
CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, 
is for the sole use of the intended recipient(s) and may contain confidential
or legally privileged information. Any unauthorized review, use, disclosure
or distribution is prohibited. If you are not the intended recipient, please
contact the sender by reply e-mail and destroy all copies of this original message.  

---------------------------------------------------------------------


Re: DIS-style query error

Posted by "Nguyen, Ricky" <rn...@chla.usc.edu>.
Filed OODT-333
https://issues.apache.org/jira/browse/OODT-333

On Oct 13, 2011, at 10:53 AM, Sean Kelly wrote:

>> Theoretically, could we also do this?:
>> RETURN = foo AND (foo = 'yes' OR bar = 'no') AND RETURN = bar
> 
> I haven't looked at the code in a while (and I tend to drink heavily ^_^) but I believe that should be valid, yielding:
> 
> - A constraint of "foo = 'yes' or bar = 'no'"
> - A range of 'foo', 'bar'.
> 
> --k
> 




---------------------------------------------------------------------
CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, 
is for the sole use of the intended recipient(s) and may contain confidential
or legally privileged information. Any unauthorized review, use, disclosure
or distribution is prohibited. If you are not the intended recipient, please
contact the sender by reply e-mail and destroy all copies of this original message.  

---------------------------------------------------------------------


Re: DIS-style query error

Posted by "Nguyen, Ricky" <rn...@chla.usc.edu>.
Filed OODT-333
https://issues.apache.org/jira/browse/OODT-333

On Oct 13, 2011, at 10:53 AM, Sean Kelly wrote:

>> Theoretically, could we also do this?:
>> RETURN = foo AND (foo = 'yes' OR bar = 'no') AND RETURN = bar
> 
> I haven't looked at the code in a while (and I tend to drink heavily ^_^) but I believe that should be valid, yielding:
> 
> - A constraint of "foo = 'yes' or bar = 'no'"
> - A range of 'foo', 'bar'.
> 
> --k
> 




---------------------------------------------------------------------
CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, 
is for the sole use of the intended recipient(s) and may contain confidential
or legally privileged information. Any unauthorized review, use, disclosure
or distribution is prohibited. If you are not the intended recipient, please
contact the sender by reply e-mail and destroy all copies of this original message.  

---------------------------------------------------------------------


Re: DIS-style query error

Posted by Sean Kelly <ke...@apache.org>.
> Theoretically, could we also do this?:
> RETURN = foo AND (foo = 'yes' OR bar = 'no') AND RETURN = bar

I haven't looked at the code in a while (and I tend to drink heavily ^_^) but I believe that should be valid, yielding:

- A constraint of "foo = 'yes' or bar = 'no'"
- A range of 'foo', 'bar'.

--k


Re: DIS-style query error

Posted by Sean Kelly <ke...@apache.org>.
> Theoretically, could we also do this?:
> RETURN = foo AND (foo = 'yes' OR bar = 'no') AND RETURN = bar

I haven't looked at the code in a while (and I tend to drink heavily ^_^) but I believe that should be valid, yielding:

- A constraint of "foo = 'yes' or bar = 'no'"
- A range of 'foo', 'bar'.

--k


Re: DIS-style query error

Posted by "Nguyen, Ricky" <rn...@chla.usc.edu>.
Yes, I agree that it is valid. I will file an issue and create a unit test to reproduce the issue. I'll use query strings like these:
RETURN = foo AND RETURN = bar AND (foo = 'yes' OR bar = 'no')
(foo = 'yes' OR bar = 'no') AND RETURN = foo AND RETURN = bar

I assume AND has precedence over OR, so the parentheses are necessary. (What does a RETURN triple evaluate to?)

Theoretically, could we also do this?:
RETURN = foo AND (foo = 'yes' OR bar = 'no') AND RETURN = bar

-Ricky

On Oct 13, 2011, at 8:55 AM, Sean Kelly wrote:

>>> DIS-style query2:
>>> prod?q=RETURN = mrn AND RETURN = birth_dt_tm AND loc_nurse_unit_cd_desc_1 = 'PICU' OR loc_nurse_unit_cd_desc_1 = 'PICU2'
>> 
>> This isn't a valid DIS-tyle query. Note that you can't do RETURN = a *AND* b. It's RETURN = a AND RETURN = b.
> 
> I think it is valid. The constraint is "loc_nurse_unit_cd_desc_1 = 'PICU' OR loc_nurse_unit_cd_desc_1 = 'PICU2'" and the range is "mrn" and "birth_dt_tm".
> 
> We usually write all the RETURNs at the end:
> 
> 	loc_nurse_unit_cd_desc_1 = 'PICU' OR loc_nurse_unit_cd_desc_1 = 'PICU2' AND RETURN = mrn AND RETURN = birth_dt_tm
> 
> But if I remember how the parser works, it doesn't matter where the RETURNs appear, or what conjunctive is used to attach them in. Or, at least, it shouldn't. (We have a bug?)
> 
> --k




---------------------------------------------------------------------
CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, 
is for the sole use of the intended recipient(s) and may contain confidential
or legally privileged information. Any unauthorized review, use, disclosure
or distribution is prohibited. If you are not the intended recipient, please
contact the sender by reply e-mail and destroy all copies of this original message.  

---------------------------------------------------------------------


Re: DIS-style query error

Posted by "Nguyen, Ricky" <rn...@chla.usc.edu>.
Yes, I agree that it is valid. I will file an issue and create a unit test to reproduce the issue. I'll use query strings like these:
RETURN = foo AND RETURN = bar AND (foo = 'yes' OR bar = 'no')
(foo = 'yes' OR bar = 'no') AND RETURN = foo AND RETURN = bar

I assume AND has precedence over OR, so the parentheses are necessary. (What does a RETURN triple evaluate to?)

Theoretically, could we also do this?:
RETURN = foo AND (foo = 'yes' OR bar = 'no') AND RETURN = bar

-Ricky

On Oct 13, 2011, at 8:55 AM, Sean Kelly wrote:

>>> DIS-style query2:
>>> prod?q=RETURN = mrn AND RETURN = birth_dt_tm AND loc_nurse_unit_cd_desc_1 = 'PICU' OR loc_nurse_unit_cd_desc_1 = 'PICU2'
>> 
>> This isn't a valid DIS-tyle query. Note that you can't do RETURN = a *AND* b. It's RETURN = a AND RETURN = b.
> 
> I think it is valid. The constraint is "loc_nurse_unit_cd_desc_1 = 'PICU' OR loc_nurse_unit_cd_desc_1 = 'PICU2'" and the range is "mrn" and "birth_dt_tm".
> 
> We usually write all the RETURNs at the end:
> 
> 	loc_nurse_unit_cd_desc_1 = 'PICU' OR loc_nurse_unit_cd_desc_1 = 'PICU2' AND RETURN = mrn AND RETURN = birth_dt_tm
> 
> But if I remember how the parser works, it doesn't matter where the RETURNs appear, or what conjunctive is used to attach them in. Or, at least, it shouldn't. (We have a bug?)
> 
> --k




---------------------------------------------------------------------
CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, 
is for the sole use of the intended recipient(s) and may contain confidential
or legally privileged information. Any unauthorized review, use, disclosure
or distribution is prohibited. If you are not the intended recipient, please
contact the sender by reply e-mail and destroy all copies of this original message.  

---------------------------------------------------------------------


Re: DIS-style query error

Posted by "Mattmann, Chris A (388J)" <ch...@jpl.nasa.gov>.
On Oct 13, 2011, at 8:55 AM, Sean Kelly wrote:

>>> DIS-style query2:
>>> prod?q=RETURN = mrn AND RETURN = birth_dt_tm AND loc_nurse_unit_cd_desc_1 = 'PICU' OR loc_nurse_unit_cd_desc_1 = 'PICU2'
>> 
>> This isn't a valid DIS-tyle query. Note that you can't do RETURN = a *AND* b. It's RETURN = a AND RETURN = b.
> 
> I think it is valid. The constraint is "loc_nurse_unit_cd_desc_1 = 'PICU' OR loc_nurse_unit_cd_desc_1 = 'PICU2'" and the range is "mrn" and "birth_dt_tm".
> 
> We usually write all the RETURNs at the end:
> 
> 	loc_nurse_unit_cd_desc_1 = 'PICU' OR loc_nurse_unit_cd_desc_1 = 'PICU2' AND RETURN = mrn AND RETURN = birth_dt_tm
> 
> But if I remember how the parser works, it doesn't matter where the RETURNs appear, or what conjunctive is used to attach them in. Or, at least, it shouldn't. (We have a bug?)

Good question; for whatever reason I was parsing the above as RETURN = a *AND* b when in fact it's RETURN = a *AND* b = c. That *is* valid, yes.

Cheers,
Chris

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Chris Mattmann, Ph.D.
Senior Computer Scientist
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 171-266B, Mailstop: 171-246
Email: chris.a.mattmann@nasa.gov
WWW:   http://sunset.usc.edu/~mattmann/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adjunct Assistant Professor, Computer Science Department
University of Southern California, Los Angeles, CA 90089 USA
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++