-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDALI.tex
More file actions
1802 lines (1472 loc) · 75.5 KB
/
DALI.tex
File metadata and controls
1802 lines (1472 loc) · 75.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
\documentclass[11pt,letter]{ivoa}
\input tthdefs
\usepackage{todonotes}
\usepackage{listings}
\lstloadlanguages{XML}
\lstset{flexiblecolumns=true,basicstyle=\small,tagstyle=\ttfamily}
\title{Data Access Layer Interface}
\ivoagroup{Data Access Layer Working Group}
\author{Patrick Dowler}
\author{Markus Demleitner}
\author{Mark Taylor}
\author{Doug Tody}
\editor{Patrick Dowler}
\previousversion[https://www.ivoa.net/documents/DALI/20251007/index.html]{WD-DALI-1.2}
\previousversion[https://www.ivoa.net/documents/DALI/20230712/index.html]{WD-DALI-1.2}
\previousversion[http://www.ivoa.net/Documents/DALI/1.1]{DALI-1.1}
\previousversion[http://www.ivoa.net/Documents/DALI/1.0]{DALI-1.0}
\begin{document}
\begin{abstract}
This document describes the Data Access Layer Interface (DALI). DALI defines
the base web service interface common to all Data Access Layer (DAL) services.
This standard defines the behaviour of common endpoints, the meaning and use of
common parameters, success and error responses, and DAL service registration.
The goal of this specification is to define the common elements that are shared
across DAL services in order to foster consistency across concrete DAL service
specifications and to enable standard re-usable client and service
implementations and libraries to be written and widely adopted.
\end{abstract}
\section{Introduction}
The Data Access Layer Interface (DALI) defines endpoints\footnote{This
documents uses the term ``endpoint'' for a network-accessible resource
– where we adopt definitions of RFC 3986 \citep{std:RFC3986} -- that a
client can talk to; previous versions of this document used the term
``resource'' directly, which may be confusing in a VO context. What is
called a ``VO resource'', in particular in the Registry context, usually
comprises several endpoints. Other standards might still call endpoints ``resources''.},
parameters, and
responses common to all DAL services so that concrete DAL service specifications
need not repeat these common elements.
\subsection{Role within the VO Architecture}
DALI defines how DAL service specifications use other IVOA standards as well as
standard internet designs and protocols. Fig.~\ref{fig:archdiag} shows the role
this document plays within the IVOA architecture \citep{2021ivoa.spec.1101D}.
\begin{figure}
\centering
\includegraphics[width=0.9\textwidth]{role_diagram.pdf}
\caption{Architecture diagram for this document}
\label{fig:archdiag}
\end{figure}
A registry extension schema, usually extending VODataService \citep{2021ivoa.spec.1102D},
may be used to
describe the capabilities of a DAL service. This schema is used for
responses from the
VOSI-capabilities \citep{2017ivoa.spec.0524G} endpoint and in registry records for the
service.
The intention of DALI is to promote consistency of behaviour
between services in the DAL family where appropriate.
Standards such as
ConeSearch \citep{2008ivoa.specQ0222P},
SIA \citep{2015ivoa.spec.1223D},
SSA \citep{2012ivoa.spec.0210T} and
TAP \citep{2019ivoa.spec.0927D}
fall into this category,
but the details of compliance are the responsibility of those
specific standards, and may not in all cases conform exactly
to the recommendations here, for instance in the case of ConeSearch 1.03
because the text predates DALI.
\subsection{Example Usage of the DALI Specification}
The DALI specification defines common elements that make up Data Access Layer
(DAL) services. DAL service specifications will refer to the sections in this
document by name rather than include all the explanatory text. For example,
suppose a document defines a service that stacks FITS images asynchronously, the
specification could say that the service has the following endpoints:
\begin{itemize}
\item a DALI-async endpoint that accepts one or more UPLOAD parameters
(section~\ref{sec:UPLOAD}) where the payloads are FITS images; the
endpoint definition
could also include a fixed set of error messages for anticipated failure modes
\item a VOSI-availability endpoint (section~\ref{sec:vosi-availability})
\item a VOSI-capabilities endpoint (section~\ref{sec:vosi-capabilities}) conforming
to a specified registry extension schema
\end{itemize}
\noindent
and would have to define the registry extension schema to be used to register
services and to implement VOSI-capabilities. Most of the service
specification would be in defining the semantics (possibly controllable via
additional input parameters) of the computations to be performed and in defining
the extension schema to describe service functionality and limits (e.g., maximum
input or result image sizes, result retention time and policies). The registry
extension schema may be part of the service specification or a separate
document.
\section{Endpoints}
\label{sec:endpoints}
DAL services are normally implemented as HTTP REST \citep{fielding00}
web services, although
other transport protocols could be used in the future. The primary object
a DAL service operates on is a job. A DAL job is defined by parameters
(section~\ref{sec:parameters}) and
can be executed either synchronously or asynchronously. A concrete service
specification defines the job parameters and the manner of execution is defined
by separate endpoints below.
In addition to job list endpoints, DAL services also implement several Virtual
Observatory Support Interface \citep{2017ivoa.spec.0524G} endpoints to describe
service availability, capabilities, and content.
A concrete DAL service must define at least one DALI-async or DALI-sync
endpoint. It may define both with the same job semantics (e.g. TAP-1.0
\citep{2010ivoa.spec.0327D}) or it may define one with one kind of job and the other with a
separate kind of job (a service that does some things synchronously and others
asynchronously).
The following table summarises the endpoints that are required in all concrete
DAL service specifications (and thus in all DAL services) and which kinds of
endpoints are defined and specified as required or optional in a concrete
specification.
\begin{tabular}{l l l l l}
\sptablerule
\textbf{endpoint type} & \textbf{endpoint name} & \textbf{required} \\
\sptablerule
DALI-sync & service specific & service specific & \\
DALI-async & service specific & service specific & \\
DALI-examples & /examples & no & \\
VOSI-availability & service specific & no & \\
VOSI-capabilities & /capabilities & registered & \\
VOSI-tables & service specific & service specific & \\
\sptablerule
\label{tab:endpoints}
\end{tabular}
The endpoint name is the path (relative to the base URL of the service). All implemented
DALI and VOSI endpoints must be siblings, except for VOSI-availability (see below);
concrete service specifications may constrain the names of these endpoints further.
The relative path limitation enables a client with just the URL for a single endpoint to
find the VOSI-capabilities endpoint and then discover all the capabilities
provided by the service.
A VOSI-capabilities endpoint is required for services registered in the IVOA registry system;
the VOSI-capabilities endpoint is optional for services that are not registered
or only included as auxiliary capabilities (e.g. of a data collection resource).
The URL for the VOSI-availability is not constrained; it may be a sibling (e.g. /availability)
or it may be hosted on a different server (e.g., VOSI-availability may be implemented as a
completely external component that tests the service from the user perspective).
A simple query-only DAL service like ConeSearch can be easily described as
having a single DALI-sync endpoint where the job is a query and the response is
the result of the query.
When an endpoint supports the POST method to communicate query
parameters, implementing services must accept payloads with media types
application/x-www-form-urlencoded \citep{std:RFC1866} and
multipart/form-data \citep{std:RFC7578}; for file uploads, clients must
use the latter.
\subsection{Asynchronous Execution: DALI-async}
\label{sec:dali-async}
Asynchronous endpoints serve representations of a list of asynchronous jobs
as defined by the Universal Worker Service (UWS) pattern \citep{2016ivoa.spec.1024H}.
Requests can
create, modify, and delete jobs in the job list. UWS also specifies special
requests to modify the phase of the job (cause the job to execute or abort).
As specified in UWS, a job is created by using the HTTP POST method to modify
the job list. The response will always be an HTTP redirect (status code 303) and
the Location (HTTP header) will contain the URL to the job.
\begin{verbatim}
POST http://example.com/base/async-jobs
\end{verbatim}
The response will include the HTTP status code 303 (See Other) and a header
named Location with a URL to the created job as a value, for example:
\begin{verbatim}
Location: http://example.com/base/async-jobs/123
\end{verbatim}
The job description (an XML document defined by the UWS schema) can always be
retrieved by accessing the job URL with the HTTP GET method:
\begin{verbatim}
GET http://example.com/base/async-jobs/123
\end{verbatim}
\begin{lstlisting}[language=XML,basicstyle=\footnotesize]
<?xml version="1.0" encoding="UTF-8"?>
<uws:job xmlns:uws="http://www.ivoa.net/xml/UWS/v1.0">
<uws:jobId>123</uws:jobId>
<uws:runId>test</uws:runId>
<uws:ownerId xsi:nil="true" />
<uws:phase>PENDING</uws:phase>
<uws:quote>2013-01-01T12:34:56</uws:quote>
<uws:startTime/>
<uws:endTime/>
<uws:executionDuration>600</uws:executionDuration>
<uws:destruction>2013-02-01T00:00:00</uws:destruction>
<uws:parameters>
<uws:parameter id="LANG">ADQL</uws:parameter>
<uws:parameter id="REQUEST">doQuery</uws:parameter>
<uws:parameter id="QUERY">select * from tab</uws:parameter>
</uws:parameters>
<uws:results/>
</uws:job>
\end{lstlisting}
In addition to the UWS job metadata, DAL jobs are defined by a set of
parameter-value pairs. The client may include parameters in the initial POST
that creates a job or it may add additional parameters by a POST to the current
list of parameters, for example:
\begin{verbatim}
http://example.com/base/async-jobs/123/parameters
\end{verbatim}
DALI-async enpoints may provide other ways to interact with jobs as specified
in current or future UWS specifications, with the following exception: the
UWS-1.0 standard may be interpreted to allow POSTing of job parameters to the
job URL, but DALI-async endpoints must not accept job parameters at this URL.
Job parameters may only be POSTed while the job is in the PENDING phase; once
execution has been requested and the job is in any other phase, job parameters
may not be modified.
A concrete DAL service specification will specify zero or more asynchronous job
submission endpoints and whether they are mandatory or optional. It may mandate
a specific endpoint name to support simple client use, or it can allow the
endpoint name to be described in the service metadata (Section~\ref{sec:vosi-capabilities}).
\subsection{Synchronous Execution: DALI-sync}
\label{sec:dali-sync}
Synchronous endpoints are ones that accept a request (a DAL job
description) and return the response (the result) directly. Synchronous requests
can be made using either the HTTP GET or POST method. If a specific type of job
is exposed through both DALI-async and DALI-sync endpoints (e.g., TAP queries),
then the parameters used to specify the job are the same for this pair of
(synchronous and asynchronous) jobs. Service specifications may also specify
different types of jobs on different endpoints, which would have different job
parameters.
A synchronous job is created by a GET or POST request to a synchronous job list,
executed automatically, and the result returned in the response. The web service
is permitted to split the operation of a synchronous request into multiple HTTP
requests as long as it is transparent to standard clients. This means that the
service may use HTTP redirects (status code 302 or 303) and the Location header
to execute a synchronous job in multiple steps. For example, a service may
\begin{itemize}
\item immediately execute and return the result in the response, or
\item the response is an HTTP redirect (status code 303) and the Location (HTTP
header) will contain a URL; the client accesses this URL with the HTTP GET
method to execute the job and get the result
\end{itemize}
Clients must be prepared to get redirects and follow them (using normal HTTP
semantics) in order to complete requests.
A concrete DAL service specification will specify zero or more synchronous job
submission endpoints and whether they are mandatory or optional. It may mandate
a specific endpoint name to support simple client use, or it can allow the
endpoint name to be described in the service capability metadata
(Section~\ref{sec:vosi-capabilities}).
\subsection{DALI-examples}
\label{sec:dali-examples}
The DALI-examples endpoint returns a document with usage examples or similar
material to the user. In DAL services, this endpoint is always accessed
using the name ``examples''. It is a child of the base URL for the service. The
following specification is intended to make sure the content is usable for both
machines and humans. As such, the DALI-examples endpoint contains additional
markup conforming to the RDFa 1.1 Lite \citep{std:RDFaLite11} specification,
which defines the
following attributes: \xmlel{vocab}, \xmlel{typeof}, \xmlel{property},
\xmlel{resource}, and \xmlel{prefix} (although we
do not include any use of the \xmlel{prefix} attribute).
The DALI-examples capability identifier is:
$$
\hbox{\nolinkurl{ivo://ivoa.net/std/DALI#examples}}
$$
DAL services may implement the /examples endpoint and include it in the
capabilities described by the VOSI-capabilities.
(Section~\ref{sec:vosi-capabilities}); if they
do not, retrieving its URL must yield a 404 HTTP error code.
The document at /examples must be well-formed XML. This restriction is imposed
in order to let clients parse the document using XML parsers rather than
much more complex parsers (e.g. HTML5 parsers). It is therefore advisable to
author it in XHTML, although this specification does not prescribe any document
types.
The document should be viewable with ``common web browsers''. Javascript or CSS
must not be necessary to find and interpret the elements specified below. Apart
from that, service operators are free to include whatever material or styling
they desire in addition and within the example elements defined here.
The elements containing examples must be descendants of an element that has a
\xmlel{vocab} attribute with the value as shown below:
\begin{lstlisting}[language=XML]
<div vocab="http://www.ivoa.net/rdf/examples#">
...
</div>
\end{lstlisting}
The URI in the \xmlel{vocab} attribute resolves to an IVOA vocabulary of
concepts useful for describing examples. That vocabulary complies to
Vocabularies in the VO version 2 \citep{2021ivoa.spec.0525D}. The
values of the \xmlel{property} attributes below are described in it, and
the concept URIs formed according to RDFa rules resolve to elements
within it, which may be useful for documentation purposes. Clients
purely interested in presenting the examples to their users usually have
no reason to retrieve the vocabulary.
No other \xmlel{vocab} attributes are allowed in the document. Each example resides in
an element that has a \xmlel{typeof} attribute with the value
\emph{example}. All such elements
must have an \xmlel{id} attribute to allow external referencing via fragments and a
\xmlel{resource} attribute with a reference pointing to the element itself. As an
example,
\begin{lstlisting}[language=XML]
<div id="x" resource="#x" typeof="example"> ... </div>
\end{lstlisting}
\noindent located inside the element having the \xmlel{vocab} attribute would
contain an example referable via the \emph{x} fragment identifier. The
\xmlel{div} element is
a suitable HTML element to hold an example.
The content of the example is expressed using the \xmlel{property} attribute. For
DALI-examples, we define the following values for the \xmlel{property} attribute:
\begin{itemize}
\item \emph{name}
\item \emph{capability}
\item \emph{generic-parameter}
\item \emph{continuation}.
\end{itemize}
Each example must include one
name. DAL service specifications may define additional
properties so they can mark up additional information in their examples
using the procedures described in Vocabularies in the VO 2. For
instance, TAP has introduced the notions of \emph{query} and \emph{table}.
In principle, any element permitted by the document type can include the RDFa
attributes, so authors may re-use existing markup intended for display.
Alternatively, the \xmlel{span} element is a good choice when the example values are
included in surrounding text and the author does not want any special rendering
to be applied by the machine-readable additions.
To maintain compatibility with mainstream RDFa tools, extra care is
necessary with elements that have \xmlel{src} or \xmlel{href}
attributes. According to RDFa rules, in such cases the object of the
relationship is the linked entity rather than the element content.
While this is intended in some cases -- see the continuation property
below -- this will lead to erroneous interpretations in the typical
case.
For instance,
\begin{lstlisting}[language=XML]
<!-- Wrong! -->
<div id="x" resource="#x" typeof="example">
<p>The case of <a property="name"
href="http://object-resolver.edu/M42">Messier 42</a> is special.</p>
</div>
\end{lstlisting}
\noindent
would imply that the name of the example \texttt{x} is
\nolinkurl{http://object-resolver.edu/M42} rather than just ``Messier
42''. Full RDFa offers the \xmlel{content} attribute to allow correct
markup even in the presence of \xmlel{href} attributes, but since DALI
examples are restricted to RDFa lite, this cannot be used.
The rule of thumb is to only use elements with links when the
relationship's object actually is a linked document or entity (for the
terms given here, this is only true for continuation). If document
authors wants to express a link with the relationship's object anyway,
they will have to restructure their texts (which typically will also
yield better link semantics). For instance, the example above could be
written as:
\begin{lstlisting}[language=XML]
<div id="x" resource="#x" typeof="example">
<p>The case of <span property="name">Messier 42</span> (<a
href="http://object-resolver.edu/M42">M42 at object resolver</a>)
is special.</p>
</div>
\end{lstlisting}
\subsubsection{name property}
The content of this element must be plain text (i.e., no child
elements) and
should be suitable for display within a
space-limited label in user interface and still give some idea about the meaning
of the example. In XHTML, a head element (\xmlel{h2}, say) would usually be a good
choice for the example name, for example:
\begin{lstlisting}[language=XML]
<h2 property="name">Synchronous TAP query</h2>
\end{lstlisting}
\subsubsection{capability property}
The capability property for an example specifies which service capability the
example is to be used with by giving, in plain text, the standards URI
as given in the respective capability's \xmlel{standardID} attribute.
For example, if the text is describing how to use a
SODA-1.0 service, the example could contain:
\begin{lstlisting}[language=XML]
<span property="capability">ivo://ivoa.net/std/SODA#sync-1.0</span>
\end{lstlisting}
IVOA standard service capabilities are defined as URIs, so example documents
may want to show the URI or show more user-friendly text depending on the
expected audience for the document. For specifications that do not define
specific capability identifiers, the IVOID for the specification itself should
be used.
\subsubsection{generic-parameter property}
Request parameters are included within the example by using the
generic-parameter property. The element must also be assigned a
\xmlel{typeof} attribute
with value of \emph{keyval}. Within this element, the document must include a pair of
elements with \xmlel{property} attributes valued key and value, where the plain-text content are
the parameter name and value respectively. Multiple generic-parameter(s) are
permitted, for example:
\begin{lstlisting}[language=XML]
<span property="generic-parameter" typeof="keyval">
<span property="key">REQUEST</span>
<span property="value">doQuery</span>
</span>
<span property="generic-parameter" typeof="keyval">
<span property="key">LANG</span>
<span property="value">ADQL</span>
</span>
<span property="generic-parameter" typeof="keyval">
<span property="key">QUERY</span>
<span property="value">SELECT * from tap_schema.tables</span>
</span>
\end{lstlisting}
\subsubsection{continuation property}
If the examples are spread over multiple linked documents, the links to
documents with additional examples must be within the parent element defining
the \xmlel{vocab} attribute and the link elements must contain the following additional
attributes: a \xmlel{property} attribute with the value
\emph{continuation}, a \xmlel{resource}
attribute with an empty value (referring to the current document), and
the \xmlel{href}
attribute with the URL of another document formatted as above (i.e. another
collection of examples that clients should read to collect the full set of
examples).
\begin{lstlisting}[language=XML,basicstyle=\footnotesize]
<div vocab="http://www.ivoa.net/rdf/examples#">
<div id="x" resource="#x" typeof="example">
...
</div>
<a property="continuation"
href="simple_examples.html">Simple examples</a>
<a property="continuation"
href="fancy_examples.html">Fancy examples</a>
</div>
\end{lstlisting}
In the above example, the two linked documents would also contain some element
with a vocab and examples as described above.
\subsection{Availability: VOSI-availability}
\label{sec:vosi-availability}
VOSI-availability \citep{2017ivoa.spec.0524G} defines a simple endpoint that
reports on the current ability of the service to perform.
If the VOSI-availability endpoint is implemented a description
of this capability must be provided in the VOSI-capabilities document.
The VOSI-availability endpoint is
intended to respond with a dynamically generated document describing the current state of the service
operation, e.g.:
\begin{lstlisting}[language=XML,basicstyle=\footnotesize]
<?xml version="1.0" encoding="UTF-8"?>
<vosi:availability
xmlns:vosi="http://www.ivoa.net/xml/VOSIAvailability/v1.0">
<vosi:available>true</vosi:available>
<vosi:note>service is accepting queries</vosi:note>
</vosi:availability>
\end{lstlisting}
\subsection{Capabilities: VOSI-capabilities}
\label{sec:vosi-capabilities}
VOSI-capabilities \citep{2017ivoa.spec.0524G} defines a simple endpoint that
returns an XML document
describing the service. In DAL services, this endpoint always accessed
under the name
``capabilities''. It is a child of the base URL for the service. The
VOSI-capabilities should describe all the capabilities (which is roughly
what this specification calls and ``endpoint'') exposed by the service,
including which standards each endpoint implements.
All registered DAL services must implement the /capabilities endpoint. The following
capabilities document shows the capabilities and tables VOSI endpoints
and a TAP capability:
\begin{lstlisting}[language=XML,basicstyle=\footnotesize]
<?xml version="1.0" encoding="UTF-8"?>
<vosi:capabilities
xmlns:vosi="http://www.ivoa.net/xml/VOSICapabilities/v1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:vod="http://www.ivoa.net/xml/VODataService/v1.1">
<capability standardID="ivo://ivoa.net/std/VOSI#capabilities">
<interface xsi:type="vod:ParamHTTP" version="1.0">
<accessURL use="full">
http://example.com/tap/capabilities
</accessURL>
</interface>
</capability>
<capability standardID="ivo://ivoa.net/std/VOSI#tables">
<interface xsi:type="vod:ParamHTTP" version="1.0">
<accessURL use="full">
http://example.com/tap/tables
</accessURL>
</interface>
</capability>
<capability xmlns:tr="http://www.ivoa.net/xml/TAPRegExt/v1.0"
standardID="ivo://ivoa.net/std/TAP" xsi:type="tr:TableAccess">
<interface xsi:type="vod:ParamHTTP" role="std" version="1.0">
<accessURL use="full">
http://example.com/tap/
</accessURL>
</interface>
<!-- service details from TAPRegExt go here -->
</capability>
</vosi:capabilities>
\end{lstlisting}
Note that while this example shows the use of a registry extension schema (the
inline \verb|xmlns:tr="http://www.ivoa.net/xml/TAPRegExt/v1.0"| in the last capability
element) this is not required; services may be registered and described without
such an extension. The use of \xmlel{standardID} -- which should contain the
IVOID of
the standard a capability adheres to -- does not imply a particular (or any)
\xmlel{xsi:type} be included.
\subsection{Tables: VOSI-tables}
\label{sec:vosi-tables}
VOSI-tables \citep{2017ivoa.spec.0524G} defines a simple endpoint that returns an
XML document
describing the content of the service. The document format is defined by the
VOSI \citep{2017ivoa.spec.0524G} standard and allows the service to
describe their content
as a tableset: schemas, tables, and columns.
A concrete DAL service specification will specify whether the VOSI-tables endpoint is
permitted or required and may restrict the endpoint name or location.
Since DAL services with a VOSI-tables endpoint will specify
in the capabilities which version they are using, DAL services can make use of
new versions without change to the DAL service specification.
\section{Data Types and Literal Values}
\label{sec:xtypes}
In this section we specify how values are to be expressed. These literal values
are used as input or output from DAL services: as parameter values when
invoking services, as data values in response documents (e.g. VOTable),
etc. We define some general purpose values for the \xmlel{xtype} attribute of
the VOTable \xmlel{FIELD} and \xmlel{PARAM} elements for simple
structured values: \emph{timestamp}, \emph{interval},
\emph{hms}, \emph{dms},
\emph{point}, \emph{circle}, \emph{range}, \emph{polygon}, \emph{moc},
\emph{shape}, \emph{multishape}, \emph{uri}, and \emph{uuid} (see below).
A special case is the \emph{json} xtype: It allows publishers to, in
effect, embed complex, structured data in VOTables. Publishers
intending to use it are encouraged to carefully review whether
interoperable and metadata-rich VOTable constructs can be employed
instead.
In the following, where we say \verb|datatype="char"| we also allow the VOTable
\verb|datatype="unicodeChar"|. Where we say \verb|arraysize="*"| we also allow
providers to be more explicit by using a fixed size (e.g. \verb|20|) or fixed
with a limit (e.g. \verb|20*|) when applicable.
In the following, where we say ``VOTable type metadata'', we mean either VOTable
\xmlel{FIELD} or \xmlel{PARAM} elements.
Services may use non-standard \xmlel{xtype} values for non-standard datatypes, but if they
do so they should include a simple prefix (a string followed by a colon
followed by the non-standard xtype) so client software can easily determine
if a value is standard or not. For example, an \xmlel{xtype} for a
non-standard 3D-vector might be \emph{geom:vector3d}.
\subsection{Numbers}
Integer and real numbers must be represented in a manner consistent with the
specification for numbers in VOTable \citep{2019ivoa.spec.1021O}. When used as
values in service parameters, the serialization for \xmlel{TABLEDATA} must be used.
\subsection{Boolean}
Boolean values must be represented in a manner consistent with the
specification for boolean in VOTable \citep{2019ivoa.spec.1021O}. When used as
values in service parameters, the serialization for \xmlel{TABLEDATA} must be used.
\subsection{Timestamp}
Timestamp values serialised in VOTable or described in service parameters must have
the following VOTable type metadata:
\begin{verbatim}
datatype="char" arraysize="*" xtype="timestamp"
\end{verbatim}
\noindent
Date and time values must be represented using the convention established for
FITS \citep{std:FITS} and STC \citep{2007ivoa.spec.1030R} for astronomical times:
\begin{verbatim}
YYYY-MM-DD['T'hh:mm:ss[.SSS]]
\end{verbatim}
\noindent
where the T is a character separating the date and time components. The time
component is optional, in which case the T separator is not used. Fractions of a
second are permitted but not required. For example:
\begin{verbatim}
2000-01-02T15:20:30.456
2001-02-03T04:05:06
2002-03-04
\end{verbatim}
\noindent
are all legal date or date plus time values. Astronomical values never
include a time zone indicator. However, values that
are civil in nature (e.g. when some processing was completed, when some record
was last modified) may include the time zone indicator Z to explicitly specify
the UTC time zone. Civil times conform to:
\begin{verbatim}
YYYY-MM-DD['T'hh:mm:ss[.SSS]['Z']]
\end{verbatim}
\noindent
where the optional Z character indicates the value is UTC. For example:
\begin{verbatim}
2000-01-02T15:20:30.456Z
2000-01-02T15:20:30Z
\end{verbatim}
\noindent
are valid civil time values. In cases where time values may be
expressed using Julian Date (JD) or Modified Julian Date (MJD), these follow the
rules for double precision numbers above and may have additional metadata as
described in the VOTable standard \citep{2019ivoa.spec.1021O}. All date-time values (formatted string, JD,
and MJD) shall be interpreted as referring to time scale UTC and time reference
position UNKNOWN, unless either or both of these are explicitly specified to be
different \citep{2007ivoa.spec.1030R}.
Note that the format used here is very close to the standard ISO8601 timestamp
format except with respect to timezone handling. ISO8601 requires a Z character
at the end of the string when the timezone is UTC; here, we follow the FITS
\citep{std:FITS} convention for astronomical values by omitting the Z but still
defaulting to UTC.
\subsection{Interval}
Numeric intervals are pairs of numeric values (integer and floating-point). For floating point
intervals, special values for positive and negative infinity may be used to specify open-ended intervals.
Finite bounding values are included in the interval. Open-ended floating-point
intervals have one or both bounding values that are infinite. Intervals with two identical values
are equivalent to a scalar value but must still be serialised as a pair of values.
Interval values serialised in VOTable or described in service parameters must have
the following VOTable type metadata:
\begin{verbatim}
datatype="double" arraysize="2" xtype="interval"
\end{verbatim}
\noindent where other numeric datatypes (\verb|float|, \verb|short|, \verb|int|, \verb|long|)
are also permitted.
The representation of an interval uses the numeric array serialisation from
VOTable. For example:
\begin{verbatim}
0.5 1.0
-Inf 0.0
0.0 +Inf
-Inf +Inf
1.0 1.0
\end{verbatim}
\noindent where each line is a legal floating-point interval value and:
\begin{verbatim}
0 2
-5 5
0 0
\end{verbatim}
\noindent where each line is a legal integer interval value.
Interval values serialised in VOTable or described in service parameters
with this xtype may include additional metadata like minimum
or maximum value. These are specified using the standard scalar \verb|MIN| and
\verb|MAX| child elements to describe the (minimum) lower bound and (maximum)
upper bound of interval(s) respectively.
\subsection{Multiinterval}
The \verb|multiinterval| xtype is a way to convey complex one dimensional extent
(e.g. the temporal coverage of an observation made by combining several exposures)
made up of multiple intervals. A multiinterval value is interpreted as the union
of all component intervals. Multiple intervals may be serialised in a single value and
described as (possibly) multiple with the following VOTable type metadata:
\begin{verbatim}
datatype="double" arraysize="*" xtype="multiinterval"
\end{verbatim}
\noindent where other numeric datatypes (\verb|float|, \verb|short|, \verb|int|, \verb|long|)
are also permitted. A single interval value is also a valid multiinterval. For example:
\begin{verbatim}
1.0 3.0 4.0 5.0
\end{verbatim}
\noindent is a valid value for multiple intervals ([1.0,3.0] and [4.0,5.0]).
Multiinterval values serialised in VOTable or described in service parameters
with this xtype may include additional metadata like minimum
or maximum value. These are specified using the standard scalar \verb|MIN| and
\verb|MAX| child elements to describe the minimum lower bound and maximum
upper bound of all component intervals respectively (e.g. 1.0 and 5.0 in the example
above).
\subsection{Sexagesimal Coordinates}
Coordinate values expressed in sexagesimal form can be described using the
following VOTable type metadata. For right ascension:
\begin{verbatim}
datatype="char" arraysize="*" xtype="hms"
\end{verbatim}
\noindent and for declination:
\begin{verbatim}
datatype="char" arraysize="*" xtype="dms"
\end{verbatim}
For \verb|xtype="hms"|, the values are serialised as hours:minutes:seconds where hours
and minutes are integer values and seconds is a real value. For \verb|xtype="dms"|, the values
are serialised as degrees:minutes:seconds where degrees and minutes (of arc) are integer
values and seconds is a real value. All hours must fall within [0,24], degrees
(latitude) must fall within [-90,90], minutes must fall within [0,60), and seconds
must fall within [0,60). Leading zeros are permitted so that values of minutes and the integer
part of seconds can be expressed as 2-digit numbers. Valid values for \verb|xtype="hms"| are
from 00:00:00 to 24:00:00.
Valid values for \verb|xtype="dms"| are from -90:00:00 to 90:00:00; an optional + sign at
the start is allowed (e.g. +10:20:30) but not required. The upper bound on minutes
and seconds is not part of the valid range; for example 12:34:60 is not allowed and must
be expressed as 12:35:00 instead.
\subsection{Point}
Geometry values are two-dimensional; although they are usually longitude and
latitude values in spherical coordinates this is specified in the coordinate
metadata and not in the values.
Point values serialised in VOTable or described in service parameters must have following
VOTable type metadata:
\begin{verbatim}
datatype="double" arraysize="2" xtype="point"
\end{verbatim}
\noindent where \verb|float| is also allowed.
For points in a spherical coordinate system, the values are ordered as: longitude latitude. For example:
\begin{verbatim}
12.3 45.6
\end{verbatim}
Coordinate values are not limited to fall within a defined valid range; this is a change from
DALI 1.1 where equatorial coordinates were explicitly limited. Software may have
to perform range reduction in some coordinate systems (for example, spherical coordinates) in
order to correctly interpret or use the coordinate values. Coordinate values are more likely to
work as expected if they are expressed in the simplest form and do not require range reduction.
For example, in spherical coordinates, \verb|362.0 2.0| is equivalent to \verb|2.0 2.0|, but the
latter form is more likely to work as intended in all cases.
There is no general purpose definition of minimum and/or maximum point values, but
specific services may define something that is applicable in a more limited context.
\subsection{Circle}
Circle values serialised in VOTable or described in service parameters must have the following VOTable type metadata:
\begin{verbatim}
datatype="double" arraysize="3" xtype="circle"
\end{verbatim}
\noindent where \verb|float| is also allowed.
The values are ordered as a point followed by a radius. For example:
\begin{verbatim}
12.3 45.6 0.5
\end{verbatim}
Valid coordinate value limits are specified by \verb|xtype="point"| above.
Circle-valued service parameters may include additional metadata like minimum and
or maximum value. These are specified using a custom interpretation of the
\verb|MAX| child element with a value that is the largest circle that makes sense
for the operation. The value could be a maximum allowed by the service or simply
the circle where larger circles and circles outside the specified maximum will not
yield useful results. Since the maximum circle includes coordinates and radius,
it is useful for describing parameters of a request related to a specific target
location (for example, a SODA cutout of specific archival data).
There is no general purpose definition of a minimum circle value for parameters or
a definition of a minimum or maximum circle to describe field values (in a column
of a table), but specific services may define something that is applicable in a
more limited context.
\subsection{Range}
Range values serialised in VOTable or described in service parameters must have the following VOTable type metadata:
\begin{verbatim}
datatype="double" arraysize="4" xtype="range"
\end{verbatim}
\noindent where \verb|float| is also allowed.
A range is a coordinate bounding box specified
as two pairs of coordinate values: min-coordinate1 max-coordinate1 min-coordinate2 max-coordinate2.
For example:
\begin{verbatim}
10.0 11.0 20.0 21.0
\end{verbatim}
\noindent
includes values from 10 to 11 (coordinate1) and from 20 to 21 (coordinate2).
Valid coordinate value limits are specified by \verb|xtype="point"| above.
This range form is used as part of the value of the POS parameter in
\citep{2015ivoa.spec.1223D} and \citep{2017ivoa.spec.0517B} (see also "shape" below).
For example, a range can span the meridian (longitude 0): 359 1 -1 1 is interpreted
as the small (2x2 degree) coordinate range from 359 across the meridian to 1 degree
longitude.
Range-valued service parameters may include additional metadata like minimum and
or maximum value. These are specified using a custom interpretation of the
\verb|MAX| child element with a value that is the largest range that makes sense
for the operation. The value could be a maximum allowed by the service or simply
the range where larger ranges and ranges outside the specified maximum will not yield
useful results.
There is no general purpose definition of a minimum range value for parameters or
a definition of a minimum or maximum range to describe field values (in a column
of a table), but specific services may define something that is applicable in a
more limited context.
\subsection{Polygon}
Polygon values serialised in VOTable or described in service parameters must have the
following VOTable type metadata:
\begin{verbatim}
datatype="double" arraysize="*" xtype="polygon"
\end{verbatim}
\noindent where \verb|float| is also allowed.
The array holds a sequence of vertices (points) (e.g. longitude latitude longitude
latitude ...) with an even number of values and at least three (3) points (six
(6) numeric values). A polygon is always implicitly closed: there is an implied edge from
the last point back to the first point; explicitly including the first point at the end is
highly discouraged because it creates an edge of length 0 that has
negative side effects on some polygon computations. For example:
\begin{verbatim}
10.0 10.0 10.2 10.0 10.2 10.2 10.0 10.2
\end{verbatim}
Valid coordinate value limits are specified by \verb|xtype="point"| above.
Vertices must be ordered such that the polygon
winding direction is counter-clockwise (when viewed from the origin toward the
sky) as described in \citep{2007ivoa.spec.1030R}.
Polygon-valued service parameters may include additional metadata to describe minimum
and/or maximum values. These are specified using a custom interpretation of the
\verb|MAX| child element with a value that is the largest polygon that makes sense
for the operation. The value could be a maximum allowed by the service or simply
the polygon that describes the target region. Since the maximum polygon includes
coordinates, it is useful for describing parameters of a request related
to a specific target location (for example, a SODA cutout of specific archival data).
There is no general purpose definition of a minimum polygon value for parameters or
a definition of a minimum or maximum polygon to describe field values (in a column
of a table), but specific services may define something that is applicable in a
more limited context.
\subsection{MOC}
Spatial MOC (Multi Order Coverage) values serialised in VOTable or described in service parameters must
have the following VOTable type metadata:
\begin{verbatim}
datatype="char" arraysize="*" xtype="moc"
\end{verbatim}
\noindent
The value is the ascii serialisation of a MOC specified in \citet{2022ivoa.spec.0727F}
section 4.3.2 and may be a one- or two-dimension (spatial) MOC.
Note: explicit time MOC and space-time MOC xtypes may be added in a future version.
\subsection{Shape}
Shape values serialised in VOTable or described in service parameters must have the following VOTable type metadata:
\begin{verbatim}
datatype="char" arraysize="*" xtype="shape"
\end{verbatim}
\noindent
The value is a polymorphic shape made up of a type label (equivalent to an existing simple
geometric xtype and the string serialisation of the value as described above.
The allowed shapes are: \verb|circle|, \verb|range|, \verb|polygon|. For example:
\begin{verbatim}
circle 12.3 45.6 0.5
\end{verbatim}
\begin{verbatim}
range 10.0 11.0 20.0 21.0
\end{verbatim}
\begin{verbatim}
polygon 10.0 10.0 10.2 10.0 10.2 10.2 10.0 10.2
\end{verbatim}
The interpretation and constraints on the coordinate values are as specified
for the individual xtypes above.
The shape xtype provides a compatible description of the POS parameter in
\citep{2015ivoa.spec.1223D} and \citep{2017ivoa.spec.0517B}.
Shape-valued service parameters may include additional metadata to describe minimum
and/or maximum values. These are specified using a custom interpretation of the
\verb|MAX| child element with a value that is the largest shape that makes sense
for the operation. The value could be a maximum allowed by the service or simply
the shape that describes the target region. Since the maximum shape includes
coordinates and radius, it is useful for describing parameters of a request related
to a specific target location (for example, a SODA cutout of specific archival data).
For example, the following would describe the maximum shape for an input \verb|POS|
parameter for a large (IRIS) data file (accessible via the CADC SODA service):
\begin{lstlisting}[language=XML]
<GROUP name="inputParams">
<PARAM name="ID" datatype="char" arraysize="23"
ucd="meta.id;meta.dataset" value="cadc:IRIS/I212B2H0.fits" />
...
<PARAM name="POS" datatype="char" arraysize="*" xtype="shape"
ucd="obs.field" value="">
<VALUES>
<MAX value="polygon 134.38 -6.37 134.42 6.01
146.87 5.97 146.84 -6.41" />
</VALUES>
</PARAM>
...
</GROUP>
\end{lstlisting}
In the specific context of a SODA service, the maximum shape is generally going
to be the bounds of the data. The type label used in the maximum shape only tells
the client how to interpret the value; it does not limit the caller to only using
that type of shape.
There is no general purpose definition of a minimum shape value for parameters or
a definition of a minimum or maximum shape to describe field values (in a column
of a table), but specific services may define something that is applicable in a