0 votes
470 views
It appears that the radial query function is not recognized when accessing catalogs through the API:

https://datalab.noao.edu/tap/sync?request=doQuery&lang=ADQL&format=csv&query=SELECT%20unwise_objid,%20ra,%20dec,%20mag_w1_vg,%20mag_w2_vg,%20w1_w2_vg,%20qf_w1,%20qf_w2,%20flags_unwise_w1,%20flags_unwise_w2,%20flags_info_w1,%20flags_info_w2%20FROM%20unwise_dr1.object%20WHERE%20Q3C_RADIAL_QUERY(ra,%20dec,%201.0,%201.0,%200.002777777777777778);

Response:<?xml version="1.0" encoding="UTF-8"?>
<VOTABLE xmlns="http://www.ivoa.net/xml/VOTable/v1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2">
  <RESOURCE type="results">
    <INFO name="QUERY_STATUS" value="ERROR">IllegalArgumentException: net.sf.jsqlparser.JSQLParserException JSQLParserException:  ParseException: Encountered "Q3C_RADIAL_QUERY ( ra , dec , 0.0 , 0.0 , 0.002777777777777778 ) ;" at line 1, column 169.
by | 470 views

1 Answer

0 votes
It appears that the ADQL string isn't being converted to lower-case before being submitted to the TAP service, we'll fix that.  The workaround is to simply make the q3c_radial_query function name lower-case yourself.  Please let us know if you continue to have problems.
by datalab (21.6k points)
It still doesn't work:
<?xml version="1.0" encoding="UTF-8"?>
<VOTABLE xmlns="http://www.ivoa.net/xml/VOTable/v1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2">
  <RESOURCE type="results">
    <INFO name="QUERY_STATUS" value="ERROR">IllegalArgumentException: net.sf.jsqlparser.JSQLParserException JSQLParserException:  ParseException: Encountered "q3c_radial_query ( ra , dec , 0.0 , 0.0 , 0.002777777777777778 ) ;" at line 1, column 169.
Are you calling the URL in your original message directly using e.g. 'wget' or 'curl'?  Since the subject mentioned 'API' the lower-case is an issue for the queryClient interface or the query web tool, and from TOPCAT you would get a parser error from TOPCAT, but I can reproduce the message using wget/curl directly.

The problem in that case is that q3c_radial_query() is a boolean function.  The queryClient API rewrites the query so that it reads as something like

      ...... WHERE 't' = q3c_radial_query(.....)

For example, your URL request would become something like

wget -O - "https://datalab.noao.edu/tap/sync?request=doQuery&lang=ADQL&format=csv&query=SELECT%20unwise_objid,%20ra,%20dec,%20mag_w1_vg,%20mag_w2_vg,%20w1_w2_vg,%20qf_w1,%20qf_w2,%20flags_unwise_w1,%20flags_unwise_w2,%20flags_info_w1,%20flags_info_w2%20FROM%20unwise_dr1.object%20WHERE%20%27t%27%3DQ3C_RADIAL_QUERY(ra,%20dec,%201.0,%201.0,%200.002777777777777778);"
Yes, that was it: WHERE 't' = q3c_radial_query(.....)
It's working now, thank you very much!

453 questions

465 answers

474 comments

659 users

Welcome to Data Lab Help Desk, where you can ask questions and receive answers from other members of the community.

Categories