/gsim-raml-schema

RAML documentation of Statistic Norways GSIM based information model.

Primary LanguageRAMLApache License 2.0Apache-2.0

gsim-raml-schema

Statistics Norway is modernizing its core systems for statistical production. Statistics Norway implements a logical data model based on the UN standard Generic Statistical Information Model (GSIM).

This project is documentation of the physical design using RAML (RESTful API Modeling Language).

The intention is to have all GSIM objects and attributes represented as RAML-files.

Image of the logical data model (LDM):

RAML

The raml-files in this project follows the RAML 1.0 spesification.

We only use the data types section of RAML. There are no endpoints or methods. Those are automatically generated using Linked Data Store .

Inheritance

Objects that are abstract in GSIM is maintained in the folder /schemas/abstract/.

A typical example of this is the object IdentifiableArtefact that is reused in almost all other objects:

#%RAML 1.0 Library
uses:
  IdentifiableArtefact: ./abstract/IdentifiableArtefact.raml

types:
  DataStructure:
    description:  Defines the structure of an organized collection of data (Data Set).
    type: [ IdentifiableArtefact.IdentifiableArtefact ]

Annotations

This is maintained in the folder /schemas/annotation/

Attributes can link to other objects, and this is done by using annotations.

#%RAML 1.0 Library
#Defines links between attributes and objects
annotationTypes:
  types:
    type: string[]
    description: Holds the type of objects a link points to

Linked Domain

  • By using annotation (Link.types) a link can be defined as a property of an attribute.
  • The cardinality of a link is controlled by both the type property of the attribute and if the attribute is optional or mandatory.
  • A single link should be defined as type string.
  • A multiple link should be defined as type string[].
  • The value of the link holds the legal domains for this link.
#%RAML 1.0 Library
uses:
  Link: ./annotation/Link.raml
  IdentifiableArtefact: ./abstract/IdentifiableArtefact.raml

types:
  DataStructure:
    description:  Defines the structure of an organized collection of data (Data Set).
    type: [ IdentifiableArtefact.IdentifiableArtefact ]

    properties:
      id:
        type: string
        description: The global unique identifier (GUID) of the information object assigned by the owner agency.

      mandatoryComponents:
        type: string[]
        description: One or more Identifier- or MeasureComponents
        (Link.types): [IdentifierComponent, MeasureComponent]

      optionalComponents?:
        type: string[]
        description: One or more AttributeComponents to describe something about the measures in a dataset.
        (Link.types): [AttributeComponent]

Example of linked domain

Consider the following json-example. It shows that a DataStructure has a list of links to both IdentifierComponent and MeasureComponent through the mandatoryComponents property.

  • Links are string typed fields that carry the relative resource path with the managed domain and ID of the entity they link to.
{
  "id": "b68daffc-6dbe-467a-8670-02c927ff73e7",
  "mandatoryComponents": [
    "/IdentifierComponent/2af2368c-3ab1-44df-860e-bd60d30f8f96",
    "/IdentifierComponent/1e91eb73-da0c-4ee5-8fdd-81a948048e44",
    "/MeasureComponent/2499638d-5f58-463c-8310-772fbd3d78ad"
  ],
  "optionalComponents": [
    "/AttributeComponent/0716427a-add2-4327-bfb0-e91659bb6f9a"
  ]
}  

Implementation roadmap

This is an overview of the implementation progress.

Per GSIM Group

Group Coverage Progress Comment
Base usable usable
Exchange usable usable We have made a conscious choice not to focus on the Questionnaire objects at this point.
Concepts usable usable We have made a conscious choice not to focus on the some of the objects related to codelists and classifications since they are covered in an existing system (KLASS) used by Statistic Norway. See additional notes at the bottom of this document.
Structures usable usable We have made a conscious choice not to focus on the Reference Metatdata objects at this point.
Business usable usable All objects are covered, but there has been little time to go through the quality of attributes and usable examples.

Explanation:

  • Coverage means how many GSIM-objects exists as RAML-files.
  • Progress indicates the quality of those RAML-files (including associated JSON example files).

Per GSIM Object

Legend

Progress range This means
usable - usable Develop on this object has begun in a separate branch, but it is not merged into master branch yet.
usable- usable The object is merged into master branch, but must still be considered an early draft.
usable - usable The object is merged into master branch, and is considered more than a draft.

Objects in master-branch is found here: https://github.com/statisticsnorway/gsim-raml-schema/tree/master/schemas

Progress

GSIM Group Object Progress Comment
Base Identifiable Artefact usable Abstract Object
Base Administrative Details usable Object Type
Base Multilingual Text usable Object Type
Base Agent usable
Base AgentDetails usable Object Type
Base Agent In Role usable
Base Role usable
Base Organization usable Implemented as ENUM in Agent.agentType
Base Individual usable Implemented as ENUM in Agent.agentType
Base System usable Implemented as ENUM in Agent.agentType
Exchange Exchange Channel usable Abstract Object
Exchange Protocol usable
Exchange Provision Agreement usable
Exchange Information Consumer usable Implemented as link between ProvisionAgreement and AgentInRole
Exchange Information Provider usable Implemented as link between ProvisionAgreement and AgentInRole
Exchange Data Harvesting usable Renamed from Web Scraper Channel
Exchange Questionnaire usable
Exchange Adminstrative Register usable
Exchange Product usable
Exchange OutputSpecification usable
Exchange Presentation usable
Concepts Variable usable
Concepts Represented Variable usable
Concepts Value Domain usable Abstract Object
Concepts Population usable
Concepts Unit Type usable
Concepts Instance Variable usable
Concepts Described Value Domain usable
Concepts Enumerated Value Domain usable
Concepts Sentinel Value Domain usable Implemented as attribute in Instance Variable with link to either Enumerated Value Domain or Described Value Domain
Concepts Substantive Value Domain usable Implemented as attribute in Represented Variable with link to either Enumerated Value Domain or Described Value DomainConcepts
Concepts Universe usable
Concepts MeasurementType usable
Concepts MeasurementUnit usable
Concepts Concept usable Abstract Object
Structures Component Relationship usable
Structures Data Structure Component usable Abstract Object
Structures Identifier Component usable
Structures Measure Component usable
Structures Attribute Component usable
Structures Data Structure usable Abstract Object
Structures Unit Data Structure usable
Structures Dimensional Data Structure usable
Structures Data Set usable Abstract Object
Structures Unit Data Set usable
Structures Dimensional Data Set usable
Structures Information Resource usable Abstract Object
Structures Data Resource usable
Structures Logical Record usable
Structures Record Relationship usable
Structures Statistical Register Persons usable Implemented as ENUM in DataResource.dataResourceType
Structures Establishment Enterprise Register usable Implemented as ENUM in DataResource.dataResourceType
Business Assessment usable
Business BusinessCase usable
Business BusinessFunction usable
Business BusinessProcess usable
Business BusinessService usable
Business ChangeDefinition usable
Business EnvironmentChange usable
Business InformationRequest usable
Business ParameterInput usable
Business ProcessControl usable
Business ProcessControlDesign usable
Business ProcessDesign usable
Business ProcessExecutionLog usable
Business ProcessInput usable Abstract Object
Business ProcessInputSpesification usable
Business ProcessMethod usable
Business ProcessMetric usable
Business ProcessOutput usable Abstract Object
Business ProcessOutputSpesification usable
Business ProcessPattern usable
Business ProcessStep usable
Business ProcessStepInstance usable
Business ProcessSupportInput usable
Business Rule usable
Business StatisticalNeed usable Abstract Object
Business StatisticalSupportProgram usable
Business StatisticalProgram usable
Business StatisticalProgramCycle usable
Business StatisticalProgramDesign usable
Business TransformableInput usable
Business TransformedOutput usable

Regarding Statistical Classifications and Codelists

Objects in Concepts group regarding classifications and codelists has not yet been addressed in RAML due to the use of an existing system for this in Statistics Norway (https://www.ssb.no/en/klass/).

In EnumeratedVariableDomain there is an attribute that links to this system:

#%RAML 1.0 Library
uses:
  IdentifiableArtefact: ./abstract/IdentifiableArtefact.raml
  ValueDomain: ./abstract/ValueDomain.raml

types:
  EnumeratedValueDomain:
    description: A Value Domain expressed as a list of Categories and associated Codes.
    type: [IdentifiableArtefact.IdentifiableArtefact, ValueDomain.ValueDomain]

    properties:
      klassUrl:
        type: string
        description: The url to KLASS (Statistics Norways system for Classifications and Codelists).
        displayName: Klass Url

Example:

{
    "id": "bf51c92c-d3d2-4190-bdf1-df4332ca14cc",
    "name": [
      {
        "languageCode": "en",
        "languageText": "Families 2006"
      }
    ],
    "description": [
      {
        "languageCode": "en",
        "languageText": "Classification of families"
      }
    ],
    "administrativeStatus": "OPEN",
    "version": "1.0.0",
    "versionValidFrom": "2006-01-01T00:00:00.000Z",
    "validFrom": "2006-01-01T00:00:00.000Z",
    "createdDate": "2006-01-01T00:00:00.000Z",
    "createdBy": "OHV",
    "dataType": "STRING",
    "klassUrl": "https://www.ssb.no/en/klass/klassifikasjoner/17"
}

Future expansions

KLASS (Statistics Norways system for classifications and Codelists) is also based on GSIM, and will hopefully in the future be a part of the RAML spesifications of this project.

See KLASS on Github: https://github.com/statisticsnorway/klass