Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change type of owner field to string #46

Closed
wants to merge 14 commits into from
1 change: 1 addition & 0 deletions .github/workflows/release-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- main
- master
- backport/**
paths:
- "generated/python/**"
- ".github/workflows/release-python.yml"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,16 @@ public class Dataset implements Serializable
@NotNull
private UUID id;
/**
* Reusable langugage string type
* Owner
* <p>
* Owner of the data set (responsible division in Statistics Norway). Values defined by https://www.ssb.no/en/klass/klassifikasjoner/83
* (Required)
*
*/
@JsonProperty("owner")
@Valid
@JsonPropertyDescription("Owner of the data set (responsible division in Statistics Norway). Values defined by https://www.ssb.no/en/klass/klassifikasjoner/83")
@NotNull
private LanguageStringType owner;
private String owner;
/**
* File path
* <p>
Expand Down Expand Up @@ -296,7 +298,7 @@ public class Dataset implements Serializable
@JsonIgnore
@Valid
private Map<String, Object> additionalProperties = new LinkedHashMap<String, Object>();
private final static long serialVersionUID = 8856456406912570855L;
private final static long serialVersionUID = -7758597202153354155L;

/**
* No args constructor for use in serialization
Expand Down Expand Up @@ -340,7 +342,7 @@ public Dataset() {
* @param keyword
* Keyword(s). A list of searchable keywords that can contribute to the development of effective filtering and search services.
* @param owner
* Owner. Owner of the data set (responsible division in Statistics Norway). See also Classification of organisational units https://www.ssb.no/en/klass/klassifikasjoner/83.
* Owner. Owner of the data set (responsible division in Statistics Norway). Values defined by https://www.ssb.no/en/klass/klassifikasjoner/83.
* @param containsDataFrom
* Contains data from. The data set contains data from date/time.
* @param filePath
Expand All @@ -358,7 +360,7 @@ public 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<String> 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, LanguageStringType name, LanguageStringType description, LanguageStringType dataSource, LanguageStringType registerUri, LanguageStringType populationDescription, String version, LanguageStringType versionDescription, String unitType, Dataset.TemporalityTypeType temporalityType, LanguageStringType subjectField, List<String> keyword, LanguageStringType spatialCoverageDescription, UUID id, String owner, String filePath, Date metadataCreatedDate, String metadataCreatedBy, Date metadataLastUpdatedDate, String metadataLastUpdatedBy, String containsDataFrom, String containsDataUntil) {
super();
this.shortName = shortName;
this.assessment = assessment;
Expand Down Expand Up @@ -752,22 +754,26 @@ public void setId(UUID id) {
}

/**
* Reusable langugage string type
* Owner
* <p>
* Owner of the data set (responsible division in Statistics Norway). Values defined by https://www.ssb.no/en/klass/klassifikasjoner/83
* (Required)
*
*/
@JsonProperty("owner")
public LanguageStringType getOwner() {
public String getOwner() {
return owner;
}

/**
* Reusable langugage string type
* Owner
* <p>
* Owner of the data set (responsible division in Statistics Norway). Values defined by https://www.ssb.no/en/klass/klassifikasjoner/83
* (Required)
*
*/
@JsonProperty("owner")
public void setOwner(LanguageStringType owner) {
public void setOwner(String owner) {
this.owner = owner;
}

Expand Down Expand Up @@ -1162,7 +1168,7 @@ 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<String> keyword, LanguageStringType spatialCoverageDescription, UUID id, LanguageStringType owner, String filePath, Date metadataCreatedDate, String metadataCreatedBy, Date metadataLastUpdatedDate, String metadataLastUpdatedBy, String containsDataFrom, String containsDataUntil) {
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<String> keyword, LanguageStringType spatialCoverageDescription, UUID id, String 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);
}

Expand All @@ -1181,7 +1187,7 @@ 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<String> 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, LanguageStringType name, LanguageStringType description, LanguageStringType dataSource, LanguageStringType registerUri, LanguageStringType populationDescription, String version, LanguageStringType versionDescription, String unitType, Dataset.TemporalityTypeType temporalityType, LanguageStringType subjectField, List<String> keyword, LanguageStringType spatialCoverageDescription, UUID id, String 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));
Expand Down Expand Up @@ -1280,7 +1286,7 @@ public Dataset.DatasetBuilderBase withId(UUID id) {
return this;
}

public Dataset.DatasetBuilderBase withOwner(LanguageStringType owner) {
public Dataset.DatasetBuilderBase withOwner(String owner) {
((Dataset) this.instance).owner = owner;
return this;
}
Expand Down
10 changes: 5 additions & 5 deletions generated/python/datadoc_model/datadoc_model/model.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: metadata-container-json-schema.json
# timestamp: 2024-02-21T08:51:44+00:00
# timestamp: 2024-03-08T11:35:44+00:00

from __future__ import annotations

Expand Down Expand Up @@ -212,9 +212,9 @@ class Dataset(DatadocBaseModel):
id: Optional[UUID] = Field(
None, description="Unique identifier for the data set", title="Identifier"
)
owner: Optional[LanguageStringType] = Field(
owner: Optional[str] = Field(
None,
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",
description="Owner of the data set (responsible division in Statistics Norway). Values defined by https://www.ssb.no/en/klass/klassifikasjoner/83",
title="Owner",
)
file_path: Optional[str] = Field(
Expand Down Expand Up @@ -345,8 +345,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["2.2.0"] = Field(
"2.2.0", description="Version of this model"
)
dataset: Optional[Dataset] = None
variables: Optional[list[Variable]] = None
Expand Down
2 changes: 1 addition & 1 deletion generated/python/datadoc_model/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "ssb-datadoc-model"
version = "4.2.0"
version = "4.3.2"
description = "Data Model for use in Statistics Norway's Metadata system"
authors = ["Statistics Norway <[email protected]>"]
license = "MIT"
Expand Down
6 changes: 3 additions & 3 deletions src/datadoc/datadoc-json-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"document_version": {
"description": "Version of this model",
"const": "2.1.0"
"const": "2.2.0"
},
"dataset": {
"type": "object",
Expand Down Expand Up @@ -126,8 +126,8 @@
},
"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"
"description": "Owner of the data set (responsible division in Statistics Norway). Values defined by https://www.ssb.no/en/klass/klassifikasjoner/83",
"type": "string"
},
"file_path": {
"title": "File path",
Expand Down
Loading