gmantele / vollt

Java libraries implementing the IVOA protocol: ADQL, UWS and TAP
http://cdsportal.u-strasbg.fr/taptuto/
29 stars 28 forks source link

`capabilities`: add IVO ids in output formats to support TAPRegExt #153

Open jontxu opened 7 months ago

jontxu commented 7 months ago

Hi, I was notified by @mbtaylor that the capabilities endpoint from our TAP service does not follow the TAPRegExt recommendation as it lacks the ivo-id attribute for the relevant output formats (outputFormat in the XML). This ID is used by some clients to interpret (for the time being) VOTable types, as shown on the recommendation: https://www.ivoa.net/documents/TAPRegExt/20120827/REC-TAPRegExt-1.0.html#outforms

Current output:

<outputFormat>
  <mime>application/x-votable+xml</mime>
  <alias>votable</alias>
</outputFormat>
<outputFormat>
  <mime>application/x-votable+xml;serialization=BINARY2</mime>
  <alias>votable/b2</alias>
</outputFormat>
<outputFormat>
  <mime>application/x-votable+xml;serialization=TABLEDATA</mime>
  <alias>votable/td</alias>
</outputFormat>

Expected (TapRegExt-supporting) output:

<outputFormat ivo-id="ivo://ivoa.net/std/TAPRegExt#output-votable-td">
  <mime>application/x-votable+xml</mime>
  <alias>votable</alias>
</outputFormat>
<outputFormat ivo-id="ivo://ivoa.net/std/TAPRegExt#output-votable-binary2">
  <mime>application/x-votable+xml;serialization=BINARY2</mime>
  <alias>votable/b2</alias>
</outputFormat>
<outputFormat ivo-id="ivo://ivoa.net/std/TAPRegExt#output-votable-td">
  <mime>application/x-votable+xml;serialization=TABLEDATA</mime>
  <alias>votable/td</alias>
</outputFormat>

Looking into the code, seems like its implementation is somewhat trivial, by adding support for a ivoId field in tap.formatter.OutputFormat (and the classes which implement it) and adding the attribute when getting the output formats when writing the capabilities in tap.resource.TAP.

mbtaylor commented 7 months ago

To clarify, the existing behaviour is not non-compliant, since TAPRegExt only suggests rather than requires the ivo-id attributes as above, but it would be nicer if the VOLLT implementation did include them.

jontxu commented 7 months ago

Thanks for the clarification, I edited the title and comment accordingly.

gmantele commented 7 months ago

Indeed, this attribute is optional. When I developed this part of VOLLT, I guess I did not know which IVO-ID to write in this attribute and whether it would be useful or not. It seems to be now useful and thanks to your example, I have a clear idea on the value to write for this attribute. Thanks to both of you for this feedback. It is indeed a trivial change to implement. I'll include that in the next stable release of VOLLT/TAP-Lib.