VODataservice API¶
Models¶
Pydantic-xml models for VODataService types
TODO: This is an incomplete spec, covering only elements needed for VOSITables https://github.com/spacetelescope/vo-models/issues/17
- class vo_models.vodataservice.models.FKColumn(**data)[source]¶
A pair of columns that are used to join two tables.
- Parameters:
- model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- class vo_models.vodataservice.models.ForeignKey(**data)[source]¶
A description of the mapping a foreign key – a set of columns from one table – to columns in another table.
- Parameters:
target_table (str) – (elem) - The fully qualified name (including catalogue and schema, as applicable) of the table that can be joined with the table containing this foreign key.
fk_column (list[FKColumn]) – (elem) - A pair of column names, one from this table and one from the target table that should be used to join the tables in a query.
description (str | None) – (elem) - A free-text description of what this key points to and what the relationship means.
utype (str | None) – (elem) - An identifier for a concept in a data model that the association enabled by this key represents.
- model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- class vo_models.vodataservice.models.DataType(**data)[source]¶
A type of data contained in the column.
- Parameters:
- model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- class vo_models.vodataservice.models.TableParam(**data)[source]¶
A description of a table column.
- Parameters:
column_name (str) – (elem) - The name of the parameter or column.
description (str | None) – (elem) - A free-text description of a parameter’s or column’s contents.
unit (str | None) – (elem) - The unit associated with the values in the parameter or column.
ucd (str | None) – (elem) - The name of a unified content descriptor that describes the scientific content of the parameter.
utype (str | None) – (elem) - An identifier for a concept in a data model that the data in this schema represent.
xtype (str | None) – (elem) - The xtype of the column.
datatype (DataType | None) – (elem) - A type of data contained in the column
flag (list[str] | None) – (elem) -A keyword representing traits of the column. Recognized values include “indexed”, “primary”, and “nullable”.
- classmethod validate_colname(value)[source]¶
Escape the column name if it is an ADQL reserved word
See: https://www.ivoa.net/documents/ADQL/20180112/PR-ADQL-2.1-20180112.html#tth_sEc2.1.3
value: - The column name to escape.
- Parameters:
value (str)
- classmethod validate_description(value)[source]¶
Sanitize bad XML values in the description
- Parameters:
value (str)
- model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- class vo_models.vodataservice.models.Table(**data)[source]¶
A model representing a single table element.
- Parameters:
table_type (str | None) –
(attr) - A name for the role this table plays.
Recognized values include “output”, indicating this table is output from a query; “base_table”, indicating a table whose records represent the main subjects of its schema; and “view”, indicating that the table represents a useful combination or subset of other tables. Other values are allowed.
table_name (str) –
(elem) - The fully qualified name of the table.
This name should include all catalogue or schema prefixes needed to sufficiently uniquely distinguish it in a query.
title (str | None) – (elem) - A descriptive, human-interpretable name for the table.
description (str | None) – (elem) - A free-text description of the table’s contents
utype (str | None) – (elem) - An identifier for a concept in a data model that the data in this table represent.
nrows (int | None) – (elem) - The approximate size of the table in rows.
column (list[TableParam] | None) – (elem) - A description of a table column.
foreign_key (list[ForeignKey] | None) – (elem) - A description of a foreign keys, one or more columns from the current table that can be used to join with another table.
- classmethod validate_lists(value)[source]¶
If we have a single column or foreign_key, make it a list
- model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- class vo_models.vodataservice.models.TableSchema(**data)[source]¶
A detailed description of a logically related group of tables.
- Parameters:
schema_name (str) –
(elem) - A name for the group of tables.
If no title is given, this name can be used for display purposes. If there is no appropriate logical name associated with this group, the name should be explicitly set to “default”.
title (str | None) – (elem) - A descriptive, human-interpretable name for the group of tables.
description (str | None) – (elem) - A free text description of the group of tables that should explain in general how all of the tables in the group are related.
utype (str | None) – (elem) - An identifier for a concept in a data model that the data in this schema as a whole represent.
table (list[Table] | None) – (elem) - A description of a table.
- model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- class vo_models.vodataservice.models.TableSet(**data)[source]¶
A description of the tables that are accessible through this service.
Each schema name must be unique within a tableset.
- Parameters:
tableset_schema (list[TableSchema]) –
(elem) - A named description of a group of logically related tables.
The name given by the “name” child element must be unique within this TableSet instance. If there is only one schema in this set and/or there is no locally appropriate name to provide, the name can be set to “default”.
- classmethod validate_tableset_schema(value)[source]¶
If we have a single tableset_schema, make it a list
- model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- class vo_models.vodataservice.models.BaseParam(**data)[source]¶
A description of a parameter that places no restriction on the parameter’s data type.
TODO: Set as base for TableParam when implementing VODataservice fully.
- Parameters:
name – (elem) - The name of the parameter.
description (str | None) – (elem) - A free-text description of the parameter’s contents.
unit (str | None) – (elem) - The unit associated with the values in the parameter.
ucd (str | None) – (elem) - The name of a unified content descriptor that describes the scientific content of the parameter.
utype (str | None) – (elem) - An identifier for a concept in a data model that the data in this parameter represent.
- model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- class vo_models.vodataservice.models.InputParam(**data)[source]¶
A description of a service or function parameter having a fixed data type.
- Parameters:
datatype (DataType | None) – (elem) - A type of data contained in the parameter.
use (Literal['required', 'optional', 'ignored']) – (attr) - An indication of whether this parameter is required to be provided for the application or service to work properly.
std (bool | None) – (attr) - If true, the meaning and behavior of this parameter is reserved and defined by a standard interface.
description (str | None)
unit (str | None)
ucd (str | None)
utype (str | None)
- model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- class vo_models.vodataservice.models.ParamHTTP(**data)[source]¶
A service invoked via an HTTP Query (either Get or Post) with a set of arguments consisting of keyword name-value pairs.
- Parameters:
queryType – (element) - The type of HTTP request, either ‘GET’ or ‘POST’. Max occurs 2.
resultType – (element) - The MIME media type of a document returned in the HTTP response.
param (list[InputParam] | None) – (element) - A description of a input parameter that can be provided as a name=value argument.
testQuery – (element) - An ampersand-delimited list of arguments that can be used to test this service interface.
version (str | None)
role (str | None)
type (Literal['vs:ParamHTTP'])
security_method (list[SecurityMethod] | None)
test_querystring (str | None)
result_type (str | None)
test_query (str | None)
- model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.