Skip to content

Commit

Permalink
add Suggester + nomenclature (#82)
Browse files Browse the repository at this point in the history
* add Suggester + nomenclature

- a SUGGESTER is a new value of VisualizationHintEnum
- the container "Nomenclatures" (directly in the Questionnaire) is the same as CodeLists
- a Nomenclature has the same content as in Lunatic
- only VariableType and ResponseType may contain NomenclatureReference

* add id to nomenclatureType

* adapt pogues-model to Pogues developments

* use Urn as an attribute

* Update pom.xml
  • Loading branch information
BulotF authored Nov 9, 2023
1 parent 32a8439 commit 12085fb
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>fr.insee.pogues</groupId>
<artifactId>pogues-model</artifactId>
<packaging>jar</packaging>
<version>1.0.5</version>
<version>1.0.5-snapshot</version>
<name>Pogues Model</name>
<description>Classes and converters for the Pogues model</description>
<url>https://inseefr.github.io/Pogues-Model/</url>
Expand Down
68 changes: 66 additions & 2 deletions src/main/resources/xsd/Questionnaire.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -624,8 +624,10 @@
<xs:element name="Name" type="xs:token"/>
<xs:element name="Label" type="xs:token"/>
<xs:element name="Code" type="CodeType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="SuggesterParameters" type="SuggesterParametersType" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="id" type="xs:ID" use="required"/>
<xs:attribute name="Urn" type="xs:string" use="optional"/>
</xs:complexType>
</xs:element>

Expand Down Expand Up @@ -658,6 +660,61 @@
</xs:sequence>
</xs:complexType>

<xs:complexType name="SuggesterParametersType">
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="fields" type="SuggesterField" minOccurs="1" maxOccurs="unbounded"/>
<xs:element name="max" type="xs:integer" minOccurs="0"/>
<xs:element name="stopWords" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="order" type="SuggesterOrder" minOccurs="0"/>
<xs:element name="queryParser" type="SuggesterQueryParser"/>
</xs:sequence>
<xs:attribute name="id" type="xs:ID" use="required"/>
</xs:complexType>

<xs:complexType name="SuggesterField">
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:choice>
<xs:element name="rules" type="xs:string"/>
<xs:element name="rulesA" type="xs:string" minOccurs="1" maxOccurs="unbounded"/>
</xs:choice>
<xs:element name="language" type="xs:string" minOccurs="0"/>
<xs:element name="min" type="xs:integer" minOccurs="0"/>
<xs:element name="stemmer" type="xs:boolean" minOccurs="0"/>
<xs:element name="synonyms" type="FieldSynonym" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="FieldSynonym">
<xs:sequence>
<xs:element name="source" type="xs:string" minOccurs="1"/>
<xs:element name="target" type="xs:string" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="SuggesterOrder">
<xs:sequence>
<xs:element name="field" type="xs:string"/>
<xs:element name="type" type="xs:string"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="SuggesterQueryParser">
<xs:sequence>
<xs:element name="type" type="xs:string"/>
<xs:element name="params" type="SuggesterQueryParserParams" minOccurs="0"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="SuggesterQueryParserParams">
<xs:sequence>
<xs:element name="language" type="xs:string" minOccurs="0"/>
<xs:element name="min" type="xs:integer" minOccurs="0"/>
<xs:element name="pattern" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>

<!-- Data types -->

<xs:complexType name="DatatypeType" abstract="true">
Expand Down Expand Up @@ -840,8 +897,9 @@
</xs:enumeration>
<xs:enumeration value="PAIRWISE">
<xs:annotation>
<xs:documentation>When surveying households, we distinguish the household and the individual members of the household. In order to properly set up the questionnaire, we want to map individuals relationships, in fact pairing them.
Moreover, as far as possible we would like to infer some relationships instead of asking redundant questions.
<xs:documentation>When surveying households, we distinguish the household and the individual members of the household.
In order to properly set up the questionnaire, we want to map individuals relationships, in fact pairing them.
Moreover, as far as possible we would like to infer some relationships instead of asking redundant questions.
For example, if Alice is the mother of Bob, then Bob is the child of Alice.</xs:documentation>
</xs:annotation>
</xs:enumeration>
Expand Down Expand Up @@ -870,6 +928,12 @@
answer))</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="SUGGESTER">
<xs:annotation>
<xs:documentation>For a large list of codes, such as a nomenclature, this component is used to suggest the sublist of codes
whose labels correspond to the text entered by the respondent and the suggester's rules</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>

Expand Down

0 comments on commit 12085fb

Please sign in to comment.