vollt
vollt copied to clipboard
No adqlgeo features written into `capabilities` endpoint despite support being available for all
I was notified by @mbtaylor that the capabilities endpoint from our TAP service does not show information regarding ADQL language features related to geometries (or adqlgeo
). I was surprised because all of them are supported, since we follow the tap_full.properties configuration file, where it states that
If the list is empty (no item), all functions are allowed.
So far so good. Although still not the whole picture.
Looking at the code, the issue seems to be that:
- The
geometries
list fromConfigurableServiceConnection
will benull
whenever its configuration counterpart is either implicitly (i.e.,geometries=
) or explicitly (i.e.,geometries=ANY
) set to allow all geometrical features according toConfigurableServiceConnection#initADQLGeometries()
. - When obtaining the capabilities of the TAP service via
TAP#getCapability()
, it only looks for a non-empty list. In other words, it will print the geometry features if and only if explicitly stated in the configuration file.
Luckily the fix is straightforward: split the regular expression containing the allowed language features (ConfigurableServiceConnection.GEOMETRY_REGEXP
) and setting geometries
like so:
geometries = new ArrayList<String>(Arrays.asList(GEOMETRY_REGEXP.substring(1, GEOMETRY_REGEXP.length() - 1).split("\\|")));
As the geometries list will not be null anymore, the next line from TAP#getCapability()
if (service.getGeometries() != null && service.getGeometries().size() > 0){
Could also be replaced with a more concise
if (!service.getGeometries().isEmpty()) {