VOSI (VO Support Interface)#

vo-models supports the following VOSI v1.0 protocols:

Availability#

The Availability model is used to represent the response given by a UWS service to a GET /availability request.

Model
availability = Availability(
    available=True,
    up_since="2023-01-01T00:00:00Z",
    down_at="2023-01-02T00:00:00Z",
    back_at="2023-01-03T00:00:00Z",
    notes=["This service is available for public use."],
)

availability.to_xml()
XML Output
<availability
    xmlns="http://www.ivoa.net/xml/VOSIAvailability/v1.0"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<available>true</available>
<upSince>2023-01-01T00:00:00.000Z</upSince>
<downAt>2023-01-02T00:00:00.000Z</downAt>
<backAt>2023-01-03T00:00:00.000Z</backAt>
</availability>
"""

Tables#

VOSITable#

For requests for a single table from the GET /tables/{table_name} endpoint, you can use the Table model.

Note

This model is functionally identical to the Table element, specifically namespaced under VOSI.

Model
test_element = VOSITable(
    table_type="table",
    table_name="tap_schema.schemas",
    title=None,
    description="description of schemas in this dataset",
    utype=None,
    nrows=None,
    column=[
        TableParam(
            column_name="schema_name",
            description="Fully qualified schema name",
            unit=None,
            ucd=None,
            datatype=DataType(type_attr="vs:VOTableType", arraysize="*", value="char"),
            flag=["std"],
        ),
        TableParam(
            column_name="description",
            description="Brief description of the schema",
            unit=None,
            ucd=None,
            datatype=DataType(type_attr="vs:VOTableType", arraysize="*", value="char"),
            flag=["std"],
        ),
    ],
    foreign_key=None,
)
XML Output
<vosi:table type='table'>
    <name>tap_schema.schemas</name>
    <description>description of schemas in this dataset</description>
    <column>
        <name>schema_name</name>
        <description>Fully qualified schema name</description>
        <dataType xsi:type='vs:VOTableType' arraysize='*'>char</dataType>
        <flag>std</flag>
    </column>
    <column>
        <name>description</name>
        <description>Brief description of the schema</description>
        <dataType xsi:type='vs:VOTableType' arraysize='*'>char</dataType>
        <flag>std</flag>
    </column>
</vosi:table>

VOSITableSet#

For requests to the GET /tables endpoint, you can use the TableSet model to represent table schemas, their child tables, and columns.

Note

This model is functionally identical to the TableSet element, specifically namespaced under VOSI.

Model
test_element = VOSITableSet(
    tableset_schema=[
        TableSchema(
            schema_name="tap_schema",
            title=None,
            description="schema information for TAP services",
            table=[
                Table(
                    table_type="table",
                    table_name="tap_schema.schemas",
                    title=None,
                    description="description of schemas in this dataset",
                    utype=None,
                    nrows=None,
                    column=None,
                    foreign_key=None,
                ),
                Table(
                    table_type="table",
                    table_name="tap_schema.tables",
                    title=None,
                    description="description of tables in this dataset",
                    utype=None,
                    nrows=None,
                    column=None,
                    foreign_key=None,
                ),
            ],
        ),
    ]
)
XML Output
<vosi:tableset>
    <schema>
    <name>tap_schema</name>
    <description>schema information for TAP services</description>
    <table type='table'>
        <name>tap_schema.schemas</name>
        <description>description of schemas in this dataset</description>
    </table>
    <table type='table'>
        <name>tap_schema.tables</name>
        <description>description of tables in this dataset</description>
    </table>
    </schema>
</vosi:tableset>