empty param values in votable

Mark Taylor m.b.taylor at bristol.ac.uk
Fri Jul 17 11:08:08 CEST 2020


On Fri, 17 Jul 2020, Carlos Rodrigo wrote:

> Hi
>
> the astropy people have found an issue in one SVO service votable and I am not sure if I understand
> the VOTable standard about this.
>
> The main point is:
>
> <PARAM name="INPUT:Instrument" datatype="char" arraysize="*">
> <VALUES>
> <OPTION name="All" value=""/>
> <OPTION value="90prime"/>
> <OPTION value="AcqCam-N"/>
> </VALUES>
> </PARAM>
>
> is correct? Is it valid to specify value="" for an OPTION element?

value="" is legal in a VOTable OPTION.

However, the above sequence is not legal, since the PARAM element
has no value attribute; VOTable schema declares the value attribute
of PARAM as mandatory.  It is allowed to be the empty string (value="").

> you can see the actual votable at:
> http://svo2.cab.inta-csic.es/theory/fps/fpsold.php?FORMAT=metadata
>
> A related question:
>
> Is it valid to write:
>
> <PARAM name="Instrument" datatype="char" arraysize="*" value=""/>
>
> that is, specifying an empty value for a PARAM element?

Yes.

> And, a last question, having a VALUES sub-element replaces the need of having a VALUE attribute for
> params?

No.  According to the schema, a PARAM must always have a value.
If you don't want to specify one, the only legal thing you can do is
use an empty string.

You can test VOTable validity using votlint, which tests schema
validity as well as various other things that might be wrong
with it (http://www.starlink.ac.uk/stilts/sun256/votlint.html):

   % stilts votlint votable='http://svo2.cab.inta-csic.es/theory/fps/fpsold.php?FORMAT=metadata'
   WARNING (l.2, c.136): Element not namespaced, should be in http://www.ivoa.net/xml/VOTable/v1.1
   WARNING (l.2, c.136): SchemaLocation: schemaLocation value = 'http://www.ivoa.net/xml/VOTable/v1.1' must have even number of URI's.
   ERROR (l.5, c.159): cvc-complex-type.4: Attribute 'value' must appear on element 'PARAM'.
   ERROR (l.12, c.159): cvc-complex-type.4: Attribute 'value' must appear on element 'PARAM'.
   ERROR (l.19, c.108): cvc-complex-type.4: Attribute 'value' must appear on element 'PARAM'.
   ERROR (l.26, c.108): cvc-complex-type.4: Attribute 'value' must appear on element 'PARAM'.


Historically, PARAM was intended to represent a table parameter,
in the sense of an item of per-table (rather than per-column) metadata.
Given that, the requirement to have a value makes sense.

In some recent usage, the PARAM element has been co-opted (or abused
due to linguisitic confusion?) to specify a parameter in the sense
of a variable for which the user can supply a value, and in that
context giving a value attribute on the PARAM element doesn't
make much sense.

Mark

--
Mark Taylor   Astronomical Programmer   Physics, Bristol University, UK
m.b.taylor at bris.ac.uk +44-117-9288776  http://www.star.bris.ac.uk/~mbt/


More information about the apps mailing list