Skip to content

Commit ace4fe4

Browse files
authored
Merge pull request #64 from molinaro-m/responseformat
adding RESPONSEFORMAT, DALI error responses & OVERFLOW usage
2 parents 21f5389 + 0635b3d commit ace4fe4

File tree

2 files changed

+130
-146
lines changed

2 files changed

+130
-146
lines changed

ConeSearch.tex

Lines changed: 129 additions & 145 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,14 @@ \section{Service Interface Requirements}
107107
\label{sec:2}
108108

109109
A service implementation that is compliant with this standard must meet
110-
the following requirements:
110+
the requirements described in the following 3 subsections
111+
(\ref{subsec:baseurl}, \ref{subsec:response}, and \ref{subsec:error}).
111112

112-
\begin{enumerate}
113-
\item the service must respond to a HTTP GET request
114-
represented by a URL having two parts:\\
113+
\subsection{Query resource}
114+
\label{subsec:baseurl}
115+
116+
The service must respond to a HTTP GET request
117+
represented by a URL having two parts:\\
115118

116119
\begin{itemize}
117120
\item A base URL of the form\\
@@ -167,11 +170,18 @@ \section{Service Interface Requirements}
167170
\item[Example]
168171
\url{http://mycone.org/cgi-bin/search?RA=180.567&DEC=-30.45&SR=0.0125}
169172
\end{bigdescription}
170-
\item As defined by DALI a service SHOULD also understand the following parameter:
173+
\item As defined by DALI a service SHOULD also understand the following parameters:
171174
\begin{description}
172175
\item[\textbf{MAXREC}] to let the client limit the number of records returned
173-
or require a service metadata response. Its usage is encouraged and preferred
174-
to the SR=0 solution for metadata discovery.
176+
or require a service metadata response. That means that a
177+
request including any of MAXREC or SR set with a value of 0
178+
should require a metadata response.
179+
\item[\textbf{RESPONSEFORMAT}] to allow alternative optional response
180+
formats other than the mandatory VOTable one. Indeed, a Simple
181+
Cone Search service MUST provide responses in VOTable format \citep{2025ivoa.spec.0116O},
182+
compliant with respect to what will
183+
be detailed in the next subsection (Sec.~\ref{subsec:response}), but should also
184+
support the DALI RESPONSEFORMAT parameter.
175185
\end{description}
176186
\item The query MAY contain the optional parameter,
177187
\textbf{VERB}, whose value is an integer--either 1, 2, or 3--indicating
@@ -198,146 +208,115 @@ \section{Service Interface Requirements}
198208
A query following this syntax represents a request for
199209
information on sources located within the specified cone on the sky.
200210

201-
\item The service must respond with an XML document in the VOTable
202-
format, that represents a table of astronomical sources whose positions
203-
are within the cone (see Appendix \ref{appendix:a} for an example).
204-
There may also be other sources outside the cone -- the service
205-
implementor may decide on the exact search criterion used internally to
206-
the service to select the sources. The base MIME-type of the HTTP
207-
response should be \texttt{text/xml}. The more specific form
208-
\texttt{text/xml;content=x-votable} may optionally be used. The
209-
MIME-type, \texttt{text/xml;votable} shall also be considered legal (for
210-
backward compatibility reasons); however, this value is strongly
211-
discouraged as it is not compliant with the MIME-type standard
212-
\citep{std:MIME}. Simple Cone Search services MUST return VOTable
213-
version 1 documents.
214-
215-
\begin{bigdescription}
216-
\item[Editor's Note] The original NVO specification allowed a
217-
MIME-type of text/xml;votable, thus for backward
218-
compatibility this is still allowed but discouraged.
219-
\end{bigdescription}
220-
221-
The VOTable MUST comply with these conditions:
211+
\subsection{Succesful response}
212+
\label{subsec:response}
213+
214+
A successfull response from a Cone Search service \textbf{must} be a
215+
table containing the astronomical sources whose positions are within the
216+
cone described by the query parameter values described in
217+
Sec.~\ref{subsec:baseurl}. The service implementor may decide on the exact
218+
search criterion used to select the sources, including also other
219+
sources outside the cone.
220+
The response table \textbf{must} contain, alongside all possible columns
221+
available in the served source catalog:
222+
\begin{itemize}
223+
\item one string column representing an ID for that record of the table.
224+
This identifier may not be repeated in the table, and it could be used to
225+
retrieve that same record again from that same table;
226+
\item one numerical column representing the main value for the
227+
right-ascension of the source in the ICRS coordinate system;
228+
\item one numerical column representing the main value for the
229+
declination of the source in the ICRS coordinate system.
230+
\end{itemize}
231+
Right-ascension and declination of the output columns \textbf{MUST} be in decimal degrees.
232+
233+
By default, the service \textbf{must} respond with an XML document in the
234+
VOTable\citep{2025ivoa.spec.0116O} format. However, if RESPONSEFORMAT is
235+
set (see Sec.~\ref{subsec:baseurl}) the response table \textbf{should}
236+
match the requested format; if this format is unsupported the request
237+
\textbf{should} fail.
238+
239+
When the response is in the default VOTable format (see Appendix \ref{appendix:a}
240+
for an example), the MIME-type of the HTTP response \textbf{should} be
241+
set to \texttt{application/x-votable+xml}. The form
242+
\texttt{text/xml} can optionally be used, while the
243+
form \texttt{text/xml;votable} shall be considered legal
244+
only for backward compatibility reasons
245+
\footnote{
246+
The original NVO specification allowed a MIME-type of text/xml;votable,
247+
this is why for backward compatibility this is still allowed but discouraged.
248+
}
249+
and is strongly discouraged as it is not compliant with the MIME-type
250+
standard \citep{std:MIME}.
251+
252+
Simple Cone Search services \textbf{MUST} return VOTable
253+
version 1 documents.
254+
255+
The response in VOTable format \textbf{MUST} follow the prescriptions on
256+
VOTable usage in result contained (currently) in Sec. 4.4 of the DALI 1.1
257+
specification. Moreover it \textbf{MUST} comply with these conditions:
222258

223-
\begin{itemize}
224-
\item There must be a single RESOURCE with \texttt{type=''results''} in the VOTable,
225-
and that RESOURCE must contain a single TABLE. Additional RESOURCE(s) are
226-
allowed to enable, e.g., DataLink service descriptors.
227-
\item The TABLE must have FIELDS where
228-
the following UCD values have been set. There must only be one FIELD
229-
with each of these UCDs:
230-
231-
\begin{itemize}
232-
\item Exactly one FIELD must have ucd="meta.id;meta.main",
233-
with an array character type (fixed or variable
234-
length), representing an ID string for that record of the table. This
235-
identifier may not be repeated in the table, and it could be used to
236-
retrieve that same record again from that same table.
237-
\item Exactly one FIELD must have ucd="pos.eq.ra;meta.main",
238-
representing the right-ascension of the source in the ICRS coordinate system.
239-
\item Exactly one FIELD must have ucd="pos.eq.dec;meta.main",
240-
representing the declination of the source in the ICRS coordinate system.
241-
\item The above right-ascension and declination FIELD(s) must have the datatype
242-
attribute set to float or double, following the VOTable standard \citep{2019ivoa.spec.1021O}.
243-
\end{itemize}
244-
245-
\item The VOTable may include an expression of the
246-
uncertainty of the positions given in the above mentioned fields to be
247-
interpreted either as a positional error of the source positions, or an
248-
angular size if the sources are resolved. If this uncertainty is not
249-
provided, it should be taken to be zero; otherwise, it may be set for
250-
all table entries with a PARAM in the RESOURCE which has a UCD that is
251-
set to phys.angSize;obs and has a value which is the angle in decimal
252-
degrees. Alternatively, a different value for each row in the table can
253-
be given via a FIELD in the table having a UCD set to phys.angSize;obs.
254-
\item There may be other FIELDs in the table. Their specification should
255-
include a description, data-type, and UCD.
256-
\end{itemize}
257-
258-
\item The service must respond with a stubbed version of the VOTable in the case
259-
of error. This must happen if the three required parameters (RA, DEC,
260-
SR) are not all present, or if their values cannot be parsed to
261-
floating-point numbers, or if the numbers are out of range (DEC=91.0,
262-
for example). The service may also make an error return if the search
263-
radius (give by the SR parameter) is larger than the MaxSR parameter of
264-
the Resource Profile (see Section \ref{sec:3}). In the case of error,
265-
the service MUST respond with a VOTable that contains a PARAM element or
266-
an INFO element with \texttt{name="Error"}, where thecorresponding value
267-
attribute should contain some explanation of the nature of the error. No
268-
other PARAM or INFO element in the response can be present having
269-
\texttt{name=''Error''} set, but additional INFO and PARAM elements with
270-
the name parameter set to a different value are allowed. If an INFO
271-
element is used, it must appear as a direct child of one of the
272-
following elements:
273-
274-
\begin{itemize}
275-
\item the root VOTABLE element (which is preferred by this document), or
276-
\item the RESOURCE element
277-
\end{itemize}
278-
279-
If a PARAM element is used, it must appear as a direct
280-
child of one of following elements:
281-
282-
\begin{itemize}
283-
\item the RESOURCE element, or
284-
\item a DEFINITION element below the root VOTABLE element
285-
(which is discouraged by this document).
286-
\end{itemize}
259+
\begin{itemize}
260+
\item There must be a single RESOURCE with \texttt{type=''results''} in the VOTable,
261+
and that RESOURCE must contain a single TABLE. Additional RESOURCE(s) are
262+
allowed to enable, e.g., DataLink service descriptors.
263+
\item The TABLE must have FIELDS where
264+
the following UCD values have been set. There must only be one FIELD
265+
with each of these UCDs:
287266

288-
\begin{bigdescription}
289-
\item[Editor's Note]
290-
It was recognized that this
291-
requirement, as it was described in the original NVO specification, is
292-
ambiguous about both the element to use for the ERROR message and its
293-
location in the document. The VOTable standard allows PARAM and INFO
294-
elements to appear in various places within the document. Since several
295-
of the different methods have been used in practice by Cone Search
296-
service implementations, no attempt is made in this version to correct
297-
this ambiguity. All of the above-mentioned locations should be
298-
considered legal, and Cone Search service clients should be prepared to
299-
look in all of them for an ERROR message. The use of PARAM as a child of
300-
DEFINITIONS is discouraged as the DEFINITIONS element was deprecated in
301-
VOTable v1.1.
302-
\end{bigdescription}
303-
\begin{bigdescription}
304-
\item[Example Error Responses]
305-
Error INFO as child of VOTABLE (preferred)\\
306-
307-
\begin{lstlisting}[language=XML,basicstyle=\footnotesize]
308-
<VOTABLE xmlns="http://www.ivoa.net/xml/VOTable/v1.3">
309-
<INFO ID="Error" name="Error"
310-
value="Field RA: 'as3f' is not a valid literal for RA"/>
311-
<RESOURCE/>
312-
</VOTABLE>
313-
\end{lstlisting}
314-
315-
Error PARAM as child of RESOURCE (allowed)
316-
317-
\begin{lstlisting}[language=XML,basicstyle=\footnotesize]
318-
<?xml version="1.0"?>
319-
<!DOCTYPE VOTABLE SYSTEM "http://us-vo.org/xml/VOTable.dtd">
320-
<VOTABLE version="1.0">
321-
<DESCRIPTION>
322-
HEASARC Browse data service
323-
Please send inquiries to mailto:[email protected]
324-
</DESCRIPTION>
325-
<RESOURCE ID="error_resource">
326-
<PARAM ID="Error" name="Error" datatype="char" arraysize="*"
327-
value="Invalid data type: text/html"/>
328-
</RESOURCE>
329-
</VOTABLE>
330-
\end{lstlisting}
331-
332-
\end{bigdescription}
333-
334-
Other conditions may
335-
NOT be considered erroneous, for example if a query cone is in the
336-
Southern hemisphere and the catalog coverage is in the Northern
337-
hemisphere. This type of query is different from an error return; it
338-
should return a VOTable as described above, with metadata, but no data
339-
records.
340-
\end{enumerate}
267+
\begin{itemize}
268+
\item Exactly one FIELD must have ucd="meta.id;meta.main",
269+
with an array character type (fixed or variable
270+
length), representing an ID string for that record of the table. This
271+
identifier may not be repeated in the table, and it could be used to
272+
retrieve that same record again from that same table.
273+
\item Exactly one FIELD must have ucd="pos.eq.ra;meta.main",
274+
representing the right-ascension of the source in the ICRS coordinate system.
275+
\item Exactly one FIELD must have ucd="pos.eq.dec;meta.main",
276+
representing the declination of the source in the ICRS coordinate system.
277+
\item The above right-ascension and declination FIELD(s) must have the datatype
278+
attribute set to float or double, following the VOTable
279+
standard \citep{2025ivoa.spec.0116O}.
280+
\end{itemize}
281+
282+
\item The VOTable may include an expression of the
283+
uncertainty of the positions given in the above mentioned fields to be
284+
interpreted either as a positional error of the source positions, or an
285+
angular size if the sources are resolved. If this uncertainty is not
286+
provided, it should be taken to be zero; otherwise, it may be set for
287+
all table entries with a PARAM in the RESOURCE which has a UCD that is
288+
set to phys.angSize;obs and has a value which is the angle in decimal
289+
degrees. Alternatively, a different value for each row in the table can
290+
be given via a FIELD in the table having a UCD set to phys.angSize;obs.
291+
\item There may be other FIELDs in the table. Their specification should
292+
include a description, data-type, and UCD.
293+
\end{itemize}
294+
295+
\subsection{Error response}
296+
\label{subsec:error}
297+
298+
If the service detects an exceptional condition, it \textbf{should} return
299+
an error document with an appropriate status code, as specified by DALI,
300+
with, possibly, a Content-Type header to tell the client the format of
301+
the document.
302+
303+
In the case the error is expressed in VOTable format, recommendation
304+
expressed in Section 4.4 of DALI \textbf{should} be followed.
305+
306+
Errors \textbf{must} be reported in any of the following cases:
307+
\begin{itemize}
308+
\item any of the three required paramaters (RA, DEC, SR) is missing;
309+
\item their values cannot be parsed to floating point numbers;
310+
\item the value numbers are out of range (DEC=91.0, for example).
311+
\end{itemize}
312+
313+
The service may also return an error if the search radius (given by the
314+
SR parameter) is larger than the one set by the maxSR element of the
315+
capability of the service described as a VO resource (see
316+
Sec.~\ref{sec:3}).
317+
318+
Queries targeting no records \textbf{should not} generate an error
319+
response but an empty metadata one (if applicable by format).
341320

342321
\section{The Resource Profile}
343322
\label{sec:3}
@@ -638,6 +617,11 @@ \section{Changes from Previous Versions}
638617

639618
\subsection*{Changes from WD-1.1-20200828}
640619
\begin{itemize}
620+
\item included OVERFLOW indicator (updating MAXREC usage)
621+
\item updated all UCD(s) to conform to the UCD1+ specification
622+
\item explicitly stated that RA and Dec responses must be
623+
in units of decimal degrees
624+
\item re-instated changes done in the previous WD-1.1-20200828
641625
\item embedded errata 1, 2 and 3 for ConeSearch-1.03
642626
\item Complete revert of changes to restore clean 1.03 contents,
643627
in view of specific minor updates (listed here above)

0 commit comments

Comments
 (0)