Servicetype

class pyvo.registry.Servicetype(*stds)[source]

Bases: Constraint

A constraint for for the availability of a certain kind of service on the result.

The constraint normally is a custom keyword, one of:

  • image (image services; at this point equivalent to sia, but scheduled to include sia2, too)

  • sia (SIAP version 1 services)

  • sia2 (SIAP version 2 services)

  • spectrum, ssa, ssap (all synonymous for spectral services, prefer spectrum)

  • scs, conesearch (synonymous for cone search services, prefer scs)

  • line (for SLAP services)

  • tap, table (synonymous for TAP services, prefer tap)

You can also pass in the standards’ ivoid (which generally looks like ivo://ivoa.net/std/<standardname> (except for SIA2) and have to be URIs with a scheme part in any case); note, however, that for standards pyVO does not know about it will not build service instances for you.

Multiple service types can be passed in; a match in that case is for records having any of the service types passed in.

The match is literal (i.e., no patterns are allowed); this means that you will not receive records that only have auxiliary services, which is what you want when enumerating all services of a certain type in the VO. In data discovery, you can use Servicetype(...).include_auxiliary_services() or use registry.search’s includeaux parameter; but, really, there is little point using this constraint in data discovery in the first place.

Parameters:
*stdstuple of str

one or more standards identifiers. The constraint will match records that have any of them.

Methods Summary

clone()

returns a copy of this servicetype constraint.

get_search_condition(service)

Formats this constraint to an ADQL fragment.

include_auxiliary_services()

returns a Servicetype constraint that has self's service types but includes the associated auxiliary services.

Methods Documentation

clone()[source]

returns a copy of this servicetype constraint.

get_search_condition(service)[source]

Formats this constraint to an ADQL fragment.

This takes the service the constraint is being executed on as an argument because constraints may be written differently depending on the service’s features or refuse to run altogether.

Parameters:
servicedal.tap.TAPService

The RegTAP service the query is supposed to be run on (that is relevant because we adapt to the features available on given services).

Returns:
str

A string ready for inclusion into a WHERE clause.

include_auxiliary_services()[source]

returns a Servicetype constraint that has self’s service types but includes the associated auxiliary services.

This is a convenience to maintain registry.search’s signature.