Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VOSICapabilities / TAPRegExt / VOResource #25

Merged
merged 41 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
8a054a3
first pass at tapregext
jwfraustro Sep 17, 2024
e4ce7c5
voresource / stc models
jwfraustro Sep 17, 2024
8c5d459
fix identifierURI import
jwfraustro Sep 17, 2024
4351c09
tapregext tests, model tweaks
jwfraustro Sep 19, 2024
f585153
update type hints, types
jwfraustro Sep 24, 2024
42ae9ed
more tests - not at all run
jwfraustro Sep 24, 2024
c3fed54
finish test coverage
jwfraustro Sep 24, 2024
b354ab6
test updates
jwfraustro Sep 25, 2024
3911c44
explicit imports, fix defaults
jwfraustro Sep 25, 2024
bca654a
fix tests
jwfraustro Sep 25, 2024
0fe74b0
add handling for resourcename in contact/creator
jwfraustro Sep 25, 2024
e27bd5a
voresource tests passing
jwfraustro Sep 25, 2024
73bebea
fix validators, docstrings
jwfraustro Sep 25, 2024
655a232
tests passing, fixups, remove tags
jwfraustro Sep 25, 2024
c2fe8f7
clean imports
jwfraustro Sep 25, 2024
0c7091f
add doc snippets
jwfraustro Sep 25, 2024
d366939
cleanup documentation
jwfraustro Sep 25, 2024
f899e31
bump version, update readme
jwfraustro Sep 25, 2024
c60c5ef
add voresource/tapregext docs
jwfraustro Sep 25, 2024
915bf8f
adding xsi:type, fixing standard_id
jwfraustro Sep 26, 2024
79ff263
adding capabilities tests
jwfraustro Sep 26, 2024
2864367
removing tapcaprestriction
jwfraustro Sep 26, 2024
286bcb2
added vosicapabilities model
jwfraustro Sep 26, 2024
289f175
fix schema file
jwfraustro Sep 26, 2024
85e17df
namespace woes
jwfraustro Sep 26, 2024
23a3e5e
namespacing figured out
jwfraustro Sep 26, 2024
f62be4b
fix outputformat
jwfraustro Sep 26, 2024
365a05f
add baseparam,inputparam,paramhttp
jwfraustro Sep 26, 2024
42b0b84
fix interface subclasses
jwfraustro Sep 26, 2024
62e4080
fixup broken voresource tests
jwfraustro Sep 26, 2024
9fc64c0
problems discriminating capability types
jwfraustro Sep 26, 2024
0bcd708
finally good hopefully
jwfraustro Sep 26, 2024
0b95bd4
pylint
jwfraustro Sep 26, 2024
252dd54
capabilities docs, cleanup
jwfraustro Sep 26, 2024
38bd7eb
bump version to dev release
jwfraustro Sep 27, 2024
9cf4670
isort
jwfraustro Sep 30, 2024
0386b97
update imports
jwfraustro Sep 30, 2024
af107db
docs updates
jwfraustro Sep 30, 2024
5c9fdf1
fix missing vodataservice namespace
jwfraustro Sep 30, 2024
3921b08
bump release for ns fix
jwfraustro Sep 30, 2024
42e2e6a
bump version for official release
jwfraustro Oct 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ The following IVOA protocols are currently supported:
- **VOSI (IVOA Support Interfaces) version 1.1**
- VOSI Availability
- VOSI Tables
- VOSI Capabilities
- **VODataService version 1.2 (limited)**
- DataType
- FKColumn
Expand All @@ -26,6 +27,9 @@ The following IVOA protocols are currently supported:
- TableParam
- TableSchema
- TableSet
- others
- **VOResource version 1.1**
- **TAPRegExt version 1.0**

You can read more about using these models in our documentation: https://vo-models.readthedocs.io/

Expand Down
5 changes: 3 additions & 2 deletions docs/source/pages/api/index.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. _api:

Developer Documentation
API Reference
~~~~~~~~~~~~~~~~~~~~~~~

This section contains documentation on the package's modules and classes.
Expand All @@ -11,4 +11,5 @@ This section contains documentation on the package's modules and classes.
uws_api
vosi_api
voresource_api
vodataservice_api
vodataservice_api
tapregext_api
12 changes: 12 additions & 0 deletions docs/source/pages/api/tapregext_api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.. _tapregext_api:

TAPRegExt API
--------------

Models
^^^^^^

.. automodule:: vo_models.tapregext.models
:members:
:no-inherited-members:
:exclude-members: model_config, model_fields
8 changes: 8 additions & 0 deletions docs/source/pages/api/voresource_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
VOResource API
--------------

Models
^^^^^^

.. automodule:: vo_models.voresource.models
:members:
:no-inherited-members:
:exclude-members: model_config, model_fields

Simple Types
^^^^^^^^^^^^
.. automodule:: vo_models.voresource.types
Expand Down
8 changes: 8 additions & 0 deletions docs/source/pages/api/vosi_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ Tables
^^^^^^

.. automodule:: vo_models.vosi.tables.models
:members:
:no-inherited-members:
:exclude-members: model_config, model_fields,

Capabilities
^^^^^^^^^^^^

.. automodule:: vo_models.vosi.capabilities.models
:members:
:no-inherited-members:
:exclude-members: model_config, model_fields,
6 changes: 4 additions & 2 deletions docs/source/pages/protocols/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
Supported Protocols
~~~~~~~~~~~~~~~~~~~

The following IVOA protocols are currently supported:
The pages below contain some examples for each supported protocol. For a full list of all models, see the :ref:`api`.

.. toctree::
:maxdepth: 3

uws
vosi
vodataservice
vodataservice
voresource
tapregext
36 changes: 36 additions & 0 deletions docs/source/pages/protocols/tapregext.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
.. _tapregext:

TAPRegExt
----------

TAPRegExt is an IVOA XML encoding standard for describing TAP service metadata. It is used by the TAP standard to describe the capabilities of a TAP service.

`vo-models` currently supports the full TAPRegExt v1.0 standard. The key model is the ``TableAccess`` model, which represents the capabilities of a TAP server:

Models
^^^^^^

TableAccess
***********

This model represents the capabilities of a TAP server, used as part of the VOSI Capabilities standard.

.. grid:: 2
:gutter: 2

.. grid-item-card:: Model

.. literalinclude:: ../../../../examples/snippets/tapregext/tapregext.py
:language: python
:start-after: TableAccess-model-start
:end-before: TableAccess-model-end

.. grid-item-card:: XML Output

.. literalinclude:: ../../../../examples/snippets/tapregext/tapregext.py
:language: xml
:lines: 2-
:start-after: TableAccess-xml-start
:end-before: TableAccess-xml-end

See the :ref:`tapregext_api` documentation for more information on the models and types available.
105 changes: 105 additions & 0 deletions docs/source/pages/protocols/voresource.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
.. _voresource:

VOResource
----------

VOResource is an IVOA XML encoding standard for describing resource metadata. It is used by various IVOA standards, such as VODataService, VOSI, and TAPRegExt to describe resources and the services that provide access to them.

`vo-models` currently supports the full VOResource v1.1 standard. Some of the key elements include:

Models
^^^^^^

Resource
********

Any entity or component of a VO application that is describable and identifiable by an IVOA Identifier.

.. grid:: 2
:gutter: 2

.. grid-item-card:: Model

.. literalinclude:: ../../../../examples/snippets/voresource/voresource.py
:language: python
:start-after: Resource-model-start
:end-before: Resource-model-end

.. grid-item-card:: XML Output

.. literalinclude:: ../../../../examples/snippets/voresource/voresource.py
:language: xml
:lines: 2-
:start-after: Resource-xml-start
:end-before: Resource-xml-end

Service
*******

A resource that can be invoked by a client to perform some action on its behalf.

.. grid:: 2
:gutter: 2

.. grid-item-card:: Model

.. literalinclude:: ../../../../examples/snippets/voresource/voresource.py
:language: python
:start-after: Service-model-start
:end-before: Service-model-end

.. grid-item-card:: XML Output

.. literalinclude:: ../../../../examples/snippets/voresource/voresource.py
:language: xml
:lines: 2-
:start-after: Service-xml-start
:end-before: Service-xml-end

Capability
**********

A description of what the service does (in terms of context-specific behavior), and how to use it (in terms of an interface).

.. grid:: 2
:gutter: 2

.. grid-item-card:: Model

.. literalinclude:: ../../../../examples/snippets/voresource/voresource.py
:language: python
:start-after: Capability-model-start
:end-before: Capability-model-end

.. grid-item-card:: XML Output

.. literalinclude:: ../../../../examples/snippets/voresource/voresource.py
:language: xml
:lines: 2-
:start-after: Capability-xml-start
:end-before: Capability-xml-end

Interface
*********

A description of a service interface.

.. grid:: 2
:gutter: 2

.. grid-item-card:: Model

.. literalinclude:: ../../../../examples/snippets/voresource/voresource.py
:language: python
:start-after: Interface-model-start
:end-before: Interface-model-end

.. grid-item-card:: XML Output

.. literalinclude:: ../../../../examples/snippets/voresource/voresource.py
:language: xml
:lines: 2-
:start-after: Interface-xml-start
:end-before: Interface-xml-end

See the :ref:`voresource_api` documentation for more information on the available models and types.
28 changes: 26 additions & 2 deletions docs/source/pages/protocols/vosi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ VOSI (VO Support Interface)
Availability
^^^^^^^^^^^^

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

.. grid:: 2
Expand Down Expand Up @@ -81,4 +81,28 @@ For requests to the ``GET /tables`` endpoint, you can use the ``TableSet`` model
:language: xml
:lines: 2-
:start-after: tableset-xml-start
:end-before: tableset-xml-end
:end-before: tableset-xml-end

Capabilities
^^^^^^^^^^^^

The VOSICapabilities model is used to represent the response given by a service to a
``GET /capabilities`` request. Below is a relatively full example of a VOSI capabilities document for a TAP service.

.. grid:: 2
:gutter: 2

.. grid-item-card:: Model

.. literalinclude:: ../../../../examples/snippets/vosi/capabilities.py
:language: python
:start-after: capabilities-model-start
:end-before: capabilities-model-end

.. grid-item-card:: XML Output

.. literalinclude:: ../../../../examples/snippets/vosi/capabilities.py
:language: xml
:lines: 2-
:start-after: capabilities-xml-start
:end-before: capabilities-xml-end
81 changes: 81 additions & 0 deletions examples/snippets/tapregext/tapregext.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
"""Snippets for TAPRegExt models and XML serialization."""
from vo_models.tapregext.models import (
DataLimits,
DataModelType,
Language,
LanguageFeature,
LanguageFeatureList,
OutputFormat,
TableAccess,
TimeLimits,
Version,
)

# pylint: disable=invalid-name

# [TableAccess-model-start]
table_access_model = TableAccess(
data_model=[DataModelType(value="VOTable", ivo_id="ivo://ivoa.net/std/VOTable")],
language=[
Language(
name="ADQL",
version=[Version(value="2.0", ivo_id="ivo://ivoa.net/std/ADQL-2.0")],
description="Astronomical Data Query Language",
language_features=[
LanguageFeatureList(
feature=[
LanguageFeature(form="Formal notation", description="A description"),
LanguageFeature(form="Informal notation", description="Another description"),
],
type="adql-some-feature",
)
],
)
],
output_format=[
OutputFormat(
mime="application/x-votable+xml",
alias=["VOTABLE"],
)
],
retention_period=TimeLimits(default=10, hard=100),
output_limit=DataLimits(
default={"value": 10, "unit": "row"},
hard={"value": 100, "unit": "row"},
),
)
# [TableAccess-model-end]

# [TableAccess-xml-start]
table_access_xml = """
<capability standardID="ivo://ivoa.net/std/TAP">
<dataModel ivo-id='ivo://ivoa.net/std/VOTable'>VOTable</dataModel>
<language>
<name>ADQL</name>
<version ivo-id="ivo://ivoa.net/std/ADQL-2.0">2.0</version>
<description>Astronomical Data Query Language</description>
<languageFeatures type="adql-some-feature">
<feature>
<form>Formal notation</form>
<description>A description</description>
</feature>
<feature>
<form>Informal notation</form>
<description>Another description</description>
</feature>
</languageFeatures>
</language>
<outputFormat>
<mime>application/x-votable+xml</mime>
<alias>VOTABLE</alias>
</outputFormat>
<retentionPeriod>
<default>10</default>
<hard>100</hard>
</retentionPeriod>
<outputLimit>
<default unit="row">10</default>
<hard unit="row">100</hard>
</outputLimit>
</capability>
""" # [TableAccess-xml-end]
Loading