-
Notifications
You must be signed in to change notification settings - Fork 1
Syntax
Most of XML snippets reported here are extract from the Gaia sample
Mapping for an object.
-
<INSTANCE>
is a set of key/value pairs. - Keys are the roles of the components
- Values can be
<VALUE>
,<INSTANCE>
or<COMPOSITION/ARRAY>
- Must have a dmrole
- Should he a dmtype
- Can have an ID
Example
<INSTANCE dmrole="ds:dataset.Dataset.dataID" dmtype="ds:dataset.DataID" ID="_ds_">
<VALUE dmrole="ds:dataset.DataID.title" value="Gaia TS Mapping Test" />
<VALUE dmrole="ds:dataset.DataID.datasetID" value="ivoa://gaia/ts/12345" />
<VALUE dmrole="ds:dataset.DataID.creatorDID" value="ivoa://esa/gaia/" />
<VALUE dmrole="ds:dataset.DataID.version" value="0.0" />
<VALUE dmrole="ds:dataset.DataID.date" value="2018:11:11" />
<VALUE dmrole="ds:dataset.DataID.creationType" value="LiteMappingTest" />
<INSTANCE dmrole="ds:dataset.DataID.creator" dmtype="ds:dataset.Creator">
<INSTANCE dmrole="ds:party.Role.party" dmtype="ds:party.Individual">
<VALUE dmrole="ds:party.Party.name" value="VODML-Team" />
</INSTANCE>
</INSTANCE>
</INSTANCE>
An instance can refer to another instance. In this case, it is empty and it has a ref
or a tableref
attribute.
- If the instance has a
ref
attribute, the parser will look for the instance having anID
matching the reference. The parser has to check that the target instance has the same role (this cross checking is not implemented yet)
<INSTANCE dmrole="cube:DataProduct.dataset" ref="_ds_" />
- If the instance has a
tableref
attribute, the parser will look for the instance of the target table having he same role (not implemented yet) -
globals
is a name reserved for instances being in the<GLOBALS>
block.
<INSTANCE dmrole="cube:DataProduct.dataset" tableref="globals" />
A value refers to a simple value.
- It can be either a literal or a value read in the VOTable
- A
<VALUE>
must have admrole
- A
<VALUE>
must have aref
attribute, a 'value` or both
Value Setting
- A
<VALUE>
with aref
will be set by the value of the<FIELD>
with the matching ID. - If there is non field, it will be set with the
<PARAM>
having the matching ID - If there is no param, it will be set with the
value
attribute which act here as a default value. - it is kept empty otherwise
Value set with false
<VALUE dmrole="cube:DataAxis.dependent" value="false" />
Value set with the field and then with the param having ID=time
<VALUE dmrole="coords:domain.time.JD.date" ref="time" />
Value set with today
if there no field nor param having ID=time
<VALUE dmrole="coords:domain.time.JD.date" ref="time" value="today"/>
Element indicating that one instance of the inner class must be generated per table row
- Must contain one
dmrole
which is the composition name in the model. - Must have one single
INTANCE
as child
<ARRAY dmrole="observable">
Element indicating a set of elements. All the elements contained in a COMPOSITION
are explicitly mapped inside
- Must contain one
dmrole
which is the composition name in the model.
<COMPOSITION dmrole="data">
This element indicates that the VOTable contains a set on instances of the root model.
- It must be the unique child of the root
TEMPLATES
- Must contain one
dmrole
equals toroot
. - Must have one single
INSTANCE
as child.- This INSTANCE must have a
dmrole
equals toroot
- This INSTANCE must have a
dmtype
equals to the model name.
- This INSTANCE must have a
- It must have a
groupby
attribute which value indicates the column ID or name that must be used to group data.
<SET dmrole="root" groupby="sourceid">
<INSTANCE dmrole="root" dmtype="ts:TimeSeries">
...
</INSTANCE>
</SET>
This element indicates a way to filter the table content
- It must be child of the
INSTANCE
inside anARRAY
. (TODO: The natural location is as immediate child ofARRAY
) - It must have a
key
attribute which value indicates the column used to filter. - It must have a
value
attribute giving the valid values for the key column.
<INSTANCE dmrole="cube:NDPoint.observable" dmtype="cube:Observable">
<FILTER key="band" value="G" />
....
</INSTANCE>
In theory we could have multiple FILTER
s, but this feature has not been investigated yet
The foreign key allows to join ARRAY
s from different tables.
It is not implemented yet