diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..b00e304
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,193 @@
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+wheels/
+pip-wheel-metadata/
+share/python-wheels/
+*.egg-info/
+.installed.cfg
+*.egg
+MANIFEST
+
+# PyInstaller
+# Usually these files are written by a python script from a template
+# before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.nox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*.cover
+*.py,cover
+.hypothesis/
+.pytest_cache/
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+local_settings.py
+db.sqlite3
+db.sqlite3-journal
+
+# Flask stuff:
+instance/
+.webassets-cache
+
+# Scrapy stuff:
+.scrapy
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+target/
+
+# Jupyter Notebook
+.ipynb_checkpoints
+
+# IPython
+profile_default/
+ipython_config.py
+
+# pyenv
+.python-version
+
+# pipenv
+# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
+# However, in case of collaboration, if having platform-specific dependencies or dependencies
+# having no cross-platform support, pipenv may install dependencies that don't work, or not
+# install all needed dependencies.
+#Pipfile.lock
+
+# PEP 582; used by e.g. github.com/David-OConnor/pyflow
+__pypackages__/
+
+# Celery stuff
+celerybeat-schedule
+celerybeat.pid
+
+# SageMath parsed files
+*.sage.py
+
+# Environments
+.env
+.venv
+env/
+venv/
+ENV/
+env.bak/
+venv.bak/
+
+# Spyder project settings
+.spyderproject
+.spyproject
+
+# Rope project settings
+.ropeproject
+
+# mkdocs documentation
+/site
+
+# mypy
+.mypy_cache/
+.dmypy.json
+dmypy.json
+
+# Pyre type checker
+.pyre/
+
+# eclipse
+.metadata
+bin/
+tmp/
+*.tmp
+*.bak
+*.swp
+*~.nib
+*~
+
+local.properties
+.settings/
+.project
+.classpath
+.loadpath
+.recommenders
+
+# External tool builders
+.externalToolBuilders/
+
+# Locally stored "Eclipse launch configurations"
+*.launch
+
+# PyDev specific (Python IDE for Eclipse)
+*.pydevproject
+
+# CDT-specific (C/C++ Development Tooling)
+.cproject
+
+# CDT- autotools
+.autotools
+
+# Java annotation processor (APT)
+.factorypath
+
+# PDT-specific (PHP Development Tools)
+.buildpath
+
+# sbteclipse plugin
+.target
+
+# Tern plugin
+.tern-project
+
+# TeXlipse plugin
+.texlipse
+
+# Code Recommenders
+.recommenders/
+
+# Annotation Processing
+.apt_generated/
+.apt_generated_test/
+
+# Scala IDE specific (Scala & Java development for Eclipse)
+.cache-main
+.scala_dependencies
+.worksheet
+
+# Typically, this file would be tracked if it contains build/dependency configurations:
+.project
+
+.DS*
\ No newline at end of file
diff --git a/usecases/README.md b/usecases/README.md
index 7647f0f..56b465a 100644
--- a/usecases/README.md
+++ b/usecases/README.md
@@ -5,36 +5,37 @@
### Connections between projects and use-cases
+| Usecase vs Project | XMM | Chandra | Vizier | GLAST | LSST | GAVO | Gaia | Simbad | Other project | Mock data |
+| -------------------| ------ | -----| ----- | ----- | ---- | ---- | ---- | ------ | ------------- | --------- |
+| identity | C | C | C | C | C | C | C | P C | | |
+| native_frames | | | P C | | | | | | | |
+| simple_position | C | C | C | C | C | C | C | C | | |
+| standard_properties| P C | C | C | C | C | C | C | C | | |
+| precise_astrometry | | | C | | C | | C | | | P |
+| column_grouping | | | P C | | | | | | | |
+| combined_data | P C | C | C | C | C | C | | | | |
+| complex-shaped-object| | | | P C | | | | | | |
+| orbital-system | | | | P C | | | | | | |
+| time-series | C | C | C | | C | P C | | | | |
+
* **P** Raw data provided
* **C** Concerned by the use-case
-| Usecase vs Project | XMM | Chandra | Vizier | GLAST | LSST | GAVO | Gaia | Simbad | Other project | Mock data |
-| -------------------| ------ | ----- | ----- | ---- | --- | --- | ----- | ----- | ----- | ----- |
-| identity | C | C | C | C | C | C |C | P C | | |
-| native_frames | | | P C | | | | | | | |
-| simple_position | C | C | C | C | C | C | C | C | | |
-| standard_properties| P C | C | C | C | C | C | C | C | | |
-| precise_astrometry | | | C | | C | | C | | | P |
-| column_grouping | | | P C | | | | | | | |
-| combined_data | P C | C | C | C | C | C | | | | |
-| complex-shaped-object| | | | P C | | | | | | |
-| orbital-system | | | | P C | | | | | | |
-| time-series | C | C | C | | C | P C | | | | |
### Use case proposal coverage
-| Usecase vs proposal | mango-proposal | md-proposal |
-| ---------------------| -------------- | ----------- |
-| identity | SI | |
-| native_frames | SI | |
-| simple_position | SI | |
-| standard_properties | SI | |
-| precise_astrometry | SI | |
-| column_grouping | SI | |
-| combined_data | SI | |
-| complex-shaped-object| S | |
-| orbital-system | S | |
-| time-series | | SI |
+| Usecase vs proposal | mango-proposal | md-proposal | mcd-implementation | modelinstanceinvot |
+| ---------------------| -------------- | ----------- | ------------------ |--------------------|
+| identity | S I | | | |
+| native_frames | S I | | S I | |
+| simple_position | S I | | | |
+| standard_properties | S I | | | |
+| precise_astrometry | S I | | | |
+| column_grouping | S I | | | |
+| combined_data | S I | | | |
+| complex-shaped-object| S | | | |
+| orbital-system | S | | | |
+| time-series | | S I | S I | S I |
* **S** supported
* **I** implemented
diff --git a/usecases/column_grouping/mcd-implementation/README.md b/usecases/column_grouping/mcd-implementation/README.md
new file mode 100644
index 0000000..99e6436
--- /dev/null
+++ b/usecases/column_grouping/mcd-implementation/README.md
@@ -0,0 +1,78 @@
+# Implementation of 'Column Grouping' case
+
+# Overview
+ This case involves Vizier data with a variety of columns, some of which
+ are 'in some way' related to the Radial Velocity column.
+
+ The primary goals of the case appear to be
+ * Illustrate that the model is able to associate these columns in a way that is easily resolved by a client.
+
+ The data has been annotated using IVOA VO-DML Mapping syntax
+ * Note: The associated properties are basic types, and are (IMO) improperly modeled
+ as extensions of the Measure class. Since the content of the Parameter is not
+ relevant to the Association, I have not annotated the Associated Parameter content.
+
+ Annotation was produced using the 'Jovial' modeling toolset (Java). Jovial
+ was written by Omar Laurino, and updated by me to the current data model content.
+ It provides utilities to help define and create instances of (annotations)
+ IVOA VO-DML compliant data models.
+
+ Uses the 'rama' python package to parse annotated data file and instantiate
+ instances of VO Data Model Classes. The package also applies Adapters which
+ translate certain VO Data Model Classes to corresponding AstroPY types.
+ eg: meas:Point -> astropy:SkyCoord
+ eg: meas:Time -> astropy:Time
+ This package was developed by Omar Laurino, and updated by me to the current
+ data model content.
+
+## Resources Used
+* Mapping Syntax
+ + Working Draft document:
+ https://volute.g-vo.org/svn/trunk/projects/dm/vo-dml-mapping/doc/VO-DML_mapping_WD.pdf
+
+* Jovial Library
+ + version used in this project:
+ https://github.com/mcdittmar/jovial
+ + master repository:
+ https://github.com/olaurino/jovial
+
+* Rama module
+ + version used in this project:
+ https://github.com/mcdittmar/rama
+ + master repository:
+ https://github.com/olaurino/rama
+
+## Details
+* Load Annotated VOTable
+ ```
+ doc = Reader( Votable(infile) )
+ ```
+
+* **Goal: Discover associated properties**
+ ```
+ catalog = doc.find_instances(Source)[0]
+ sys.stdout.write("o Source:\n" )
+ for param in ( catalog.parameter_dock ):
+ sys.stdout.write(" o Parameter: ucd='%s'\n"%(param.ucd) )
+ if param.associated_parameters is None:
+ sys.stdout.write(" + no Associated Parameters\n" )
+ else:
+ for item in ( param.associated_parameters ):
+ inst = item.referenced_instance
+ sys.stdout.write(" + Associated Parameter: ucd='%s'\n"%(inst.ucd) )
+ ```
+ Source:
+ + Parameter: ucd='pos.eq'
+ + no Associated Parameters
+ + Parameter: ucd='spect.dopplerVeloc'
+ + Associated Parameter: ucd='meta.code.qual'
+ + Associated Parameter: ucd='meta.number'
+ + Associated Parameter: ucd='meta.ref'
+ + Parameter: ucd='meta.code.qual'
+ + no Associated Parameters
+ + Parameter: ucd='meta.number'
+ + no Associated Parameters
+ + Parameter: ucd='meta.ref'
+ + no Associated Parameters
+
+
diff --git a/usecases/column_grouping/mcd-implementation/vizier_grouped_col_annotated.vot b/usecases/column_grouping/mcd-implementation/vizier_grouped_col_annotated.vot
new file mode 100644
index 0000000..52a7b29
--- /dev/null
+++ b/usecases/column_grouping/mcd-implementation/vizier_grouped_col_annotated.vot
@@ -0,0 +1,333 @@
+
+
+
+ mango
+ file:/Users/sao/Documents/IVOA/GitHub/ivoa-dm-examples/tmp/Mango-v1.0.vo-dml.xml
+
+
+ meas
+ https://www.ivoa.net/xml/Meas/20200908/Meas-v1.0.vo-dml.xml
+
+
+ coords
+ https://www.ivoa.net/xml/STC/20200908/Coords-v1.0.vo-dml.xml
+
+
+ ivoa
+ https://www.ivoa.net/xml/VODML/IVOA-v1.vo-dml.xml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ _coosys1
+
+
+
+
+
+
+
+
+
+
+
+ _prop03
+ _prop04
+ _prop05
+
+
+
+
+
+
+
+
+
+ _coosys2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ VizieR Astronomical Server vizier.u-strasbg.fr
+ Date: 2021-01-07T12:19:32 [V1.99+ (14-Oct-2013)]
+ Explanations and Statistics of UCDs: See LINK below
+ In case of problem, please report to: cds-question@unistra.fr
+ In this version, NULL integer columns are written as an empty string
+ <TD></TD>, explicitely possible from VOTable-1.3
+
+
+
+
+
+
+-oc.form=dec
+-out.max=50
+-nav=cat:III/21&tab:{III/21/gcrv}&key:source=3021&HTTPPRM:&
+-c.eq=J2000
+-c.r= 2
+-c.u=arcmin
+-c.geom=r
+-source=III/21/gcrv
+-order=I
+-out=recno
+-out=GCRV
+-out=GC
+-out=HD
+-out=RAB1950
+-out=DEB1950
+-out=mag
+-out=n_mag
+-out=pm
+-out=SpT
+-out=RV
+-out=q_RV
+-out=o_RV
+-out=r_RV
+Simbad=Simbad
+-out=_RA.icrs
+-out=_DE.icrs
+
+
+* ex: catalogue III/21 (cf mail 12/juin) : https://vizier.u-strasbg.fr/viz-bin/VizieR?-source=3021
+on voudrait rassembler RV, q_RV (qualite), o_RV (nb observation), r_RV (reference)
+
+
+
+
+
+
+ General Catalogue of Stellar Radial Velocities (Wilson, 1953)
+
+
+ The General Catalogue of Stellar Radial Velocity
+
+
+
+
+
+ Record number assigned by the VizieR team. Should Not be used for identification.
+
+
+
+ [1,15106] GCRV (Wilson) running number
+
+
+ [1,33342]? Boss's General Catalog (I/113) [NULL integer written as an empty string]
+
+
+
+ [1,292630]? Henry Draper Catalog (III/135) [NULL integer written as an empty string]
+
+
+
+
+ Right Ascension B1950
+
+
+ Declination B1950
+
+
+ Visual magnitude (or photographic, see n_mag)
+
+
+ [PV] Photographic (blue) magnitude, or Variable
+
+
+ ? Total proper motion [NULL integer written as an empty string]
+
+
+
+ Spectral type (5)
+
+
+ ? Heliocentric radial velocity
+
+
+
+ [A-E*] Quality of radial velocity (1)
+
+
+ Number of plates used for radial velocity
+
+
+ Abbreviation of observatory (3)
+
+
+
+ Right ascension (ICRS) (computed by VizieR, not part of the original data)
+
+
+
+ Declination (ICRS) (computed by VizieR, not part of the original data)
+
+
+
+
1
1
33342
225001
0.0
+15.59
72
47
A2
-11.0
B
6
S
00.02339
+16.1542
+
+
+
+matching records
+
+
+
+truncated result (maxtup=50)
+
+
+
diff --git a/usecases/time-series/modelinstanceinvot-cube-mapping/README.md b/usecases/time-series/modelinstanceinvot-cube-mapping/README.md
new file mode 100644
index 0000000..9d4497c
--- /dev/null
+++ b/usecases/time-series/modelinstanceinvot-cube-mapping/README.md
@@ -0,0 +1,196 @@
+## `cube_ts.xml` serialization
+
+
+This proposal is derived from the MCD's [proposal](../mcd-implementation).
+
+It maps the same data on the same model (Cube) but by using another syntax, namely `ModelInstanceInVot`
+
+### Resources
+
+* The **ModelInstanceInVot** [repository](https://github.com/ivoa-std/ModelInstanceInVot) provides rationale, syntax rules, XSD schema and large data samples.
+
+* The [modelinstanceinvot-code](https://github.com/ivoa/modelinstanceinvot-code/) repository contains many Python tools operating different aspects of the data mapping.
+
+### Test tools
+
+The current proposal can be processed by [cube_ts.py](https://github.com/ivoa/modelinstanceinvot-code/modelinstanceinvot-code/python/client/demo/cube_ts.py)
+
+* In the frame of `ModelInstanceInVot` we are considering that providing JSON serializations of model instances is a good validation scheme as long as the code generating those JSONs has no dependence with any particular model or data set.
+
+* Such JSONs can be very easily processed with most of the languages (Py, JS, Java, Rust). Therefore it becomes easy for different softwares to share model instances.
+
+* The code snippets below show how to generate and process JSON serializations:
+ * Building the JSON Serialization
+
+```python
+votable_path = os.path.join(data_dir,
+ "annotated_data",
+ "cube_ts.annot.xml"
+ )
+vodml_instance = VodmlInstance(votable_path)
+vodml_instance.populate_templates()
+vodml_instance.connect_join_iterators()
+
+instance = vodml_instance.get_root_element("cube:SparseCube")
+```
+
+ * Retrieving the GLOBALS Types
+
+```python
+coord_systems = instance_browser.get_globals_types()
+print(coord_systems)
+
+['mango:stcextends.PhotometryCoordSys', 'coords:TimeSys', 'coords:SpaceSys']
+```
+
+ * Getting the time coordinate system
+
+```
+print(DictUtils.get_pretty_json(instance_browser.get_globals_by_type("coords:TimeSys")))
+
+{
+ "@ID": "TimeSys_BARYCENTER",
+ "@dmtype": "coords:TimeSys",
+ "coords:PhysicalCoordSys.frame": {
+ "@dmtype": "coords:TimeFrame",
+ "coords:TimeFrame.refPosition": {
+ "@dmtype": "coords:StdRefLocation",
+ "coords:StdRefLocation.position": {
+ "@dmtype": "ivoa:string",
+ "@value": "BARYCENTER"
+ }
+ },
+ "coords:TimeFrame.timescale": {
+ "@dmtype": "ivoa:string",
+ "@value": "TCB"
+ }
+ }
+}
+```
+
+ * Getting the roles of the root object child
+
+```python
+root_component_roles = instance_browser.get_root_component_roles()
+print(root_component_roles)
+
+['cube:SparseCube.data', 'cube:SparseCube.dataset']
+```
+
+ * Getting the dataset instance
+
+```python
+print(DictUtils.get_pretty_json(instance_browser.get_root_component_by_role('cube:SparseCube.dataset')))
+
+{
+ "@dmtype": "ds:experiment.ObsDataset",
+ "ds:dataset.Dataset.curation": {
+ "@dmtype": "ds:dataset.Curation",
+ "ds:dataset.Curation.publisher": {
+ "@dmtype": "ds:dataset.Publisher",
+ "ds:dataset.Publisher.publisherID": {
+ "@dmtype": "ivoa:anyURI",
+ "@value": "ivo://org.gavo.dc"
+ },
+ "ds:party.Role.party": {
+ "@dmtype": "ds:party.Organization",
+ "ds:party.Party.name": {
+ "@dmtype": "ivoa:string",
+ "@value": "GAVO Data Center"
+ }
+ }
+ }
+ },
+ "ds:dataset.Dataset.dataID": {
+ "@dmtype": "ds:dataset.DataID",
+ "ds:dataset.DataID.title": {
+ "@dmtype": "ivoa:string",
+ "@ref": "ndupgttbwtit",
+ "@value": "Gaia DR2 G photometry time series for star 1866721434011386240"
+ }
+ },
+ "ds:dataset.Dataset.dataProductSubtype": {
+ "@dmtype": "ivoa:string",
+ "@value": "lightcurve"
+ },
+ "ds:dataset.Dataset.dataProductType": {
+ "@dmtype": "ds:dataset.DataProductType",
+ "@value": "TIMESERIES"
+ },
+ "ds:experiment.ObsDataset.calibLevel": {
+ "@dmtype": "ivoa:integer",
+ "@value": "1"
+ },
+ "ds:experiment.ObsDataset.target": {
+ "@dmtype": "ds:experiment.Target",
+ "ds:experiment.BaseTarget.name": {
+ "@dmtype": "ivoa:string",
+ "@value": "1866721434011386240"
+ },
+ "meas:Position.coord": {
+ "@dmtype": "meas:Position",
+ "ds:experiment.Target.position": {
+ "@dmtype": "coords:Point",
+ "coords:Coordinate.coordSys": {
+ "@dmref": "SpaceSys_ICRS"
+ },
+ "coords:Point.axis1": {
+ "@dmtype": "ivoa:RealQuantity",
+ "@ref": "ndupgttbwuga",
+ "@value": 315.018457397759
+ },
+ "coords:Point.axis2": {
+ "@dmtype": "ivoa:RealQuantity",
+ "@ref": "ndupgttbwltt",
+ "@value": 35.3014389949649
+ }
+ }
+ }
+ }
+}
+```
+
+ * Getting the column mapping. The syntax used for describing individual columns is not par of any standard. It is due the client implementation.
+
+```python
+print(instance.get_flatten_data_head())
+
+['meas:Time.coord(coords:JD.date) [col#0 obs_time]', 'meas:GenericMeasure.coord(coords:PhysicalCoordinate.cval) [col#1 phot]', 'meas:GenericMeasure.coord(coords:PhysicalCoordinate.cval) [col#2 flux]', 'meas:Error.statError(meas:Symmetrical.radius) [col#3 flux_error]']
+```
+
+ * Getting the mapped table data row per row. The elements of the data arrays returned by the iterator match the above column mapping on the base of their positions.
+
+```python
+ while True:
+ inst = instance._get_next_flatten_row()
+ if inst != None:
+ print(DictUtils.get_pretty_json(inst))
+ else:
+ break
+[
+ 2456964.614751482,
+ 13.1433285545337,
+ 104238.6015625,
+ 784.7562866210938
+]
+[
+ 2456964.688753904,
+ 13.145307101711005,
+ 104048.8203125,
+ 203.0587615966797
+]
+...
+...
+[
+ 2457507.3690639553,
+ 13.019767042062135,
+ 116802.78125,
+ 137.4085693359375
+]
+[
+ 2457507.443075384,
+ 13.014477387452114,
+ 117373.2265625,
+ 457.4692077636719
+]
+```
\ No newline at end of file
diff --git a/usecases/time-series/modelinstanceinvot-cube-mapping/cube_ts.annot.xml b/usecases/time-series/modelinstanceinvot-cube-mapping/cube_ts.annot.xml
new file mode 100644
index 0000000..74ae2c7
--- /dev/null
+++ b/usecases/time-series/modelinstanceinvot-cube-mapping/cube_ts.annot.xml
@@ -0,0 +1,512 @@
+
+
+
+ At the GAVO data Center, we hold several data collections part of
+ or derived from Gaia data release 2:
+
+ * A version
+ of GDR2's gaia_source table with just enough columns
+ to allow basic science (but therefore a bit faster and simpler to
+ deal with
+ than the full gaia_source table). This table also
+ has Lindegren's RUWE measure for filtering out marginal solutions.
+ * The light
+ curves released with DR2 as both a TAP-queriable table
+ (light curves as arrays) and an SSA service.
+ * The gdr2dist.main table
+ with distances estimates computed by
+ Bailer-Jones et al (:bibcode:`2018AJ....156...58B`) that should be
+ used in preference to
+ simple parallax operations.
+ * The gdr2mock schema, which contains a virtual Gaia catalog
+ generated from a carefully built model
+ of the Galaxy.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ With data relase 2, the Gaia DPAC released lightcurves for objects
+ considered variable. This is such a
+ lightcurve (with invalid points
+ removed), for the GAIA/GAIA2.G band.
+
+ Note that the magnitudes in phot are blindly converted to
+ flux using
+ the zero point given in the metadata. If flux_error/flux<0.1, you can
+ use 1.09*flux_error/flux as a good
+ estimate for the error; else the
+ distribution is so skewed that you should work with fluxes rather than
+ magnitude.
+
+ The zero
+ point in the magnitude metadata has been taken from the SVO
+ filter profile service.
+
+
+ Observation time (JD in barycentric TCB).
+
+
+ Magnitude in GAIA/GAIA2.G, Vega system.
+
+
+ Integrated flux in GAIA/GAIA2.G. This is in CCD electrons per second.
+
+
+ Error in GAIA/GAIA2.G flux.
+
+
+
+
+ Gaia DR2 source_id of the object
+
+
+ Publisher-assigned title of the data set
+
+
+ Gaia DR2 RA of source object
+
+
+ Gaia DR2 Dec of source object
+
+
+
+