A.8.8 Table Access Protocol (TAP) Query

Table Access Protocol Window

Table Access Protocol Window

The Table Access Protocol (TAP) load window can be opened using the TAP Query button () from the Load Window's toolbar or the Control Window's VO menu. It allows you to use the TAP protocol to make freeform queries of remote database services using an SQL-like language. This is a powerful capability, giving you full access to remote data holdings; it's similar to systems like SDSS's CasJobs, but using the IVOA-endorsed TAP standard means that you can use the same interface for many different remote datasets.

TAP is more involved than the other VO protocols implemented by TOPCAT, and this window is correspondingly more complicated than the Cone, SIA and SSA dialogues, though it does share some features with them. In particular TAP caters specifically for long-running queries by allowing asynchronous submission in which you submit a job to the server, it runs for a potentially long time, and when it finishes the result can be collected from the server.

In order to interrogate the remote database you will have to write queries in Astronomical Data Query Language (ADQL). This is a powerful tool, but to do complicated things in it is not trivial. ADQL is essentially a particular dialect of SQL, so if you know SQL already, you should be able to write ADQL queries. If you have used systems like SDSS's CasJobs, the concept should be quite familiar. A tutorial on writing ADQL/SQL is beyond the scope of this manual, but the Enter Query tab provides an Examples menu which will give you a good start in using it.

The window is composed of four tabs, of which you can see one at a time. You will use two or three of them when submitting a TAP query. Each tab is described in more detail in the following subsections, but an overview of their operation is like this:

Select Service tab
Chooses the TAP service you wish to query, either using a registry search or by entering the service URL directly. Once you have chosen a service you can move to the Enter Query tab.
Enter Query tab
Displays information about the service and the tables it holds, and allows you to enter the text of the query and submit the job. When the job is submitted you will move to the Running Jobs tab.
Running Jobs tab
Shows a list of the query jobs you have submitted, with details on their progress.
Resume Job tab
Optionally allows you to resume a query started in some earlier session.

When you first visit this window, the Select Service tab will be visible, and when your query has been submitted the Running Jobs tab will be visible. If you want to submit another query to the same service, or use a different service, just select Enter Query or Select Service respectively, by clicking on the appropriate tab at the top.

This window offers one menu additional to the standard VO windows menus:

Deletion menu
Allows you to choose when asynchronously submitted jobs will be deleted from the server. Once they are deleted they will no longer be visible in the Running Jobs tab. If they are not deleted in this way, they will stay on the server until they are deleted according to the server's deletion policy. Choose one of the available options: If you want to resume the job in a later session, you'll have to choose Never.

The additional menu items are:

: Stay Open
Makes sure that the window is not automatically closed after it loads a table.
: Reload
Reloads information displayed in the window from the server. This may be updating job status information or reloading table or service metadata; the exact behaviour depends on which tab is currently visible.

Note: The TAP dialogue has been introduced at version 3.8 of TOPCAT, at a time when most available TAP services are quite new and may not fully conform to the standard, and usage patterns are still settling down. For this reason you may find that some TAP services visible do not behave quite as expected; it is also possible that in future versions the user interface will change in line with changing service profiles or in the light of user experience.