This allows VTL rules to be generated to check data conformity with its documentation expressed in DDI.
The generation process takes as input a DDI PhysicalInstance expressed in 3.3 DDI XML file using DDI Fragment Instance and generates a text file containing VTL rules. The process is split into two steps:
dereference
building an XML file containing a dereferenced Physical Instanceddi2vtl
generating text file containing VTL rules
The generation process can be represented as follow:
For more details on transformation, see the specification.
- clone the repository
- create a
/lib
folder and a/target
folder, where/
is the Git repository root - download Saxon HE 11.4 from GitHub and extract all files in
/lib
From the command line (or by double-clicking on the script)
cd src/main/scripts
"./dereference.bat"
The result will be in /target/dereferenced.xml
.
Similarly, the ddi2vtl
can be executed after dereference
and will produce /target/vtl.txt
.
See all available command line options in the Saxon documentation.
DDI input is a 3.3 DDI XML file. A DDI PhysicalInstance must be the top-level reference of a Fragment Instance serialized atomically. Two different models are supported:
- one containing InstanceVariable referencing RepresentedVariable with the DDI representation.
- one containing InstanceVariable serializing DDI representation inline
To test your own DDI file, perform the following steps:
- Add your DDI file in
src/test/ddi
(e.g.my-ddi-file.xml
) - Change the name of the source DDI file in the script
dereference
(e.g. changephysicalInstance-test.xml
tomy-ddi-file.xml
). If desired, you also can change the name of the generated file in the scriptddi2vtl
- Run both scripts
dereference
thenddi2vtl
as mentionned in section "Get started"
The execution of generated VTL rules is out of the scope of this repository. As an example of a VTL engine, see the Trevas Java engine available in Open Source.
This work has been the subject of two presentations at international conferences:
- Using data description to automate validation with VTL at the 9th SDMX Global Conference
- Documenting and validating administrative data with DDI at the 15th Annual European DDI User Conference (EDDI 2023)