diff --git a/.github/workflows/generate-java.yml b/.github/workflows/generate-java.yml index 26786a31..da48f7d2 100644 --- a/.github/workflows/generate-java.yml +++ b/.github/workflows/generate-java.yml @@ -1,13 +1,14 @@ +name: Generate Java on: push: branches: - - "**" - - "!main" + - "**" + - "!main" paths: - - "src/**" - - "generated/java/datadoc-model/pom.xml" - - ".github/workflows/generate-java.yml" + - "src/**" + - "generated/java/datadoc-model/pom.xml" + - ".github/workflows/generate-java.yml" # Allow only one generate workflow to run at a time. This avoids race conditions when # pushing to the same branch. @@ -38,10 +39,10 @@ jobs: - name: Generate Java run: | - pushd generated/java/datadoc-model - rm -rf src/main/java - ./mvnw jsonschema2pojo:generate - popd + pushd generated/java/datadoc-model + rm -rf src/main/java + ./mvnw jsonschema2pojo:generate + popd - name: Check for modified files id: git-check @@ -50,11 +51,11 @@ jobs: - name: Commit if: steps.git-check.outputs.modified == 'true' run: | - git add -A - git commit -m '[GENERATE] Java classes from JSON Schema' + git add -A + git commit -m '[GENERATE] Java classes from JSON Schema' - name: Push if: steps.git-check.outputs.modified == 'true' run: | - git pull --rebase origin "${GITHUB_REF}" - git push origin "${GITHUB_REF}" + git pull --rebase origin "${GITHUB_REF}" + git push origin "${GITHUB_REF}" diff --git a/.github/workflows/generate-python.yml b/.github/workflows/generate-python.yml index e75b08d4..a2896130 100644 --- a/.github/workflows/generate-python.yml +++ b/.github/workflows/generate-python.yml @@ -1,12 +1,13 @@ +name: Generate Python on: push: branches: - - "**" - - "!main" + - "**" + - "!main" paths: - - "src/**/*.json" - - ".github/workflows/generate-python.yml" + - "src/**/*.json" + - ".github/workflows/generate-python.yml" # Allow only one generate workflow to run at a time. This avoids race conditions when # pushing to the same branch. @@ -40,29 +41,29 @@ jobs: - name: Install pipx run: | - python -m pip install --upgrade pipx - python -m pipx ensurepath + python -m pip install --upgrade pipx + python -m pipx ensurepath - name: Install datamodel-codegen run: | - python -m pipx install datamodel-code-generator==0.25.2 + python -m pipx install datamodel-code-generator==0.25.2 - name: Generate Python run: > - datamodel-codegen - --input-file-type jsonschema - --input src/metadata-container-json-schema.json - --output-model-type pydantic_v2.BaseModel - --base-class "datadoc_model.datadoc_base_model.DatadocBaseModel" - --use-default - --use-title-as-name - --use-one-literal-as-default - --force-optional - --use-subclass-enum - --use-standard-collections - --use-double-quotes - --target-python-version 3.10 - --output generated/python/datadoc_model/datadoc_model/model.py + datamodel-codegen + --input-file-type jsonschema + --input src/metadata-container-json-schema.json + --output-model-type pydantic_v2.BaseModel + --base-class "datadoc_model.datadoc_base_model.DatadocBaseModel" + --use-default + --use-title-as-name + --use-one-literal-as-default + --force-optional + --use-subclass-enum + --use-standard-collections + --use-double-quotes + --target-python-version 3.10 + --output generated/python/datadoc_model/datadoc_model/model.py - name: Check for modified files id: git-check @@ -71,11 +72,11 @@ jobs: - name: Commit if: steps.git-check.outputs.modified == 'true' run: | - git add -A - git commit -m '[GENERATE] Pydantic models from JSON Schema' + git add -A + git commit -m '[GENERATE] Pydantic models from JSON Schema' - name: Push if: steps.git-check.outputs.modified == 'true' run: | - git pull --rebase origin "${GITHUB_REF}" - git push origin "${GITHUB_REF}" + git pull --rebase origin "${GITHUB_REF}" + git push origin "${GITHUB_REF}" diff --git a/generated/java/datadoc-model/pom.xml b/generated/java/datadoc-model/pom.xml index 5366f2b0..58ad41f4 100644 --- a/generated/java/datadoc-model/pom.xml +++ b/generated/java/datadoc-model/pom.xml @@ -1,4 +1,6 @@ - + 4.0.0 no.ssb.dapla.metadata datadoc-model @@ -13,7 +15,8 @@ ${jdk.version} UTF-8 UTF-8 - artifactregistry://europe-north1-maven.pkg.dev/artifact-registry-5n/dapla-stat-maven/ + + artifactregistry://europe-north1-maven.pkg.dev/artifact-registry-5n/dapla-stat-maven/ statisticsnorway/ssb-datadoc-model @@ -35,66 +38,66 @@ - commons-lang - commons-lang - ${commons-lang.version} + commons-lang + commons-lang + ${commons-lang.version} - com.fasterxml.jackson.core - jackson-databind - ${jackson-databind.version} + com.fasterxml.jackson.core + jackson-databind + ${jackson-databind.version} - jakarta.validation - jakarta.validation-api - ${jakarta.validation-api.version} + jakarta.validation + jakarta.validation-api + ${jakarta.validation-api.version} - - - org.apache.maven.plugins - maven-release-plugin - ${maven-release-plugin.version} - - java-v@{project.version} - - - - org.jsonschema2pojo - jsonschema2pojo-maven-plugin - ${jsonschema2pojo-maven-plugin.version} - - ${basedir}../../../../src - ${basedir}/src/main/java - no.ssb.dapla.metadata - true - true - true - true - true - true - true - - - - - generate - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - ${jdk.version} - ${jdk.version} - - - + + + org.apache.maven.plugins + maven-release-plugin + ${maven-release-plugin.version} + + java-v@{project.version} + + + + org.jsonschema2pojo + jsonschema2pojo-maven-plugin + ${jsonschema2pojo-maven-plugin.version} + + ${basedir}../../../../src + ${basedir}/src/main/java + no.ssb.dapla.metadata + true + true + true + true + true + true + true + + + + + generate + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${jdk.version} + ${jdk.version} + + + @@ -104,7 +107,6 @@ ${artifactregistry-maven-wagon.version} - @@ -158,4 +160,4 @@ - + \ No newline at end of file diff --git a/generated/java/datadoc-model/src/main/java/no/ssb/dapla/metadata/datadoc/CustomType.java b/generated/java/datadoc-model/src/main/java/no/ssb/dapla/metadata/datadoc/CustomType.java new file mode 100644 index 00000000..592f0fa3 --- /dev/null +++ b/generated/java/datadoc-model/src/main/java/no/ssb/dapla/metadata/datadoc/CustomType.java @@ -0,0 +1,231 @@ + +package no.ssb.dapla.metadata.datadoc; + +import java.io.Serializable; +import java.util.LinkedHashMap; +import java.util.Map; +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.Valid; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "key", + "value" +}) +@Generated("jsonschema2pojo") +public class CustomType implements Serializable +{ + + /** + * Key + *

+ * Custom type KEY + * + */ + @JsonProperty("key") + @JsonPropertyDescription("Custom type KEY") + private String key; + /** + * Value + *

+ * Custom type VALUE (of type string, array or object). + * + */ + @JsonProperty("value") + @JsonPropertyDescription("Custom type VALUE (of type string, array or object).") + private Object value; + @JsonIgnore + @Valid + private Map additionalProperties = new LinkedHashMap(); + private final static long serialVersionUID = 5187573791864322508L; + + /** + * No args constructor for use in serialization + * + */ + public CustomType() { + } + + /** + * + * @param value + * Value. Custom type VALUE (of type string, array or object). + * @param key + * Key. Custom type KEY. + */ + public CustomType(String key, Object value) { + super(); + this.key = key; + this.value = value; + } + + public static CustomType.CustomTypeBuilderBase builder() { + return new CustomType.CustomTypeBuilder(); + } + + /** + * Key + *

+ * Custom type KEY + * + */ + @JsonProperty("key") + public String getKey() { + return key; + } + + /** + * Key + *

+ * Custom type KEY + * + */ + @JsonProperty("key") + public void setKey(String key) { + this.key = key; + } + + /** + * Value + *

+ * Custom type VALUE (of type string, array or object). + * + */ + @JsonProperty("value") + public Object getValue() { + return value; + } + + /** + * Value + *

+ * Custom type VALUE (of type string, array or object). + * + */ + @JsonProperty("value") + public void setValue(Object value) { + this.value = value; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(CustomType.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); + sb.append("key"); + sb.append('='); + sb.append(((this.key == null)?"":this.key)); + sb.append(','); + sb.append("value"); + sb.append('='); + sb.append(((this.value == null)?"":this.value)); + sb.append(','); + sb.append("additionalProperties"); + sb.append('='); + sb.append(((this.additionalProperties == null)?"":this.additionalProperties)); + sb.append(','); + if (sb.charAt((sb.length()- 1)) == ',') { + sb.setCharAt((sb.length()- 1), ']'); + } else { + sb.append(']'); + } + return sb.toString(); + } + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode())); + result = ((result* 31)+((this.value == null)? 0 :this.value.hashCode())); + result = ((result* 31)+((this.key == null)? 0 :this.key.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof CustomType) == false) { + return false; + } + CustomType rhs = ((CustomType) other); + return ((((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties)))&&((this.value == rhs.value)||((this.value!= null)&&this.value.equals(rhs.value))))&&((this.key == rhs.key)||((this.key!= null)&&this.key.equals(rhs.key)))); + } + + public static class CustomTypeBuilder + extends CustomType.CustomTypeBuilderBase + { + + + public CustomTypeBuilder() { + super(); + } + + public CustomTypeBuilder(String key, Object value) { + super(key, value); + } + + } + + public static abstract class CustomTypeBuilderBase{ + + protected T instance; + + @SuppressWarnings("unchecked") + public CustomTypeBuilderBase() { + // Skip initialization when called from subclass + if (this.getClass().equals(CustomType.CustomTypeBuilder.class)) { + this.instance = ((T) new CustomType()); + } + } + + @SuppressWarnings("unchecked") + public CustomTypeBuilderBase(String key, Object value) { + // Skip initialization when called from subclass + if (this.getClass().equals(CustomType.CustomTypeBuilder.class)) { + this.instance = ((T) new CustomType(key, value)); + } + } + + public T build() { + T result; + result = this.instance; + this.instance = null; + return result; + } + + public CustomType.CustomTypeBuilderBase withKey(String key) { + ((CustomType) this.instance).key = key; + return this; + } + + public CustomType.CustomTypeBuilderBase withValue(Object value) { + ((CustomType) this.instance).value = value; + return this; + } + + public CustomType.CustomTypeBuilderBase withAdditionalProperty(String name, Object value) { + ((CustomType) this.instance).additionalProperties.put(name, value); + return this; + } + + } + +} diff --git a/generated/java/datadoc-model/src/main/java/no/ssb/dapla/metadata/datadoc/CustomType__1.java b/generated/java/datadoc-model/src/main/java/no/ssb/dapla/metadata/datadoc/CustomType__1.java new file mode 100644 index 00000000..18c92d6d --- /dev/null +++ b/generated/java/datadoc-model/src/main/java/no/ssb/dapla/metadata/datadoc/CustomType__1.java @@ -0,0 +1,231 @@ + +package no.ssb.dapla.metadata.datadoc; + +import java.io.Serializable; +import java.util.LinkedHashMap; +import java.util.Map; +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.Valid; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "key", + "value" +}) +@Generated("jsonschema2pojo") +public class CustomType__1 implements Serializable +{ + + /** + * Key + *

+ * Custom type KEY + * + */ + @JsonProperty("key") + @JsonPropertyDescription("Custom type KEY") + private String key; + /** + * Value + *

+ * Custom type VALUE (of type string, array or object). + * + */ + @JsonProperty("value") + @JsonPropertyDescription("Custom type VALUE (of type string, array or object).") + private Object value; + @JsonIgnore + @Valid + private Map additionalProperties = new LinkedHashMap(); + private final static long serialVersionUID = 9007834125759711144L; + + /** + * No args constructor for use in serialization + * + */ + public CustomType__1() { + } + + /** + * + * @param value + * Value. Custom type VALUE (of type string, array or object). + * @param key + * Key. Custom type KEY. + */ + public CustomType__1(String key, Object value) { + super(); + this.key = key; + this.value = value; + } + + public static CustomType__1 .CustomType__1BuilderBase builder() { + return new CustomType__1 .CustomType__1Builder(); + } + + /** + * Key + *

+ * Custom type KEY + * + */ + @JsonProperty("key") + public String getKey() { + return key; + } + + /** + * Key + *

+ * Custom type KEY + * + */ + @JsonProperty("key") + public void setKey(String key) { + this.key = key; + } + + /** + * Value + *

+ * Custom type VALUE (of type string, array or object). + * + */ + @JsonProperty("value") + public Object getValue() { + return value; + } + + /** + * Value + *

+ * Custom type VALUE (of type string, array or object). + * + */ + @JsonProperty("value") + public void setValue(Object value) { + this.value = value; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(CustomType__1 .class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); + sb.append("key"); + sb.append('='); + sb.append(((this.key == null)?"":this.key)); + sb.append(','); + sb.append("value"); + sb.append('='); + sb.append(((this.value == null)?"":this.value)); + sb.append(','); + sb.append("additionalProperties"); + sb.append('='); + sb.append(((this.additionalProperties == null)?"":this.additionalProperties)); + sb.append(','); + if (sb.charAt((sb.length()- 1)) == ',') { + sb.setCharAt((sb.length()- 1), ']'); + } else { + sb.append(']'); + } + return sb.toString(); + } + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode())); + result = ((result* 31)+((this.value == null)? 0 :this.value.hashCode())); + result = ((result* 31)+((this.key == null)? 0 :this.key.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof CustomType__1) == false) { + return false; + } + CustomType__1 rhs = ((CustomType__1) other); + return ((((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties)))&&((this.value == rhs.value)||((this.value!= null)&&this.value.equals(rhs.value))))&&((this.key == rhs.key)||((this.key!= null)&&this.key.equals(rhs.key)))); + } + + public static class CustomType__1Builder + extends CustomType__1 .CustomType__1BuilderBase + { + + + public CustomType__1Builder() { + super(); + } + + public CustomType__1Builder(String key, Object value) { + super(key, value); + } + + } + + public static abstract class CustomType__1BuilderBase{ + + protected T instance; + + @SuppressWarnings("unchecked") + public CustomType__1BuilderBase() { + // Skip initialization when called from subclass + if (this.getClass().equals(CustomType__1 .CustomType__1Builder.class)) { + this.instance = ((T) new CustomType__1()); + } + } + + @SuppressWarnings("unchecked") + public CustomType__1BuilderBase(String key, Object value) { + // Skip initialization when called from subclass + if (this.getClass().equals(CustomType__1 .CustomType__1Builder.class)) { + this.instance = ((T) new CustomType__1(key, value)); + } + } + + public T build() { + T result; + result = this.instance; + this.instance = null; + return result; + } + + public CustomType__1 .CustomType__1BuilderBase withKey(String key) { + ((CustomType__1) this.instance).key = key; + return this; + } + + public CustomType__1 .CustomType__1BuilderBase withValue(Object value) { + ((CustomType__1) this.instance).value = value; + return this; + } + + public CustomType__1 .CustomType__1BuilderBase withAdditionalProperty(String name, Object value) { + ((CustomType__1) this.instance).additionalProperties.put(name, value); + return this; + } + + } + +} diff --git a/generated/java/datadoc-model/src/main/java/no/ssb/dapla/metadata/datadoc/Dataset.java b/generated/java/datadoc-model/src/main/java/no/ssb/dapla/metadata/datadoc/Dataset.java index e3e3f6fd..1fc860a8 100644 --- a/generated/java/datadoc-model/src/main/java/no/ssb/dapla/metadata/datadoc/Dataset.java +++ b/generated/java/datadoc-model/src/main/java/no/ssb/dapla/metadata/datadoc/Dataset.java @@ -31,7 +31,6 @@ "name", "description", "data_source", - "register_uri", "population_description", "version", "version_description", @@ -40,6 +39,10 @@ "subject_field", "keyword", "spatial_coverage_description", + "contains_personal_data", + "use_restriction", + "use_restriction_date", + "custom_type", "id", "owner", "file_path", @@ -99,46 +102,39 @@ public class Dataset implements Serializable @NotNull private Dataset.DataSetState datasetState; /** - * Reusable langugage string type + * Reusableb langugage string type * (Required) * */ @JsonProperty("name") @Valid @NotNull - private LanguageStringType name; + private List name = new ArrayList(); /** - * Reusable langugage string type + * Reusableb langugage string type * (Required) * */ @JsonProperty("description") @Valid @NotNull - private LanguageStringType description; + private List description = new ArrayList(); /** - * Reusable langugage string type + * Reusableb langugage string type * */ @JsonProperty("data_source") @Valid - private LanguageStringType dataSource; + private List dataSource = new ArrayList(); /** - * Reusable langugage string type - * - */ - @JsonProperty("register_uri") - @Valid - private LanguageStringType registerUri; - /** - * Reusable langugage string type + * Reusableb langugage string type * (Required) * */ @JsonProperty("population_description") @Valid @NotNull - private LanguageStringType populationDescription; + private List populationDescription = new ArrayList(); /** * Version *

@@ -151,12 +147,12 @@ public class Dataset implements Serializable @NotNull private String version; /** - * Reusable langugage string type + * Reusableb langugage string type * */ @JsonProperty("version_description") @Valid - private LanguageStringType versionDescription; + private List versionDescription = new ArrayList(); /** * Unit type *

@@ -175,14 +171,16 @@ public class Dataset implements Serializable @JsonProperty("temporality_type") private Dataset.TemporalityTypeType temporalityType; /** - * Reusable langugage string type + * Subject field + *

+ * Primary area of statistics in which the data set is included * (Required) * */ @JsonProperty("subject_field") - @Valid + @JsonPropertyDescription("Primary area of statistics in which the data set is included") @NotNull - private LanguageStringType subjectField; + private String subjectField; /** * Keyword(s) *

@@ -194,12 +192,51 @@ public class Dataset implements Serializable @Valid private List keyword = new ArrayList(); /** - * Reusable langugage string type + * Reusableb langugage string type * */ @JsonProperty("spatial_coverage_description") @Valid - private LanguageStringType spatialCoverageDescription; + private List spatialCoverageDescription = new ArrayList(); + /** + * Contains personal data + *

+ * Is there any personal data amongst this data (data set)? + * (Required) + * + */ + @JsonProperty("contains_personal_data") + @JsonPropertyDescription("Is there any personal data amongst this data (data set)?") + @NotNull + private Boolean containsPersonalData; + /** + * Use restriction + *

+ * Data set use restriction + * + */ + @JsonProperty("use_restriction") + @JsonPropertyDescription("Data set use restriction") + private Dataset.UseRestriction useRestriction; + /** + * Use restriction date + *

+ * Use restriction date, eg. the date (deadline) for when data must be deleted/anonymised. + * + */ + @JsonProperty("use_restriction_date") + @JsonPropertyDescription("Use restriction date, eg. the date (deadline) for when data must be deleted/anonymised.") + private Date useRestrictionDate; + /** + * Custom type for dataset metadata + *

+ * Extend the DataDoc model by adding custom metadata elements as key-value-pairs (string, array or objects). + * + */ + @JsonProperty("custom_type") + @JsonPropertyDescription("Extend the DataDoc model by adding custom metadata elements as key-value-pairs (string, array or objects).") + @Valid + private List customType = new ArrayList(); /** * Identifier *

@@ -212,14 +249,14 @@ public class Dataset implements Serializable @NotNull private UUID id; /** - * Reusable langugage string type + * Reusableb langugage string type * (Required) * */ @JsonProperty("owner") @Valid @NotNull - private LanguageStringType owner; + private List owner = new ArrayList(); /** * File path *

@@ -296,7 +333,7 @@ public class Dataset implements Serializable @JsonIgnore @Valid private Map additionalProperties = new LinkedHashMap(); - private final static long serialVersionUID = 8856456406912570855L; + private final static long serialVersionUID = -7459109918184248449L; /** * No args constructor for use in serialization @@ -329,8 +366,6 @@ public Dataset() { * Unit type. Unit Type for data file, table or data set. See Definitions of Unit Types https://www.ssb.no/en/metadata/definisjoner-av-statistiske-enheter. * @param assessment * Assessment. Value assessment (sensitivity classification) for the data set. - * @param registerUri - * Register. Link to register. * @param spatialCoverageDescription * Spatial coverage description. Description of the data set's spatial coverage. * @param metadataCreatedBy @@ -345,20 +380,28 @@ public Dataset() { * Contains data from. The data set contains data from date/time. * @param filePath * File path. The file path contains the data set's name and the path to where it is stored. + * @param useRestriction + * Use restriction. Data set use restriction. + * @param containsPersonalData + * Contains personal data. Is there any personal data amongst this data (data set)?. * @param metadataLastUpdatedDate * Metadata last updated date. Last updated date for metadata about the dataset. * @param version * Version. Version of data set. + * @param customType + * Custom type for dataset metadata. Extend the DataDoc model by adding custom metadata elements as key-value-pairs (string, array or objects). * @param metadataCreatedDate * Metadata created date. Created date for metadata about the data set. * @param name * Name. Name of data set. + * @param useRestrictionDate + * Use restriction date. Use restriction date, eg. the date (deadline) for when data must be deleted/anonymised. * @param shortName * Short name. Name of (physical) data file, data table or dataset. * @param dataSource * Data source. Data source. Set either for the data set or instance variable. */ - public Dataset(String shortName, Dataset.Assessment assessment, Dataset.DataSetStatus datasetStatus, Dataset.DataSetState datasetState, LanguageStringType name, LanguageStringType description, LanguageStringType dataSource, LanguageStringType registerUri, LanguageStringType populationDescription, String version, LanguageStringType versionDescription, String unitType, Dataset.TemporalityTypeType temporalityType, LanguageStringType subjectField, List keyword, LanguageStringType spatialCoverageDescription, UUID id, LanguageStringType owner, String filePath, Date metadataCreatedDate, String metadataCreatedBy, Date metadataLastUpdatedDate, String metadataLastUpdatedBy, String containsDataFrom, String containsDataUntil) { + public Dataset(String shortName, Dataset.Assessment assessment, Dataset.DataSetStatus datasetStatus, Dataset.DataSetState datasetState, List name, List description, List dataSource, List populationDescription, String version, List versionDescription, String unitType, Dataset.TemporalityTypeType temporalityType, String subjectField, List keyword, List spatialCoverageDescription, Boolean containsPersonalData, Dataset.UseRestriction useRestriction, Date useRestrictionDate, List customType, UUID id, List owner, String filePath, Date metadataCreatedDate, String metadataCreatedBy, Date metadataLastUpdatedDate, String metadataLastUpdatedBy, String containsDataFrom, String containsDataUntil) { super(); this.shortName = shortName; this.assessment = assessment; @@ -367,7 +410,6 @@ public Dataset(String shortName, Dataset.Assessment assessment, Dataset.DataSetS this.name = name; this.description = description; this.dataSource = dataSource; - this.registerUri = registerUri; this.populationDescription = populationDescription; this.version = version; this.versionDescription = versionDescription; @@ -376,6 +418,10 @@ public Dataset(String shortName, Dataset.Assessment assessment, Dataset.DataSetS this.subjectField = subjectField; this.keyword = keyword; this.spatialCoverageDescription = spatialCoverageDescription; + this.containsPersonalData = containsPersonalData; + this.useRestriction = useRestriction; + this.useRestrictionDate = useRestrictionDate; + this.customType = customType; this.id = id; this.owner = owner; this.filePath = filePath; @@ -488,98 +534,80 @@ public void setDatasetState(Dataset.DataSetState datasetState) { } /** - * Reusable langugage string type + * Reusableb langugage string type * (Required) * */ @JsonProperty("name") - public LanguageStringType getName() { + public List getName() { return name; } /** - * Reusable langugage string type + * Reusableb langugage string type * (Required) * */ @JsonProperty("name") - public void setName(LanguageStringType name) { + public void setName(List name) { this.name = name; } /** - * Reusable langugage string type + * Reusableb langugage string type * (Required) * */ @JsonProperty("description") - public LanguageStringType getDescription() { + public List getDescription() { return description; } /** - * Reusable langugage string type + * Reusableb langugage string type * (Required) * */ @JsonProperty("description") - public void setDescription(LanguageStringType description) { + public void setDescription(List description) { this.description = description; } /** - * Reusable langugage string type + * Reusableb langugage string type * */ @JsonProperty("data_source") - public LanguageStringType getDataSource() { + public List getDataSource() { return dataSource; } /** - * Reusable langugage string type + * Reusableb langugage string type * */ @JsonProperty("data_source") - public void setDataSource(LanguageStringType dataSource) { + public void setDataSource(List dataSource) { this.dataSource = dataSource; } /** - * Reusable langugage string type - * - */ - @JsonProperty("register_uri") - public LanguageStringType getRegisterUri() { - return registerUri; - } - - /** - * Reusable langugage string type - * - */ - @JsonProperty("register_uri") - public void setRegisterUri(LanguageStringType registerUri) { - this.registerUri = registerUri; - } - - /** - * Reusable langugage string type + * Reusableb langugage string type * (Required) * */ @JsonProperty("population_description") - public LanguageStringType getPopulationDescription() { + public List getPopulationDescription() { return populationDescription; } /** - * Reusable langugage string type + * Reusableb langugage string type * (Required) * */ @JsonProperty("population_description") - public void setPopulationDescription(LanguageStringType populationDescription) { + public void setPopulationDescription(List populationDescription) { this.populationDescription = populationDescription; } @@ -608,20 +636,20 @@ public void setVersion(String version) { } /** - * Reusable langugage string type + * Reusableb langugage string type * */ @JsonProperty("version_description") - public LanguageStringType getVersionDescription() { + public List getVersionDescription() { return versionDescription; } /** - * Reusable langugage string type + * Reusableb langugage string type * */ @JsonProperty("version_description") - public void setVersionDescription(LanguageStringType versionDescription) { + public void setVersionDescription(List versionDescription) { this.versionDescription = versionDescription; } @@ -668,22 +696,26 @@ public void setTemporalityType(Dataset.TemporalityTypeType temporalityType) { } /** - * Reusable langugage string type + * Subject field + *

+ * Primary area of statistics in which the data set is included * (Required) * */ @JsonProperty("subject_field") - public LanguageStringType getSubjectField() { + public String getSubjectField() { return subjectField; } /** - * Reusable langugage string type + * Subject field + *

+ * Primary area of statistics in which the data set is included * (Required) * */ @JsonProperty("subject_field") - public void setSubjectField(LanguageStringType subjectField) { + public void setSubjectField(String subjectField) { this.subjectField = subjectField; } @@ -710,23 +742,113 @@ public void setKeyword(List keyword) { } /** - * Reusable langugage string type + * Reusableb langugage string type * */ @JsonProperty("spatial_coverage_description") - public LanguageStringType getSpatialCoverageDescription() { + public List getSpatialCoverageDescription() { return spatialCoverageDescription; } /** - * Reusable langugage string type + * Reusableb langugage string type * */ @JsonProperty("spatial_coverage_description") - public void setSpatialCoverageDescription(LanguageStringType spatialCoverageDescription) { + public void setSpatialCoverageDescription(List spatialCoverageDescription) { this.spatialCoverageDescription = spatialCoverageDescription; } + /** + * Contains personal data + *

+ * Is there any personal data amongst this data (data set)? + * (Required) + * + */ + @JsonProperty("contains_personal_data") + public Boolean getContainsPersonalData() { + return containsPersonalData; + } + + /** + * Contains personal data + *

+ * Is there any personal data amongst this data (data set)? + * (Required) + * + */ + @JsonProperty("contains_personal_data") + public void setContainsPersonalData(Boolean containsPersonalData) { + this.containsPersonalData = containsPersonalData; + } + + /** + * Use restriction + *

+ * Data set use restriction + * + */ + @JsonProperty("use_restriction") + public Dataset.UseRestriction getUseRestriction() { + return useRestriction; + } + + /** + * Use restriction + *

+ * Data set use restriction + * + */ + @JsonProperty("use_restriction") + public void setUseRestriction(Dataset.UseRestriction useRestriction) { + this.useRestriction = useRestriction; + } + + /** + * Use restriction date + *

+ * Use restriction date, eg. the date (deadline) for when data must be deleted/anonymised. + * + */ + @JsonProperty("use_restriction_date") + public Date getUseRestrictionDate() { + return useRestrictionDate; + } + + /** + * Use restriction date + *

+ * Use restriction date, eg. the date (deadline) for when data must be deleted/anonymised. + * + */ + @JsonProperty("use_restriction_date") + public void setUseRestrictionDate(Date useRestrictionDate) { + this.useRestrictionDate = useRestrictionDate; + } + + /** + * Custom type for dataset metadata + *

+ * Extend the DataDoc model by adding custom metadata elements as key-value-pairs (string, array or objects). + * + */ + @JsonProperty("custom_type") + public List getCustomType() { + return customType; + } + + /** + * Custom type for dataset metadata + *

+ * Extend the DataDoc model by adding custom metadata elements as key-value-pairs (string, array or objects). + * + */ + @JsonProperty("custom_type") + public void setCustomType(List customType) { + this.customType = customType; + } + /** * Identifier *

@@ -752,22 +874,22 @@ public void setId(UUID id) { } /** - * Reusable langugage string type + * Reusableb langugage string type * (Required) * */ @JsonProperty("owner") - public LanguageStringType getOwner() { + public List getOwner() { return owner; } /** - * Reusable langugage string type + * Reusableb langugage string type * (Required) * */ @JsonProperty("owner") - public void setOwner(LanguageStringType owner) { + public void setOwner(List owner) { this.owner = owner; } @@ -977,10 +1099,6 @@ public String toString() { sb.append('='); sb.append(((this.dataSource == null)?"":this.dataSource)); sb.append(','); - sb.append("registerUri"); - sb.append('='); - sb.append(((this.registerUri == null)?"":this.registerUri)); - sb.append(','); sb.append("populationDescription"); sb.append('='); sb.append(((this.populationDescription == null)?"":this.populationDescription)); @@ -1013,6 +1131,22 @@ public String toString() { sb.append('='); sb.append(((this.spatialCoverageDescription == null)?"":this.spatialCoverageDescription)); sb.append(','); + sb.append("containsPersonalData"); + sb.append('='); + sb.append(((this.containsPersonalData == null)?"":this.containsPersonalData)); + sb.append(','); + sb.append("useRestriction"); + sb.append('='); + sb.append(((this.useRestriction == null)?"":this.useRestriction)); + sb.append(','); + sb.append("useRestrictionDate"); + sb.append('='); + sb.append(((this.useRestrictionDate == null)?"":this.useRestrictionDate)); + sb.append(','); + sb.append("customType"); + sb.append('='); + sb.append(((this.customType == null)?"":this.customType)); + sb.append(','); sb.append("id"); sb.append('='); sb.append(((this.id == null)?"":this.id)); @@ -1075,7 +1209,6 @@ public int hashCode() { result = ((result* 31)+((this.subjectField == null)? 0 :this.subjectField.hashCode())); result = ((result* 31)+((this.unitType == null)? 0 :this.unitType.hashCode())); result = ((result* 31)+((this.assessment == null)? 0 :this.assessment.hashCode())); - result = ((result* 31)+((this.registerUri == null)? 0 :this.registerUri.hashCode())); result = ((result* 31)+((this.spatialCoverageDescription == null)? 0 :this.spatialCoverageDescription.hashCode())); result = ((result* 31)+((this.metadataCreatedBy == null)? 0 :this.metadataCreatedBy.hashCode())); result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); @@ -1083,10 +1216,14 @@ public int hashCode() { result = ((result* 31)+((this.owner == null)? 0 :this.owner.hashCode())); result = ((result* 31)+((this.containsDataFrom == null)? 0 :this.containsDataFrom.hashCode())); result = ((result* 31)+((this.filePath == null)? 0 :this.filePath.hashCode())); + result = ((result* 31)+((this.useRestriction == null)? 0 :this.useRestriction.hashCode())); + result = ((result* 31)+((this.containsPersonalData == null)? 0 :this.containsPersonalData.hashCode())); result = ((result* 31)+((this.metadataLastUpdatedDate == null)? 0 :this.metadataLastUpdatedDate.hashCode())); result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.customType == null)? 0 :this.customType.hashCode())); result = ((result* 31)+((this.metadataCreatedDate == null)? 0 :this.metadataCreatedDate.hashCode())); result = ((result* 31)+((this.name == null)? 0 :this.name.hashCode())); + result = ((result* 31)+((this.useRestrictionDate == null)? 0 :this.useRestrictionDate.hashCode())); result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode())); result = ((result* 31)+((this.shortName == null)? 0 :this.shortName.hashCode())); result = ((result* 31)+((this.dataSource == null)? 0 :this.dataSource.hashCode())); @@ -1102,7 +1239,7 @@ public boolean equals(Object other) { return false; } Dataset rhs = ((Dataset) other); - return (((((((((((((((((((((((((((this.versionDescription == rhs.versionDescription)||((this.versionDescription!= null)&&this.versionDescription.equals(rhs.versionDescription)))&&((this.containsDataUntil == rhs.containsDataUntil)||((this.containsDataUntil!= null)&&this.containsDataUntil.equals(rhs.containsDataUntil))))&&((this.datasetState == rhs.datasetState)||((this.datasetState!= null)&&this.datasetState.equals(rhs.datasetState))))&&((this.datasetStatus == rhs.datasetStatus)||((this.datasetStatus!= null)&&this.datasetStatus.equals(rhs.datasetStatus))))&&((this.description == rhs.description)||((this.description!= null)&&this.description.equals(rhs.description))))&&((this.populationDescription == rhs.populationDescription)||((this.populationDescription!= null)&&this.populationDescription.equals(rhs.populationDescription))))&&((this.metadataLastUpdatedBy == rhs.metadataLastUpdatedBy)||((this.metadataLastUpdatedBy!= null)&&this.metadataLastUpdatedBy.equals(rhs.metadataLastUpdatedBy))))&&((this.temporalityType == rhs.temporalityType)||((this.temporalityType!= null)&&this.temporalityType.equals(rhs.temporalityType))))&&((this.subjectField == rhs.subjectField)||((this.subjectField!= null)&&this.subjectField.equals(rhs.subjectField))))&&((this.unitType == rhs.unitType)||((this.unitType!= null)&&this.unitType.equals(rhs.unitType))))&&((this.assessment == rhs.assessment)||((this.assessment!= null)&&this.assessment.equals(rhs.assessment))))&&((this.registerUri == rhs.registerUri)||((this.registerUri!= null)&&this.registerUri.equals(rhs.registerUri))))&&((this.spatialCoverageDescription == rhs.spatialCoverageDescription)||((this.spatialCoverageDescription!= null)&&this.spatialCoverageDescription.equals(rhs.spatialCoverageDescription))))&&((this.metadataCreatedBy == rhs.metadataCreatedBy)||((this.metadataCreatedBy!= null)&&this.metadataCreatedBy.equals(rhs.metadataCreatedBy))))&&((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id))))&&((this.keyword == rhs.keyword)||((this.keyword!= null)&&this.keyword.equals(rhs.keyword))))&&((this.owner == rhs.owner)||((this.owner!= null)&&this.owner.equals(rhs.owner))))&&((this.containsDataFrom == rhs.containsDataFrom)||((this.containsDataFrom!= null)&&this.containsDataFrom.equals(rhs.containsDataFrom))))&&((this.filePath == rhs.filePath)||((this.filePath!= null)&&this.filePath.equals(rhs.filePath))))&&((this.metadataLastUpdatedDate == rhs.metadataLastUpdatedDate)||((this.metadataLastUpdatedDate!= null)&&this.metadataLastUpdatedDate.equals(rhs.metadataLastUpdatedDate))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.metadataCreatedDate == rhs.metadataCreatedDate)||((this.metadataCreatedDate!= null)&&this.metadataCreatedDate.equals(rhs.metadataCreatedDate))))&&((this.name == rhs.name)||((this.name!= null)&&this.name.equals(rhs.name))))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))))&&((this.shortName == rhs.shortName)||((this.shortName!= null)&&this.shortName.equals(rhs.shortName))))&&((this.dataSource == rhs.dataSource)||((this.dataSource!= null)&&this.dataSource.equals(rhs.dataSource)))); + return ((((((((((((((((((((((((((((((this.versionDescription == rhs.versionDescription)||((this.versionDescription!= null)&&this.versionDescription.equals(rhs.versionDescription)))&&((this.containsDataUntil == rhs.containsDataUntil)||((this.containsDataUntil!= null)&&this.containsDataUntil.equals(rhs.containsDataUntil))))&&((this.datasetState == rhs.datasetState)||((this.datasetState!= null)&&this.datasetState.equals(rhs.datasetState))))&&((this.datasetStatus == rhs.datasetStatus)||((this.datasetStatus!= null)&&this.datasetStatus.equals(rhs.datasetStatus))))&&((this.description == rhs.description)||((this.description!= null)&&this.description.equals(rhs.description))))&&((this.populationDescription == rhs.populationDescription)||((this.populationDescription!= null)&&this.populationDescription.equals(rhs.populationDescription))))&&((this.metadataLastUpdatedBy == rhs.metadataLastUpdatedBy)||((this.metadataLastUpdatedBy!= null)&&this.metadataLastUpdatedBy.equals(rhs.metadataLastUpdatedBy))))&&((this.temporalityType == rhs.temporalityType)||((this.temporalityType!= null)&&this.temporalityType.equals(rhs.temporalityType))))&&((this.subjectField == rhs.subjectField)||((this.subjectField!= null)&&this.subjectField.equals(rhs.subjectField))))&&((this.unitType == rhs.unitType)||((this.unitType!= null)&&this.unitType.equals(rhs.unitType))))&&((this.assessment == rhs.assessment)||((this.assessment!= null)&&this.assessment.equals(rhs.assessment))))&&((this.spatialCoverageDescription == rhs.spatialCoverageDescription)||((this.spatialCoverageDescription!= null)&&this.spatialCoverageDescription.equals(rhs.spatialCoverageDescription))))&&((this.metadataCreatedBy == rhs.metadataCreatedBy)||((this.metadataCreatedBy!= null)&&this.metadataCreatedBy.equals(rhs.metadataCreatedBy))))&&((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id))))&&((this.keyword == rhs.keyword)||((this.keyword!= null)&&this.keyword.equals(rhs.keyword))))&&((this.owner == rhs.owner)||((this.owner!= null)&&this.owner.equals(rhs.owner))))&&((this.containsDataFrom == rhs.containsDataFrom)||((this.containsDataFrom!= null)&&this.containsDataFrom.equals(rhs.containsDataFrom))))&&((this.filePath == rhs.filePath)||((this.filePath!= null)&&this.filePath.equals(rhs.filePath))))&&((this.useRestriction == rhs.useRestriction)||((this.useRestriction!= null)&&this.useRestriction.equals(rhs.useRestriction))))&&((this.containsPersonalData == rhs.containsPersonalData)||((this.containsPersonalData!= null)&&this.containsPersonalData.equals(rhs.containsPersonalData))))&&((this.metadataLastUpdatedDate == rhs.metadataLastUpdatedDate)||((this.metadataLastUpdatedDate!= null)&&this.metadataLastUpdatedDate.equals(rhs.metadataLastUpdatedDate))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.customType == rhs.customType)||((this.customType!= null)&&this.customType.equals(rhs.customType))))&&((this.metadataCreatedDate == rhs.metadataCreatedDate)||((this.metadataCreatedDate!= null)&&this.metadataCreatedDate.equals(rhs.metadataCreatedDate))))&&((this.name == rhs.name)||((this.name!= null)&&this.name.equals(rhs.name))))&&((this.useRestrictionDate == rhs.useRestrictionDate)||((this.useRestrictionDate!= null)&&this.useRestrictionDate.equals(rhs.useRestrictionDate))))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))))&&((this.shortName == rhs.shortName)||((this.shortName!= null)&&this.shortName.equals(rhs.shortName))))&&((this.dataSource == rhs.dataSource)||((this.dataSource!= null)&&this.dataSource.equals(rhs.dataSource)))); } @@ -1162,8 +1299,8 @@ public DatasetBuilder() { super(); } - public DatasetBuilder(String shortName, Dataset.Assessment assessment, Dataset.DataSetStatus datasetStatus, Dataset.DataSetState datasetState, LanguageStringType name, LanguageStringType description, LanguageStringType dataSource, LanguageStringType registerUri, LanguageStringType populationDescription, String version, LanguageStringType versionDescription, String unitType, Dataset.TemporalityTypeType temporalityType, LanguageStringType subjectField, List keyword, LanguageStringType spatialCoverageDescription, UUID id, LanguageStringType owner, String filePath, Date metadataCreatedDate, String metadataCreatedBy, Date metadataLastUpdatedDate, String metadataLastUpdatedBy, String containsDataFrom, String containsDataUntil) { - super(shortName, assessment, datasetStatus, datasetState, name, description, dataSource, registerUri, populationDescription, version, versionDescription, unitType, temporalityType, subjectField, keyword, spatialCoverageDescription, id, owner, filePath, metadataCreatedDate, metadataCreatedBy, metadataLastUpdatedDate, metadataLastUpdatedBy, containsDataFrom, containsDataUntil); + public DatasetBuilder(String shortName, Dataset.Assessment assessment, Dataset.DataSetStatus datasetStatus, Dataset.DataSetState datasetState, List name, List description, List dataSource, List populationDescription, String version, List versionDescription, String unitType, Dataset.TemporalityTypeType temporalityType, String subjectField, List keyword, List spatialCoverageDescription, Boolean containsPersonalData, Dataset.UseRestriction useRestriction, Date useRestrictionDate, List customType, UUID id, List owner, String filePath, Date metadataCreatedDate, String metadataCreatedBy, Date metadataLastUpdatedDate, String metadataLastUpdatedBy, String containsDataFrom, String containsDataUntil) { + super(shortName, assessment, datasetStatus, datasetState, name, description, dataSource, populationDescription, version, versionDescription, unitType, temporalityType, subjectField, keyword, spatialCoverageDescription, containsPersonalData, useRestriction, useRestrictionDate, customType, id, owner, filePath, metadataCreatedDate, metadataCreatedBy, metadataLastUpdatedDate, metadataLastUpdatedBy, containsDataFrom, containsDataUntil); } } @@ -1181,10 +1318,10 @@ public DatasetBuilderBase() { } @SuppressWarnings("unchecked") - public DatasetBuilderBase(String shortName, Dataset.Assessment assessment, Dataset.DataSetStatus datasetStatus, Dataset.DataSetState datasetState, LanguageStringType name, LanguageStringType description, LanguageStringType dataSource, LanguageStringType registerUri, LanguageStringType populationDescription, String version, LanguageStringType versionDescription, String unitType, Dataset.TemporalityTypeType temporalityType, LanguageStringType subjectField, List keyword, LanguageStringType spatialCoverageDescription, UUID id, LanguageStringType owner, String filePath, Date metadataCreatedDate, String metadataCreatedBy, Date metadataLastUpdatedDate, String metadataLastUpdatedBy, String containsDataFrom, String containsDataUntil) { + public DatasetBuilderBase(String shortName, Dataset.Assessment assessment, Dataset.DataSetStatus datasetStatus, Dataset.DataSetState datasetState, List name, List description, List dataSource, List populationDescription, String version, List versionDescription, String unitType, Dataset.TemporalityTypeType temporalityType, String subjectField, List keyword, List spatialCoverageDescription, Boolean containsPersonalData, Dataset.UseRestriction useRestriction, Date useRestrictionDate, List customType, UUID id, List owner, String filePath, Date metadataCreatedDate, String metadataCreatedBy, Date metadataLastUpdatedDate, String metadataLastUpdatedBy, String containsDataFrom, String containsDataUntil) { // Skip initialization when called from subclass if (this.getClass().equals(Dataset.DatasetBuilder.class)) { - this.instance = ((T) new Dataset(shortName, assessment, datasetStatus, datasetState, name, description, dataSource, registerUri, populationDescription, version, versionDescription, unitType, temporalityType, subjectField, keyword, spatialCoverageDescription, id, owner, filePath, metadataCreatedDate, metadataCreatedBy, metadataLastUpdatedDate, metadataLastUpdatedBy, containsDataFrom, containsDataUntil)); + this.instance = ((T) new Dataset(shortName, assessment, datasetStatus, datasetState, name, description, dataSource, populationDescription, version, versionDescription, unitType, temporalityType, subjectField, keyword, spatialCoverageDescription, containsPersonalData, useRestriction, useRestrictionDate, customType, id, owner, filePath, metadataCreatedDate, metadataCreatedBy, metadataLastUpdatedDate, metadataLastUpdatedBy, containsDataFrom, containsDataUntil)); } } @@ -1215,27 +1352,22 @@ public Dataset.DatasetBuilderBase withDatasetState(Dataset.DataSetState datasetS return this; } - public Dataset.DatasetBuilderBase withName(LanguageStringType name) { + public Dataset.DatasetBuilderBase withName(List name) { ((Dataset) this.instance).name = name; return this; } - public Dataset.DatasetBuilderBase withDescription(LanguageStringType description) { + public Dataset.DatasetBuilderBase withDescription(List description) { ((Dataset) this.instance).description = description; return this; } - public Dataset.DatasetBuilderBase withDataSource(LanguageStringType dataSource) { + public Dataset.DatasetBuilderBase withDataSource(List dataSource) { ((Dataset) this.instance).dataSource = dataSource; return this; } - public Dataset.DatasetBuilderBase withRegisterUri(LanguageStringType registerUri) { - ((Dataset) this.instance).registerUri = registerUri; - return this; - } - - public Dataset.DatasetBuilderBase withPopulationDescription(LanguageStringType populationDescription) { + public Dataset.DatasetBuilderBase withPopulationDescription(List populationDescription) { ((Dataset) this.instance).populationDescription = populationDescription; return this; } @@ -1245,7 +1377,7 @@ public Dataset.DatasetBuilderBase withVersion(String version) { return this; } - public Dataset.DatasetBuilderBase withVersionDescription(LanguageStringType versionDescription) { + public Dataset.DatasetBuilderBase withVersionDescription(List versionDescription) { ((Dataset) this.instance).versionDescription = versionDescription; return this; } @@ -1260,7 +1392,7 @@ public Dataset.DatasetBuilderBase withTemporalityType(Dataset.TemporalityTypeTyp return this; } - public Dataset.DatasetBuilderBase withSubjectField(LanguageStringType subjectField) { + public Dataset.DatasetBuilderBase withSubjectField(String subjectField) { ((Dataset) this.instance).subjectField = subjectField; return this; } @@ -1270,17 +1402,37 @@ public Dataset.DatasetBuilderBase withKeyword(List keyword) { return this; } - public Dataset.DatasetBuilderBase withSpatialCoverageDescription(LanguageStringType spatialCoverageDescription) { + public Dataset.DatasetBuilderBase withSpatialCoverageDescription(List spatialCoverageDescription) { ((Dataset) this.instance).spatialCoverageDescription = spatialCoverageDescription; return this; } + public Dataset.DatasetBuilderBase withContainsPersonalData(Boolean containsPersonalData) { + ((Dataset) this.instance).containsPersonalData = containsPersonalData; + return this; + } + + public Dataset.DatasetBuilderBase withUseRestriction(Dataset.UseRestriction useRestriction) { + ((Dataset) this.instance).useRestriction = useRestriction; + return this; + } + + public Dataset.DatasetBuilderBase withUseRestrictionDate(Date useRestrictionDate) { + ((Dataset) this.instance).useRestrictionDate = useRestrictionDate; + return this; + } + + public Dataset.DatasetBuilderBase withCustomType(List customType) { + ((Dataset) this.instance).customType = customType; + return this; + } + public Dataset.DatasetBuilderBase withId(UUID id) { ((Dataset) this.instance).id = id; return this; } - public Dataset.DatasetBuilderBase withOwner(LanguageStringType owner) { + public Dataset.DatasetBuilderBase withOwner(List owner) { ((Dataset) this.instance).owner = owner; return this; } @@ -1473,4 +1625,52 @@ public static Dataset.TemporalityTypeType fromValue(String value) { } + + /** + * Use restriction + *

+ * Data set use restriction + * + */ + @Generated("jsonschema2pojo") + public enum UseRestriction { + + DELETION_ANONYMIZATION("DELETION_ANONYMIZATION"), + PROCESS_LIMITATIONS("PROCESS_LIMITATIONS"), + SECONDARY_USE_RESTRICTIONS("SECONDARY_USE_RESTRICTIONS"); + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (Dataset.UseRestriction c: values()) { + CONSTANTS.put(c.value, c); + } + } + + UseRestriction(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static Dataset.UseRestriction fromValue(String value) { + Dataset.UseRestriction constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + } diff --git a/generated/java/datadoc-model/src/main/java/no/ssb/dapla/metadata/datadoc/LanguageStringType.java b/generated/java/datadoc-model/src/main/java/no/ssb/dapla/metadata/datadoc/LanguageStringType.java deleted file mode 100644 index d34088b7..00000000 --- a/generated/java/datadoc-model/src/main/java/no/ssb/dapla/metadata/datadoc/LanguageStringType.java +++ /dev/null @@ -1,231 +0,0 @@ - -package no.ssb.dapla.metadata.datadoc; - -import java.io.Serializable; -import java.util.LinkedHashMap; -import java.util.Map; -import javax.annotation.processing.Generated; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.Valid; -import jakarta.validation.constraints.NotNull; - - -/** - * Reusable langugage string type - * - */ -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "en", - "nn", - "nb" -}) -@Generated("jsonschema2pojo") -public class LanguageStringType implements Serializable -{ - - @JsonProperty("en") - private String en; - @JsonProperty("nn") - private String nn; - /** - * - * (Required) - * - */ - @JsonProperty("nb") - @NotNull - private String nb; - @JsonIgnore - @Valid - private Map additionalProperties = new LinkedHashMap(); - private final static long serialVersionUID = -2807086073068172838L; - - /** - * No args constructor for use in serialization - * - */ - public LanguageStringType() { - } - - public LanguageStringType(String en, String nn, String nb) { - super(); - this.en = en; - this.nn = nn; - this.nb = nb; - } - - public static LanguageStringType.LanguageStringTypeBuilderBase builder() { - return new LanguageStringType.LanguageStringTypeBuilder(); - } - - @JsonProperty("en") - public String getEn() { - return en; - } - - @JsonProperty("en") - public void setEn(String en) { - this.en = en; - } - - @JsonProperty("nn") - public String getNn() { - return nn; - } - - @JsonProperty("nn") - public void setNn(String nn) { - this.nn = nn; - } - - /** - * - * (Required) - * - */ - @JsonProperty("nb") - public String getNb() { - return nb; - } - - /** - * - * (Required) - * - */ - @JsonProperty("nb") - public void setNb(String nb) { - this.nb = nb; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(LanguageStringType.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); - sb.append("en"); - sb.append('='); - sb.append(((this.en == null)?"":this.en)); - sb.append(','); - sb.append("nn"); - sb.append('='); - sb.append(((this.nn == null)?"":this.nn)); - sb.append(','); - sb.append("nb"); - sb.append('='); - sb.append(((this.nb == null)?"":this.nb)); - sb.append(','); - sb.append("additionalProperties"); - sb.append('='); - sb.append(((this.additionalProperties == null)?"":this.additionalProperties)); - sb.append(','); - if (sb.charAt((sb.length()- 1)) == ',') { - sb.setCharAt((sb.length()- 1), ']'); - } else { - sb.append(']'); - } - return sb.toString(); - } - - @Override - public int hashCode() { - int result = 1; - result = ((result* 31)+((this.nn == null)? 0 :this.nn.hashCode())); - result = ((result* 31)+((this.en == null)? 0 :this.en.hashCode())); - result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode())); - result = ((result* 31)+((this.nb == null)? 0 :this.nb.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof LanguageStringType) == false) { - return false; - } - LanguageStringType rhs = ((LanguageStringType) other); - return (((((this.nn == rhs.nn)||((this.nn!= null)&&this.nn.equals(rhs.nn)))&&((this.en == rhs.en)||((this.en!= null)&&this.en.equals(rhs.en))))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))))&&((this.nb == rhs.nb)||((this.nb!= null)&&this.nb.equals(rhs.nb)))); - } - - public static class LanguageStringTypeBuilder - extends LanguageStringType.LanguageStringTypeBuilderBase - { - - - public LanguageStringTypeBuilder() { - super(); - } - - public LanguageStringTypeBuilder(String en, String nn, String nb) { - super(en, nn, nb); - } - - } - - public static abstract class LanguageStringTypeBuilderBase{ - - protected T instance; - - @SuppressWarnings("unchecked") - public LanguageStringTypeBuilderBase() { - // Skip initialization when called from subclass - if (this.getClass().equals(LanguageStringType.LanguageStringTypeBuilder.class)) { - this.instance = ((T) new LanguageStringType()); - } - } - - @SuppressWarnings("unchecked") - public LanguageStringTypeBuilderBase(String en, String nn, String nb) { - // Skip initialization when called from subclass - if (this.getClass().equals(LanguageStringType.LanguageStringTypeBuilder.class)) { - this.instance = ((T) new LanguageStringType(en, nn, nb)); - } - } - - public T build() { - T result; - result = this.instance; - this.instance = null; - return result; - } - - public LanguageStringType.LanguageStringTypeBuilderBase withEn(String en) { - ((LanguageStringType) this.instance).en = en; - return this; - } - - public LanguageStringType.LanguageStringTypeBuilderBase withNn(String nn) { - ((LanguageStringType) this.instance).nn = nn; - return this; - } - - public LanguageStringType.LanguageStringTypeBuilderBase withNb(String nb) { - ((LanguageStringType) this.instance).nb = nb; - return this; - } - - public LanguageStringType.LanguageStringTypeBuilderBase withAdditionalProperty(String name, Object value) { - ((LanguageStringType) this.instance).additionalProperties.put(name, value); - return this; - } - - } - -} diff --git a/generated/java/datadoc-model/src/main/java/no/ssb/dapla/metadata/datadoc/OtherValue.java b/generated/java/datadoc-model/src/main/java/no/ssb/dapla/metadata/datadoc/OtherValue.java new file mode 100644 index 00000000..261a180d --- /dev/null +++ b/generated/java/datadoc-model/src/main/java/no/ssb/dapla/metadata/datadoc/OtherValue.java @@ -0,0 +1,318 @@ + +package no.ssb.dapla.metadata.datadoc; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.Valid; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "code", + "name", + "valid_from", + "valid_until" +}) +@Generated("jsonschema2pojo") +public class OtherValue implements Serializable +{ + + /** + * Code + *

+ * Other value code + * + */ + @JsonProperty("code") + @JsonPropertyDescription("Other value code") + private String code; + /** + * Reusableb langugage string type + * + */ + @JsonProperty("name") + @Valid + private List name = new ArrayList(); + /** + * Valid from + *

+ * Other value valid from date + * + */ + @JsonProperty("valid_from") + @JsonPropertyDescription("Other value valid from date") + private Date validFrom; + /** + * Valid until + *

+ * Other value until date + * + */ + @JsonProperty("valid_until") + @JsonPropertyDescription("Other value until date") + private Date validUntil; + @JsonIgnore + @Valid + private Map additionalProperties = new LinkedHashMap(); + private final static long serialVersionUID = 7799050029710232246L; + + /** + * No args constructor for use in serialization + * + */ + public OtherValue() { + } + + /** + * + * @param code + * Code. Other value code. + * @param name + * Name. Other value name (text). + * @param validUntil + * Valid until. Other value until date. + * @param validFrom + * Valid from. Other value valid from date. + */ + public OtherValue(String code, List name, Date validFrom, Date validUntil) { + super(); + this.code = code; + this.name = name; + this.validFrom = validFrom; + this.validUntil = validUntil; + } + + public static OtherValue.OtherValueBuilderBase builder() { + return new OtherValue.OtherValueBuilder(); + } + + /** + * Code + *

+ * Other value code + * + */ + @JsonProperty("code") + public String getCode() { + return code; + } + + /** + * Code + *

+ * Other value code + * + */ + @JsonProperty("code") + public void setCode(String code) { + this.code = code; + } + + /** + * Reusableb langugage string type + * + */ + @JsonProperty("name") + public List getName() { + return name; + } + + /** + * Reusableb langugage string type + * + */ + @JsonProperty("name") + public void setName(List name) { + this.name = name; + } + + /** + * Valid from + *

+ * Other value valid from date + * + */ + @JsonProperty("valid_from") + public Date getValidFrom() { + return validFrom; + } + + /** + * Valid from + *

+ * Other value valid from date + * + */ + @JsonProperty("valid_from") + public void setValidFrom(Date validFrom) { + this.validFrom = validFrom; + } + + /** + * Valid until + *

+ * Other value until date + * + */ + @JsonProperty("valid_until") + public Date getValidUntil() { + return validUntil; + } + + /** + * Valid until + *

+ * Other value until date + * + */ + @JsonProperty("valid_until") + public void setValidUntil(Date validUntil) { + this.validUntil = validUntil; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(OtherValue.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); + sb.append("code"); + sb.append('='); + sb.append(((this.code == null)?"":this.code)); + sb.append(','); + sb.append("name"); + sb.append('='); + sb.append(((this.name == null)?"":this.name)); + sb.append(','); + sb.append("validFrom"); + sb.append('='); + sb.append(((this.validFrom == null)?"":this.validFrom)); + sb.append(','); + sb.append("validUntil"); + sb.append('='); + sb.append(((this.validUntil == null)?"":this.validUntil)); + sb.append(','); + sb.append("additionalProperties"); + sb.append('='); + sb.append(((this.additionalProperties == null)?"":this.additionalProperties)); + sb.append(','); + if (sb.charAt((sb.length()- 1)) == ',') { + sb.setCharAt((sb.length()- 1), ']'); + } else { + sb.append(']'); + } + return sb.toString(); + } + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.name == null)? 0 :this.name.hashCode())); + result = ((result* 31)+((this.validUntil == null)? 0 :this.validUntil.hashCode())); + result = ((result* 31)+((this.code == null)? 0 :this.code.hashCode())); + result = ((result* 31)+((this.validFrom == null)? 0 :this.validFrom.hashCode())); + result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof OtherValue) == false) { + return false; + } + OtherValue rhs = ((OtherValue) other); + return ((((((this.name == rhs.name)||((this.name!= null)&&this.name.equals(rhs.name)))&&((this.validUntil == rhs.validUntil)||((this.validUntil!= null)&&this.validUntil.equals(rhs.validUntil))))&&((this.code == rhs.code)||((this.code!= null)&&this.code.equals(rhs.code))))&&((this.validFrom == rhs.validFrom)||((this.validFrom!= null)&&this.validFrom.equals(rhs.validFrom))))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties)))); + } + + public static class OtherValueBuilder + extends OtherValue.OtherValueBuilderBase + { + + + public OtherValueBuilder() { + super(); + } + + public OtherValueBuilder(String code, List name, Date validFrom, Date validUntil) { + super(code, name, validFrom, validUntil); + } + + } + + public static abstract class OtherValueBuilderBase{ + + protected T instance; + + @SuppressWarnings("unchecked") + public OtherValueBuilderBase() { + // Skip initialization when called from subclass + if (this.getClass().equals(OtherValue.OtherValueBuilder.class)) { + this.instance = ((T) new OtherValue()); + } + } + + @SuppressWarnings("unchecked") + public OtherValueBuilderBase(String code, List name, Date validFrom, Date validUntil) { + // Skip initialization when called from subclass + if (this.getClass().equals(OtherValue.OtherValueBuilder.class)) { + this.instance = ((T) new OtherValue(code, name, validFrom, validUntil)); + } + } + + public T build() { + T result; + result = this.instance; + this.instance = null; + return result; + } + + public OtherValue.OtherValueBuilderBase withCode(String code) { + ((OtherValue) this.instance).code = code; + return this; + } + + public OtherValue.OtherValueBuilderBase withName(List name) { + ((OtherValue) this.instance).name = name; + return this; + } + + public OtherValue.OtherValueBuilderBase withValidFrom(Date validFrom) { + ((OtherValue) this.instance).validFrom = validFrom; + return this; + } + + public OtherValue.OtherValueBuilderBase withValidUntil(Date validUntil) { + ((OtherValue) this.instance).validUntil = validUntil; + return this; + } + + public OtherValue.OtherValueBuilderBase withAdditionalProperty(String name, Object value) { + ((OtherValue) this.instance).additionalProperties.put(name, value); + return this; + } + + } + +} diff --git a/generated/java/datadoc-model/src/main/java/no/ssb/dapla/metadata/datadoc/SentinelValues.java b/generated/java/datadoc-model/src/main/java/no/ssb/dapla/metadata/datadoc/SentinelValues.java new file mode 100644 index 00000000..3faf8c67 --- /dev/null +++ b/generated/java/datadoc-model/src/main/java/no/ssb/dapla/metadata/datadoc/SentinelValues.java @@ -0,0 +1,242 @@ + +package no.ssb.dapla.metadata.datadoc; + +import java.io.Serializable; +import java.net.URI; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.Valid; + + +/** + * Sentinel values + *

+ * + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "sentinel_value_uri", + "sentinel_value_elements" +}) +@Generated("jsonschema2pojo") +public class SentinelValues implements Serializable +{ + + /** + * Sentinel value URI + *

+ * A link (URI) to a standardized list of sentinel values included in the variable, eg. a link to a codelist in Klass (https://www.ssb.no/en/klass/) Proposals for the standardization of sentinel values ​​have been drafted, but this has not yet been processed by the Standards Committee in Statistics Norway. + * + */ + @JsonProperty("sentinel_value_uri") + @JsonPropertyDescription("A link (URI) to a standardized list of sentinel values included in the variable, eg. a link to a codelist in Klass (https://www.ssb.no/en/klass/)") + private URI sentinelValueUri; + /** + * Sentinel value elements + *

+ * A selection (subset) of sentinel values in the 'sentinel_value_uri' ​​applicable to the data set. + * + */ + @JsonProperty("sentinel_value_elements") + @JsonPropertyDescription("A selection (subset) of sentinel values in the 'sentinel_value_uri' \u200b\u200bapplicable to the data set.") + @Valid + private List sentinelValueElements = new ArrayList(); + @JsonIgnore + @Valid + private Map additionalProperties = new LinkedHashMap(); + private final static long serialVersionUID = 6740706452491998917L; + + /** + * No args constructor for use in serialization + * + */ + public SentinelValues() { + } + + /** + * + * @param sentinelValueElements + * Sentinel value elements. A selection (subset) of sentinel values in the 'sentinel_value_uri' ​​applicable to the data set. + * @param sentinelValueUri + * Sentinel value URI. A link (URI) to a standardized list of sentinel values included in the variable, eg. a link to a codelist in Klass (https://www.ssb.no/en/klass/). + */ + public SentinelValues(URI sentinelValueUri, List sentinelValueElements) { + super(); + this.sentinelValueUri = sentinelValueUri; + this.sentinelValueElements = sentinelValueElements; + } + + public static SentinelValues.SentinelValuesBuilderBase builder() { + return new SentinelValues.SentinelValuesBuilder(); + } + + /** + * Sentinel value URI + *

+ * A link (URI) to a standardized list of sentinel values included in the variable, eg. a link to a codelist in Klass (https://www.ssb.no/en/klass/) Proposals for the standardization of sentinel values ​​have been drafted, but this has not yet been processed by the Standards Committee in Statistics Norway. + * + */ + @JsonProperty("sentinel_value_uri") + public URI getSentinelValueUri() { + return sentinelValueUri; + } + + /** + * Sentinel value URI + *

+ * A link (URI) to a standardized list of sentinel values included in the variable, eg. a link to a codelist in Klass (https://www.ssb.no/en/klass/) Proposals for the standardization of sentinel values ​​have been drafted, but this has not yet been processed by the Standards Committee in Statistics Norway. + * + */ + @JsonProperty("sentinel_value_uri") + public void setSentinelValueUri(URI sentinelValueUri) { + this.sentinelValueUri = sentinelValueUri; + } + + /** + * Sentinel value elements + *

+ * A selection (subset) of sentinel values in the 'sentinel_value_uri' ​​applicable to the data set. + * + */ + @JsonProperty("sentinel_value_elements") + public List getSentinelValueElements() { + return sentinelValueElements; + } + + /** + * Sentinel value elements + *

+ * A selection (subset) of sentinel values in the 'sentinel_value_uri' ​​applicable to the data set. + * + */ + @JsonProperty("sentinel_value_elements") + public void setSentinelValueElements(List sentinelValueElements) { + this.sentinelValueElements = sentinelValueElements; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(SentinelValues.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); + sb.append("sentinelValueUri"); + sb.append('='); + sb.append(((this.sentinelValueUri == null)?"":this.sentinelValueUri)); + sb.append(','); + sb.append("sentinelValueElements"); + sb.append('='); + sb.append(((this.sentinelValueElements == null)?"":this.sentinelValueElements)); + sb.append(','); + sb.append("additionalProperties"); + sb.append('='); + sb.append(((this.additionalProperties == null)?"":this.additionalProperties)); + sb.append(','); + if (sb.charAt((sb.length()- 1)) == ',') { + sb.setCharAt((sb.length()- 1), ']'); + } else { + sb.append(']'); + } + return sb.toString(); + } + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.sentinelValueElements == null)? 0 :this.sentinelValueElements.hashCode())); + result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode())); + result = ((result* 31)+((this.sentinelValueUri == null)? 0 :this.sentinelValueUri.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof SentinelValues) == false) { + return false; + } + SentinelValues rhs = ((SentinelValues) other); + return ((((this.sentinelValueElements == rhs.sentinelValueElements)||((this.sentinelValueElements!= null)&&this.sentinelValueElements.equals(rhs.sentinelValueElements)))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))))&&((this.sentinelValueUri == rhs.sentinelValueUri)||((this.sentinelValueUri!= null)&&this.sentinelValueUri.equals(rhs.sentinelValueUri)))); + } + + public static class SentinelValuesBuilder + extends SentinelValues.SentinelValuesBuilderBase + { + + + public SentinelValuesBuilder() { + super(); + } + + public SentinelValuesBuilder(URI sentinelValueUri, List sentinelValueElements) { + super(sentinelValueUri, sentinelValueElements); + } + + } + + public static abstract class SentinelValuesBuilderBase{ + + protected T instance; + + @SuppressWarnings("unchecked") + public SentinelValuesBuilderBase() { + // Skip initialization when called from subclass + if (this.getClass().equals(SentinelValues.SentinelValuesBuilder.class)) { + this.instance = ((T) new SentinelValues()); + } + } + + @SuppressWarnings("unchecked") + public SentinelValuesBuilderBase(URI sentinelValueUri, List sentinelValueElements) { + // Skip initialization when called from subclass + if (this.getClass().equals(SentinelValues.SentinelValuesBuilder.class)) { + this.instance = ((T) new SentinelValues(sentinelValueUri, sentinelValueElements)); + } + } + + public T build() { + T result; + result = this.instance; + this.instance = null; + return result; + } + + public SentinelValues.SentinelValuesBuilderBase withSentinelValueUri(URI sentinelValueUri) { + ((SentinelValues) this.instance).sentinelValueUri = sentinelValueUri; + return this; + } + + public SentinelValues.SentinelValuesBuilderBase withSentinelValueElements(List sentinelValueElements) { + ((SentinelValues) this.instance).sentinelValueElements = sentinelValueElements; + return this; + } + + public SentinelValues.SentinelValuesBuilderBase withAdditionalProperty(String name, Object value) { + ((SentinelValues) this.instance).additionalProperties.put(name, value); + return this; + } + + } + +} diff --git a/generated/java/datadoc-model/src/main/java/no/ssb/dapla/metadata/datadoc/SpecialValues.java b/generated/java/datadoc-model/src/main/java/no/ssb/dapla/metadata/datadoc/SpecialValues.java new file mode 100644 index 00000000..51f9b044 --- /dev/null +++ b/generated/java/datadoc-model/src/main/java/no/ssb/dapla/metadata/datadoc/SpecialValues.java @@ -0,0 +1,241 @@ + +package no.ssb.dapla.metadata.datadoc; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.Valid; + + +/** + * Special values + *

+ * + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "sentinel", + "other_value" +}) +@Generated("jsonschema2pojo") +public class SpecialValues implements Serializable +{ + + /** + * Sentinel values + *

+ * + * + */ + @JsonProperty("sentinel") + @Valid + private SentinelValues sentinel; + /** + * Other special values + *

+ * Other special values not represented as 'sentinel_value' in a standardized code list. + * + */ + @JsonProperty("other_value") + @JsonPropertyDescription("Other special values not represented as 'sentinel_value' in a standardized code list.") + @Valid + private List otherValue = new ArrayList(); + @JsonIgnore + @Valid + private Map additionalProperties = new LinkedHashMap(); + private final static long serialVersionUID = 5889699621554465663L; + + /** + * No args constructor for use in serialization + * + */ + public SpecialValues() { + } + + /** + * + * @param sentinel + * Sentinel values. + * @param otherValue + * Other special values. Other special values not represented as 'sentinel_value' in a standardized code list. + */ + public SpecialValues(SentinelValues sentinel, List otherValue) { + super(); + this.sentinel = sentinel; + this.otherValue = otherValue; + } + + public static SpecialValues.SpecialValuesBuilderBase builder() { + return new SpecialValues.SpecialValuesBuilder(); + } + + /** + * Sentinel values + *

+ * + * + */ + @JsonProperty("sentinel") + public SentinelValues getSentinel() { + return sentinel; + } + + /** + * Sentinel values + *

+ * + * + */ + @JsonProperty("sentinel") + public void setSentinel(SentinelValues sentinel) { + this.sentinel = sentinel; + } + + /** + * Other special values + *

+ * Other special values not represented as 'sentinel_value' in a standardized code list. + * + */ + @JsonProperty("other_value") + public List getOtherValue() { + return otherValue; + } + + /** + * Other special values + *

+ * Other special values not represented as 'sentinel_value' in a standardized code list. + * + */ + @JsonProperty("other_value") + public void setOtherValue(List otherValue) { + this.otherValue = otherValue; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(SpecialValues.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); + sb.append("sentinel"); + sb.append('='); + sb.append(((this.sentinel == null)?"":this.sentinel)); + sb.append(','); + sb.append("otherValue"); + sb.append('='); + sb.append(((this.otherValue == null)?"":this.otherValue)); + sb.append(','); + sb.append("additionalProperties"); + sb.append('='); + sb.append(((this.additionalProperties == null)?"":this.additionalProperties)); + sb.append(','); + if (sb.charAt((sb.length()- 1)) == ',') { + sb.setCharAt((sb.length()- 1), ']'); + } else { + sb.append(']'); + } + return sb.toString(); + } + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.sentinel == null)? 0 :this.sentinel.hashCode())); + result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode())); + result = ((result* 31)+((this.otherValue == null)? 0 :this.otherValue.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof SpecialValues) == false) { + return false; + } + SpecialValues rhs = ((SpecialValues) other); + return ((((this.sentinel == rhs.sentinel)||((this.sentinel!= null)&&this.sentinel.equals(rhs.sentinel)))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))))&&((this.otherValue == rhs.otherValue)||((this.otherValue!= null)&&this.otherValue.equals(rhs.otherValue)))); + } + + public static class SpecialValuesBuilder + extends SpecialValues.SpecialValuesBuilderBase + { + + + public SpecialValuesBuilder() { + super(); + } + + public SpecialValuesBuilder(SentinelValues sentinel, List otherValue) { + super(sentinel, otherValue); + } + + } + + public static abstract class SpecialValuesBuilderBase{ + + protected T instance; + + @SuppressWarnings("unchecked") + public SpecialValuesBuilderBase() { + // Skip initialization when called from subclass + if (this.getClass().equals(SpecialValues.SpecialValuesBuilder.class)) { + this.instance = ((T) new SpecialValues()); + } + } + + @SuppressWarnings("unchecked") + public SpecialValuesBuilderBase(SentinelValues sentinel, List otherValue) { + // Skip initialization when called from subclass + if (this.getClass().equals(SpecialValues.SpecialValuesBuilder.class)) { + this.instance = ((T) new SpecialValues(sentinel, otherValue)); + } + } + + public T build() { + T result; + result = this.instance; + this.instance = null; + return result; + } + + public SpecialValues.SpecialValuesBuilderBase withSentinel(SentinelValues sentinel) { + ((SpecialValues) this.instance).sentinel = sentinel; + return this; + } + + public SpecialValues.SpecialValuesBuilderBase withOtherValue(List otherValue) { + ((SpecialValues) this.instance).otherValue = otherValue; + return this; + } + + public SpecialValues.SpecialValuesBuilderBase withAdditionalProperty(String name, Object value) { + ((SpecialValues) this.instance).additionalProperties.put(name, value); + return this; + } + + } + +} diff --git a/generated/java/datadoc-model/src/main/java/no/ssb/dapla/metadata/datadoc/Variable.java b/generated/java/datadoc-model/src/main/java/no/ssb/dapla/metadata/datadoc/Variable.java index 987303d7..9b48f304 100644 --- a/generated/java/datadoc-model/src/main/java/no/ssb/dapla/metadata/datadoc/Variable.java +++ b/generated/java/datadoc-model/src/main/java/no/ssb/dapla/metadata/datadoc/Variable.java @@ -3,9 +3,11 @@ import java.io.Serializable; import java.net.URI; +import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.LinkedHashMap; +import java.util.List; import java.util.Map; import java.util.UUID; import javax.annotation.processing.Generated; @@ -24,6 +26,7 @@ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ "short_name", + "data_element_path", "name", "data_type", "variable_role", @@ -34,10 +37,12 @@ "comment", "temporality_type", "measurement_unit", + "multiplication_factor", "format", "classification_uri", - "sentinel_value_uri", + "special_value", "invalid_value_description", + "custom_type", "id", "contains_data_from", "contains_data_until" @@ -49,23 +54,32 @@ public class Variable implements Serializable /** * Short name *

- * Physical name of the variable in the dataset. Should match the recommended short name. + * Physical name of the variable (data element) in the dataset. Should match the recommended short name. * (Required) * */ @JsonProperty("short_name") - @JsonPropertyDescription("Physical name of the variable in the dataset. Should match the recommended short name.") + @JsonPropertyDescription("Physical name of the variable (data element) in the dataset. Should match the recommended short name.") @NotNull private String shortName; /** - * Reusable langugage string type + * Data element path + *

+ * The path (dot notation) to the data element in a hierarchical data structure, eg. 'person.adress'. Must be given in addition to the short_name.For hierarchical datasets only, eg. json and xml documents. + * + */ + @JsonProperty("data_element_path") + @JsonPropertyDescription("The path (dot notation) to the data element in a hierarchical data structure, eg. 'person.adress'. Must be given in addition to the short_name.") + private String dataElementPath; + /** + * Reusableb langugage string type * (Required) * */ @JsonProperty("name") @Valid @NotNull - private LanguageStringType name; + private List name = new ArrayList(); /** * Data type *

@@ -109,26 +123,26 @@ public class Variable implements Serializable @NotNull private Boolean directPersonIdentifying; /** - * Reusable langugage string type + * Reusableb langugage string type * */ @JsonProperty("data_source") @Valid - private LanguageStringType dataSource; + private List dataSource = new ArrayList(); /** - * Reusable langugage string type + * Reusableb langugage string type * */ @JsonProperty("population_description") @Valid - private LanguageStringType populationDescription; + private List populationDescription = new ArrayList(); /** - * Reusable langugage string type + * Reusableb langugage string type * */ @JsonProperty("comment") @Valid - private LanguageStringType comment; + private List comment = new ArrayList(); /** * Reusable temporalitytype type * @@ -144,6 +158,15 @@ public class Variable implements Serializable @JsonProperty("measurement_unit") @JsonPropertyDescription("Measurement unit") private String measurementUnit; + /** + * Multiplication factor + *

+ * A multiplication factor for a value/result is a number that multiplies that value/result. + * + */ + @JsonProperty("multiplication_factor") + @JsonPropertyDescription("A multiplication factor for a value/result is a number that multiplies that value/result.") + private Integer multiplicationFactor; /** * Format *

@@ -163,21 +186,31 @@ public class Variable implements Serializable @JsonPropertyDescription("Link (URI) to valid classification or code list") private URI classificationUri; /** - * Sentinel value URI + * Special values *

- * A link (URI) to an overview of sentinel values included in the variable. Proposals for the standardization of sentinel values ​​have been drafted, but this has not yet been processed by the Standards Committee in Statistics Norway: 01 - In total, 02 - Sum, 03 - Subtotal, 04 - Other, 05 - Rest, 06 - Invalid value, 07 - Unspecified, 08 - Not relevant + * * */ - @JsonProperty("sentinel_value_uri") - @JsonPropertyDescription("A link (URI) to an overview of sentinel values included in the variable. Proposals for the standardization of sentinel values \u200b\u200bhave been drafted, but this has not yet been processed by the Standards Committee in Statistics Norway: 01 - In total, 02 - Sum, 03 - Subtotal, 04 - Other, 05 - Rest, 06 - Invalid value, 07 - Unspecified, 08 - Not relevant") - private URI sentinelValueUri; + @JsonProperty("special_value") + @Valid + private SpecialValues specialValue; /** - * Reusable langugage string type + * Reusableb langugage string type * */ @JsonProperty("invalid_value_description") @Valid - private LanguageStringType invalidValueDescription; + private List invalidValueDescription = new ArrayList(); + /** + * Custom type for variable metadata + *

+ * Extend the DataDoc model by adding custom metadata elements as key-value-pairs (string, array or objects). + * + */ + @JsonProperty("custom_type") + @JsonPropertyDescription("Extend the DataDoc model by adding custom metadata elements as key-value-pairs (string, array or objects).") + @Valid + private List customType = new ArrayList(); /** * Identifier *

@@ -210,7 +243,7 @@ public class Variable implements Serializable @JsonIgnore @Valid private Map additionalProperties = new LinkedHashMap(); - private final static long serialVersionUID = -2952914587996934465L; + private final static long serialVersionUID = 1019444275429139130L; /** * No args constructor for use in serialization @@ -221,6 +254,8 @@ public Variable() { /** * + * @param specialValue + * Special values. * @param containsDataUntil * Contains data up until. The instance variable in the data set contains data up to and including this date. This can be useful information for data sets that contain many instance variables in addition to data for many periods/years. In many cases, it will then be the case that some of the instance variables in the data set are terminated (no longer updated) after a given point in time. * @param containsDataFrom @@ -241,10 +276,12 @@ public Variable() { * Measurement unit. Measurement unit. * @param directPersonIdentifying * Direct Person identifying Information (DPI). Direct Person identifying Information (DPI). Some of the values ​​in an instance variable kan be DPI, others not. In this case, DPI is set equal to true. For example, the variable exporter where some of the values ​​can be organization number, others social security numbers (sole proprietorships). + * @param customType + * Custom type for variable metadata. Extend the DataDoc model by adding custom metadata elements as key-value-pairs (string, array or objects). * @param variableRole * Variable role. Role of the instance variable in the data set. - * @param sentinelValueUri - * Sentinel value URI. A link (URI) to an overview of sentinel values included in the variable. Proposals for the standardization of sentinel values ​​have been drafted, but this has not yet been processed by the Standards Committee in Statistics Norway: 01 - In total, 02 - Sum, 03 - Subtotal, 04 - Other, 05 - Rest, 06 - Invalid value, 07 - Unspecified, 08 - Not relevant. + * @param dataElementPath + * Data element path. The path (dot notation) to the data element in a hierarchical data structure, eg. 'person.adress'. Must be given in addition to the short_name. * @param name * Name. Variable names can be inherited from VarDef, but can also be documented/changed here. * @param comment @@ -252,15 +289,18 @@ public Variable() { * @param id * Identifier. Unique SSB identifier for the instance variable in the data set. * @param shortName - * Short name. Physical name of the variable in the dataset. Should match the recommended short name. + * Short name. Physical name of the variable (data element) in the dataset. Should match the recommended short name. * @param dataSource * Data source. Data source. Set at data set level, but can be overwritten at variable instance level. + * @param multiplicationFactor + * Multiplication factor. A multiplication factor for a value/result is a number that multiplies that value/result. * @param invalidValueDescription * Invalid value(s) description. Invalid value(s) description used in addition (or as an alternative) to standard sentinel values. */ - public Variable(String shortName, LanguageStringType name, Variable.DataType dataType, Variable.VariableRole variableRole, URI definitionUri, Boolean directPersonIdentifying, LanguageStringType dataSource, LanguageStringType populationDescription, LanguageStringType comment, no.ssb.dapla.metadata.datadoc.Dataset.TemporalityTypeType temporalityType, String measurementUnit, String format, URI classificationUri, URI sentinelValueUri, LanguageStringType invalidValueDescription, UUID id, Date containsDataFrom, Date containsDataUntil) { + public Variable(String shortName, String dataElementPath, List name, Variable.DataType dataType, Variable.VariableRole variableRole, URI definitionUri, Boolean directPersonIdentifying, List dataSource, List populationDescription, List comment, no.ssb.dapla.metadata.datadoc.Dataset.TemporalityTypeType temporalityType, String measurementUnit, Integer multiplicationFactor, String format, URI classificationUri, SpecialValues specialValue, List invalidValueDescription, List customType, UUID id, Date containsDataFrom, Date containsDataUntil) { super(); this.shortName = shortName; + this.dataElementPath = dataElementPath; this.name = name; this.dataType = dataType; this.variableRole = variableRole; @@ -271,10 +311,12 @@ public Variable(String shortName, LanguageStringType name, Variable.DataType dat this.comment = comment; this.temporalityType = temporalityType; this.measurementUnit = measurementUnit; + this.multiplicationFactor = multiplicationFactor; this.format = format; this.classificationUri = classificationUri; - this.sentinelValueUri = sentinelValueUri; + this.specialValue = specialValue; this.invalidValueDescription = invalidValueDescription; + this.customType = customType; this.id = id; this.containsDataFrom = containsDataFrom; this.containsDataUntil = containsDataUntil; @@ -287,7 +329,7 @@ public static Variable.VariableBuilderBase builder() { /** * Short name *

- * Physical name of the variable in the dataset. Should match the recommended short name. + * Physical name of the variable (data element) in the dataset. Should match the recommended short name. * (Required) * */ @@ -299,7 +341,7 @@ public String getShortName() { /** * Short name *

- * Physical name of the variable in the dataset. Should match the recommended short name. + * Physical name of the variable (data element) in the dataset. Should match the recommended short name. * (Required) * */ @@ -309,22 +351,44 @@ public void setShortName(String shortName) { } /** - * Reusable langugage string type + * Data element path + *

+ * The path (dot notation) to the data element in a hierarchical data structure, eg. 'person.adress'. Must be given in addition to the short_name.For hierarchical datasets only, eg. json and xml documents. + * + */ + @JsonProperty("data_element_path") + public String getDataElementPath() { + return dataElementPath; + } + + /** + * Data element path + *

+ * The path (dot notation) to the data element in a hierarchical data structure, eg. 'person.adress'. Must be given in addition to the short_name.For hierarchical datasets only, eg. json and xml documents. + * + */ + @JsonProperty("data_element_path") + public void setDataElementPath(String dataElementPath) { + this.dataElementPath = dataElementPath; + } + + /** + * Reusableb langugage string type * (Required) * */ @JsonProperty("name") - public LanguageStringType getName() { + public List getName() { return name; } /** - * Reusable langugage string type + * Reusableb langugage string type * (Required) * */ @JsonProperty("name") - public void setName(LanguageStringType name) { + public void setName(List name) { this.name = name; } @@ -423,56 +487,56 @@ public void setDirectPersonIdentifying(Boolean directPersonIdentifying) { } /** - * Reusable langugage string type + * Reusableb langugage string type * */ @JsonProperty("data_source") - public LanguageStringType getDataSource() { + public List getDataSource() { return dataSource; } /** - * Reusable langugage string type + * Reusableb langugage string type * */ @JsonProperty("data_source") - public void setDataSource(LanguageStringType dataSource) { + public void setDataSource(List dataSource) { this.dataSource = dataSource; } /** - * Reusable langugage string type + * Reusableb langugage string type * */ @JsonProperty("population_description") - public LanguageStringType getPopulationDescription() { + public List getPopulationDescription() { return populationDescription; } /** - * Reusable langugage string type + * Reusableb langugage string type * */ @JsonProperty("population_description") - public void setPopulationDescription(LanguageStringType populationDescription) { + public void setPopulationDescription(List populationDescription) { this.populationDescription = populationDescription; } /** - * Reusable langugage string type + * Reusableb langugage string type * */ @JsonProperty("comment") - public LanguageStringType getComment() { + public List getComment() { return comment; } /** - * Reusable langugage string type + * Reusableb langugage string type * */ @JsonProperty("comment") - public void setComment(LanguageStringType comment) { + public void setComment(List comment) { this.comment = comment; } @@ -516,6 +580,28 @@ public void setMeasurementUnit(String measurementUnit) { this.measurementUnit = measurementUnit; } + /** + * Multiplication factor + *

+ * A multiplication factor for a value/result is a number that multiplies that value/result. + * + */ + @JsonProperty("multiplication_factor") + public Integer getMultiplicationFactor() { + return multiplicationFactor; + } + + /** + * Multiplication factor + *

+ * A multiplication factor for a value/result is a number that multiplies that value/result. + * + */ + @JsonProperty("multiplication_factor") + public void setMultiplicationFactor(Integer multiplicationFactor) { + this.multiplicationFactor = multiplicationFactor; + } + /** * Format *

@@ -561,45 +647,67 @@ public void setClassificationUri(URI classificationUri) { } /** - * Sentinel value URI + * Special values *

- * A link (URI) to an overview of sentinel values included in the variable. Proposals for the standardization of sentinel values ​​have been drafted, but this has not yet been processed by the Standards Committee in Statistics Norway: 01 - In total, 02 - Sum, 03 - Subtotal, 04 - Other, 05 - Rest, 06 - Invalid value, 07 - Unspecified, 08 - Not relevant + * * */ - @JsonProperty("sentinel_value_uri") - public URI getSentinelValueUri() { - return sentinelValueUri; + @JsonProperty("special_value") + public SpecialValues getSpecialValue() { + return specialValue; } /** - * Sentinel value URI + * Special values *

- * A link (URI) to an overview of sentinel values included in the variable. Proposals for the standardization of sentinel values ​​have been drafted, but this has not yet been processed by the Standards Committee in Statistics Norway: 01 - In total, 02 - Sum, 03 - Subtotal, 04 - Other, 05 - Rest, 06 - Invalid value, 07 - Unspecified, 08 - Not relevant + * * */ - @JsonProperty("sentinel_value_uri") - public void setSentinelValueUri(URI sentinelValueUri) { - this.sentinelValueUri = sentinelValueUri; + @JsonProperty("special_value") + public void setSpecialValue(SpecialValues specialValue) { + this.specialValue = specialValue; } /** - * Reusable langugage string type + * Reusableb langugage string type * */ @JsonProperty("invalid_value_description") - public LanguageStringType getInvalidValueDescription() { + public List getInvalidValueDescription() { return invalidValueDescription; } /** - * Reusable langugage string type + * Reusableb langugage string type * */ @JsonProperty("invalid_value_description") - public void setInvalidValueDescription(LanguageStringType invalidValueDescription) { + public void setInvalidValueDescription(List invalidValueDescription) { this.invalidValueDescription = invalidValueDescription; } + /** + * Custom type for variable metadata + *

+ * Extend the DataDoc model by adding custom metadata elements as key-value-pairs (string, array or objects). + * + */ + @JsonProperty("custom_type") + public List getCustomType() { + return customType; + } + + /** + * Custom type for variable metadata + *

+ * Extend the DataDoc model by adding custom metadata elements as key-value-pairs (string, array or objects). + * + */ + @JsonProperty("custom_type") + public void setCustomType(List customType) { + this.customType = customType; + } + /** * Identifier *

@@ -686,6 +794,10 @@ public String toString() { sb.append('='); sb.append(((this.shortName == null)?"":this.shortName)); sb.append(','); + sb.append("dataElementPath"); + sb.append('='); + sb.append(((this.dataElementPath == null)?"":this.dataElementPath)); + sb.append(','); sb.append("name"); sb.append('='); sb.append(((this.name == null)?"":this.name)); @@ -726,6 +838,10 @@ public String toString() { sb.append('='); sb.append(((this.measurementUnit == null)?"":this.measurementUnit)); sb.append(','); + sb.append("multiplicationFactor"); + sb.append('='); + sb.append(((this.multiplicationFactor == null)?"":this.multiplicationFactor)); + sb.append(','); sb.append("format"); sb.append('='); sb.append(((this.format == null)?"":this.format)); @@ -734,14 +850,18 @@ public String toString() { sb.append('='); sb.append(((this.classificationUri == null)?"":this.classificationUri)); sb.append(','); - sb.append("sentinelValueUri"); + sb.append("specialValue"); sb.append('='); - sb.append(((this.sentinelValueUri == null)?"":this.sentinelValueUri)); + sb.append(((this.specialValue == null)?"":this.specialValue)); sb.append(','); sb.append("invalidValueDescription"); sb.append('='); sb.append(((this.invalidValueDescription == null)?"":this.invalidValueDescription)); sb.append(','); + sb.append("customType"); + sb.append('='); + sb.append(((this.customType == null)?"":this.customType)); + sb.append(','); sb.append("id"); sb.append('='); sb.append(((this.id == null)?"":this.id)); @@ -769,6 +889,7 @@ public String toString() { @Override public int hashCode() { int result = 1; + result = ((result* 31)+((this.specialValue == null)? 0 :this.specialValue.hashCode())); result = ((result* 31)+((this.containsDataUntil == null)? 0 :this.containsDataUntil.hashCode())); result = ((result* 31)+((this.containsDataFrom == null)? 0 :this.containsDataFrom.hashCode())); result = ((result* 31)+((this.dataType == null)? 0 :this.dataType.hashCode())); @@ -779,14 +900,16 @@ public int hashCode() { result = ((result* 31)+((this.temporalityType == null)? 0 :this.temporalityType.hashCode())); result = ((result* 31)+((this.measurementUnit == null)? 0 :this.measurementUnit.hashCode())); result = ((result* 31)+((this.directPersonIdentifying == null)? 0 :this.directPersonIdentifying.hashCode())); + result = ((result* 31)+((this.customType == null)? 0 :this.customType.hashCode())); result = ((result* 31)+((this.variableRole == null)? 0 :this.variableRole.hashCode())); - result = ((result* 31)+((this.sentinelValueUri == null)? 0 :this.sentinelValueUri.hashCode())); + result = ((result* 31)+((this.dataElementPath == null)? 0 :this.dataElementPath.hashCode())); result = ((result* 31)+((this.name == null)? 0 :this.name.hashCode())); result = ((result* 31)+((this.comment == null)? 0 :this.comment.hashCode())); result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode())); result = ((result* 31)+((this.shortName == null)? 0 :this.shortName.hashCode())); result = ((result* 31)+((this.dataSource == null)? 0 :this.dataSource.hashCode())); + result = ((result* 31)+((this.multiplicationFactor == null)? 0 :this.multiplicationFactor.hashCode())); result = ((result* 31)+((this.invalidValueDescription == null)? 0 :this.invalidValueDescription.hashCode())); return result; } @@ -800,7 +923,7 @@ public boolean equals(Object other) { return false; } Variable rhs = ((Variable) other); - return ((((((((((((((((((((this.containsDataUntil == rhs.containsDataUntil)||((this.containsDataUntil!= null)&&this.containsDataUntil.equals(rhs.containsDataUntil)))&&((this.containsDataFrom == rhs.containsDataFrom)||((this.containsDataFrom!= null)&&this.containsDataFrom.equals(rhs.containsDataFrom))))&&((this.dataType == rhs.dataType)||((this.dataType!= null)&&this.dataType.equals(rhs.dataType))))&&((this.format == rhs.format)||((this.format!= null)&&this.format.equals(rhs.format))))&&((this.classificationUri == rhs.classificationUri)||((this.classificationUri!= null)&&this.classificationUri.equals(rhs.classificationUri))))&&((this.populationDescription == rhs.populationDescription)||((this.populationDescription!= null)&&this.populationDescription.equals(rhs.populationDescription))))&&((this.definitionUri == rhs.definitionUri)||((this.definitionUri!= null)&&this.definitionUri.equals(rhs.definitionUri))))&&((this.temporalityType == rhs.temporalityType)||((this.temporalityType!= null)&&this.temporalityType.equals(rhs.temporalityType))))&&((this.measurementUnit == rhs.measurementUnit)||((this.measurementUnit!= null)&&this.measurementUnit.equals(rhs.measurementUnit))))&&((this.directPersonIdentifying == rhs.directPersonIdentifying)||((this.directPersonIdentifying!= null)&&this.directPersonIdentifying.equals(rhs.directPersonIdentifying))))&&((this.variableRole == rhs.variableRole)||((this.variableRole!= null)&&this.variableRole.equals(rhs.variableRole))))&&((this.sentinelValueUri == rhs.sentinelValueUri)||((this.sentinelValueUri!= null)&&this.sentinelValueUri.equals(rhs.sentinelValueUri))))&&((this.name == rhs.name)||((this.name!= null)&&this.name.equals(rhs.name))))&&((this.comment == rhs.comment)||((this.comment!= null)&&this.comment.equals(rhs.comment))))&&((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id))))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))))&&((this.shortName == rhs.shortName)||((this.shortName!= null)&&this.shortName.equals(rhs.shortName))))&&((this.dataSource == rhs.dataSource)||((this.dataSource!= null)&&this.dataSource.equals(rhs.dataSource))))&&((this.invalidValueDescription == rhs.invalidValueDescription)||((this.invalidValueDescription!= null)&&this.invalidValueDescription.equals(rhs.invalidValueDescription)))); + return (((((((((((((((((((((((this.specialValue == rhs.specialValue)||((this.specialValue!= null)&&this.specialValue.equals(rhs.specialValue)))&&((this.containsDataUntil == rhs.containsDataUntil)||((this.containsDataUntil!= null)&&this.containsDataUntil.equals(rhs.containsDataUntil))))&&((this.containsDataFrom == rhs.containsDataFrom)||((this.containsDataFrom!= null)&&this.containsDataFrom.equals(rhs.containsDataFrom))))&&((this.dataType == rhs.dataType)||((this.dataType!= null)&&this.dataType.equals(rhs.dataType))))&&((this.format == rhs.format)||((this.format!= null)&&this.format.equals(rhs.format))))&&((this.classificationUri == rhs.classificationUri)||((this.classificationUri!= null)&&this.classificationUri.equals(rhs.classificationUri))))&&((this.populationDescription == rhs.populationDescription)||((this.populationDescription!= null)&&this.populationDescription.equals(rhs.populationDescription))))&&((this.definitionUri == rhs.definitionUri)||((this.definitionUri!= null)&&this.definitionUri.equals(rhs.definitionUri))))&&((this.temporalityType == rhs.temporalityType)||((this.temporalityType!= null)&&this.temporalityType.equals(rhs.temporalityType))))&&((this.measurementUnit == rhs.measurementUnit)||((this.measurementUnit!= null)&&this.measurementUnit.equals(rhs.measurementUnit))))&&((this.directPersonIdentifying == rhs.directPersonIdentifying)||((this.directPersonIdentifying!= null)&&this.directPersonIdentifying.equals(rhs.directPersonIdentifying))))&&((this.customType == rhs.customType)||((this.customType!= null)&&this.customType.equals(rhs.customType))))&&((this.variableRole == rhs.variableRole)||((this.variableRole!= null)&&this.variableRole.equals(rhs.variableRole))))&&((this.dataElementPath == rhs.dataElementPath)||((this.dataElementPath!= null)&&this.dataElementPath.equals(rhs.dataElementPath))))&&((this.name == rhs.name)||((this.name!= null)&&this.name.equals(rhs.name))))&&((this.comment == rhs.comment)||((this.comment!= null)&&this.comment.equals(rhs.comment))))&&((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id))))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))))&&((this.shortName == rhs.shortName)||((this.shortName!= null)&&this.shortName.equals(rhs.shortName))))&&((this.dataSource == rhs.dataSource)||((this.dataSource!= null)&&this.dataSource.equals(rhs.dataSource))))&&((this.multiplicationFactor == rhs.multiplicationFactor)||((this.multiplicationFactor!= null)&&this.multiplicationFactor.equals(rhs.multiplicationFactor))))&&((this.invalidValueDescription == rhs.invalidValueDescription)||((this.invalidValueDescription!= null)&&this.invalidValueDescription.equals(rhs.invalidValueDescription)))); } @@ -817,7 +940,8 @@ public enum DataType { INTEGER("INTEGER"), DATETIME("DATETIME"), BOOLEAN("BOOLEAN"), - FLOAT("FLOAT"); + FLOAT("FLOAT"), + ARRAY("ARRAY"); private final String value; private final static Map CONSTANTS = new HashMap(); @@ -862,8 +986,8 @@ public VariableBuilder() { super(); } - public VariableBuilder(String shortName, LanguageStringType name, Variable.DataType dataType, Variable.VariableRole variableRole, URI definitionUri, Boolean directPersonIdentifying, LanguageStringType dataSource, LanguageStringType populationDescription, LanguageStringType comment, no.ssb.dapla.metadata.datadoc.Dataset.TemporalityTypeType temporalityType, String measurementUnit, String format, URI classificationUri, URI sentinelValueUri, LanguageStringType invalidValueDescription, UUID id, Date containsDataFrom, Date containsDataUntil) { - super(shortName, name, dataType, variableRole, definitionUri, directPersonIdentifying, dataSource, populationDescription, comment, temporalityType, measurementUnit, format, classificationUri, sentinelValueUri, invalidValueDescription, id, containsDataFrom, containsDataUntil); + public VariableBuilder(String shortName, String dataElementPath, List name, Variable.DataType dataType, Variable.VariableRole variableRole, URI definitionUri, Boolean directPersonIdentifying, List dataSource, List populationDescription, List comment, no.ssb.dapla.metadata.datadoc.Dataset.TemporalityTypeType temporalityType, String measurementUnit, Integer multiplicationFactor, String format, URI classificationUri, SpecialValues specialValue, List invalidValueDescription, List customType, UUID id, Date containsDataFrom, Date containsDataUntil) { + super(shortName, dataElementPath, name, dataType, variableRole, definitionUri, directPersonIdentifying, dataSource, populationDescription, comment, temporalityType, measurementUnit, multiplicationFactor, format, classificationUri, specialValue, invalidValueDescription, customType, id, containsDataFrom, containsDataUntil); } } @@ -881,10 +1005,10 @@ public VariableBuilderBase() { } @SuppressWarnings("unchecked") - public VariableBuilderBase(String shortName, LanguageStringType name, Variable.DataType dataType, Variable.VariableRole variableRole, URI definitionUri, Boolean directPersonIdentifying, LanguageStringType dataSource, LanguageStringType populationDescription, LanguageStringType comment, no.ssb.dapla.metadata.datadoc.Dataset.TemporalityTypeType temporalityType, String measurementUnit, String format, URI classificationUri, URI sentinelValueUri, LanguageStringType invalidValueDescription, UUID id, Date containsDataFrom, Date containsDataUntil) { + public VariableBuilderBase(String shortName, String dataElementPath, List name, Variable.DataType dataType, Variable.VariableRole variableRole, URI definitionUri, Boolean directPersonIdentifying, List dataSource, List populationDescription, List comment, no.ssb.dapla.metadata.datadoc.Dataset.TemporalityTypeType temporalityType, String measurementUnit, Integer multiplicationFactor, String format, URI classificationUri, SpecialValues specialValue, List invalidValueDescription, List customType, UUID id, Date containsDataFrom, Date containsDataUntil) { // Skip initialization when called from subclass if (this.getClass().equals(Variable.VariableBuilder.class)) { - this.instance = ((T) new Variable(shortName, name, dataType, variableRole, definitionUri, directPersonIdentifying, dataSource, populationDescription, comment, temporalityType, measurementUnit, format, classificationUri, sentinelValueUri, invalidValueDescription, id, containsDataFrom, containsDataUntil)); + this.instance = ((T) new Variable(shortName, dataElementPath, name, dataType, variableRole, definitionUri, directPersonIdentifying, dataSource, populationDescription, comment, temporalityType, measurementUnit, multiplicationFactor, format, classificationUri, specialValue, invalidValueDescription, customType, id, containsDataFrom, containsDataUntil)); } } @@ -900,7 +1024,12 @@ public Variable.VariableBuilderBase withShortName(String shortName) { return this; } - public Variable.VariableBuilderBase withName(LanguageStringType name) { + public Variable.VariableBuilderBase withDataElementPath(String dataElementPath) { + ((Variable) this.instance).dataElementPath = dataElementPath; + return this; + } + + public Variable.VariableBuilderBase withName(List name) { ((Variable) this.instance).name = name; return this; } @@ -925,17 +1054,17 @@ public Variable.VariableBuilderBase withDirectPersonIdentifying(Boolean directPe return this; } - public Variable.VariableBuilderBase withDataSource(LanguageStringType dataSource) { + public Variable.VariableBuilderBase withDataSource(List dataSource) { ((Variable) this.instance).dataSource = dataSource; return this; } - public Variable.VariableBuilderBase withPopulationDescription(LanguageStringType populationDescription) { + public Variable.VariableBuilderBase withPopulationDescription(List populationDescription) { ((Variable) this.instance).populationDescription = populationDescription; return this; } - public Variable.VariableBuilderBase withComment(LanguageStringType comment) { + public Variable.VariableBuilderBase withComment(List comment) { ((Variable) this.instance).comment = comment; return this; } @@ -950,6 +1079,11 @@ public Variable.VariableBuilderBase withMeasurementUnit(String measurementUnit) return this; } + public Variable.VariableBuilderBase withMultiplicationFactor(Integer multiplicationFactor) { + ((Variable) this.instance).multiplicationFactor = multiplicationFactor; + return this; + } + public Variable.VariableBuilderBase withFormat(String format) { ((Variable) this.instance).format = format; return this; @@ -960,16 +1094,21 @@ public Variable.VariableBuilderBase withClassificationUri(URI classificationUri) return this; } - public Variable.VariableBuilderBase withSentinelValueUri(URI sentinelValueUri) { - ((Variable) this.instance).sentinelValueUri = sentinelValueUri; + public Variable.VariableBuilderBase withSpecialValue(SpecialValues specialValue) { + ((Variable) this.instance).specialValue = specialValue; return this; } - public Variable.VariableBuilderBase withInvalidValueDescription(LanguageStringType invalidValueDescription) { + public Variable.VariableBuilderBase withInvalidValueDescription(List invalidValueDescription) { ((Variable) this.instance).invalidValueDescription = invalidValueDescription; return this; } + public Variable.VariableBuilderBase withCustomType(List customType) { + ((Variable) this.instance).customType = customType; + return this; + } + public Variable.VariableBuilderBase withId(UUID id) { ((Variable) this.instance).id = id; return this; diff --git a/generated/python/datadoc_model/datadoc_model/model.py b/generated/python/datadoc_model/datadoc_model/model.py index ee93d925..68420e13 100644 --- a/generated/python/datadoc_model/datadoc_model/model.py +++ b/generated/python/datadoc_model/datadoc_model/model.py @@ -1,14 +1,14 @@ # generated by datamodel-codegen: # filename: metadata-container-json-schema.json -# timestamp: 2024-02-21T09:13:37+00:00 +# timestamp: 2024-02-22T10:00:48+00:00 from __future__ import annotations from enum import Enum -from typing import Any, Literal, Optional +from typing import Any, Literal, Optional, Union from uuid import UUID -from pydantic import AnyUrl, AwareDatetime, Field +from pydantic import AnyUrl, AwareDatetime, Field, RootModel from datadoc_model.datadoc_base_model import DatadocBaseModel @@ -34,12 +34,28 @@ class DataSetState(str, Enum): OUTPUT_DATA = "OUTPUT_DATA" +class UseRestriction(str, Enum): + DELETION_ANONYMIZATION = "DELETION_ANONYMIZATION" + PROCESS_LIMITATIONS = "PROCESS_LIMITATIONS" + SECONDARY_USE_RESTRICTIONS = "SECONDARY_USE_RESTRICTIONS" + + +class CustomTypeForDatasetMetadatum(DatadocBaseModel): + key: Optional[str] = Field(None, description="Custom type KEY", title="Key") + value: Optional[Union[str, list, dict[str, Any]]] = Field( + None, + description="Custom type VALUE (of type string, array or object).", + title="Value", + ) + + class DataType(str, Enum): STRING = "STRING" INTEGER = "INTEGER" DATETIME = "DATETIME" BOOLEAN = "BOOLEAN" FLOAT = "FLOAT" + ARRAY = "ARRAY" class VariableRole(str, Enum): @@ -50,10 +66,39 @@ class VariableRole(str, Enum): ATTRIBUTE = "ATTRIBUTE" -class LanguageStringType(DatadocBaseModel): - en: Optional[str] = None - nn: Optional[str] = None - nb: Optional[str] = None +class SentinelValues(DatadocBaseModel): + sentinel_value_uri: Optional[AnyUrl] = Field( + None, + description="A link (URI) to a standardized list of sentinel values included in the variable, eg. a link to a codelist in Klass (https://www.ssb.no/en/klass/)", + title="Sentinel value URI", + ) + sentinel_value_elements: Optional[list[str]] = Field( + None, + description="A selection (subset) of sentinel values in the 'sentinel_value_uri' \u200b\u200bapplicable to the data set.", + title="Sentinel value elements", + ) + + +class CustomTypeForVariableMetadatum(DatadocBaseModel): + key: Optional[str] = Field(None, description="Custom type KEY", title="Key") + value: Optional[Union[str, list, dict[str, Any]]] = Field( + None, + description="Custom type VALUE (of type string, array or object).", + title="Value", + ) + + +class LanguageStringTypeItem(DatadocBaseModel): + languageCode: Optional[str] = Field( + None, description="Language code (ISO 639-1)", title="Language code" + ) + languageText: Optional[str] = Field( + None, description="Language text", title="Language text" + ) + + +class LanguageStringType(RootModel[Optional[list[LanguageStringTypeItem]]]): + root: Optional[list[LanguageStringTypeItem]] = None class TemporalityTypeType(str, Enum): @@ -168,9 +213,6 @@ class Dataset(DatadocBaseModel): description="Data source. Set either for the data set or instance variable.", title="Data source", ) - register_uri: Optional[LanguageStringType] = Field( - None, description="Link to register", title="Register" - ) population_description: Optional[LanguageStringType] = Field( None, description="Description of the population covered in the data set. Includes unit type, spatial coverage and period of time.", @@ -194,7 +236,7 @@ class Dataset(DatadocBaseModel): description="Temporality type. Either for the instance variable or the data set", title="Temporality type", ) - subject_field: Optional[LanguageStringType] = Field( + subject_field: Optional[str] = Field( None, description="Primary area of statistics in which the data set is included", title="Subject field", @@ -209,6 +251,24 @@ class Dataset(DatadocBaseModel): description="Description of the data set's spatial coverage", title="Spatial coverage description", ) + contains_personal_data: Optional[bool] = Field( + None, + description="Is there any personal data amongst this data (data set)?", + title="Contains personal data", + ) + use_restriction: Optional[UseRestriction] = Field( + None, description="Data set use restriction", title="Use restriction" + ) + use_restriction_date: Optional[AwareDatetime] = Field( + None, + description="Use restriction date, eg. the date (deadline) for when data must be deleted/anonymised.", + title="Use restriction date", + ) + custom_type: Optional[list[CustomTypeForDatasetMetadatum]] = Field( + None, + description="Extend the DataDoc model by adding custom metadata elements as key-value-pairs (string, array or objects).", + title="Custom type for dataset metadata", + ) id: Optional[UUID] = Field( None, description="Unique identifier for the data set", title="Identifier" ) @@ -252,12 +312,39 @@ class Dataset(DatadocBaseModel): ) +class OtherSpecialValue(DatadocBaseModel): + code: Optional[str] = Field(None, description="Other value code", title="Code") + name: Optional[LanguageStringType] = Field( + None, description="Other value name (text)", title="Name" + ) + valid_from: Optional[AwareDatetime] = Field( + None, description="Other value valid from date", title="Valid from" + ) + valid_until: Optional[AwareDatetime] = Field( + None, description="Other value until date", title="Valid until" + ) + + +class SpecialValues(DatadocBaseModel): + sentinel: Optional[SentinelValues] = Field(None, title="Sentinel values") + other_value: Optional[list[OtherSpecialValue]] = Field( + None, + description="Other special values not represented as 'sentinel_value' in a standardized code list.", + title="Other special values", + ) + + class Variable(DatadocBaseModel): short_name: Optional[str] = Field( None, - description="Physical name of the variable in the dataset. Should match the recommended short name.", + description="Physical name of the variable (data element) in the dataset. Should match the recommended short name.", title="Short name", ) + data_element_path: Optional[str] = Field( + None, + description="The path (dot notation) to the data element in a hierarchical data structure, eg. 'person.adress'. Must be given in addition to the short_name.", + title="Data element path", + ) name: Optional[LanguageStringType] = Field( None, description="Variable names can be inherited from VarDef, but can also be documented/changed here", @@ -304,6 +391,11 @@ class Variable(DatadocBaseModel): measurement_unit: Optional[str] = Field( None, description="Measurement unit", title="Measurement unit" ) + multiplication_factor: Optional[int] = Field( + None, + description="A multiplication factor for a value/result is a number that multiplies that value/result.", + title="Multiplication factor", + ) format: Optional[str] = Field( None, description="The format of the values \u200b\u200b(physical format or regular expression) in machine-readable form for validation. This can be used as a further specification of the data type (dataType) in those cases where this is relevant.", @@ -314,16 +406,17 @@ class Variable(DatadocBaseModel): description="Link (URI) to valid classification or code list", title="Classification or codelist URI", ) - sentinel_value_uri: Optional[AnyUrl] = Field( - None, - description="A link (URI) to an overview of sentinel values included in the variable. Proposals for the standardization of sentinel values \u200b\u200bhave been drafted, but this has not yet been processed by the Standards Committee in Statistics Norway: 01 - In total, 02 - Sum, 03 - Subtotal, 04 - Other, 05 - Rest, 06 - Invalid value, 07 - Unspecified, 08 - Not relevant", - title="Sentinel value URI", - ) + special_value: Optional[SpecialValues] = Field(None, title="Special values") invalid_value_description: Optional[LanguageStringType] = Field( None, description="Invalid value(s) description used in addition (or as an alternative) to standard sentinel values.", title="Invalid value(s) description", ) + custom_type: Optional[list[CustomTypeForVariableMetadatum]] = Field( + None, + description="Extend the DataDoc model by adding custom metadata elements as key-value-pairs (string, array or objects).", + title="Custom type for variable metadata", + ) id: Optional[UUID] = Field( None, description="Unique SSB identifier for the instance variable in the data set", @@ -345,8 +438,8 @@ class DatadocMetadata(DatadocBaseModel): percentage_complete: Optional[int] = Field( None, description="Percentage of obligatory metadata fields populated." ) - document_version: Literal["2.1.0"] = Field( - "2.1.0", description="Version of this model" + document_version: Literal["3.0.0"] = Field( + "3.0.0", description="Version of this model" ) dataset: Optional[Dataset] = None variables: Optional[list[Variable]] = None diff --git a/generated/python/datadoc_model/pyproject.toml b/generated/python/datadoc_model/pyproject.toml index 09f18337..12e6c56c 100644 --- a/generated/python/datadoc_model/pyproject.toml +++ b/generated/python/datadoc_model/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "ssb-datadoc-model" -version = "4.3.0" +version = "5.0.0" description = "Data Model for use in Statistics Norway's Metadata system" authors = ["Statistics Norway "] license = "MIT" diff --git a/src/datadoc/datadoc-json-schema.json b/src/datadoc/datadoc-json-schema.json index 084dbcab..97cdfb09 100644 --- a/src/datadoc/datadoc-json-schema.json +++ b/src/datadoc/datadoc-json-schema.json @@ -10,7 +10,7 @@ }, "document_version": { "description": "Version of this model", - "const": "2.1.0" + "const": "3.0.0" }, "dataset": { "type": "object", @@ -57,27 +57,22 @@ "name": { "title": "Name", "description": "Name of data set", - "$ref": "./no/languageStringType.json#/languageStringType" + "$ref": "./languageStringType.json#/languageStringType" }, "description": { "title": "Description", "description": "Free text description of the data set", - "$ref": "./no/languageStringType.json#/languageStringType" + "$ref": "./languageStringType.json#/languageStringType" }, "data_source": { "title": "Data source", "description": "Data source. Set either for the data set or instance variable.", - "$ref": "./no/languageStringType.json#/languageStringType" - }, - "register_uri": { - "title": "Register", - "description": "Link to register", - "$ref": "./no/languageStringType.json#/languageStringType" + "$ref": "./languageStringType.json#/languageStringType" }, "population_description": { "title": "Description of population", "description": "Description of the population covered in the data set. Includes unit type, spatial coverage and period of time.", - "$ref": "./no/languageStringType.json#/languageStringType" + "$ref": "./languageStringType.json#/languageStringType" }, "version": { "title": "Version", @@ -87,7 +82,7 @@ "version_description": { "title": "Version description", "description": "Dataset version information in the form of descriptive text", - "$ref": "./no/languageStringType.json#/languageStringType" + "$ref": "./languageStringType.json#/languageStringType" }, "unit_type": { "title": "Unit type", @@ -97,12 +92,12 @@ "temporality_type": { "title": "Temporality type", "description": "Temporality type. Either for the instance variable or the data set", - "$ref": "./no/temporalityTypeType.json#/temporalityTypeType" + "$ref": "./temporalityTypeType.json#/temporalityTypeType" }, "subject_field": { "title": "Subject field", "description": "Primary area of statistics in which the data set is included", - "$ref": "./no/languageStringType.json#/languageStringType" + "type": "string" }, "keyword": { "title": "Keyword(s)", @@ -115,7 +110,58 @@ "spatial_coverage_description": { "title": "Spatial coverage description", "description": "Description of the data set's spatial coverage", - "$ref": "./no/languageStringType.json#/languageStringType" + "$ref": "./languageStringType.json#/languageStringType" + }, + "contains_personal_data": { + "title": "Contains personal data", + "description": "Is there any personal data amongst this data (data set)?", + "type": "boolean" + }, + "use_restriction": { + "title": "Use restriction", + "description": "Data set use restriction", + "type": "string", + "enum": [ + "DELETION_ANONYMIZATION", + "PROCESS_LIMITATIONS", + "SECONDARY_USE_RESTRICTIONS" + ] + }, + "use_restriction_date": { + "title": "Use restriction date", + "description": "Use restriction date, eg. the date (deadline) for when data must be deleted/anonymised.", + "type": "string", + "format": "date-time" + }, + "custom_type": { + "title": "Custom type for dataset metadata", + "description": "Extend the DataDoc model by adding custom metadata elements as key-value-pairs (string, array or objects).", + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "title": "Key", + "description": "Custom type KEY", + "type": "string" + }, + "value": { + "title": "Value", + "description": "Custom type VALUE (of type string, array or object).", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array" + }, + { + "type": "object" + } + ] + } + } + } }, "id": { "title": "Identifier", @@ -127,7 +173,7 @@ "owner": { "title": "Owner", "description": "Owner of the data set (responsible division in Statistics Norway). See also Classification of organisational units https://www.ssb.no/en/klass/klassifikasjoner/83", - "$ref": "./no/languageStringType.json#/languageStringType" + "$ref": "./languageStringType.json#/languageStringType" }, "file_path": { "title": "File path", @@ -178,6 +224,7 @@ "unit_type", "description", "subject_field", + "contains_personal_data", "id", "owner", "file_path", @@ -195,12 +242,18 @@ "short_name": { "type": "string", "title": "Short name", - "description": "Physical name of the variable in the dataset. Should match the recommended short name." + "description": "Physical name of the variable (data element) in the dataset. Should match the recommended short name." + }, + "data_element_path": { + "title": "Data element path", + "description": "The path (dot notation) to the data element in a hierarchical data structure, eg. 'person.adress'. Must be given in addition to the short_name.", + "$comment": "For hierarchical datasets only, eg. json and xml documents.", + "type": "string" }, "name": { "title": "Name", "description": "Variable names can be inherited from VarDef, but can also be documented/changed here", - "$ref": "./no/languageStringType.json#/languageStringType" + "$ref": "./languageStringType.json#/languageStringType" }, "data_type": { "title": "Data type", @@ -211,7 +264,8 @@ "INTEGER", "DATETIME", "BOOLEAN", - "FLOAT" + "FLOAT", + "ARRAY" ] }, "variable_role": { @@ -240,22 +294,22 @@ "data_source": { "title": "Data source", "description": "Data source. Set at data set level, but can be overwritten at variable instance level.", - "$ref": "./no/languageStringType.json#/languageStringType" + "$ref": "./languageStringType.json#/languageStringType" }, "population_description": { "title": "Population description", "description": "The population the variable describes can be specified in more detail here. Set at dataset level, but can be overwritten at instance variable level.", - "$ref": "./no/languageStringType.json#/languageStringType" + "$ref": "./languageStringType.json#/languageStringType" }, "comment": { "title": "Comment", "description": "Further clarification of the variables definition", - "$ref": "./no/languageStringType.json#/languageStringType" + "$ref": "./languageStringType.json#/languageStringType" }, "temporality_type": { "title": "Temporality type", "description": "Temporality type. Set either for variable instance or dataset.", - "$ref": "./no/temporalityTypeType.json#/temporalityTypeType" + "$ref": "./temporalityTypeType.json#/temporalityTypeType" }, "measurement_unit": { "title": "Measurement unit", @@ -263,6 +317,11 @@ "$comment": "TODO: measurement_unit implemented as string. In the future this should be implemente as enum? See https://www.ssb.no/klass/klassifikasjoner/303/koder", "type": "string" }, + "multiplication_factor": { + "title": "Multiplication factor", + "description": "A multiplication factor for a value/result is a number that multiplies that value/result.", + "type": "integer" + }, "format": { "title": "Format", "description": "The format of the values ​​(physical format or regular expression) in machine-readable form for validation. This can be used as a further specification of the data type (dataType) in those cases where this is relevant.", @@ -274,16 +333,99 @@ "type": "string", "format": "uri" }, - "sentinel_value_uri": { - "title": "Sentinel value URI", - "description": "A link (URI) to an overview of sentinel values included in the variable. Proposals for the standardization of sentinel values ​​have been drafted, but this has not yet been processed by the Standards Committee in Statistics Norway: 01 - In total, 02 - Sum, 03 - Subtotal, 04 - Other, 05 - Rest, 06 - Invalid value, 07 - Unspecified, 08 - Not relevant", - "type": "string", - "format": "uri" + "special_value": { + "title": "Special values", + "type": "object", + "properties": { + "sentinel": { + "title": "Sentinel values", + "type": "object", + "properties": { + "sentinel_value_uri": { + "title": "Sentinel value URI", + "description": "A link (URI) to a standardized list of sentinel values included in the variable, eg. a link to a codelist in Klass (https://www.ssb.no/en/klass/)", + "$comment": "Proposals for the standardization of sentinel values ​​have been drafted, but this has not yet been processed by the Standards Committee in Statistics Norway.", + "type": "string", + "format": "uri" + }, + "sentinel_value_elements": { + "title": "Sentinel value elements", + "description": "A selection (subset) of sentinel values in the 'sentinel_value_uri' ​​applicable to the data set.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "other_value": { + "title": "Other special values", + "description": "Other special values not represented as 'sentinel_value' in a standardized code list.", + "type": "array", + "items": { + "type": "object", + "properties": { + "code": { + "title": "Code", + "description": "Other value code", + "type": "string" + }, + "name": { + "title": "Name", + "description": "Other value name (text)", + "$ref": "./languageStringType.json#/languageStringType" + }, + "valid_from": { + "title": "Valid from", + "description": "Other value valid from date", + "type": "string", + "format": "date-time" + }, + "valid_until": { + "title": "Valid until", + "description": "Other value until date", + "type": "string", + "format": "date-time" + } + } + } + } + } }, "invalid_value_description": { "title": "Invalid value(s) description", "description": "Invalid value(s) description used in addition (or as an alternative) to standard sentinel values.", - "$ref": "./no/languageStringType.json#/languageStringType" + "$ref": "./languageStringType.json#/languageStringType" + }, + "custom_type": { + "title": "Custom type for variable metadata", + "description": "Extend the DataDoc model by adding custom metadata elements as key-value-pairs (string, array or objects).", + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "title": "Key", + "description": "Custom type KEY", + "type": "string" + }, + "value": { + "title": "Value", + "description": "Custom type VALUE (of type string, array or object).", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array" + }, + { + "type": "object" + } + ] + } + } + } }, "id": { "title": "Identifier", @@ -321,4 +463,4 @@ "dataset", "variables" ] -} +} \ No newline at end of file diff --git a/src/datadoc/languageStringType.json b/src/datadoc/languageStringType.json new file mode 100644 index 00000000..2975c5bc --- /dev/null +++ b/src/datadoc/languageStringType.json @@ -0,0 +1,29 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + + "languageStringType": { + "$comment": "Reusableb langugage string type", + "type": "array", + "items": [ + { + "type": "object", + "properties": { + "languageCode": { + "title": "Language code", + "description": "Language code (ISO 639-1)", + "type": "string" + }, + "languageText": { + "title": "Language text", + "description": "Language text", + "type": "string" + } + }, + "required": [ + "languageCode", + "languageText" + ] + } + ] + } +} \ No newline at end of file diff --git a/src/datadoc/no/languageStringType.json b/src/datadoc/no/languageStringType.json deleted file mode 100644 index d3ff6b64..00000000 --- a/src/datadoc/no/languageStringType.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - - "languageStringType": { - "$comment": "Reusable langugage string type", - "type": "object", - "properties": { - "en": { - "type": "string" - }, - "nn": { - "type": "string" - }, - "nb": { - "type": "string" - } - }, - "required": [ - "nb" - ] - } -} \ No newline at end of file diff --git a/src/datadoc/no/temporalityTypeType.json b/src/datadoc/temporalityTypeType.json similarity index 100% rename from src/datadoc/no/temporalityTypeType.json rename to src/datadoc/temporalityTypeType.json