InseeFr / Pogues-Model

Classes and converters for the Pogues data model
MIT License
2 stars 8 forks source link

fix: suggester field synonyms #93

Closed nsenave closed 8 months ago

nsenave commented 8 months ago

Summary

The synonyms property this time.

Done

Why a dirty "pre-processing" class?

The current output of Pogues app for suggesters (including field synonyms) is as it should be in Lunatic. I wanted to keep that.

Yet XSD generated classes doesn't allow to have key/value pairs (at least not without some hacking which would be worst).

So, I added a pre-processing step for json questionnaire inputs to change key/value pairs into source/target fields.

In the end, the usage of this is as follows:

  1. questionnaires are be converted from json to xml
  2. Eno v2 does Pogues to DDI using the xml output, and the suggester parameters are put in a CDATA in the DDI
  3. Eno v3 does the DDI to Lunatic, it will require a patch to read the xml content of that CDATA anyway to convert it to Lunatic json...

=> Later on, when Eno v3 does the Pogues to DDI/Lunatic transformation, we will only use the json representation in Pouges-Model and this pre-processing will be removed.

nsenave commented 8 months ago

Note: I tried to replace jaxb with jackson, but maintaining the json <-> xml conversions would be too much work (too much risks).

Switch to jackson will be done when the xml format will no longer be required (i.e. when Eno v3 can do the Pogues to DDI transformation)