openapi: 3.0.1
info:
title: Internal Variable Definitions Administration API
description: |2+
## Introduction
Variable Definitions are centralized definitions of concrete variables which are typically present in multiple datasets. Variable Definitions support standardization of data and metadata and facilitate sharing and joining of data by clarifying when variables have an identical definition.
## Maintenance of Variable Definitions
This API allows for creation, maintenance and access of Variable Definitions.
### Ownership
Creation and maintenance of variables may only be performed by Statistics Norway employees representing a specific Dapla team, who are defined as the owners of a given Variable Definition. In order to create variables, the single team an owner currently represents must be specified in the bearer token. This is currently only supported from the Dapla Lab platform. All maintenance is to be performed by the owners, with no intervention from administrators.
### Status
All Variable Definitions have an associated status. The possible values for status are `DRAFT`, `PUBLISHED_INTERNAL` and `PUBLISHED_EXTERNAL`.
#### Draft
When a Variable Definition is created it is assigned the status `DRAFT`. Under this status the Variable Definition is:
- Only visible to Statistics Norway employees.
- Mutable (it may be changed directly without need for versioning).
- Not suitable to refer to from other systems.
This status may be changed to `PUBLISHED_INTERNAL` or `PUBLISHED_EXTERNAL` with a direct update.
#### Published Internal
Under this status the Variable Definition is:
- Only visible to Statistics Norway employees.
- Immutable (all changes are versioned).
- Suitable to refer to in internal systems for statistics production.
- Not suitable to refer to for external use (for example in Statistikkbanken).
This status may be changed to `PUBLISHED_EXTERNAL` by creating a Patch version.
#### Published External
Under this status the Variable Definition is:
- Visible to the general public.
- Immutable (all changes are versioned).
- Suitable to refer to from any system.
This status may not be changed as it would break immutability. If a Variable Definition is no longer relevant then its period of validity should be ended by specifying a `valid_until` date in a Patch version.
### Immutability
Variable Definitions are immutable. This means that any changes must be performed in a strict versioning system. Consumers can avoid being exposed to breaking changes by specifying a `date_of_validity` when they request a Variable Definition.
#### Patches
Patches are for changes which do not affect the fundamental meaning of the Variable Definition.
#### Validity Periods
Validity Periods are versions with a period defined by a `valid_from` date and optionally a `valid_until` date. If the fundamental meaning of a Variable Definition is to be changed, it should be done by creating a new Validity Period.
contact:
name: Team Metadata
email: metadata@ssb.no
license:
name: CC BY 4.0
url: https://creativecommons.org/licenses/by/4.0/deed.no
version: "0.1"
servers:
- url: https://metadata.intern.ssb.no
description: Internal server
- url: https://metadata.intern.test.ssb.no
description: Internal test server
- url: http://localhost:8080
description: Local development
security:
- keycloak_token: []
- labid_token: []
tags:
- name: Validity Periods
description: Create and access Validity Periods.
- name: Patches
description: Create and access Patches.
- name: Data Migration
description: Create variable definitions from existing definitions in Vardok.
externalDocs:
description: Vardok website
url: https://www.ssb.no/a/metadata/definisjoner/variabler/main.html
- name: Draft Variable Definitions
description: "Create, update and delete variable definitions with DRAFT status."
paths:
/vardok-migration:
get:
tags:
- Data Migration
summary: Get a list of all vardok and vardef id mappings
description: Get a list of all vardok and vardef id mappings
operationId: listVardokVardefMappings
responses:
"200":
description: OK response
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/VardokVardefIdPairResponse"
examples:
Vardef vardok id list:
value: |-
[
{
"vardok_id": "1607",
"vardef_id": "wypvb3wd"
}
]
security: []
/vardok-migration/{vardef-id}:
get:
tags:
- Data Migration
summary: Get a vardok id by vardef id.
description: Get a vardok id by vardef id.
operationId: getVardokByVardefId
parameters:
- name: vardef-id
in: path
description: The ID of a variable definition which has been migrated.
required: true
schema:
pattern: "^[a-zA-Z0-9-_]{8}$"
type: string
examples:
Vardef id:
value: wypvb3wd
Not found:
value: Xy9_7-Az
responses:
"404":
description: Not found
content:
application/problem+json:
schema:
$ref: https://opensource.zalando.com/restful-api-guidelines/models/problem-1.0.1.yaml#/Problem
examples:
Not found:
value:
type: about:blank
status: 404
detail: Not found
parameters: {}
"200":
description: OK response
content:
application/json:
schema:
$ref: "#/components/schemas/VardokIdResponse"
examples:
Vardef id:
value:
vardok_id: "1607"
security: []
/vardok-migration/{vardok-id}:
get:
tags:
- Data Migration
summary: Get a variable definition by vardok id.
description: Get a variable definition by vardok id.
operationId: getVardefByVardokId
parameters:
- name: vardok-id
in: path
description: The ID of the definition in Vardok.
required: true
schema:
pattern: "\\d{1,5}"
type: string
examples:
Vardok id:
value: "1607"
Not found:
value: "9999"
responses:
"200":
description: OK response
content:
application/json:
schema:
$ref: "#/components/schemas/CompleteView"
examples:
Vardok id:
value:
id: wypvb3wd
patch_id: 1
name:
en: Country Background
nb: Landbakgrunn
nn: Landbakgrunn
short_name: landbak
definition:
en: "Country background is the person's own, the mother's or\
\ possibly the father's country of birth. Persons without\
\ an immigrant background always have Norway as country background.\
\ In cases where the parents have different countries of birth\
\ the mother's country of birth is chosen. If neither the\
\ person nor the parents are born abroad, country background\
\ is chosen from the first person born abroad in the order\
\ mother's mother, mother's father, father's mother, father's\
\ father."
nb: "For personer født i utlandet, er dette (med noen få unntak)\
\ eget fødeland. For personer født i Norge er det foreldrenes\
\ fødeland. I de tilfeller der foreldrene har ulikt fødeland,\
\ er det morens fødeland som blir valgt. Hvis ikke personen\
\ selv eller noen av foreldrene er utenlandsfødt, hentes landbakgrunn\
\ fra de første utenlandsfødte en treffer på i rekkefølgen\
\ mormor, morfar, farmor eller farfar."
nn: "For personar fødd i utlandet, er dette (med nokre få unntak)\
\ eige fødeland. For personar fødd i Noreg er det fødelandet\
\ til foreldra. I dei tilfella der foreldra har ulikt fødeland,\
\ er det fødelandet til mora som blir valt. Viss ikkje personen\
\ sjølv eller nokon av foreldra er utenlandsfødt, blir henta\
\ landsbakgrunn frå dei første utenlandsfødte ein treffar\
\ på i rekkjefølgja mormor, morfar, farmor eller farfar."
classification_reference: "91"
unit_types:
- "01"
- "02"
subject_fields:
- he04
contains_special_categories_of_personal_data: true
variable_status: DRAFT
measurement_type: "01"
valid_from: 2003-01-01
external_reference_uri: https://www.ssb.no/a/metadata/conceptvariable/vardok/1919/nb
comment:
nb: Fra og med 1.1.2003 ble definisjon endret til også å trekke
inn besteforeldrenes fødeland.
nn: Fra og med 1.1.2003 ble definisjon endret til også å trekke
inn besteforeldrenes fødeland.
en: "As of 1 January 2003, the definition was changed to also\
\ include the grandparents' country of birth."
related_variable_definition_uris:
- https://example.com/
owner:
team: team-a
groups:
- team-a-developers
contact:
title:
en: Division for population statistics
nb: Seksjon for befolkningsstatistikk
nn: Seksjon for befolkningsstatistikk
email: s320@ssb.no
created_at: 2024-06-11T08:15:19.038Z
created_by: ano@ssb.no
last_updated_at: 2024-06-11T08:15:19.038Z
last_updated_by: ano@ssb.no
"404":
description: Not found
content:
application/problem+json:
schema:
$ref: https://opensource.zalando.com/restful-api-guidelines/models/problem-1.0.1.yaml#/Problem
examples:
Not found:
value:
type: about:blank
status: 404
detail: Not found
parameters: {}
security: []
post:
tags:
- Data Migration
summary: Create a variable definition from a VarDok variable definition.
description: Create a variable definition from a VarDok variable definition.
operationId: createVariableDefinitionFromVarDok
parameters:
- name: vardok-id
in: path
description: The ID of the definition in Vardok.
required: true
schema:
type: string
examples:
Migrate Vardok:
value: "1607"
responses:
"201":
description: Successfully created.
content:
application/json:
schema:
$ref: "#/components/schemas/CompleteView"
examples:
Migrate Vardok:
value:
id: wypvb3wd
patch_id: 1
name:
en: Country Background
nb: Landbakgrunn
nn: Landbakgrunn
short_name: landbak
definition:
en: "Country background is the person's own, the mother's or\
\ possibly the father's country of birth. Persons without\
\ an immigrant background always have Norway as country background.\
\ In cases where the parents have different countries of birth\
\ the mother's country of birth is chosen. If neither the\
\ person nor the parents are born abroad, country background\
\ is chosen from the first person born abroad in the order\
\ mother's mother, mother's father, father's mother, father's\
\ father."
nb: "For personer født i utlandet, er dette (med noen få unntak)\
\ eget fødeland. For personer født i Norge er det foreldrenes\
\ fødeland. I de tilfeller der foreldrene har ulikt fødeland,\
\ er det morens fødeland som blir valgt. Hvis ikke personen\
\ selv eller noen av foreldrene er utenlandsfødt, hentes landbakgrunn\
\ fra de første utenlandsfødte en treffer på i rekkefølgen\
\ mormor, morfar, farmor eller farfar."
nn: "For personar fødd i utlandet, er dette (med nokre få unntak)\
\ eige fødeland. For personar fødd i Noreg er det fødelandet\
\ til foreldra. I dei tilfella der foreldra har ulikt fødeland,\
\ er det fødelandet til mora som blir valt. Viss ikkje personen\
\ sjølv eller nokon av foreldra er utenlandsfødt, blir henta\
\ landsbakgrunn frå dei første utenlandsfødte ein treffar\
\ på i rekkjefølgja mormor, morfar, farmor eller farfar."
classification_reference: "91"
unit_types:
- "01"
- "02"
subject_fields:
- he04
contains_special_categories_of_personal_data: true
variable_status: DRAFT
measurement_type: "01"
valid_from: 2003-01-01
external_reference_uri: https://www.ssb.no/a/metadata/conceptvariable/vardok/1919/nb
comment:
nb: Fra og med 1.1.2003 ble definisjon endret til også å trekke
inn besteforeldrenes fødeland.
nn: Fra og med 1.1.2003 ble definisjon endret til også å trekke
inn besteforeldrenes fødeland.
en: "As of 1 January 2003, the definition was changed to also\
\ include the grandparents' country of birth."
related_variable_definition_uris:
- https://example.com/
owner:
team: team-a
groups:
- team-a-developers
contact:
title:
en: Division for population statistics
nb: Seksjon for befolkningsstatistikk
nn: Seksjon for befolkningsstatistikk
email: s320@ssb.no
created_at: 2024-06-11T08:15:19.038Z
created_by: ano@ssb.no
last_updated_at: 2024-06-11T08:15:19.038Z
last_updated_by: ano@ssb.no
"400":
description: Bad request.
content:
application/problem+json:
schema:
$ref: https://opensource.zalando.com/restful-api-guidelines/models/problem-1.0.1.yaml#/Problem
examples:
Bad request:
value:
type: about:blank
status: 400
detail: "Failed to convert argument [example] for value [null]\
\ due to: Error deserializing type: example"
Constraint violation:
value:
suppressed: []
parameters: {}
type: https://zalando.github.io/problem/constraint-violation
title: Constraint Violation
status: 400
violations:
- field: classificationReference
message: Code incorrect is not a valid classification id
security:
- labid_token: []
/variable-definitions:
get:
tags:
- Variable Definitions
summary: List all variable definitions.
description: List all variable definitions.
operationId: listVariableDefinitions
parameters:
- name: Accept-Language
in: header
description: Render the variable definition in the given language.
allowEmptyValue: true
schema:
$ref: "#/components/schemas/SupportedLanguages"
examples:
Date not specified:
value: nb
- name: date_of_validity
in: query
description: List only variable definitions which are valid on this date.
explode: false
schema:
type: string
format: date
nullable: true
examples:
Specific date:
value: 1970-01-01
- name: short_name
in: query
description: List only the variable definition with the given short name.
explode: false
schema:
type: string
nullable: true
examples:
Specific short_name:
value: landbak
- name: render
in: query
description: Render the Variable Definition for presentation in a frontend
explode: false
schema:
type: boolean
nullable: true
examples:
Date not specified:
value: "false"
Specific date:
value: "false"
Rendered:
value: "true"
Not found:
value: "false"
responses:
"200":
description: OK response
content:
application/json:
schema:
type: array
items:
oneOf:
- $ref: "#/components/schemas/CompleteView"
- $ref: "#/components/schemas/RenderedView"
examples:
Specific date:
value: |-
[
{
"id": "wypvb3wd",
"patch_id": 1,
"name": {
"en": "Country Background",
"nb": "Landbakgrunn",
"nn": "Landbakgrunn"
},
"short_name": "landbak",
"definition": {
"en": "Country background is the person's own, the mother's or possibly the father's country of birth. Persons without an immigrant background always have Norway as country background. In cases where the parents have different countries of birth the mother's country of birth is chosen. If neither the person nor the parents are born abroad, country background is chosen from the first person born abroad in the order mother's mother, mother's father, father's mother, father's father.",
"nb": "For personer født i utlandet, er dette (med noen få unntak) eget fødeland. For personer født i Norge er det foreldrenes fødeland. I de tilfeller der foreldrene har ulikt fødeland, er det morens fødeland som blir valgt. Hvis ikke personen selv eller noen av foreldrene er utenlandsfødt, hentes landbakgrunn fra de første utenlandsfødte en treffer på i rekkefølgen mormor, morfar, farmor eller farfar.",
"nn": "For personar fødd i utlandet, er dette (med nokre få unntak) eige fødeland. For personar fødd i Noreg er det fødelandet til foreldra. I dei tilfella der foreldra har ulikt fødeland, er det fødelandet til mora som blir valt. Viss ikkje personen sjølv eller nokon av foreldra er utenlandsfødt, blir henta landsbakgrunn frå dei første utenlandsfødte ein treffar på i rekkjefølgja mormor, morfar, farmor eller farfar."
},
"classification_reference": "91",
"unit_types": ["01", "02"],
"subject_fields": ["he04"],
"contains_special_categories_of_personal_data": true,
"variable_status": "DRAFT",
"measurement_type": "01",
"valid_from": "2003-01-01",
"valid_until": null,
"external_reference_uri": "https://www.ssb.no/a/metadata/conceptvariable/vardok/1919/nb",
"comment": {
"nb": "Fra og med 1.1.2003 ble definisjon endret til også å trekke inn besteforeldrenes fødeland.",
"nn": "Fra og med 1.1.2003 ble definisjon endret til også å trekke inn besteforeldrenes fødeland.",
"en": "As of 1 January 2003, the definition was changed to also include the grandparents' country of birth."
},
"related_variable_definition_uris": [
"https://example.com/"
],
"owner": {
"team": "team-a",
"groups": ["team-a-developers"]
},
"contact": {
"title": {
"en": "Division for population statistics",
"nb": "Seksjon for befolkningsstatistikk",
"nn": "Seksjon for befolkningsstatistikk"
},
"email": "s320@ssb.no"
},
"created_at": "2024-06-11T08:15:19.038Z",
"created_by": "ano@ssb.no",
"last_updated_at": "2024-06-11T08:15:19.038Z",
"last_updated_by": "ano@ssb.no"
}
]
Specific short_name:
value: |-
[
{
"id": "wypvb3wd",
"patch_id": 1,
"name": {
"en": "Country Background",
"nb": "Landbakgrunn",
"nn": "Landbakgrunn"
},
"short_name": "landbak",
"definition": {
"en": "Country background is the person's own, the mother's or possibly the father's country of birth. Persons without an immigrant background always have Norway as country background. In cases where the parents have different countries of birth the mother's country of birth is chosen. If neither the person nor the parents are born abroad, country background is chosen from the first person born abroad in the order mother's mother, mother's father, father's mother, father's father.",
"nb": "For personer født i utlandet, er dette (med noen få unntak) eget fødeland. For personer født i Norge er det foreldrenes fødeland. I de tilfeller der foreldrene har ulikt fødeland, er det morens fødeland som blir valgt. Hvis ikke personen selv eller noen av foreldrene er utenlandsfødt, hentes landbakgrunn fra de første utenlandsfødte en treffer på i rekkefølgen mormor, morfar, farmor eller farfar.",
"nn": "For personar fødd i utlandet, er dette (med nokre få unntak) eige fødeland. For personar fødd i Noreg er det fødelandet til foreldra. I dei tilfella der foreldra har ulikt fødeland, er det fødelandet til mora som blir valt. Viss ikkje personen sjølv eller nokon av foreldra er utenlandsfødt, blir henta landsbakgrunn frå dei første utenlandsfødte ein treffar på i rekkjefølgja mormor, morfar, farmor eller farfar."
},
"classification_reference": "91",
"unit_types": ["01", "02"],
"subject_fields": ["he04"],
"contains_special_categories_of_personal_data": true,
"variable_status": "DRAFT",
"measurement_type": "01",
"valid_from": "2003-01-01",
"valid_until": null,
"external_reference_uri": "https://www.ssb.no/a/metadata/conceptvariable/vardok/1919/nb",
"comment": {
"nb": "Fra og med 1.1.2003 ble definisjon endret til også å trekke inn besteforeldrenes fødeland.",
"nn": "Fra og med 1.1.2003 ble definisjon endret til også å trekke inn besteforeldrenes fødeland.",
"en": "As of 1 January 2003, the definition was changed to also include the grandparents' country of birth."
},
"related_variable_definition_uris": [
"https://example.com/"
],
"owner": {
"team": "team-a",
"groups": ["team-a-developers"]
},
"contact": {
"title": {
"en": "Division for population statistics",
"nb": "Seksjon for befolkningsstatistikk",
"nn": "Seksjon for befolkningsstatistikk"
},
"email": "s320@ssb.no"
},
"created_at": "2024-06-11T08:15:19.038Z",
"created_by": "ano@ssb.no",
"last_updated_at": "2024-06-11T08:15:19.038Z",
"last_updated_by": "ano@ssb.no"
}
]
Date not specified:
value: "[]"
Rendered:
value: |-
[
{
"id": "wypvb3wd",
"patch_id": 1,
"name": "Landbakgrunn",
"short_name": "landbak",
"definition": "For personer født i utlandet, er dette (med noen få unntak) eget fødeland. For personer født i Norge er det foreldrenes fødeland. I de tilfeller der foreldrene har ulikt fødeland, er det morens fødeland som blir valgt. Hvis ikke personen selv eller noen av foreldrene er utenlandsfødt, hentes landbakgrunn fra de første utenlandsfødte en treffer på i rekkefølgen mormor, morfar, farmor eller farfar.",
"classification_uri": "https://dataportal.ssb.no/classifications/91",
"unit_types": [{
"reference_uri": "https://dataportal.ssb.no/classifications/702",
"code": "20",
"title": "Person"
}
],
"subject_fields": [
{
"reference_uri": "https://dataportal.ssb.no/classifications/618",
"code": "be07",
"title": "Innvandrere"
}
],
"contains_special_categories_of_personal_data": true,
"variable_status": "PUBLISHED_EXTERNAL",
"measurement_type": {
"reference_uri": "https://dataportal.ssb.no/classifications/303",
"code": "01",
"title": "Andel"
},
"valid_from": "2003-01-01",
"valid_until": null,
"external_reference_uri": "https://www.ssb.no/a/metadata/conceptvariable/vardok/1919/nb",
"comment": "Fra og med 1.1.2003 ble definisjon endret til også å trekke inn besteforeldrenes fødeland.",
"related_variable_definition_uris": [
"https://example.com/"
],
"owner": {
"team": "team-a",
"groups": ["team-a-developers"]
},
"contact": {
"title": "Seksjon for befolkningsstatistikk",
"email": "s320@ssb.no"
},
"created_at": "2024-06-11T08:15:19.038Z",
"created_by": "ano@ssb.no",
"last_updated_at": "2024-06-11T08:15:19.038Z",
"last_updated_by": "ano@ssb.no"
}
]
security: []
post:
tags:
- Draft Variable Definitions
summary: Create a variable definition.
description: Create a variable definition. New variable definitions are automatically
assigned status DRAFT and must include all required fields. Attempts to specify
id or variable_status in a request will receive 400 BAD REQUEST responses.
operationId: createVariableDefinition
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/CreateDraft"
examples:
Create Draft:
value:
name:
en: Country Background
nb: Landbakgrunn
nn: Landbakgrunn
short_name: landbak
definition:
en: "Country background is the person's own, the mother's or possibly\
\ the father's country of birth. Persons without an immigrant\
\ background always have Norway as country background. In cases\
\ where the parents have different countries of birth the mother's\
\ country of birth is chosen. If neither the person nor the\
\ parents are born abroad, country background is chosen from\
\ the first person born abroad in the order mother's mother,\
\ mother's father, father's mother, father's father."
nb: "For personer født i utlandet, er dette (med noen få unntak)\
\ eget fødeland. For personer født i Norge er det foreldrenes\
\ fødeland. I de tilfeller der foreldrene har ulikt fødeland,\
\ er det morens fødeland som blir valgt. Hvis ikke personen\
\ selv eller noen av foreldrene er utenlandsfødt, hentes landbakgrunn\
\ fra de første utenlandsfødte en treffer på i rekkefølgen mormor,\
\ morfar, farmor eller farfar."
nn: "For personar fødd i utlandet, er dette (med nokre få unntak)\
\ eige fødeland. For personar fødd i Noreg er det fødelandet\
\ til foreldra. I dei tilfella der foreldra har ulikt fødeland,\
\ er det fødelandet til mora som blir valt. Viss ikkje personen\
\ sjølv eller nokon av foreldra er utenlandsfødt, blir henta\
\ landsbakgrunn frå dei første utenlandsfødte ein treffar på\
\ i rekkjefølgja mormor, morfar, farmor eller farfar."
classification_reference: "91"
unit_types:
- "01"
- "02"
subject_fields:
- he04
contains_special_categories_of_personal_data: true
measurement_type: "01"
valid_from: 2003-01-01
external_reference_uri: https://www.ssb.no/a/metadata/conceptvariable/vardok/1919/nb
comment:
nb: Fra og med 1.1.2003 ble definisjon endret til også å trekke
inn besteforeldrenes fødeland.
nn: Fra og med 1.1.2003 ble definisjon endret til også å trekke
inn besteforeldrenes fødeland.
en: "As of 1 January 2003, the definition was changed to also\
\ include the grandparents' country of birth."
related_variable_definition_uris:
- https://example.com/
contact:
title:
en: Division for population statistics
nb: Seksjon for befolkningsstatistikk
nn: Seksjon for befolkningsstatistikk
email: s320@ssb.no
responses:
"201":
description: Successfully created.
content:
application/json:
schema:
$ref: "#/components/schemas/CompleteView"
examples:
Create Draft:
value:
id: wypvb3wd
patch_id: 1
name:
en: Country Background
nb: Landbakgrunn
nn: Landbakgrunn
short_name: landbak
definition:
en: "Country background is the person's own, the mother's or\
\ possibly the father's country of birth. Persons without\
\ an immigrant background always have Norway as country background.\
\ In cases where the parents have different countries of birth\
\ the mother's country of birth is chosen. If neither the\
\ person nor the parents are born abroad, country background\
\ is chosen from the first person born abroad in the order\
\ mother's mother, mother's father, father's mother, father's\
\ father."
nb: "For personer født i utlandet, er dette (med noen få unntak)\
\ eget fødeland. For personer født i Norge er det foreldrenes\
\ fødeland. I de tilfeller der foreldrene har ulikt fødeland,\
\ er det morens fødeland som blir valgt. Hvis ikke personen\
\ selv eller noen av foreldrene er utenlandsfødt, hentes landbakgrunn\
\ fra de første utenlandsfødte en treffer på i rekkefølgen\
\ mormor, morfar, farmor eller farfar."
nn: "For personar fødd i utlandet, er dette (med nokre få unntak)\
\ eige fødeland. For personar fødd i Noreg er det fødelandet\
\ til foreldra. I dei tilfella der foreldra har ulikt fødeland,\
\ er det fødelandet til mora som blir valt. Viss ikkje personen\
\ sjølv eller nokon av foreldra er utenlandsfødt, blir henta\
\ landsbakgrunn frå dei første utenlandsfødte ein treffar\
\ på i rekkjefølgja mormor, morfar, farmor eller farfar."
classification_reference: "91"
unit_types:
- "01"
- "02"
subject_fields:
- he04
contains_special_categories_of_personal_data: true
variable_status: DRAFT
measurement_type: "01"
valid_from: 2003-01-01
external_reference_uri: https://www.ssb.no/a/metadata/conceptvariable/vardok/1919/nb
comment:
nb: Fra og med 1.1.2003 ble definisjon endret til også å trekke
inn besteforeldrenes fødeland.
nn: Fra og med 1.1.2003 ble definisjon endret til også å trekke
inn besteforeldrenes fødeland.
en: "As of 1 January 2003, the definition was changed to also\
\ include the grandparents' country of birth."
related_variable_definition_uris:
- https://example.com/
owner:
team: team-a
groups:
- team-a-developers
contact:
title:
en: Division for population statistics
nb: Seksjon for befolkningsstatistikk
nn: Seksjon for befolkningsstatistikk
email: s320@ssb.no
created_at: 2024-06-11T08:15:19.038Z
created_by: ano@ssb.no
last_updated_at: 2024-06-11T08:15:19.038Z
last_updated_by: ano@ssb.no
"400":
description: Bad request.
content:
application/problem+json:
schema:
$ref: https://opensource.zalando.com/restful-api-guidelines/models/problem-1.0.1.yaml#/Problem
examples:
Bad request:
value:
type: about:blank
status: 400
detail: "Failed to convert argument [example] for value [null]\
\ due to: Error deserializing type: example"
Constraint violation:
value:
suppressed: []
parameters: {}
type: https://zalando.github.io/problem/constraint-violation
title: Constraint Violation
status: 400
violations:
- field: classificationReference
message: Code incorrect is not a valid classification id
"409":
description: Short name is already in use by another variable definition.
content:
application/problem+json:
schema:
$ref: https://opensource.zalando.com/restful-api-guidelines/models/problem-1.0.1.yaml#/Problem
examples:
Conflict:
value:
type: about:blank
status: 409
detail: Short name is already in use by another variable definition.
security:
- labid_token: []
/variable-definitions/{variable-definition-id}:
get:
tags:
- Variable Definitions
summary: Get one variable definition.
description: Get one variable definition.
operationId: getVariableDefinitionById
parameters:
- name: Accept-Language
in: header
description: Render the variable definition in the given language.
allowEmptyValue: true
schema:
$ref: "#/components/schemas/SupportedLanguages"
examples:
Date not specified:
value: nb
- name: variable-definition-id
in: path
description: Unique identifier for the variable definition.
required: true
schema:
type: string
examples:
Date not specified:
value: wypvb3wd
Specific date:
value: wypvb3wd
Rendered:
value: wypvb3wd
Not found:
value: invalid id
- name: date_of_validity
in: query
description: List only variable definitions which are valid on this date.
explode: false
schema:
type: string
format: date
nullable: true
examples:
Specific date:
value: 1970-01-01
- name: render
in: query
description: Render the Variable Definition for presentation in a frontend
explode: false
schema:
type: boolean
nullable: true
examples:
Date not specified:
value: "false"
Specific date:
value: "false"
Rendered:
value: "true"
Not found:
value: "false"
responses:
"200":
description: Ok
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/CompleteView"
- $ref: "#/components/schemas/RenderedView"
examples:
Date not specified:
value:
id: wypvb3wd
patch_id: 1
name:
en: Country Background
nb: Landbakgrunn
nn: Landbakgrunn
short_name: landbak
definition:
en: "Country background is the person's own, the mother's or\
\ possibly the father's country of birth. Persons without\
\ an immigrant background always have Norway as country background.\
\ In cases where the parents have different countries of birth\
\ the mother's country of birth is chosen. If neither the\
\ person nor the parents are born abroad, country background\
\ is chosen from the first person born abroad in the order\
\ mother's mother, mother's father, father's mother, father's\
\ father."
nb: "For personer født i utlandet, er dette (med noen få unntak)\
\ eget fødeland. For personer født i Norge er det foreldrenes\
\ fødeland. I de tilfeller der foreldrene har ulikt fødeland,\
\ er det morens fødeland som blir valgt. Hvis ikke personen\
\ selv eller noen av foreldrene er utenlandsfødt, hentes landbakgrunn\
\ fra de første utenlandsfødte en treffer på i rekkefølgen\
\ mormor, morfar, farmor eller farfar."
nn: "For personar fødd i utlandet, er dette (med nokre få unntak)\
\ eige fødeland. For personar fødd i Noreg er det fødelandet\
\ til foreldra. I dei tilfella der foreldra har ulikt fødeland,\
\ er det fødelandet til mora som blir valt. Viss ikkje personen\
\ sjølv eller nokon av foreldra er utenlandsfødt, blir henta\
\ landsbakgrunn frå dei første utenlandsfødte ein treffar\
\ på i rekkjefølgja mormor, morfar, farmor eller farfar."
classification_reference: "91"
unit_types:
- "01"
- "02"
subject_fields:
- he04
contains_special_categories_of_personal_data: true
variable_status: DRAFT
measurement_type: "01"
valid_from: 2003-01-01
external_reference_uri: https://www.ssb.no/a/metadata/conceptvariable/vardok/1919/nb
comment:
nb: Fra og med 1.1.2003 ble definisjon endret til også å trekke
inn besteforeldrenes fødeland.
nn: Fra og med 1.1.2003 ble definisjon endret til også å trekke
inn besteforeldrenes fødeland.
en: "As of 1 January 2003, the definition was changed to also\
\ include the grandparents' country of birth."
related_variable_definition_uris:
- https://example.com/
owner:
team: team-a
groups:
- team-a-developers
contact:
title:
en: Division for population statistics
nb: Seksjon for befolkningsstatistikk
nn: Seksjon for befolkningsstatistikk
email: s320@ssb.no
created_at: 2024-06-11T08:15:19.038Z
created_by: ano@ssb.no
last_updated_at: 2024-06-11T08:15:19.038Z
last_updated_by: ano@ssb.no
Specific date:
value:
id: wypvb3wd
patch_id: 1
name:
en: Country Background
nb: Landbakgrunn
nn: Landbakgrunn
short_name: landbak
definition:
en: "Country background is the person's own, the mother's or\
\ possibly the father's country of birth. Persons without\
\ an immigrant background always have Norway as country background.\
\ In cases where the parents have different countries of birth\
\ the mother's country of birth is chosen. If neither the\
\ person nor the parents are born abroad, country background\
\ is chosen from the first person born abroad in the order\
\ mother's mother, mother's father, father's mother, father's\
\ father."
nb: "For personer født i utlandet, er dette (med noen få unntak)\
\ eget fødeland. For personer født i Norge er det foreldrenes\
\ fødeland. I de tilfeller der foreldrene har ulikt fødeland,\
\ er det morens fødeland som blir valgt. Hvis ikke personen\
\ selv eller noen av foreldrene er utenlandsfødt, hentes landbakgrunn\
\ fra de første utenlandsfødte en treffer på i rekkefølgen\
\ mormor, morfar, farmor eller farfar."
nn: "For personar fødd i utlandet, er dette (med nokre få unntak)\
\ eige fødeland. For personar fødd i Noreg er det fødelandet\
\ til foreldra. I dei tilfella der foreldra har ulikt fødeland,\
\ er det fødelandet til mora som blir valt. Viss ikkje personen\
\ sjølv eller nokon av foreldra er utenlandsfødt, blir henta\
\ landsbakgrunn frå dei første utenlandsfødte ein treffar\
\ på i rekkjefølgja mormor, morfar, farmor eller farfar."
classification_reference: "91"
unit_types:
- "01"
- "02"
subject_fields:
- he04
contains_special_categories_of_personal_data: true
variable_status: DRAFT
measurement_type: "01"
valid_from: 2003-01-01
external_reference_uri: https://www.ssb.no/a/metadata/conceptvariable/vardok/1919/nb
comment:
nb: Fra og med 1.1.2003 ble definisjon endret til også å trekke
inn besteforeldrenes fødeland.
nn: Fra og med 1.1.2003 ble definisjon endret til også å trekke
inn besteforeldrenes fødeland.
en: "As of 1 January 2003, the definition was changed to also\
\ include the grandparents' country of birth."
related_variable_definition_uris:
- https://example.com/
owner:
team: team-a
groups:
- team-a-developers
contact:
title:
en: Division for population statistics
nb: Seksjon for befolkningsstatistikk
nn: Seksjon for befolkningsstatistikk
email: s320@ssb.no
created_at: 2024-06-11T08:15:19.038Z
created_by: ano@ssb.no
last_updated_at: 2024-06-11T08:15:19.038Z
last_updated_by: ano@ssb.no
Rendered:
value:
id: wypvb3wd
patch_id: 1
name: Landbakgrunn
short_name: landbak
definition: "For personer født i utlandet, er dette (med noen\
\ få unntak) eget fødeland. For personer født i Norge er det\
\ foreldrenes fødeland. I de tilfeller der foreldrene har ulikt\
\ fødeland, er det morens fødeland som blir valgt. Hvis ikke\
\ personen selv eller noen av foreldrene er utenlandsfødt, hentes\
\ landbakgrunn fra de første utenlandsfødte en treffer på i\
\ rekkefølgen mormor, morfar, farmor eller farfar."
classification_uri: https://dataportal.ssb.no/classifications/91
unit_types:
- reference_uri: https://dataportal.ssb.no/classifications/702
code: "20"
title: Person
subject_fields:
- reference_uri: https://dataportal.ssb.no/classifications/618
code: be07
title: Innvandrere
contains_special_categories_of_personal_data: true
variable_status: PUBLISHED_EXTERNAL
measurement_type:
reference_uri: https://dataportal.ssb.no/classifications/303
code: "01"
title: Andel
valid_from: 2003-01-01
external_reference_uri: https://www.ssb.no/a/metadata/conceptvariable/vardok/1919/nb
comment: Fra og med 1.1.2003 ble definisjon endret til også å
trekke inn besteforeldrenes fødeland.
related_variable_definition_uris:
- https://example.com/
owner:
team: team-a
groups:
- team-a-developers
contact:
title: Seksjon for befolkningsstatistikk
email: s320@ssb.no
created_at: 2024-06-11T08:15:19.038Z
created_by: ano@ssb.no
last_updated_at: 2024-06-11T08:15:19.038Z
last_updated_by: ano@ssb.no
"404":
description: Not found
content:
application/problem+json:
schema:
$ref: https://opensource.zalando.com/restful-api-guidelines/models/problem-1.0.1.yaml#/Problem
examples:
Not found:
value:
type: about:blank
status: 404
detail: Not found
parameters: {}
security: []
delete:
tags:
- Draft Variable Definitions
summary: Delete a variable definition.
description: Delete a variable definition.
operationId: deleteVariableDefinitionById
parameters:
- name: variable-definition-id
in: path
description: Unique identifier for the variable definition.
required: true
schema:
type: string
examples:
Delete:
value: wypvb3wd
Not found:
value: invalid id
responses:
"204":
description: Successfully deleted
content:
application/json:
examples:
Delete:
value: ""
"404":
description: Not found
content:
application/problem+json:
schema:
$ref: https://opensource.zalando.com/restful-api-guidelines/models/problem-1.0.1.yaml#/Problem
examples:
Not found:
value:
type: about:blank
status: 404
detail: Not found
parameters: {}
"405":
description: Not allowed for variable definitions with this status.
content:
application/problem+json:
schema:
$ref: https://opensource.zalando.com/restful-api-guidelines/models/problem-1.0.1.yaml#/Problem
examples:
Method not allowed:
value:
type: about:blank
status: 405
detail: Not allowed for variable definitions with this status.
patch:
tags:
- Draft Variable Definitions
summary: Update a variable definition.
description: Update a variable definition. Only the fields which need updating
should be supplied. Fields supplied with explicit null values will be deleted
unless the field is required.
operationId: updateVariableDefinitionById
parameters:
- name: variable-definition-id
in: path
description: Unique identifier for the variable definition.
required: true
schema:
type: string
examples:
Update:
value: wypvb3wd
Delete field:
value: wypvb3wd
Not found:
value: invalid id
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/UpdateDraft"
examples:
Update:
value:
classification_reference: 702
Delete field:
value:
classification_reference: "null"
Constraint violation:
value:
classification_reference: incorrect
responses:
"200":
description: Successfully updated
content:
application/json:
schema:
$ref: "#/components/schemas/CompleteView"
examples:
Update:
value:
id: wypvb3wd
patch_id: 1
name:
en: Country Background
nb: Landbakgrunn
nn: Landbakgrunn
short_name: landbak
definition:
en: "Country background is the person's own, the mother's or\
\ possibly the father's country of birth. Persons without\
\ an immigrant background always have Norway as country background.\
\ In cases where the parents have different countries of birth\
\ the mother's country of birth is chosen. If neither the\
\ person nor the parents are born abroad, country background\
\ is chosen from the first person born abroad in the order\
\ mother's mother, mother's father, father's mother, father's\
\ father."
nb: "For personer født i utlandet, er dette (med noen få unntak)\
\ eget fødeland. For personer født i Norge er det foreldrenes\
\ fødeland. I de tilfeller der foreldrene har ulikt fødeland,\
\ er det morens fødeland som blir valgt. Hvis ikke personen\
\ selv eller noen av foreldrene er utenlandsfødt, hentes landbakgrunn\
\ fra de første utenlandsfødte en treffer på i rekkefølgen\
\ mormor, morfar, farmor eller farfar."
nn: "For personar fødd i utlandet, er dette (med nokre få unntak)\
\ eige fødeland. For personar fødd i Noreg er det fødelandet\
\ til foreldra. I dei tilfella der foreldra har ulikt fødeland,\
\ er det fødelandet til mora som blir valt. Viss ikkje personen\
\ sjølv eller nokon av foreldra er utenlandsfødt, blir henta\
\ landsbakgrunn frå dei første utenlandsfødte ein treffar\
\ på i rekkjefølgja mormor, morfar, farmor eller farfar."
classification_reference: "91"
unit_types:
- "01"
- "02"
subject_fields:
- he04
contains_special_categories_of_personal_data: true
variable_status: DRAFT
measurement_type: "01"
valid_from: 2003-01-01
external_reference_uri: https://www.ssb.no/a/metadata/conceptvariable/vardok/1919/nb
comment:
nb: Fra og med 1.1.2003 ble definisjon endret til også å trekke
inn besteforeldrenes fødeland.
nn: Fra og med 1.1.2003 ble definisjon endret til også å trekke
inn besteforeldrenes fødeland.
en: "As of 1 January 2003, the definition was changed to also\
\ include the grandparents' country of birth."
related_variable_definition_uris:
- https://example.com/
owner:
team: team-a
groups:
- team-a-developers
contact:
title:
en: Division for population statistics
nb: Seksjon for befolkningsstatistikk
nn: Seksjon for befolkningsstatistikk
email: s320@ssb.no
created_at: 2024-06-11T08:15:19.038Z
created_by: ano@ssb.no
last_updated_at: 2024-06-11T08:15:19.038Z
last_updated_by: ano@ssb.no
Delete field:
value:
id: wypvb3wd
patch_id: 1
name:
en: Country Background
nb: Landbakgrunn
nn: Landbakgrunn
short_name: landbak
definition:
en: "Country background is the person's own, the mother's or\
\ possibly the father's country of birth. Persons without\
\ an immigrant background always have Norway as country background.\
\ In cases where the parents have different countries of birth\
\ the mother's country of birth is chosen. If neither the\
\ person nor the parents are born abroad, country background\
\ is chosen from the first person born abroad in the order\
\ mother's mother, mother's father, father's mother, father's\
\ father."
nb: "For personer født i utlandet, er dette (med noen få unntak)\
\ eget fødeland. For personer født i Norge er det foreldrenes\
\ fødeland. I de tilfeller der foreldrene har ulikt fødeland,\
\ er det morens fødeland som blir valgt. Hvis ikke personen\
\ selv eller noen av foreldrene er utenlandsfødt, hentes landbakgrunn\
\ fra de første utenlandsfødte en treffer på i rekkefølgen\
\ mormor, morfar, farmor eller farfar."
nn: "For personar fødd i utlandet, er dette (med nokre få unntak)\
\ eige fødeland. For personar fødd i Noreg er det fødelandet\
\ til foreldra. I dei tilfella der foreldra har ulikt fødeland,\
\ er det fødelandet til mora som blir valt. Viss ikkje personen\
\ sjølv eller nokon av foreldra er utenlandsfødt, blir henta\
\ landsbakgrunn frå dei første utenlandsfødte ein treffar\
\ på i rekkjefølgja mormor, morfar, farmor eller farfar."
unit_types:
- "01"
- "02"
subject_fields:
- he04
contains_special_categories_of_personal_data: true
variable_status: DRAFT
measurement_type: "01"
valid_from: 2003-01-01
external_reference_uri: https://www.ssb.no/a/metadata/conceptvariable/vardok/1919/nb
comment:
nb: Fra og med 1.1.2003 ble definisjon endret til også å trekke
inn besteforeldrenes fødeland.
nn: Fra og med 1.1.2003 ble definisjon endret til også å trekke
inn besteforeldrenes fødeland.
en: "As of 1 January 2003, the definition was changed to also\
\ include the grandparents' country of birth."
related_variable_definition_uris:
- https://example.com/
owner:
team: team-a
groups:
- team-a-developers
contact:
title:
en: Division for population statistics
nb: Seksjon for befolkningsstatistikk
nn: Seksjon for befolkningsstatistikk
email: s320@ssb.no
created_at: 2024-06-11T08:15:19.038Z
created_by: ano@ssb.no
last_updated_at: 2024-06-11T08:15:19.038Z
last_updated_by: ano@ssb.no
"400":
description: Bad request.
content:
application/problem+json:
schema:
$ref: https://opensource.zalando.com/restful-api-guidelines/models/problem-1.0.1.yaml#/Problem
examples:
Bad request:
value:
type: about:blank
status: 400
detail: "Failed to convert argument [example] for value [null]\
\ due to: Error deserializing type: example"
Constraint violation:
value:
suppressed: []
parameters: {}
type: https://zalando.github.io/problem/constraint-violation
title: Constraint Violation
status: 400
violations:
- field: classificationReference
message: Code incorrect is not a valid classification id
"404":
description: Not found
content:
application/problem+json:
schema:
$ref: https://opensource.zalando.com/restful-api-guidelines/models/problem-1.0.1.yaml#/Problem
examples:
Not found:
value:
type: about:blank
status: 404
detail: Not found
parameters: {}
"405":
description: Not allowed for variable definitions with this status.
content:
application/problem+json:
schema:
$ref: https://opensource.zalando.com/restful-api-guidelines/models/problem-1.0.1.yaml#/Problem
examples:
Method not allowed:
value:
type: about:blank
status: 405
detail: Not allowed for variable definitions with this status.
"409":
description: Short name is already in use by another variable definition.
content:
application/problem+json:
schema:
$ref: https://opensource.zalando.com/restful-api-guidelines/models/problem-1.0.1.yaml#/Problem
examples:
Conflict:
value:
type: about:blank
status: 409
detail: Short name is already in use by another variable definition.
/variable-definitions/{variable-definition-id}/patches:
get:
tags:
- Patches
summary: List all patches for the given variable definition.
description: List all patches for the given variable definition. The full object
is returned for comparison purposes.
operationId: listPatches
parameters:
- name: variable-definition-id
in: path
description: Unique identifier for the variable definition.
required: true
schema:
type: string
examples:
Patches:
value: wypvb3wd
Not found:
value: invalid id
responses:
"200":
description: Ok
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/CompleteView"
examples:
Patches:
value: |-
[
{
"id": "wypvb3wd",
"patch_id": 1,
"name": {
"en": "Country Background",
"nb": "Landbakgrunn",
"nn": "Landbakgrunn"
},
"short_name": "landbak",
"definition": {
"en": "Country background is the person's own, the mother's or possibly the father's country of birth. Persons without an immigrant background always have Norway as country background. In cases where the parents have different countries of birth the mother's country of birth is chosen. If neither the person nor the parents are born abroad, country background is chosen from the first person born abroad in the order mother's mother, mother's father, father's mother, father's father.",
"nb": "For personer født i utlandet, er dette (med noen få unntak) eget fødeland. For personer født i Norge er det foreldrenes fødeland. I de tilfeller der foreldrene har ulikt fødeland, er det morens fødeland som blir valgt. Hvis ikke personen selv eller noen av foreldrene er utenlandsfødt, hentes landbakgrunn fra de første utenlandsfødte en treffer på i rekkefølgen mormor, morfar, farmor eller farfar.",
"nn": "For personar fødd i utlandet, er dette (med nokre få unntak) eige fødeland. For personar fødd i Noreg er det fødelandet til foreldra. I dei tilfella der foreldra har ulikt fødeland, er det fødelandet til mora som blir valt. Viss ikkje personen sjølv eller nokon av foreldra er utenlandsfødt, blir henta landsbakgrunn frå dei første utenlandsfødte ein treffar på i rekkjefølgja mormor, morfar, farmor eller farfar."
},
"classification_reference": "91",
"unit_types": ["01", "02"],
"subject_fields": ["he04"],
"contains_special_categories_of_personal_data": true,
"variable_status": "DRAFT",
"measurement_type": "01",
"valid_from": "2003-01-01",
"valid_until": null,
"external_reference_uri": "https://www.ssb.no/a/metadata/conceptvariable/vardok/1919/nb",
"comment": {
"nb": "Fra og med 1.1.2003 ble definisjon endret til også å trekke inn besteforeldrenes fødeland.",
"nn": "Fra og med 1.1.2003 ble definisjon endret til også å trekke inn besteforeldrenes fødeland.",
"en": "As of 1 January 2003, the definition was changed to also include the grandparents' country of birth."
},
"related_variable_definition_uris": [
"https://example.com/"
],
"owner": {
"team": "team-a",
"groups": ["team-a-developers"]
},
"contact": {
"title": {
"en": "Division for population statistics",
"nb": "Seksjon for befolkningsstatistikk",
"nn": "Seksjon for befolkningsstatistikk"
},
"email": "s320@ssb.no"
},
"created_at": "2024-06-11T08:15:19.038Z",
"created_by": "ano@ssb.no",
"last_updated_at": "2024-06-11T08:15:19.038Z",
"last_updated_by": "ano@ssb.no"
}
]
"404":
description: Not found
content:
application/problem+json:
schema:
$ref: https://opensource.zalando.com/restful-api-guidelines/models/problem-1.0.1.yaml#/Problem
examples:
Not found:
value:
type: about:blank
status: 404
detail: Not found
parameters: {}
security: []
post:
tags:
- Patches
summary: Create a new patch for a variable definition.
description: Create a new patch for a variable definition.
operationId: createPatch
parameters:
- name: variable-definition-id
in: path
description: Unique identifier for the variable definition.
required: true
schema:
type: string
examples:
Create patch:
value: wypvb3wd
Not found:
value: invalid id
- name: valid_from
in: query
description: Valid from date for the specific validity period to be patched.
schema:
type: string
format: date
nullable: true
examples:
Create patch:
value: 1970-01-01
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/CreatePatch"
examples:
Create patch:
value:
name:
en: Country Background
nb: Landbakgrunnen
nn: Landbakgrunnen
definition:
en: "Country background is the person's own, the mother's or possibly\
\ the father's country of birth. Persons without an immigrant\
\ background always have Norway as country background. In cases\
\ where the parents have different countries of birth the mother's\
\ country of birth is chosen. If neither the person nor the\
\ parents are born abroad, country background is chosen from\
\ the first person born abroad in the order mother's mother,\
\ mother's father, father's mother, father's father."
nb: "For personer født i utlandet, er dette (med noen få unntak)\
\ eget fødeland. For personer født i Norge er det foreldrenes\
\ fødeland. I de tilfeller der foreldrene har ulikt fødeland,\
\ er det morens fødeland som blir valgt. Hvis ikke personen\
\ selv eller noen av foreldrene er utenlandsfødt, hentes landbakgrunn\
\ fra de første utenlandsfødte en treffer på i rekkefølgen mormor,\
\ morfar, farmor eller farfar."
nn: "For personar fødd i utlandet, er dette (med nokre få unntak)\
\ eige fødeland. For personar fødd i Noreg er det fødelandet\
\ til foreldra. I dei tilfella der foreldra har ulikt fødeland,\
\ er det fødelandet til mora som blir valt. Viss ikkje personen\
\ sjølv eller nokon av foreldra er utenlandsfødt, blir henta\
\ landsbakgrunn frå dei første utenlandsfødte ein treffar på\
\ i rekkjefølgja mormor, morfar, farmor eller farfar."
classification_reference: "91"
unit_types:
- "01"
- "05"
subject_fields:
- he04
contains_special_categories_of_personal_data: false
measurement_type: "01"
valid_until: 2026-01-01
external_reference_uri: https://www.ssb.no/a/metadata/conceptvariable/vardok/1919/nb
comment:
en: Changes in unit types
nb: Endring i enhetstyper.
nn: Endring i enhetstyper.
related_variable_definition_uris:
- https://example.com/
contact:
title:
en: Division for population statistics
nb: Seksjon for befolkningsstatistikk
nn: Seksjon for befolkningsstatistikk
email: s320@ssb.no
responses:
"201":
description: Successfully created.
content:
application/json:
schema:
$ref: "#/components/schemas/CompleteView"
examples:
Create patch:
value:
id: wypvb3wd
patch_id: 2
name:
en: Country Background
nb: Landbakgrunn
nn: Landbakgrunn
short_name: landbak
definition:
en: "Country background is the person's own, the mother's or\
\ possibly the father's country of birth. Persons without\
\ an immigrant background always have Norway as country background.\
\ In cases where the parents have different countries of birth\
\ the mother's country of birth is chosen. If neither the\
\ person nor the parents are born abroad, country background\
\ is chosen from the first person born abroad in the order\
\ mother's mother, mother's father, father's mother, father's\
\ father."
nb: "For personer født i utlandet, er dette (med noen få unntak)\
\ eget fødeland. For personer født i Norge er det foreldrenes\
\ fødeland. I de tilfeller der foreldrene har ulikt fødeland,\
\ er det morens fødeland som blir valgt. Hvis ikke personen\
\ selv eller noen av foreldrene er utenlandsfødt, hentes landbakgrunn\
\ fra de første utenlandsfødte en treffer på i rekkefølgen\
\ mormor, morfar, farmor eller farfar."
nn: "For personar fødd i utlandet, er dette (med nokre få unntak)\
\ eige fødeland. For personar fødd i Noreg er det fødelandet\
\ til foreldra. I dei tilfella der foreldra har ulikt fødeland,\
\ er det fødelandet til mora som blir valt. Viss ikkje personen\
\ sjølv eller nokon av foreldra er utenlandsfødt, blir henta\
\ landsbakgrunn frå dei første utenlandsfødte ein treffar\
\ på i rekkjefølgja mormor, morfar, farmor eller farfar."
classification_reference: "91"
unit_types:
- "01"
- "02"
subject_fields:
- he04
contains_special_categories_of_personal_data: true
variable_status: PUBLISHED_INTERNAL
measurement_type: "01"
valid_from: 2003-01-01
external_reference_uri: https://www.ssb.no/a/metadata/conceptvariable/vardok/1919/nb
comment:
nb: Fra og med 1.1.2003 ble definisjon endret til også å trekke
inn besteforeldrenes fødeland.
nn: Fra og med 1.1.2003 ble definisjon endret til også å trekke
inn besteforeldrenes fødeland.
en: "As of 1 January 2003, the definition was changed to also\
\ include the grandparents' country of birth."
related_variable_definition_uris:
- https://example.com/
owner:
team: team-a
groups:
- team-a-developers
contact:
title:
en: Division for population statistics
nb: Seksjon for befolkningsstatistikk
nn: Seksjon for befolkningsstatistikk
email: s320@ssb.no
created_at: 2024-06-11T08:15:19.038Z
created_by: ano@ssb.no
last_updated_at: 2024-06-11T08:15:19.038Z
last_updated_by: ano@ssb.no
"404":
description: Not found
content:
application/problem+json:
schema:
$ref: https://opensource.zalando.com/restful-api-guidelines/models/problem-1.0.1.yaml#/Problem
examples:
Not found:
value:
type: about:blank
status: 404
detail: Not found
parameters: {}
"400":
description: Bad request.
content:
application/problem+json:
schema:
$ref: https://opensource.zalando.com/restful-api-guidelines/models/problem-1.0.1.yaml#/Problem
examples:
Bad request:
value:
type: about:blank
status: 400
detail: "Failed to convert argument [example] for value [null]\
\ due to: Error deserializing type: example"
Constraint violation:
value:
suppressed: []
parameters: {}
type: https://zalando.github.io/problem/constraint-violation
title: Constraint Violation
status: 400
violations:
- field: classificationReference
message: Code incorrect is not a valid classification id
"405":
description: Not allowed for variable definitions with this status.
content:
application/problem+json:
schema:
$ref: https://opensource.zalando.com/restful-api-guidelines/models/problem-1.0.1.yaml#/Problem
examples:
Method not allowed:
value:
type: about:blank
status: 405
detail: Not allowed for variable definitions with this status.
/variable-definitions/{variable-definition-id}/patches/{patch-id}:
get:
tags:
- Patches
summary: Get one concrete patch for the given variable definition.
description: Get one concrete patch for the given variable definition. The full
object is returned for comparison purposes.
operationId: getPatch
parameters:
- name: variable-definition-id
in: path
description: Unique identifier for the variable definition.
required: true
schema:
type: string
examples:
Patch:
value: wypvb3wd
Not found:
value: wypvb3wd
- name: patch-id
in: path
description: ID of the patch to retrieve
required: true
schema:
type: integer
format: int32
examples:
Patch:
value: "1"
Not found:
value: "244"
responses:
"200":
description: Ok
content:
application/json:
schema:
$ref: "#/components/schemas/CompleteView"
examples:
Patch:
value:
id: wypvb3wd
patch_id: 1
name:
en: Country Background
nb: Landbakgrunn
nn: Landbakgrunn
short_name: landbak
definition:
en: "Country background is the person's own, the mother's or\
\ possibly the father's country of birth. Persons without\
\ an immigrant background always have Norway as country background.\
\ In cases where the parents have different countries of birth\
\ the mother's country of birth is chosen. If neither the\
\ person nor the parents are born abroad, country background\
\ is chosen from the first person born abroad in the order\
\ mother's mother, mother's father, father's mother, father's\
\ father."
nb: "For personer født i utlandet, er dette (med noen få unntak)\
\ eget fødeland. For personer født i Norge er det foreldrenes\
\ fødeland. I de tilfeller der foreldrene har ulikt fødeland,\
\ er det morens fødeland som blir valgt. Hvis ikke personen\
\ selv eller noen av foreldrene er utenlandsfødt, hentes landbakgrunn\
\ fra de første utenlandsfødte en treffer på i rekkefølgen\
\ mormor, morfar, farmor eller farfar."
nn: "For personar fødd i utlandet, er dette (med nokre få unntak)\
\ eige fødeland. For personar fødd i Noreg er det fødelandet\
\ til foreldra. I dei tilfella der foreldra har ulikt fødeland,\
\ er det fødelandet til mora som blir valt. Viss ikkje personen\
\ sjølv eller nokon av foreldra er utenlandsfødt, blir henta\
\ landsbakgrunn frå dei første utenlandsfødte ein treffar\
\ på i rekkjefølgja mormor, morfar, farmor eller farfar."
classification_reference: "91"
unit_types:
- "01"
- "02"
subject_fields:
- he04
contains_special_categories_of_personal_data: true
variable_status: DRAFT
measurement_type: "01"
valid_from: 2003-01-01
external_reference_uri: https://www.ssb.no/a/metadata/conceptvariable/vardok/1919/nb
comment:
nb: Fra og med 1.1.2003 ble definisjon endret til også å trekke
inn besteforeldrenes fødeland.
nn: Fra og med 1.1.2003 ble definisjon endret til også å trekke
inn besteforeldrenes fødeland.
en: "As of 1 January 2003, the definition was changed to also\
\ include the grandparents' country of birth."
related_variable_definition_uris:
- https://example.com/
owner:
team: team-a
groups:
- team-a-developers
contact:
title:
en: Division for population statistics
nb: Seksjon for befolkningsstatistikk
nn: Seksjon for befolkningsstatistikk
email: s320@ssb.no
created_at: 2024-06-11T08:15:19.038Z
created_by: ano@ssb.no
last_updated_at: 2024-06-11T08:15:19.038Z
last_updated_by: ano@ssb.no
"404":
description: Not found
content:
application/problem+json:
schema:
$ref: https://opensource.zalando.com/restful-api-guidelines/models/problem-1.0.1.yaml#/Problem
examples:
Not found:
value:
type: about:blank
status: 404
detail: Not found
parameters: {}
security: []
/variable-definitions/{variable-definition-id}/validity-periods:
get:
tags:
- Validity Periods
summary: List all validity periods.
description: List all validity periods.
operationId: listValidityPeriods
parameters:
- name: variable-definition-id
in: path
description: Unique identifier for the variable definition.
required: true
schema:
type: string
examples:
Validity periods:
value: wypvb3wd
Not found:
value: invalid id
responses:
"200":
description: Ok
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/CompleteView"
examples:
Validity periods:
value: |-
[
{
"id": "wypvb3wd",
"patch_id": 1,
"name": {
"en": "Country Background",
"nb": "Landbakgrunn",
"nn": "Landbakgrunn"
},
"short_name": "landbak",
"definition": {
"en": "Country background is the person's own, the mother's or possibly the father's country of birth. Persons without an immigrant background always have Norway as country background. In cases where the parents have different countries of birth the mother's country of birth is chosen. If neither the person nor the parents are born abroad, country background is chosen from the first person born abroad in the order mother's mother, mother's father, father's mother, father's father.",
"nb": "For personer født i utlandet, er dette (med noen få unntak) eget fødeland. For personer født i Norge er det foreldrenes fødeland. I de tilfeller der foreldrene har ulikt fødeland, er det morens fødeland som blir valgt. Hvis ikke personen selv eller noen av foreldrene er utenlandsfødt, hentes landbakgrunn fra de første utenlandsfødte en treffer på i rekkefølgen mormor, morfar, farmor eller farfar.",
"nn": "For personar fødd i utlandet, er dette (med nokre få unntak) eige fødeland. For personar fødd i Noreg er det fødelandet til foreldra. I dei tilfella der foreldra har ulikt fødeland, er det fødelandet til mora som blir valt. Viss ikkje personen sjølv eller nokon av foreldra er utenlandsfødt, blir henta landsbakgrunn frå dei første utenlandsfødte ein treffar på i rekkjefølgja mormor, morfar, farmor eller farfar."
},
"classification_reference": "91",
"unit_types": ["01", "02"],
"subject_fields": ["he04"],
"contains_special_categories_of_personal_data": true,
"variable_status": "DRAFT",
"measurement_type": "01",
"valid_from": "2003-01-01",
"valid_until": null,
"external_reference_uri": "https://www.ssb.no/a/metadata/conceptvariable/vardok/1919/nb",
"comment": {
"nb": "Fra og med 1.1.2003 ble definisjon endret til også å trekke inn besteforeldrenes fødeland.",
"nn": "Fra og med 1.1.2003 ble definisjon endret til også å trekke inn besteforeldrenes fødeland.",
"en": "As of 1 January 2003, the definition was changed to also include the grandparents' country of birth."
},
"related_variable_definition_uris": [
"https://example.com/"
],
"owner": {
"team": "team-a",
"groups": ["team-a-developers"]
},
"contact": {
"title": {
"en": "Division for population statistics",
"nb": "Seksjon for befolkningsstatistikk",
"nn": "Seksjon for befolkningsstatistikk"
},
"email": "s320@ssb.no"
},
"created_at": "2024-06-11T08:15:19.038Z",
"created_by": "ano@ssb.no",
"last_updated_at": "2024-06-11T08:15:19.038Z",
"last_updated_by": "ano@ssb.no"
}
]
"404":
description: Not found
content:
application/problem+json:
schema:
$ref: https://opensource.zalando.com/restful-api-guidelines/models/problem-1.0.1.yaml#/Problem
examples:
Not found:
value:
type: about:blank
status: 404
detail: Not found
parameters: {}
security: []
post:
tags:
- Validity Periods
summary: Create a new validity period for a variable definition.
description: Create a new validity period for a variable definition.
operationId: createValidityPeriod
parameters:
- name: variable-definition-id
in: path
description: Unique identifier for the variable definition.
required: true
schema:
type: string
examples:
Create validity period:
value: wypvb3wd
Not found:
value: invalid id
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/CreateValidityPeriod"
examples:
Create validity period:
value:
name:
en: Country Background
nb: Landbakgrunnen
nn: Landbakgrunnen
definition:
en: Country background is the mothers birth country.
nb: For personer født i utlandet er dette mors fødeland.
nn: For personar fødd i utlandet mors fødeland.
classification_reference: "91"
unit_types:
- "01"
- "05"
subject_fields:
- he04
contains_special_categories_of_personal_data: false
measurement_type: "01"
valid_from: 2026-01-02
external_reference_uri: https://www.ssb.no/a/metadata/conceptvariable/vardok/1919/nb
comment:
en: Change in legislation triggers change of definition text.
nb: Endring i lovgiving utløser endring av definisjonstekst.
nn: Endring i lovgiving utløser endring av definisjonstekst.
related_variable_definition_uris:
- https://example.com/
contact:
title:
en: Division for population statistics
nb: Seksjon for befolkningsstatistikk
nn: Seksjon for befolkningsstatistikk
email: s320@ssb.no
responses:
"201":
description: Successfully created.
content:
application/json:
schema:
$ref: "#/components/schemas/CompleteView"
examples:
Create validity period:
value:
id: wypvb3wd
patch_id: 1
name:
en: Country Background
nb: Landbakgrunn
nn: Landbakgrunn
short_name: landbak
definition:
en: "Country background is the person's own, the mother's or\
\ possibly the father's country of birth. Persons without\
\ an immigrant background always have Norway as country background.\
\ In cases where the parents have different countries of birth\
\ the mother's country of birth is chosen. If neither the\
\ person nor the parents are born abroad, country background\
\ is chosen from the first person born abroad in the order\
\ mother's mother, mother's father, father's mother, father's\
\ father."
nb: "For personer født i utlandet, er dette (med noen få unntak)\
\ eget fødeland. For personer født i Norge er det foreldrenes\
\ fødeland. I de tilfeller der foreldrene har ulikt fødeland,\
\ er det morens fødeland som blir valgt. Hvis ikke personen\
\ selv eller noen av foreldrene er utenlandsfødt, hentes landbakgrunn\
\ fra de første utenlandsfødte en treffer på i rekkefølgen\
\ mormor, morfar, farmor eller farfar."
nn: "For personar fødd i utlandet, er dette (med nokre få unntak)\
\ eige fødeland. For personar fødd i Noreg er det fødelandet\
\ til foreldra. I dei tilfella der foreldra har ulikt fødeland,\
\ er det fødelandet til mora som blir valt. Viss ikkje personen\
\ sjølv eller nokon av foreldra er utenlandsfødt, blir henta\
\ landsbakgrunn frå dei første utenlandsfødte ein treffar\
\ på i rekkjefølgja mormor, morfar, farmor eller farfar."
classification_reference: "91"
unit_types:
- "01"
- "02"
subject_fields:
- he04
contains_special_categories_of_personal_data: true
variable_status: DRAFT
measurement_type: "01"
valid_from: 2003-01-01
external_reference_uri: https://www.ssb.no/a/metadata/conceptvariable/vardok/1919/nb
comment:
nb: Fra og med 1.1.2003 ble definisjon endret til også å trekke
inn besteforeldrenes fødeland.
nn: Fra og med 1.1.2003 ble definisjon endret til også å trekke
inn besteforeldrenes fødeland.
en: "As of 1 January 2003, the definition was changed to also\
\ include the grandparents' country of birth."
related_variable_definition_uris:
- https://example.com/
owner:
team: team-a
groups:
- team-a-developers
contact:
title:
en: Division for population statistics
nb: Seksjon for befolkningsstatistikk
nn: Seksjon for befolkningsstatistikk
email: s320@ssb.no
created_at: 2024-06-11T08:15:19.038Z
created_by: ano@ssb.no
last_updated_at: 2024-06-11T08:15:19.038Z
last_updated_by: ano@ssb.no
"404":
description: Not found
content:
application/problem+json:
schema:
$ref: https://opensource.zalando.com/restful-api-guidelines/models/problem-1.0.1.yaml#/Problem
examples:
Not found:
value:
type: about:blank
status: 404
detail: Not found
parameters: {}
"400":
description: Bad request.
content:
application/problem+json:
schema:
$ref: https://opensource.zalando.com/restful-api-guidelines/models/problem-1.0.1.yaml#/Problem
examples:
Bad request:
value:
type: about:blank
status: 400
detail: "Failed to convert argument [example] for value [null]\
\ due to: Error deserializing type: example"
Constraint violation:
value:
suppressed: []
parameters: {}
type: https://zalando.github.io/problem/constraint-violation
title: Constraint Violation
status: 400
violations:
- field: classificationReference
message: Code incorrect is not a valid classification id
"405":
description: Not allowed for variable definitions with this status.
content:
application/problem+json:
schema:
$ref: https://opensource.zalando.com/restful-api-guidelines/models/problem-1.0.1.yaml#/Problem
examples:
Method not allowed:
value:
type: about:blank
status: 405
detail: Not allowed for variable definitions with this status.
components:
schemas:
CompleteView:
required:
- contact
- contains_special_categories_of_personal_data
- created_at
- created_by
- definition
- id
- last_updated_at
- last_updated_by
- name
- owner
- patch_id
- short_name
- subject_fields
- unit_types
- valid_from
- variable_status
type: object
properties:
id:
type: string
description: Unique identifier for the variable definition.
format: "^[a-zA-Z0-9-_]{8}$"
patch_id:
type: integer
description: Integer identifying a patch of a variable definition.
format: int32
example: 1
name:
$ref: "#/components/schemas/LanguageStringType"
short_name:
type: string
description: Recommended short name. Must be unique within an organization.
definition:
$ref: "#/components/schemas/LanguageStringType"
classification_reference:
type: string
description: ID of a classification or code list from Klass. The given classification
defines all possible values for the defined variable.
nullable: true
unit_types:
type: array
description: "A list of one or more unit types, e.g. person, vehicle, household.\
\ Must be defined as codes from https://dataportal.ssb.no/classifications/702."
items:
type: string
subject_fields:
type: array
description: A list of subject fields that the variable is used in. Must
be defined as codes from https://dataportal.ssb.no/classifications/618.
items:
type: string
contains_special_categories_of_personal_data:
type: boolean
description: "True if variable instances contain particularly sensitive\
\ information. Applies even if the information or identifiers are pseudonymized.\
\ Information within the following categories are regarded as particularly\
\ sensitive: Ethnicity, Political alignment, Religion, Philosophical beliefs,\
\ Union membership, Genetics, Biometrics, Health, Sexual relations, Sexual\
\ orientation"
variable_status:
$ref: "#/components/schemas/VariableStatus"
measurement_type:
type: string
description: "Type of measurement for the variable, e.g. length, volume,\
\ currency. Must be defined as codes from https://dataportal.ssb.no/classifications/303"
nullable: true
valid_from:
type: string
description: The variable definition is valid from this date inclusive
format: date
valid_until:
type: string
description: The variable definition is valid until this date inclusive
format: date
nullable: true
external_reference_uri:
type: string
description: A link (URI) to an external definition/documentation
format: url
nullable: true
comment:
nullable: true
allOf:
- $ref: "#/components/schemas/LanguageStringType"
related_variable_definition_uris:
type: array
description: "Link(s) to related definitions of variables - a list of one\
\ or more definitions. For example for a variable after-tax income it\
\ could be relevant to link to definitions of income from work, property\
\ income etc."
nullable: true
items:
type: string
format: url
owner:
$ref: "#/components/schemas/Owner"
contact:
$ref: "#/components/schemas/Contact"
created_at:
type: string
description: The timestamp at which this variable definition was first created.
format: date-time
created_by:
type: string
description: The user who created this variable definition.
last_updated_at:
type: string
description: The timestamp at which this variable definition was last modified.
format: date-time
last_updated_by:
type: string
description: The user who last modified this variable definition.
description: Complete view For internal users who need all details while maintaining
variable definitions.
Contact:
required:
- email
- title
type: object
properties:
title:
$ref: "#/components/schemas/LanguageStringType"
email:
type: string
format: email
description: Contact details
CreateDraft:
required:
- contact
- contains_special_categories_of_personal_data
- definition
- name
- short_name
- subject_fields
- unit_types
- valid_from
type: object
properties:
name:
$ref: "#/components/schemas/LanguageStringType"
short_name:
pattern: "^[a-z0-9_]{2,}$"
type: string
description: Recommended short name. Must be unique within an organization.
definition:
$ref: "#/components/schemas/LanguageStringType"
classification_reference:
type: string
description: ID of a classification or code list from Klass. The given classification
defines all possible values for the defined variable.
nullable: true
unit_types:
type: array
description: "A list of one or more unit types, e.g. person, vehicle, household.\
\ Must be defined as codes from https://dataportal.ssb.no/classifications/702."
items:
minLength: 1
type: string
subject_fields:
type: array
description: A list of subject fields that the variable is used in. Must
be defined as codes from https://dataportal.ssb.no/classifications/618.
items:
minLength: 1
type: string
contains_special_categories_of_personal_data:
type: boolean
description: "True if variable instances contain particularly sensitive\
\ information. Applies even if the information or identifiers are pseudonymized.\
\ Information within the following categories are regarded as particularly\
\ sensitive: Ethnicity, Political alignment, Religion, Philosophical beliefs,\
\ Union membership, Genetics, Biometrics, Health, Sexual relations, Sexual\
\ orientation"
default: false
measurement_type:
type: string
description: "Type of measurement for the variable, e.g. length, volume,\
\ currency. Must be defined as codes from https://dataportal.ssb.no/classifications/303"
nullable: true
valid_from:
type: string
description: The variable definition is valid from this date inclusive
format: date
valid_until:
type: string
description: The variable definition is valid until this date inclusive
format: date
nullable: true
external_reference_uri:
type: string
description: A link (URI) to an external definition/documentation
format: url
nullable: true
comment:
nullable: true
allOf:
- $ref: "#/components/schemas/LanguageStringType"
related_variable_definition_uris:
type: array
description: "Link(s) to related definitions of variables - a list of one\
\ or more definitions. For example for a variable after-tax income it\
\ could be relevant to link to definitions of income from work, property\
\ income etc."
nullable: true
items:
type: string
format: url
contact:
$ref: "#/components/schemas/Contact"
description: Create a Draft Variable Definition
example:
name:
en: Country Background
nb: Landbakgrunn
nn: Landbakgrunn
short_name: landbak
definition:
en: "Country background is the person's own, the mother's or possibly the\
\ father's country of birth. Persons without an immigrant background always\
\ have Norway as country background. In cases where the parents have different\
\ countries of birth the mother's country of birth is chosen. If neither\
\ the person nor the parents are born abroad, country background is chosen\
\ from the first person born abroad in the order mother's mother, mother's\
\ father, father's mother, father's father."
nb: "For personer født i utlandet, er dette (med noen få unntak) eget fø\
deland. For personer født i Norge er det foreldrenes fødeland. I de tilfeller\
\ der foreldrene har ulikt fødeland, er det morens fødeland som blir valgt.\
\ Hvis ikke personen selv eller noen av foreldrene er utenlandsfødt, hentes\
\ landbakgrunn fra de første utenlandsfødte en treffer på i rekkefølgen\
\ mormor, morfar, farmor eller farfar."
nn: "For personar fødd i utlandet, er dette (med nokre få unntak) eige fø\
deland. For personar fødd i Noreg er det fødelandet til foreldra. I dei\
\ tilfella der foreldra har ulikt fødeland, er det fødelandet til mora\
\ som blir valt. Viss ikkje personen sjølv eller nokon av foreldra er\
\ utenlandsfødt, blir henta landsbakgrunn frå dei første utenlandsfødte\
\ ein treffar på i rekkjefølgja mormor, morfar, farmor eller farfar."
classification_reference: "91"
unit_types:
- "01"
- "02"
subject_fields:
- he04
contains_special_categories_of_personal_data: true
measurement_type: "01"
valid_from: 2003-01-01
external_reference_uri: https://www.ssb.no/a/metadata/conceptvariable/vardok/1919/nb
comment:
nb: Fra og med 1.1.2003 ble definisjon endret til også å trekke inn besteforeldrenes
fødeland.
nn: Fra og med 1.1.2003 ble definisjon endret til også å trekke inn besteforeldrenes
fødeland.
en: "As of 1 January 2003, the definition was changed to also include the\
\ grandparents' country of birth."
related_variable_definition_uris:
- https://example.com/
contact:
title:
en: Division for population statistics
nb: Seksjon for befolkningsstatistikk
nn: Seksjon for befolkningsstatistikk
email: s320@ssb.no
CreatePatch:
type: object
properties:
name:
nullable: true
allOf:
- $ref: "#/components/schemas/LanguageStringType"
definition:
nullable: true
allOf:
- $ref: "#/components/schemas/LanguageStringType"
classification_reference:
type: string
description: ID of a classification or code list from Klass. The given classification
defines all possible values for the defined variable.
nullable: true
unit_types:
type: array
description: "A list of one or more unit types, e.g. person, vehicle, household.\
\ Must be defined as codes from https://dataportal.ssb.no/classifications/702."
nullable: true
items:
minLength: 1
type: string
subject_fields:
type: array
description: A list of subject fields that the variable is used in. Must
be defined as codes from https://dataportal.ssb.no/classifications/618.
nullable: true
items:
minLength: 1
type: string
contains_special_categories_of_personal_data:
type: boolean
description: "True if variable instances contain particularly sensitive\
\ information. Applies even if the information or identifiers are pseudonymized.\
\ Information within the following categories are regarded as particularly\
\ sensitive: Ethnicity, Political alignment, Religion, Philosophical beliefs,\
\ Union membership, Genetics, Biometrics, Health, Sexual relations, Sexual\
\ orientation"
nullable: true
variable_status:
nullable: true
allOf:
- $ref: "#/components/schemas/VariableStatus"
measurement_type:
type: string
description: "Type of measurement for the variable, e.g. length, volume,\
\ currency. Must be defined as codes from https://dataportal.ssb.no/classifications/303"
nullable: true
valid_until:
type: string
description: The variable definition is valid until this date inclusive
format: date
nullable: true
external_reference_uri:
type: string
description: A link (URI) to an external definition/documentation
format: url
nullable: true
comment:
nullable: true
allOf:
- $ref: "#/components/schemas/LanguageStringType"
related_variable_definition_uris:
type: array
description: "Link(s) to related definitions of variables - a list of one\
\ or more definitions. For example for a variable after-tax income it\
\ could be relevant to link to definitions of income from work, property\
\ income etc."
nullable: true
items:
type: string
format: url
owner:
nullable: true
allOf:
- $ref: "#/components/schemas/Owner"
contact:
nullable: true
allOf:
- $ref: "#/components/schemas/Contact"
description: Create a new Patch version on a Published Variable Definition.
example:
name:
en: Country Background
nb: Landbakgrunnen
nn: Landbakgrunnen
definition:
en: "Country background is the person's own, the mother's or possibly the\
\ father's country of birth. Persons without an immigrant background always\
\ have Norway as country background. In cases where the parents have different\
\ countries of birth the mother's country of birth is chosen. If neither\
\ the person nor the parents are born abroad, country background is chosen\
\ from the first person born abroad in the order mother's mother, mother's\
\ father, father's mother, father's father."
nb: "For personer født i utlandet, er dette (med noen få unntak) eget fø\
deland. For personer født i Norge er det foreldrenes fødeland. I de tilfeller\
\ der foreldrene har ulikt fødeland, er det morens fødeland som blir valgt.\
\ Hvis ikke personen selv eller noen av foreldrene er utenlandsfødt, hentes\
\ landbakgrunn fra de første utenlandsfødte en treffer på i rekkefølgen\
\ mormor, morfar, farmor eller farfar."
nn: "For personar fødd i utlandet, er dette (med nokre få unntak) eige fø\
deland. For personar fødd i Noreg er det fødelandet til foreldra. I dei\
\ tilfella der foreldra har ulikt fødeland, er det fødelandet til mora\
\ som blir valt. Viss ikkje personen sjølv eller nokon av foreldra er\
\ utenlandsfødt, blir henta landsbakgrunn frå dei første utenlandsfødte\
\ ein treffar på i rekkjefølgja mormor, morfar, farmor eller farfar."
classification_reference: "91"
unit_types:
- "01"
- "05"
subject_fields:
- he04
contains_special_categories_of_personal_data: false
measurement_type: "01"
valid_until: 2026-01-01
external_reference_uri: https://www.ssb.no/a/metadata/conceptvariable/vardok/1919/nb
comment:
en: Changes in unit types
nb: Endring i enhetstyper.
nn: Endring i enhetstyper.
related_variable_definition_uris:
- https://example.com/
contact:
title:
en: Division for population statistics
nb: Seksjon for befolkningsstatistikk
nn: Seksjon for befolkningsstatistikk
email: s320@ssb.no
CreateValidityPeriod:
required:
- definition
- valid_from
type: object
properties:
name:
nullable: true
allOf:
- $ref: "#/components/schemas/LanguageStringType"
definition:
$ref: "#/components/schemas/LanguageStringType"
classification_reference:
type: string
description: ID of a classification or code list from Klass. The given classification
defines all possible values for the defined variable.
nullable: true
unit_types:
type: array
description: "A list of one or more unit types, e.g. person, vehicle, household.\
\ Must be defined as codes from https://dataportal.ssb.no/classifications/702."
nullable: true
items:
minLength: 1
type: string
subject_fields:
type: array
description: A list of subject fields that the variable is used in. Must
be defined as codes from https://dataportal.ssb.no/classifications/618.
nullable: true
items:
minLength: 1
type: string
contains_special_categories_of_personal_data:
type: boolean
description: "True if variable instances contain particularly sensitive\
\ information. Applies even if the information or identifiers are pseudonymized.\
\ Information within the following categories are regarded as particularly\
\ sensitive: Ethnicity, Political alignment, Religion, Philosophical beliefs,\
\ Union membership, Genetics, Biometrics, Health, Sexual relations, Sexual\
\ orientation"
nullable: true
measurement_type:
type: string
description: "Type of measurement for the variable, e.g. length, volume,\
\ currency. Must be defined as codes from https://dataportal.ssb.no/classifications/303"
nullable: true
valid_from:
type: string
description: The variable definition is valid from this date inclusive
format: date
external_reference_uri:
type: string
description: A link (URI) to an external definition/documentation
format: url
nullable: true
comment:
nullable: true
allOf:
- $ref: "#/components/schemas/LanguageStringType"
related_variable_definition_uris:
type: array
description: "Link(s) to related definitions of variables - a list of one\
\ or more definitions. For example for a variable after-tax income it\
\ could be relevant to link to definitions of income from work, property\
\ income etc."
nullable: true
items:
type: string
format: url
contact:
nullable: true
allOf:
- $ref: "#/components/schemas/Contact"
description: Create a new Validity Period on a Published Variable Definition.
example:
name:
en: Country Background
nb: Landbakgrunnen
nn: Landbakgrunnen
definition:
en: Country background is the mothers birth country.
nb: For personer født i utlandet er dette mors fødeland.
nn: For personar fødd i utlandet mors fødeland.
classification_reference: "91"
unit_types:
- "01"
- "05"
subject_fields:
- he04
contains_special_categories_of_personal_data: false
measurement_type: "01"
valid_from: 2026-01-02
external_reference_uri: https://www.ssb.no/a/metadata/conceptvariable/vardok/1919/nb
comment:
en: Change in legislation triggers change of definition text.
nb: Endring i lovgiving utløser endring av definisjonstekst.
nn: Endring i lovgiving utløser endring av definisjonstekst.
related_variable_definition_uris:
- https://example.com/
contact:
title:
en: Division for population statistics
nb: Seksjon for befolkningsstatistikk
nn: Seksjon for befolkningsstatistikk
email: s320@ssb.no
KlassReference:
required:
- reference_uri
type: object
properties:
reference_uri:
type: string
code:
type: string
nullable: true
title:
type: string
nullable: true
LanguageStringType:
type: object
properties:
nb:
type: string
description: Norwegian Bokmål
nullable: true
nn:
type: string
description: Norwegian Nynorsk
nullable: true
en:
type: string
description: English
nullable: true
description: "Language string type Represents one text, with translations for\
\ the languages in \\[SupportedLanguages\\]. All fields are nullable to allow\
\ for flexibility for maintainers."
Owner:
required:
- groups
- team
type: object
properties:
team:
minLength: 1
type: string
description: The Dapla team with responsibility for this variable definition.
groups:
minItems: 1
type: array
description: The groups with permission to modify this variable definition.
items:
minLength: 1
type: string
description: "Owner of the definition, i.e. responsible Dapla team (statistics\
\ team) and information about access management groups."
example:
team: play-obr-b
groups:
- play-obr-b-developers
RenderedContact:
required:
- email
- title
type: object
properties:
title:
type: string
email:
type: string
example:
title: Seksjon for befolkningsstatistikk
email: s320@ssb.no
RenderedView:
required:
- contains_special_categories_of_personal_data
- created_at
- created_by
- id
- last_updated_at
- last_updated_by
- owner
- patch_id
- short_name
- subject_fields
- unit_types
- valid_from
- variable_status
type: object
properties:
id:
type: string
description: Unique identifier for the variable definition.
format: "^[a-zA-Z0-9-_]{8}$"
patch_id:
type: integer
description: Integer identifying a patch of a variable definition.
format: int32
example: 1
name:
type: string
description: Name of the variable. Must be unique for a given Unit Type
and Owner combination.
nullable: true
short_name:
type: string
description: Recommended short name. Must be unique within an organization.
definition:
type: string
description: Definition of the variable.
nullable: true
classification_uri:
type: string
description: Link to the classification which defines all permitted values
for this variable.
nullable: true
unit_types:
type: array
items:
$ref: "#/components/schemas/KlassReference"
subject_fields:
type: array
items:
$ref: "#/components/schemas/KlassReference"
contains_special_categories_of_personal_data:
type: boolean
description: "True if variable instances contain particularly sensitive\
\ information. Applies even if the information or identifiers are pseudonymized.\
\ Information within the following categories are regarded as particularly\
\ sensitive: Ethnicity, Political alignment, Religion, Philosophical beliefs,\
\ Union membership, Genetics, Biometrics, Health, Sexual relations, Sexual\
\ orientation"
variable_status:
$ref: "#/components/schemas/VariableStatus"
measurement_type:
nullable: true
allOf:
- $ref: "#/components/schemas/KlassReference"
valid_from:
type: string
description: The variable definition is valid from this date inclusive
format: date
valid_until:
type: string
description: The variable definition is valid until this date inclusive
format: date
nullable: true
external_reference_uri:
type: string
description: A link (URI) to an external definition/documentation
format: url
nullable: true
comment:
type: string
description: Optional comment to explain the definition or communicate potential
changes.
nullable: true
related_variable_definition_uris:
type: array
description: "Link(s) to related definitions of variables - a list of one\
\ or more definitions. For example for a variable after-tax income it\
\ could be relevant to link to definitions of income from work, property\
\ income etc."
nullable: true
items:
type: string
format: url
owner:
$ref: "#/components/schemas/Owner"
contact:
nullable: true
allOf:
- $ref: "#/components/schemas/RenderedContact"
created_at:
type: string
description: The timestamp at which this variable definition was first created.
format: date-time
created_by:
type: string
description: The user who created this variable definition.
last_updated_at:
type: string
description: The timestamp at which this variable definition was last modified.
format: date-time
last_updated_by:
type: string
description: The user who last modified this variable definition.
description: "Render a Variable Definition in a specific language, for display\
\ to end users."
example:
id: wypvb3wd
patch_id: 1
name: Landbakgrunn
short_name: landbak
definition: "For personer født i utlandet, er dette (med noen få unntak) eget\
\ fødeland. For personer født i Norge er det foreldrenes fødeland. I de\
\ tilfeller der foreldrene har ulikt fødeland, er det morens fødeland som\
\ blir valgt. Hvis ikke personen selv eller noen av foreldrene er utenlandsfø\
dt, hentes landbakgrunn fra de første utenlandsfødte en treffer på i rekkefø\
lgen mormor, morfar, farmor eller farfar."
classification_uri: https://dataportal.ssb.no/classifications/91
unit_types:
- reference_uri: https://dataportal.ssb.no/classifications/702
code: "20"
title: Person
subject_fields:
- reference_uri: https://dataportal.ssb.no/classifications/618
code: be07
title: Innvandrere
contains_special_categories_of_personal_data: true
variable_status: PUBLISHED_EXTERNAL
measurement_type:
reference_uri: https://dataportal.ssb.no/classifications/303
code: "01"
title: Andel
valid_from: 2003-01-01
valid_until: null
external_reference_uri: https://www.ssb.no/a/metadata/conceptvariable/vardok/1919/nb
comment: Fra og med 1.1.2003 ble definisjon endret til også å trekke inn besteforeldrenes
fødeland.
related_variable_definition_uris:
- https://example.com/
owner:
team: team-a
groups:
- team-a-developers
contact:
title: Seksjon for befolkningsstatistikk
email: s320@ssb.no
created_at: 2024-06-11T08:15:19.038Z
created_by: ano@ssb.no
last_updated_at: 2024-06-11T08:15:19.038Z
last_updated_by: ano@ssb.no
SupportedLanguages:
type: string
description: Languages the application supports.
enum:
- nb
- nn
- en
x-enum-descriptions:
- Norwegian Bokmål
- Norwegian Nynorsk
- English
UpdateDraft:
type: object
properties:
name:
nullable: true
allOf:
- $ref: "#/components/schemas/LanguageStringType"
short_name:
pattern: "^[a-z0-9_]{2,}$"
type: string
description: Recommended short name. Must be unique within an organization.
nullable: true
definition:
nullable: true
allOf:
- $ref: "#/components/schemas/LanguageStringType"
classification_reference:
type: string
description: ID of a classification or code list from Klass. The given classification
defines all possible values for the defined variable.
nullable: true
unit_types:
type: array
description: "A list of one or more unit types, e.g. person, vehicle, household.\
\ Must be defined as codes from https://dataportal.ssb.no/classifications/702."
nullable: true
items:
minLength: 1
type: string
subject_fields:
type: array
description: A list of subject fields that the variable is used in. Must
be defined as codes from https://dataportal.ssb.no/classifications/618.
nullable: true
items:
minLength: 1
type: string
contains_special_categories_of_personal_data:
type: boolean
description: "True if variable instances contain particularly sensitive\
\ information. Applies even if the information or identifiers are pseudonymized.\
\ Information within the following categories are regarded as particularly\
\ sensitive: Ethnicity, Political alignment, Religion, Philosophical beliefs,\
\ Union membership, Genetics, Biometrics, Health, Sexual relations, Sexual\
\ orientation"
nullable: true
variable_status:
nullable: true
allOf:
- $ref: "#/components/schemas/VariableStatus"
measurement_type:
type: string
description: "Type of measurement for the variable, e.g. length, volume,\
\ currency. Must be defined as codes from https://dataportal.ssb.no/classifications/303"
nullable: true
valid_from:
type: string
description: The variable definition is valid from this date inclusive
format: date
nullable: true
valid_until:
type: string
format: date
nullable: true
external_reference_uri:
type: string
description: A link (URI) to an external definition/documentation
format: url
nullable: true
comment:
nullable: true
allOf:
- $ref: "#/components/schemas/LanguageStringType"
related_variable_definition_uris:
type: array
description: "Link(s) to related definitions of variables - a list of one\
\ or more definitions. For example for a variable after-tax income it\
\ could be relevant to link to definitions of income from work, property\
\ income etc."
nullable: true
items:
type: string
format: url
owner:
nullable: true
allOf:
- $ref: "#/components/schemas/Owner"
contact:
nullable: true
allOf:
- $ref: "#/components/schemas/Contact"
description: Update variable definition Data structure with all fields optional
for updating a Draft Variable Definition. Fields supplied with explicit null
values will be deleted unless the field is required.
example:
name:
en: Country Background
nb: Landbakgrunn
nn: Landbakgrunn
short_name: landbak
definition:
en: "Country background is the person's own, the mother's or possibly the\
\ father's country of birth. Persons without an immigrant background always\
\ have Norway as country background. In cases where the parents have different\
\ countries of birth the mother's country of birth is chosen. If neither\
\ the person nor the parents are born abroad, country background is chosen\
\ from the first person born abroad in the order mother's mother, mother's\
\ father, father's mother, father's father."
nb: "For personer født i utlandet, er dette (med noen få unntak) eget fø\
deland. For personer født i Norge er det foreldrenes fødeland. I de tilfeller\
\ der foreldrene har ulikt fødeland, er det morens fødeland som blir valgt.\
\ Hvis ikke personen selv eller noen av foreldrene er utenlandsfødt, hentes\
\ landbakgrunn fra de første utenlandsfødte en treffer på i rekkefølgen\
\ mormor, morfar, farmor eller farfar."
nn: "For personar fødd i utlandet, er dette (med nokre få unntak) eige fø\
deland. For personar fødd i Noreg er det fødelandet til foreldra. I dei\
\ tilfella der foreldra har ulikt fødeland, er det fødelandet til mora\
\ som blir valt. Viss ikkje personen sjølv eller nokon av foreldra er\
\ utenlandsfødt, blir henta landsbakgrunn frå dei første utenlandsfødte\
\ ein treffar på i rekkjefølgja mormor, morfar, farmor eller farfar."
classification_reference: "91"
unit_types:
- "01"
- "02"
subject_fields:
- he04
contains_special_categories_of_personal_data: true
measurement_type: "01"
valid_from: 2003-01-01
external_reference_uri: https://www.ssb.no/a/metadata/conceptvariable/vardok/1919/nb
comment:
nb: Fra og med 1.1.2003 ble definisjon endret til også å trekke inn besteforeldrenes
fødeland.
nn: Fra og med 1.1.2003 ble definisjon endret til også å trekke inn besteforeldrenes
fødeland.
en: "As of 1 January 2003, the definition was changed to also include the\
\ grandparents' country of birth."
related_variable_definition_uris:
- https://example.com/
contact:
title:
en: Division for population statistics
nb: Seksjon for befolkningsstatistikk
nn: Seksjon for befolkningsstatistikk
email: s320@ssb.no
VardokIdResponse:
required:
- vardok_id
type: object
properties:
vardok_id:
type: string
VardokVardefIdPairResponse:
required:
- vardef_id
- vardok_id
type: object
properties:
vardok_id:
type: string
vardef_id:
type: string
VariableStatus:
type: string
description: Status of the life cycle of the variable
enum:
- DRAFT
- PUBLISHED_INTERNAL
- PUBLISHED_EXTERNAL
securitySchemes:
keycloak_token:
type: http
description: "A token granted by Statistics Norway's Keycloak instance. The\
\ `aud` claim must include `vardef`. Valid tokens are by default granted the\
\ `VARIABLE_CONSUMER` role. In order to be assigned the `VARIABLE_OWNER` role,\
\ the token must contain the `dapla` claim with team details populated by\
\ `DaplaUserinfoMapper`.\
\ These tokens may not be granted the `VARIABLE_CREATOR` role."
scheme: bearer
bearerFormat: JWT
labid_token:
type: http
description: A token granted by Statistics Norway's LabID instance. May be obtained
from a Dapla Lab service. Valid tokens
may be granted all of the available roles.
scheme: bearer
bearerFormat: JWT