ADQL Validator

Check the correctness of your ADQL query.


This web page aims also to be a demonstration of what the ADQL library can do (parse ADQL, transform the query in a Java object tree and translate in SQL). So it is just a simple form to submit an ADQL query to the ADQL validator available on this website and to display properly the result of the validation.


The ADQL validator itself can be called with the following URL:

Only 4 parameters can be provided: query, tables and translator. The parameter query is the only mandatory parameter.

version is optional. It sets the ADQL language version of the parser. If omitted, it is set by default to the last official ADQL version (today: ADQL-2.0).

tables is optional and is either a URL toward the tables list or a file containing the tables list. If this parameter is not provided, only the syntax is checked (not the tables and columns names).

translator is optional and must be one of the following values: psql (or postgres or postgresql), pgsphere, mysql or sqlserver. If this parameter is not provided or is incorrect, the default translator will be selected: pgsphere.

Parameters may be provided either in GET or POST. If the tables list is given into a file, both parameters must be written in a POST multipart request (and then tables will contain the file content).

Tables list format

The validator lets you parse and validate an ADQL query over a given list of tables. If no tables list is provided, only the syntax of the query will be checked.

This list is an XML document following the schema VODataResource. The expected root node is tableSet. This document is exactly the same as the "tables" resource of a TAP service. Thus, you can easily have an example using any well implemented TAP service you know. A list of some known TAP services is provided in the form below.

ADQL query:

(optional) ADQL version: (REC_2.0)

(optional) Tables and columns:

OR URL: OR a file:

(optional) ADQL to SQL translator to use: (adql.translator.PgSphereTranslator)

    Correction suggestion:

    The same query you have written but in a SQL executable by Postgres+PgSphere


    The tree drawn below represents the syntactic tree generated by the ADQL library. In each node, you have the name of the Java class (with a link toward its Javadoc) and the name/type of the object. By clicking on a node, you can expand or collapse it and so show or hide its children.