Skip to main content

Tools for validating VOTable annotated with MIVOT and to generate MIVOT snippets

Project description

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

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 [path] [output_dir]
       Create MIVOT snippets from VODML files
       path: either a simple file to any VODML-Model or an ur
       output_dir: (optional) 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mivot_validator-0.0.2.tar.gz (220.4 kB view details)

Uploaded Source

Built Distribution

mivot_validator-0.0.2-py3-none-any.whl (178.7 kB view details)

Uploaded Python 3

File details

Details for the file mivot_validator-0.0.2.tar.gz.

File metadata

  • Download URL: mivot_validator-0.0.2.tar.gz
  • Upload date:
  • Size: 220.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for mivot_validator-0.0.2.tar.gz
Algorithm Hash digest
SHA256 c6888fce48b04122135a955ef6db4f57b322778922f22e86b494ddcf6ca59b90
MD5 e49f21a29f4c3e46f39f630e7e766cda
BLAKE2b-256 549beb733bbfb2b976cb3befda10f15fef60e8938eeb6fb6439687891cc715d0

See more details on using hashes here.

File details

Details for the file mivot_validator-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for mivot_validator-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fe122bb8e458e2deff4452d134d6e835fe56e9715247665c67fdb46a2f4b1b80
MD5 6d5439dfea3c12a5728e440b1eb67738
BLAKE2b-256 5784914381dd50093858c1e8ae3c44ac0f7ce9ab5f552369191c5b0618fae9d8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page