SubqueriedConstraint¶
- class pyvo.registry.SubqueriedConstraint[source]¶
Bases:
Constraint
An (abstract) constraint for when the constraint is over a table other than rr.resource.
We need to be careful with these, because they will in general have 1:n relationships to rr.resource, and these will lead to duplicated interfaces if we just do the NATURAL JOIN we normally do.
Instead, we have to resort to ivoid in (subquery) conditions. In particular, extra_tables will always be empty for these.
To configure those, give the table to query in _subquery_table and _condition, _fillers, and _keyword as usual. The rest is taken care of by get_search_condition.
Methods Summary
get_search_condition
(service)Formats this constraint to an ADQL fragment.
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.