Skip to main content

mivot-validator

This package has 2 purposes:

  • Validation of VOTables annotated with IVOA recommendation MIVOT
  • MIVOT serialization of model components (snippets) that can be used to build annotations

An extended description is available on readthedocs

Installation

The validator is distributed as a Python package.

$ pip install mivot-validator

Scripts for Validating Annotated VOTables

There are 2 validation levels:

  • against the XML schemas (VOTable and MIVOT)
  • against the model itself as it is defined in VODML

XML Schema Validation

Validation of an annotated VOTable against both VOTable and MIVOT schemas:

$ mivot-validate  PROJECT_DIR/tests/data/gaia_3mags_ok_1.xml

USAGE: mivot-validate [path]
       Validate against both VOTable and MIVOT schemas
       path: either a simple file or a directory
             all directory XML files are validated
       exit status: 0 in case of success, 1 otherwise

Validation of an annotated VOTable against the MIVOT schema only:

$ mivot-mapping-validate  PROJECT_DIR/tests/data/gaia_3mags_ok_1.xml 

USAGE: mivot-mapping-validate [path]
       Validate XML files against  MIVOT schema
       path: either a simple file or a directory
             all directory XML files are validated
       exit status: 0 in case of success, 1 otherwise

Model Validation

This tool checks that mapped classes match the model they refer to.

$ mivot-instance-validate <VOTABLE path>
    
USAGE: mivot-instance-validate [path]
       Validate the mapped instances against the VODML definitions
       path: path to the mapped VOTable to be checked
       exit status: 0 in case of success, 1 otherwise

Types and Roles Checking

The validation tool below checks that all dmtype and dmrole referenced in the mapping block are known by mapped models; it does not care of the class structures. This checking only works with the PhotDM/MANGO/Meas/Coord/ivoa models, other models are ignored.

$ types-and-roles-validate <VOTABLE path>
    
USAGE: types-and-roles-validate [path]
       Validate all dmtypes and dmroles
       exit status: 0 in case of success, 1 otherwise

Snippet Generation

To facilitate the MIVOT annotation of VODML files, it can be convenient to work with pre-computed snippets that can be stacked to build full annotation blocks.

  • A snippet is a MIVOT fragment, where values and references are not set, that represents a component of a model.
  • Snippets can easily be derived from the VODML representation of the model as long as there is no class polymorphism. If there is some, we provide a tool helping users to resolve abstract components.

There are two snippet generators available in this package:

  • mivot-snippet-model which allows, for a given model, to generate all non-abstract object and data types as MIVOT components.
  • The mivot-snippet-instance which generate, for a given concrete class name, a usable snippet including the concrete classes given either as user input or as command line parameters.

Build all MIVOT snippets for a model

$ mivot-snippet-model [VODML path or url]
    
USAGE: mivot-snippet-model [url] [output_dir]
       Create MIVOT snippets from VODML files
       url: url of any VODML-Model (must be prefixed with file:// in case of local file)
       output_dir: path to the chosen output directory (session working directory by default)
       exit status: 0 in case of success, 1 otherwise

Build the MIVOT snippet for one model class with resolving abstract types:

$ mivot-snippet-instance coords:TimeSys `pwd`/coords.TimeSys.example \
   -cc dmrole=coords:TimeFrame.refPosition,context=coords:TimeSys,dmtype=coords:RefLocation,class=coords:StdRefLocation\
   -cc dmrole=coords:TimeFrame.refDirection,context=coords:TimeSys,dmtype=coords:RefLocation,class=coords:StdRefLocation

In this example the tool will generate one snippet for the object type coords:TimeSys.

  • The produced file will be located in CURRENT_FOLDER/coords.TimeSys.example.xml. If the output is not an absolute path, it will be located in the session working directory.
  • All MIVOT instances of (abstract) type coords:RefLocation playing the role coords:TimeFrame.refPosition and hosted by a class playing the role coords:TimeSys, will be replaced by instances of type coords:StdRefLocation
  • All MIVOT instances of (abstract) type coords:RefLocation playing the role coords:TimeFrame.refDirection and hosted by a class playing the role coords:TimeSys, will be replaced by instances of type coords:StdRefLocation

Metadata

Release files for mivot-validator 0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mivot-validator 0.8
File Size Uploaded Provenance Actions
mivot_validator-0.8.tar.gz 210.2 kB Without provenance Details for mivot_validator-0.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mivot-validator 0.8
File Interpreter ABI Platform Actions
mivot_validator-0.8-py3-none-any.whl Python 3 none any Details for mivot_validator-0.8-py3-none-any.whl

Total release size: 364.2 kB

Release files / mivot_validator-0.8.tar.gz

Download URL mivot_validator-0.8.tar.gz
Size 210.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c7a1280285c2b9075fc121b2118c77a14ae33cdf82a4ce2e69bdb62c0f2746e2
BLAKE2b-256 checksum
How to use checksums
c34ed999a0a18e329000c82c053b576fb8996e7aa4fac709bd4383a6b9c43e5d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / mivot_validator-0.8-py3-none-any.whl

Download URL mivot_validator-0.8-py3-none-any.whl
Size 154.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4d60997b753c2b07803586abdb6bc6b97c7e1d926aace33921f79dba58998f39
BLAKE2b-256 checksum
How to use checksums
e07f8f37a24201f3c9261af6031ec3510b0333986ec3c0d8e83f32dd8a7b20bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Security for mivot-validator 0.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page