VODataService

VODataService is an IVOA XML encoding standard for data collections and services that access them. It is an extension of the VOResource standard.

vo-models currently supports the following VODataService v1.2 elements:

Models

FKColumn

Represents a single foreign key column.

Model
fk_column = FKColumn(
    from_column="from_column",
    target_column="target_column",
)
XML Output
<fkColumn>
    <fromColumn>from_column</fromColumn>
    <targetColumn>target_column</targetColumn>
</fkColumn>

ForeignKey

Represents one or more foreign key columns.

Model
foreign_key = ForeignKey(
    target_table="target_table",
    fk_column=fk_column,
    description="description",
    utype="utype",
)
XML Output
<foreignKey>
    <targetTable>target_table</targetTable>
    <fkColumn>
        <fromColumn>from_column</fromColumn>
        <targetColumn>target_column</targetColumn>
    </fkColumn>
    <description>description</description>
    <utype>utype</utype>
</foreignKey>

DataType

A simple element containing a column’s datatype.

Model
data_type = DataType(
    type="string",
    arraysize="32*",
    value="value",
)
XML Output
<dataType
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:type="string" arraysize="32*">value</dataType>
"""

TableParam

A description of a table parameter (a column within the table) with a fixed datatype.

Model
table_param = TableParam(
    column_name="example_column",
    description="Example column description",
    datatype=data_type,
    flag=["std", "indexed"],
)
XML Output
<column>
    <name>example_column</name>
    <description>Example column description</description>
    <unit></unit>
    <ucd></ucd>
    <utype></utype>
    <xtype></xtype>
    <dataType
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:type="string"
        arraysize="32*">
        value
    </dataType>
    <flag>std</flag>
    <flag>indexed</flag>
</column>

Table

A single table element.

Model
table = Table(
    table_type="table",
    table_name="example_table",
    description="Example table description",
    column=table_param,
    foreign_key=foreign_key,
)
XML Output
<table type="table">
    <name>example_table</name>
    <description>Example table description</description>
    <column>
        <name>example_column</name>
        <description>Example column description</description>
        <dataType
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:type="string" arraysize="32*">
                value
        </dataType>
        <flag>std</flag>
        <flag>indexed</flag>
    </column>
    <foreignKey>
        <targetTable>target_table</targetTable>
        <fkColumn>
            <fromColumn>from_column</fromColumn>
            <targetColumn>target_column</targetColumn>
        </fkColumn>
        <description>description</description>
        <utype>utype</utype>
    </foreignKey>
</table>

TableSchema

Represents a description of a logically related group of tables.

Model
table_schema = TableSchema(
    name="example_schema",
    title="Example schema title",
    description="Example schema description",
    table=table,
)
XML Output
<schema>
    <name>default</name>
    <title>Example schema title</title>
    <description>Example schema description</description>
    <table type="table">
        <name>example_table</name>
        <description>Example table description</description>
        <column>
            <name>example_column</name>
            <description>Example column description</description>
            <dataType
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:type="string"
                arraysize="32*"
            >value</dataType>
            <flag>std</flag>
            <flag>indexed</flag>
        </column>
        <foreignKey>
            <targetTable>target_table</targetTable>
            <fkColumn>
                <fromColumn>from_column</fromColumn>
                <targetColumn>target_column</targetColumn>
            </fkColumn>
            <description>description</description>
            <utype>utype</utype>
        </foreignKey>
    </table>
</schema>

TableSet

Represents a collection of tables that are part of a single resource.

Model
table_set = TableSet(
    tableset_schema=table_schema,
)
XML Output
<tableset>
    <schema>
        <name>default</name>
        <title>Example schema title</title>
        <description>Example schema description</description>
        <table type="table">
            <name>example_table</name>
            <description>Example table description</description>
            <column>
                <name>example_column</name>
                <description>Example column description</description>
                <dataType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="string"
                    arraysize="32*">value</dataType>
                <flag>std</flag>
                <flag>indexed</flag>
            </column>
            <foreignKey>
                <targetTable>target_table</targetTable>
                <fkColumn>
                    <fromColumn>from_column</fromColumn>
                    <targetColumn>target_column</targetColumn>
                </fkColumn>
                <description>description</description>
                <utype>utype</utype>
            </foreignKey>
        </table>
    </schema>
</tableset>