.TH STILTS-TAPQUERY 1 "Mar 2017" "" "Stilts commands" .SH NAME stilts-tapquery \- Queries a Table Access Protocol server .SH SYNOPSIS .ad l .HP 16 .hy 0 \fBstilts tapquery\fR [nupload=\fI\fR] [ufmtN=\fI\fR] [uploadN=\fI\fR] [ucmdN=\fI\fR] [ocmd=\fI\fR] [omode=\fIout|meta|stats|count|checksum|cgi|discard|topcat|samp|tosql|gui\fR] [out=\fI\fR] [ofmt=\fI\fR] [upnameN=\fI\fR] [tapurl=\fI\fR] [interface=\fItap1.0|tap1.1|cap\fR] [adql=\fI\fR] [parse=\fItrue|false\fR] [sync=\fItrue|false\fR] [maxrec=\fI\fR] [destruction=\fI\fR] [executionduration=\fI\fR] [compress=\fItrue|false\fR] [upvotformat=\fITABLEDATA|BINARY|BINARY2\fR] [language=\fI\fR] [poll=\fI\fR] [progress=\fItrue|false\fR] [delete=\fIfinished|never|always|now\fR] .hy .ad .SH DESCRIPTION .PP \fItapquery\fR can query remote databases using the Table Access Protocol (TAP) services by submitting Astronomical Data Query Language queries to them and retrieving the results. TAP and ADQL are Virtual Observatory protocols. .PP Queries can be submitted in either synchronous or asynchronous mode, as determined by the \fIsync\fR parameter. In asynchronous mode, if the query has not been deleted by the time the command exits (see the \fIdelete\fR parameter), the result can be picked up at a later stage using the \fItapresume\fR command. Table uploads are supported, so it is possible (if the service supports this functionality), to upload a local table to the remote database, perform a query involving it, such as a join with a remote table of some sort, and receive the result. This powerful facility gives you crossmatches between local and remote tables. .PP This command does not provide any facility for querying the service for either table or capability metadata, so you will need to know about the service capabilities and database structure from some other source (possibly TOPCAT). .PP \fBNote:\fR this command has been introduced at STILTS version 2.3, at which time most available TAP services are quite new and may not fully conform to the standards, and usage patterns are still settling down. For this reason you may find that some TAP services do not behave quite as expected; it is also possible that in future versions the command behaviour or parameters will change in line with changing service profiles or in the light of user experience. .SH OPTIONS .TP \fBnupload=\fI\fR .RS The number of upload tables for this task. For each of the upload tables N there will be associated parameters \fIufmtN\fR, \fIuploadN\fR and \fIucmdN\fR. .RE .TP \fBufmtN=\fI\fR .RS Specifies the format of upload table #N as specified by parameter \fIuploadN\fR. The known formats are listed in SUN/256. This flag can be used if you know what format your table is in. If it has the special value \fI(auto)\fR (the default), then an attempt will be made to detect the format of the table automatically. This cannot always be done correctly however, in which case the program will exit with an error explaining which formats were attempted. This parameter is ignored for scheme-specified tables. .RE .TP \fBuploadN=\fI\fR .RS The location of upload table #N. This may take one of the following forms: .RS 2 .IP * 2 A filename. .IP * 2 A URL. .IP * 2 The special value "\fI-\fR", meaning standard input. In this case the input format must be given explicitly using the \fIufmtN\fR parameter. Note that not all formats can be streamed in this way. .IP * 2 A scheme specification of the form \fI::\fR. .IP * 2 A system command line with either a "\fI<\fR" character at the start, or a "\fI|\fR" character at the end ("\fI\fR .RS Specifies processing to be performed on upload table #N as specified by parameter \fIuploadN\fR, before any other processing has taken place. The value of this parameter is one or more of the filter commands described in SUN/256. If more than one is given, they must be separated by semicolon characters (";"). This parameter can be repeated multiple times on the same command line to build up a list of processing steps. The sequence of commands given in this way defines the processing pipeline which is performed on the table. .PP Commands may alteratively be supplied in an external file, by using the indirection character '@'. Thus a value of "\fI@filename\fR" causes the file \fIfilename\fR to be read for a list of filter commands to execute. The commands in the file may be separated by newline characters and/or semicolons, and lines which are blank or which start with a '\fI#\fR' character are ignored. .RE .TP \fBocmd=\fI\fR .RS Specifies processing to be performed on the output table, after all other processing has taken place. The value of this parameter is one or more of the filter commands described in SUN/256. If more than one is given, they must be separated by semicolon characters (";"). This parameter can be repeated multiple times on the same command line to build up a list of processing steps. The sequence of commands given in this way defines the processing pipeline which is performed on the table. .PP Commands may alteratively be supplied in an external file, by using the indirection character '@'. Thus a value of "\fI@filename\fR" causes the file \fIfilename\fR to be read for a list of filter commands to execute. The commands in the file may be separated by newline characters and/or semicolons, and lines which are blank or which start with a '\fI#\fR' character are ignored. .RE .TP \fBomode=\fIout|meta|stats|count|checksum|cgi|discard|topcat|samp|tosql|gui\fR .RS The mode in which the result table will be output. The default mode is \fIout\fR, which means that the result will be written as a new table to disk or elsewhere, as determined by the \fIout\fR and \fIofmt\fR parameters. However, there are other possibilities, which correspond to uses to which a table can be put other than outputting it, such as displaying metadata, calculating statistics, or populating a table in an SQL database. For some values of this parameter, additional parameters (\fI\fR) are required to determine the exact behaviour. .PP Possible values are .RS 2 .IP * 2 \fIout\fR .IP * 2 \fImeta\fR .IP * 2 \fIstats\fR .IP * 2 \fIcount\fR .IP * 2 \fIchecksum\fR .IP * 2 \fIcgi\fR .IP * 2 \fIdiscard\fR .IP * 2 \fItopcat\fR .IP * 2 \fIsamp\fR .IP * 2 \fItosql\fR .IP * 2 \fIgui\fR .RE Use the \fIhelp=omode\fR flag or see SUN/256 for more information. .RE .TP \fBout=\fI\fR .RS The location of the output table. This is usually a filename to write to. If it is equal to the special value "-" (the default) the output table will be written to standard output. .PP This parameter must only be given if \fIomode\fR has its default value of "\fIout\fR". .RE .TP \fBofmt=\fI\fR .RS Specifies the format in which the output table will be written (one of the ones in SUN/256 - matching is case-insensitive and you can use just the first few letters). If it has the special value "\fI(auto)\fR" (the default), then the output filename will be examined to try to guess what sort of file is required usually by looking at the extension. If it's not obvious from the filename what output format is intended, an error will result. .PP This parameter must only be given if \fIomode\fR has its default value of "\fIout\fR". .RE .TP \fBupnameN=\fI\fR .RS Identifier to use in server-side expressions for uploaded table #N. In ADQL expressions, the table should be referred to as "\fITAP_UPLOAD.