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:
sia
,sia1
(SIAP version 1 services; prefersia1
for symmetry, althoughsia
will be kept as the official IVOA short name for SIA1)sia2
(SIAP version 2 services)ssa
,ssap
(synonymous for SSAP services)scs
,conesearch
(synonymous for cone search services, preferscs
)line
(for SLAP services)tap
,table
(synonymous for TAP services, prefertap
)image
(a deprecated alias for sia)spectrum
(a deprecated alias for ssap)
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.
Contrary to what the names of the service types may suggest, “image” and “spectrum” do not select all resources serving images or spectra. For instance, at the moment you would have to search for images served in three different ways: SIAv1, SIAv2, and ObsTAP. Against that, “image” only selects SIAv1, and “spectrum” similarly omits ObsTAP. A global discovery module is under active development to provide global dataset discovery. When it is ready, these two misleading options may be removed.
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’sincludeaux
parameter; but, really, there is little point using this constraint in data discovery in the first place.- Parameters:
- *stdsstr
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.
returns a Servicetype constraint that has self's service types but includes the associated auxiliary services.
Methods Documentation
- 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:
- service
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).
- service
- Returns:
- str
A string ready for inclusion into a WHERE clause.