From e39f6017acbda68432cf0ac13fac4cc0836811d7 Mon Sep 17 00:00:00 2001 From: Anis Koubaa <mohamed.koubaa@kit.edu> Date: Tue, 4 Feb 2025 15:42:01 +0100 Subject: [PATCH] add oemeta v2-support. --- .../oep_access/oemeta/v2/v20/README.md | 25 + .../oep_access/oemeta/v2/v20/__init__.py | 0 .../oemeta/v2/v20/build_source/README.md | 52 + .../v2/v20/build_source/schema_structure.json | 31 + .../schema_structure.json.license | 5 + .../v2/v20/build_source/schemas/context.json | 89 + .../v2/v20/build_source/schemas/dataset.json | 46 + .../v2/v20/build_source/schemas/fields.json | 252 +++ .../v2/v20/build_source/schemas/general.json | 151 ++ .../v2/v20/build_source/schemas/licenses.json | 63 + .../v2/v20/build_source/schemas/meta.json | 54 + .../v20/build_source/schemas/provenance.json | 76 + .../v2/v20/build_source/schemas/review.json | 32 + .../v2/v20/build_source/schemas/sources.json | 118 ++ .../v2/v20/build_source/schemas/spatial.json | 109 ++ .../v2/v20/build_source/schemas/temporal.json | 80 + .../v2/v20/build_source/scripts/__init__.py | 0 .../build_source/scripts/create_example.py | 264 +++ .../v20/build_source/scripts/create_schema.py | 216 +++ .../build_source/scripts/create_template.py | 149 ++ .../scripts/example/contributors.json | 20 + .../scripts/example/contributors.json.license | 4 + .../build_source/scripts/example/fields.json | 167 ++ .../scripts/example/fields.json.license | 4 + .../v2/v20/build_source/scripts/settings.py | 23 + .../oep_access/oemeta/v2/v20/context.json | 87 + .../oep_access/oemeta/v2/v20/example.json | 349 ++++ .../oep_access/oemeta/v2/v20/example.py | 10 + .../oemeta/v2/v20/metadata_key_description.md | 227 +++ .../oep_access/oemeta/v2/v20/schema.json | 1505 +++++++++++++++++ .../oep_access/oemeta/v2/v20/schema.py | 10 + .../oep_access/oemeta/v2/v20/template.json | 186 ++ .../oep_access/oemeta/v2/v20/template.py | 10 + 33 files changed, 4414 insertions(+) create mode 100644 services/backend_regimo/components/oep_access/oemeta/v2/v20/README.md create mode 100644 services/backend_regimo/components/oep_access/oemeta/v2/v20/__init__.py create mode 100644 services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/README.md create mode 100644 services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schema_structure.json create mode 100644 services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schema_structure.json.license create mode 100644 services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/context.json create mode 100644 services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/dataset.json create mode 100644 services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/fields.json create mode 100644 services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/general.json create mode 100644 services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/licenses.json create mode 100644 services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/meta.json create mode 100644 services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/provenance.json create mode 100644 services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/review.json create mode 100644 services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/sources.json create mode 100644 services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/spatial.json create mode 100644 services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/temporal.json create mode 100644 services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/scripts/__init__.py create mode 100644 services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/scripts/create_example.py create mode 100644 services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/scripts/create_schema.py create mode 100644 services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/scripts/create_template.py create mode 100644 services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/scripts/example/contributors.json create mode 100644 services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/scripts/example/contributors.json.license create mode 100644 services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/scripts/example/fields.json create mode 100644 services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/scripts/example/fields.json.license create mode 100644 services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/scripts/settings.py create mode 100644 services/backend_regimo/components/oep_access/oemeta/v2/v20/context.json create mode 100644 services/backend_regimo/components/oep_access/oemeta/v2/v20/example.json create mode 100644 services/backend_regimo/components/oep_access/oemeta/v2/v20/example.py create mode 100644 services/backend_regimo/components/oep_access/oemeta/v2/v20/metadata_key_description.md create mode 100644 services/backend_regimo/components/oep_access/oemeta/v2/v20/schema.json create mode 100644 services/backend_regimo/components/oep_access/oemeta/v2/v20/schema.py create mode 100644 services/backend_regimo/components/oep_access/oemeta/v2/v20/template.json create mode 100644 services/backend_regimo/components/oep_access/oemeta/v2/v20/template.py diff --git a/services/backend_regimo/components/oep_access/oemeta/v2/v20/README.md b/services/backend_regimo/components/oep_access/oemeta/v2/v20/README.md new file mode 100644 index 0000000..d7298c4 --- /dev/null +++ b/services/backend_regimo/components/oep_access/oemeta/v2/v20/README.md @@ -0,0 +1,25 @@ +<!-- +SPDX-FileCopyrightText: 2024 Ludwig Hülk <Ludee> © Reiner Lemoine Institut +SPDX-FileCopyrightText: 2024 Jonas Huber <jh-RLI> © Reiner Lemoine Institut + +SPDX-License-Identifier: MIT +--> + +<a href="https://github.com/OpenEnergyPlatform/oemetadata/"><img align="right" width="100" height="100" src="https://raw.githubusercontent.com/OpenEnergyPlatform/organisation/production/logo/OpenEnergyFamily_Logo_OEMetadata.png" alt="OpenEnergyMetadata"></a> +<a href="https://openenergyplatform.org/"><img align="right" width="100" height="100" src="https://avatars2.githubusercontent.com/u/37101913?s=400&u=9b593cfdb6048a05ea6e72d333169a65e7c922be&v=4" alt="OpenEnergyPlatform"></a> + + +# OEMetadata - Version 2.0 + +This version of the OEMetadata represents the latest released version. +This release is fully integrated into the OEP. + +The OEMetadata contains the following files: + +* [template.json](https://github.com/OpenEnergyPlatform/oemetadata/blob/production/metadata/latest/template.json) contains an empty metadata string with all fields. +* [example.json](https://github.com/OpenEnergyPlatform/oemetadata/blob/production/metadata/latest/example.json) contains a basic metadata example. +* [metadata_key_description.md](https://github.com/OpenEnergyPlatform/oemetadata/blob/production/metadata/latest/metadata_key_description.md) contains a full description of each metadata key and an example. +* [context.json](https://github.com/OpenEnergyPlatform/oemetadata/blob/production/metadata/latest/context.json) contains the references of metadata keys in ontology terms. +* [schema.json](https://github.com/OpenEnergyPlatform/oemetadata/blob/production/metadata/latest/schema.json) contains the json schema for the metadata. + +For further information see the [Changelog](https://github.com/OpenEnergyPlatform/oemetadata/blob/production/CHANGELOG.md). diff --git a/services/backend_regimo/components/oep_access/oemeta/v2/v20/__init__.py b/services/backend_regimo/components/oep_access/oemeta/v2/v20/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/README.md b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/README.md new file mode 100644 index 0000000..edd6967 --- /dev/null +++ b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/README.md @@ -0,0 +1,52 @@ +<!-- +SPDX-FileCopyrightText: Ludwig Hülk <Ludee> © Reiner Lemoine Institut +SPDX-FileCopyrightText: Jonas Huber <jh-RLI> © Reiner Lemoine Institut + +SPDX-License-Identifier: CC0-1.0 +--> + +# OEMetadata Build Source + +The OEMetadata uses the [JSON Schema](https://json-schema.org/) specification +to define the structure of the metadata. <br> +It offers the possibility to make the `schema.json` more modular. <br> +For better maintenance the file is split into separate files. <br> +The `schema_structure.json` contains the overall pattern of the structure. + +## Structure + +The directory `build_source` contains two parts: + +### Schemas `build_source/schemas/` + +The schemas are the core of the OEMetadata specification. <br> +They are separated by category and follow the logic of OEMetadata structure. + + +### Scripts `build_source/scripts/` + +- `create_schema.py` Creates the complete `schema.json` from `schemas` +- `create_template.py` Creates the `template.json` from `schema.json` +- `create_example.py` Creates the `example.json` from `schema.json` + +## Usage + +Create a python3 environment + + cd ../oemetadata/ + python3 -m venv env + +Install the requirements + + source env/bin/activate + pip install -r requirements.txt + +Create the OEMetadata json schema from schemas + + cd metadata/v2/v20/build_source/scripts/ + python metadata/v2/v20/build_source/scripts/create_schema.py + +Create the OEMetadata template and example from json schema + + python metadata/v2/v20/build_source/scripts/create_example_from_schema.py + python metadata/v2/v20/build_source/scripts/create_template_from_schema.py diff --git a/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schema_structure.json b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schema_structure.json new file mode 100644 index 0000000..faa8f8b --- /dev/null +++ b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schema_structure.json @@ -0,0 +1,31 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/OpenEnergyPlatform/oemetadata/production/metadata/v20/v20/schema.json", + "description": "Open Energy Metadata (OEMetadata) - metadata schema", + "type": "object", + "required": ["resources"], + "properties": { + "collection": {"$ref": "dataset.json#"}, + "resources": { + "description": "A collection of related resources.", + "type": "array", + "items": { + "type": "object", + "properties": { + "general": {"$ref": "general.json#"}, + "context": {"$ref": "context.json#"}, + "spatial": {"$ref": "spatial.json#"}, + "temporal": {"$ref": "temporal.json#"}, + "sources": {"$ref": "sources.json#"}, + "licenses": {"$ref": "licenses.json#"}, + "provenance": {"$ref": "provenance.json#"}, + "resource": {"$ref": "fields.json#"}, + "review": {"$ref": "review.json#"} + } + }, + "title": "Resources" + }, + "meta": {"$ref": "meta.json#"} + }, + "additionalProperties": true +} \ No newline at end of file diff --git a/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schema_structure.json.license b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schema_structure.json.license new file mode 100644 index 0000000..d379f75 --- /dev/null +++ b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schema_structure.json.license @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: 2024 Ludwig Hülk <@Ludee> © Reiner Lemoine Institut +# SPDX-FileCopyrightText: 2024 Jonas Huber <jh-RLI> © Reiner Lemoine Institut +# SPDX-FileCopyrightText: 2024 Christian Hofmann <christian-rli> © Reiner Lemoine Institut +# +# SPDX-License-Identifier: MIT diff --git a/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/context.json b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/context.json new file mode 100644 index 0000000..7c20703 --- /dev/null +++ b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/context.json @@ -0,0 +1,89 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/OpenEnergyPlatform/oemetadata/production/metadata/v20/v20/build_source/schemas/context.json", + "type": "object", + "properties": { + "context": { + "description": "An Object that describes the general setting, environment or project leading to the creation or maintenance of this dataset. In science this can be the research project.", + "type": "object", + "properties": { + "title": { + "description": "A title of the associated project.", + "type": ["string", "null"], + "examples": ["NFDI4Energy"], + "badge": "Gold", + "title": "Context Title" + }, + "homepage": { + "description": "A URL of the project.", + "type": ["string", "null"], + "examples": ["https://nfdi4energy.uol.de/"], + "badge": "Gold", + "title": "Homepage", + "format": "uri" + }, + + "documentation": { + "description": "A URL of the project documentation.", + "type": ["string", "null"], + "examples": ["https://nfdi4energy.uol.de/sites/about_us/"], + "badge": "Gold", + "title": "Documentation" + }, + "sourceCode": { + "description": "A URL of the source code of the project.", + "type": ["string", "null"], + "examples": ["https://github.com/NFDI4Energy"], + "badge": "Gold", + "title": "Source Code" + }, + "publisher": { + "description": "The publishing agency of the data. This can be the OEP.", + "type": ["string", "null"], + "examples": ["Open Energy Platform (OEP)"], + "badge": "Bronze", + "title": "Publisher" + },"publisherLogo": { + "description": "A URL to the logo of the publishing agency of data.", + "type": ["string", "null"], + "examples": ["https://github.com/OpenEnergyPlatform/organisation/blob/production/logo/OpenEnergyFamily_Logo_OpenEnergyPlatform.svg"], + "badge": "Gold", + "title": "Publisher Logo", + "format": "uri" + }, + "contact": { + "description": "A reference to the creator or maintainer of the data set. This can be an email address or a GitHub handle.", + "type": ["string", "null"], + "examples": ["contact@example.com"], + "badge": "Gold", + "title": "E-Mail Contact", + "format": "email" + }, + "fundingAgency": { + "description": "A name of the entity providing the funding. This can be a government agency or a company.", + "type": ["string", "null"], + "examples": [" Deutsche Forschungsgemeinschaft (DFG)"], + "badge": "Gold", + "title": "Funding Agency" + }, + "fundingAgencyLogo": { + "description": "A URL to the logo or image of the funding agency.", + "type": ["string", "null"], + "examples": ["https://upload.wikimedia.org/wikipedia/commons/8/86/DFG-logo-blau.svg"], + "badge": "Gold", + "title": "Funding Agency Logo", + "format": "uri" + }, + "grantNo": { + "description": "An identifying grant number. In case of a publicly funded project, this number is assigned by the funding agency.", + "type": ["string", "null"], + "examples": ["501865131"], + "badge": "Gold", + "title": "Grant Number" + } + }, + "badge": "Gold", + "title": "Context" + } + } +} \ No newline at end of file diff --git a/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/dataset.json b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/dataset.json new file mode 100644 index 0000000..9e32482 --- /dev/null +++ b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/dataset.json @@ -0,0 +1,46 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/OpenEnergyPlatform/oemetadata/production/metadata/v20/v20/build_source/schemas/collection.json", + "type": "object", + "properties": { + "@context": { + "description": "Explanation of metadata keys in ontology terms.", + "examples": ["https://raw.githubusercontent.com/OpenEnergyPlatform/oemetadata/production/metadata/latest/context.json"], + "type": ["string", "null"], + "badge": "Platinum", + "title": "@context", + "readOnly": true + }, + "name": { + "description": "A filename or database conform dataset name.", + "type": ["string", "null"], + "examples": ["oep_oemetadata"], + "badge": "Iron", + "title": "Dataset Name" + }, + "title": { + "description": "A human readable dataset name.", + "type": ["string", "null"], + "examples": ["OEP OEMetadata"], + "badge": "Bronze", + "title": "Dataset Title" + }, + "description": { + "description": "A free text description of the dataset.", + "type": ["string", "null"], + "examples": ["A dataset for the OEMetadata examples."], + "badge": "Bronze", + "title": "Dataset Description" + }, + "id": { + "description": "A unique identifier (UUID/DOI) for the collection.", + "type": ["string", "null"], + "examples": ["https://databus.openenergyplatform.org/oeplatform/reference"], + "badge": "Silver", + "title": "Dataset Identifier", + "format": "uri", + "readOnly": true + } + }, + "required": ["name"] +} \ No newline at end of file diff --git a/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/fields.json b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/fields.json new file mode 100644 index 0000000..745a516 --- /dev/null +++ b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/fields.json @@ -0,0 +1,252 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/OpenEnergyPlatform/oemetadata/production/metadata/v20/v20/build_source/schemas/fields.json", + "type": "object", + "properties": { + "type": { + "description": "The 'table' type indicates that the resource is tabular as per 'Frictionless Tabular Data' definition.", + "type": ["string", "null"], + "examples": ["table"], + "badge": "Gold", + "title": "Type", + "options": { + "hidden": true + } + }, + "format": { + "description": "A file extension format. Possible options are 'csv', 'xlsx', 'json', 'PostgreSQL', 'SQLite' and other standard file extensions.", + "type": ["string", "null"], + "examples": ["CSV"], + "badge": "Gold", + "title": "Format", + "options": { + "hidden": true + } + }, + "encoding": { + "description": "Specifies the character encoding of the resource's data file. The default is 'UTF-8'. The values should be one of the 'Preferred MIME Names'.", + "type": ["string", "null"], + "examples": ["UTF-8"], + "badge": "Gold", + "title": "Encoding", + "options": { + "hidden": true + } + }, + "schema": { + "description": "An object that describes the structure of a table. It contains all fields (columns of the table), the primary key and optional foreign keys.", + "type": "object", + "properties": { + "fields": { + "description": "An array of objects that describes a field (column) and its detailed information.", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "The name of the field. The name may only consist of lowercase alphanumeric characters or underscores. It must not begin with a number or an underscore.", + "type": ["string", "null"], + "examples": ["year"], + "badge": "Iron", + "title": "Column Name", + "readOnly": true + }, + "description": { + "description": "A text describing the field.", + "type": ["string", "null"], + "examples": ["Reference year for which the data was collected."], + "badge": "Silver", + "title": "Description" + }, + "type": { + "description": "The data type of the field. In case of a geom column in a database, also indicate the shape and CRS.", + "type": ["string", "null"], + "examples": ["geometry(Point, 4326)"], + "badge": "Iron", + "title": "Type", + "readOnly": true + }, + "nullable": { + "description": "A boolean key to specify that a column can be nullable. True is the default value.", + "type": ["boolean", "null"], + "examples": [true], + "badge": "Iron", + "title": "Nullable", + "readOnly": true + }, + "unit": { + "description": "The unit of a field. If it does not apply, use 'null'. If the unit is given in a separate field, reference this field (e.g. 'unit'). Use a space between numbers and units (100 m).", + "type": ["string", "null"], + "examples": ["MW"], + "badge": "Silver", + "title": "Unit" + }, + "isAbout": { + "description": "An array of objects that describes the field in ontology terms.", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "The class label of the ontology term.", + "type": ["string", "null"], + "examples": ["wind energy converting unit"], + "badge": "Platinum", + "title": "Is About Name" + }, + "@id": { + "description": "The path of the ontology term (IRI).", + "type": ["string", "null"], + "examples": ["https://openenergyplatform.org/ontology/oeo/OEO_00000044"], + "badge": "Platinum", + "title": "Is About Identifier", + "format": "uri" + } + }, + "badge": "Platinum", + "title": "isAbout" + }, + "badge": "Platinum", + "title": "isAbout" + }, + "valueReference": { + "description": "An array of objects for an extended description of the values in the column in ontology terms.", + "type": "array", + "items": { + "type": "object", + "properties": { + "value": { + "description": "The name of the value in the column.", + "type": ["string", "null"], + "examples": ["onshore"], + "badge": "Platinum", + "title": "Value Reference" + }, + "name": { + "description": "The class label of the ontology term in the column.", + "type": ["string", "null"], + "examples": ["onshore wind farm"], + "badge": "Platinum", + "title": "Value Reference Name" + }, + "@id": { + "description": "The path of the ontology term (IRI) in the column.", + "type": ["string", "null"], + "examples": ["https://openenergyplatform.org/ontology/oeo/OEO_00000311"], + "badge": "Platinum", + "title": "Value Reference Identifier", + "format": "uri" + } + }, + "badge": "Platinum", + "title": "valueReference" + }, + "badge": "Platinum", + "title": "valueReference" + } + }, + "title": "Field", + "required": ["name", "type", "nullable"] + }, + "title": "Field" + }, + "primaryKey": { + "description": "An array of fields that uniquely identifies each row in the table.", + "type": "array", + "items": { + "description": "The default value is the “id†column.", + "type": ["string", "null"], + "examples": ["id"], + "badge": "Iron", + "title": "Primary key" + }, + "badge": "Iron", + "title": "Primary key" + }, + "foreignKeys": { + "description": "List of foreign keys.", + "type": "array", + "items": { + "description": "An array of objects with foreign keys that describe a field that relates to a field in another table.", + "type": "object", + "properties": { + "fields": { + "description": "An array of fields in the table that is constrained by the foreign key.", + "type": "array", + "items": { + "description": "The column in the table that is constrained by the foreign key.", + "type": ["string", "null"], + "examples": ["id","version"], + "badge": "Iron", + "title": "Foreign Key Field" + }, + "badge": "Iron", + "title": "Fields" + }, + "reference": { + "description": "The reference to the foreign table.", + "type": "object", + "properties": { + "resource": { + "description": "The referenced foreign table.", + "type": ["string", "null"], + "examples": ["model_draft.oep_oemetadata_table_example_version"], + "badge": "Iron", + "title": "Foreign Resource" + }, + "fields": { + "description": "The foreign resource column.", + "type": "array", + "items": { + "description": "The foreign resource column.", + "type": ["string", "null"], + "examples": ["id","version"], + "badge": "Iron", + "title": "Field" + }, + "badge": "Iron", + "title": "Field" + } + }, + "badge": "Iron", + "title": "Reference", + "required": ["resource", "fields"] + } + }, + "title": "Foreign Key", + "required": ["fields"] + }, + "badge": "Iron", + "title": "Foreign Keys" + } + }, + "title": "Schema", + "required": ["primaryKey"] + }, + "dialect": { + "description": "The Dialect defines a simple format for describing the various dialects of CSV files in a language-independent manner. In a database, the values in the fields are 'null'.", + "type": "object", + "properties": { + "delimiter": { + "description": "The delimiter specifies the character sequence which should separate fields (columns). Common characters are ',' (comma), ';' (semicolon), '.' (point) and '\\t' (tab).", + "type": ["string", "null"], + "examples": [";"], + "badge": "Silver", + "title": "Delimiter" + }, + "decimalSeparator": { + "description": "The symbol used to separate the integer part from the fractional part of a number written in decimal form. Depending on language and region this symbol can be '.' or ','.", + "type": ["string", "null"], + "examples": ["."], + "badge": "Silver", + "title": "Decimal separator" + } + }, + "badge": "Silver", + "title": "Dialect", + "options": { + "hidden": true + } + } + } +} \ No newline at end of file diff --git a/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/general.json b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/general.json new file mode 100644 index 0000000..f0bbfd6 --- /dev/null +++ b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/general.json @@ -0,0 +1,151 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/OpenEnergyPlatform/oemetadata/production/metadata/v20/v20/build_source/schemas/general.json", + "type": "object", + "properties": { + "@id": { + "description": "A Uniform Resource Identifier (URI) that links the resource via the OpenEnergyDatabus (DBpedia Databus).", + "type": ["string", "null"], + "examples": ["https://databus.openenergyplatform.org/oeplatform/supply/wri_global_power_plant_database/2022-11-07"], + "badge": "Platinum", + "title": "@Id", + "readOnly": true + }, + "name": { + "description": "A filename or database conform table name.", + "type": ["string", "null"], + "examples": ["oemetadata_table_template"], + "badge": "Iron", + "title": "Name" + }, + "topics": { + "description": "An array of predefined topics that correspond to the database schemas of the OEP.", + "type": "array", + "items": { + "description": "The topics are used to group the data in the database.", + "type": ["string", "null"], + "examples": ["model_draft"], + "badge": "Bronze", + "title": "Topic" + }, + "badge": "Bronze", + "title": "Topics" + }, + "title": { + "description": "A human readable table name.", + "type": ["string", "null"], + "examples": ["OEMetadata Table Template"], + "badge": "Silver", + "title": "Title" + }, + "path": { + "description": "A unique identifier (URI/UUID/DOI) for the table or file.", + "type": ["string", "null"], + "examples": ["http://openenergyplatform.org/dataedit/view/model_draft/oemetadata_table_template"], + "badge": "Bronze", + "title": "Path", + "readOnly": true + }, + "description": { + "description": "A description of the table. It should be usable as summary information for the table that is described by the metadata.", + "type": ["string", "null"], + "examples": ["Example table used to illustrate the OEMetadata structure and features."], + "badge": "Silver", + "title": "Description" + }, + "languages": { + "description": "An array of languages used within the described data structures (e.g. titles, descriptions) or metadata.", + "type": "array", + "items": { + "description": "The language keys must follow the Standard IETF (BCP47) and can be repeated if more languages are used.", + "type": ["string", "null"], + "examples": ["en-GB", "de-DE"], + "badge": "Gold", + "title": "Language" + }, + "badge": "Gold", + "title": "Languages" + }, + "subject": { + "description": "An array of objects that references to the subjects of the resource in ontology terms.", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "A class label of the ontology term.", + "type": ["string", "null"], + "examples": ["energy"], + "badge": "Platinum", + "title": "Subject Name" + }, + "@id": { + "description": "A unique identifier (URI/IRI) of the ontology class.", + "type": ["string", "null"], + "examples": ["https://openenergyplatform.org/ontology/oeo/OEO_00000150"], + "badge": "Platinum", + "title": "Subject Identifier", + "format": "uri" + } + }, + "badge": "Platinum", + "title": "Subject" + }, + "badge": "Platinum", + "title": "Subject" + }, + "keywords": { + "description": "An array of freely selectable keywords that help with searching and structuring.", + "type": "array", + "items": { + "description": "The keyword are used and managed in the OEP as table tags.", + "type": ["string", "null"], + "examples": ["example","ODbL-1.0","NFDI4Energy"], + "badge": "Silver", + "title": "Keyword" + }, + "badge": "Silver", + "title": "Keywords" + }, + "publicationDate": { + "description": "A date of publication of the data or metadata. The date format is ISO 8601 (YYYY-MM-DD).", + "type": ["string", "null"], + "examples": ["2024-10-15"], + "badge": "Bronze", + "title": "Publication Date", + "format": "date" + }, + "embargoPeriod": { + "description": "An object that describes the embargo period during which public access to the data is not allowed.", + "type": "object", + "properties": { + "start": { + "description": "The start date of the embargo period. The date of the data (metadata) upload.", + "type": ["string", "null"], + "examples": ["2024-10-11"], + "badge": "Bronze", + "title": "Embargo Period Start", + "format": "date" + }, + "end": { + "description": "The end date of the embargo period. This is the intended publication date.", + "type": ["string", "null"], + "examples": ["2025-01-01"], + "badge": "Bronze", + "title": "Embargo Period End (Publication Date)", + "format": "date" + }, + "isActive": { + "description": "A boolean key that indicates if the embargo period is currently active. Must be changed to False on the embargo period end date.", + "type": ["boolean", "null"], + "examples": [true], + "badge": "Bronze", + "title": "Embargo Period is Active " + } + }, + "badge": "Bronze", + "title": "Embargo Period" + } + }, + "required": ["name"] +} diff --git a/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/licenses.json b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/licenses.json new file mode 100644 index 0000000..011c4ec --- /dev/null +++ b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/licenses.json @@ -0,0 +1,63 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/OpenEnergyPlatform/oemetadata/production/metadata/v20/v20/build_source/schemas/licenses.json", + "type": "object", + "properties": { + "licenses": { + "description": "An array of objects of licenses under which the described data is provided.", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "The SPDX identifier.", + "type": ["string", "null"], + "examples": ["ODbL-1.0"], + "badge": "Bronze", + "title": "Name" + }, + "title": { + "description": "The official (human readable) title of the license.", + "type": ["string", "null"], + "examples": ["Open Data Commons Open Database License 1.0"], + "badge": "Bronze", + "title": "Title" + }, + "path": { + "description": "A link or path to the license text.", + "type": ["string", "null"], + "examples": ["https://opendatacommons.org/licenses/odbl/1-0/index.html"], + "badge": "Bronze", + "title": "Path", + "format": "uri" + }, + "instruction": { + "description": "A short description of rights and obligations. The use of tl;drLegal is recommended.", + "type": ["string", "null"], + "examples": ["You are free to share and change, but you must attribute, and share derivations under the same license. See https://tldrlegal.com/license/odc-open-database-license-(odbl) for further information."], + "badge": "Bronze", + "title": "Instruction" + }, + "attribution": { + "description": "A copyright holder of the data. Must be provided if attribution licenses are used.", + "type": ["string", "null"], + "examples": ["© Reiner Lemoine Institut"], + "badge": "Bronze", + "title": "Attribution" + }, + "copyrightStatement": { + "description": "A link or path that proves that the source or data has the appropriate license. This can be a page number or website imprint.", + "type": ["string", "null"], + "examples": ["https://github.com/OpenEnergyPlatform/oemetadata/blob/develop/LICENSE.txt"], + "badge": "Bronze", + "title": "Copyright Statement" + } + }, + "badge": "Bronze", + "title": "License" + }, + "badge": "Bronze", + "title": "Licenses" + } + } +} \ No newline at end of file diff --git a/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/meta.json b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/meta.json new file mode 100644 index 0000000..d4407eb --- /dev/null +++ b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/meta.json @@ -0,0 +1,54 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/OpenEnergyPlatform/oemetadata/production/metadata/v20/v20/build_source/schemas/meta.json", + "type": "object", + "properties": { + "metaMetadata": { + "description": "An object that describes the metadata themselves, their format, version and license.", + "type": "object", + "properties": { + "metadataVersion": { + "description": "Type and version number of the metadata.", + "examples": ["OEMetadata-2.0.1"], + "type": ["string", "null"], + "badge": null, + "title": "Metadata Version" + }, + "metadataLicense": { + "description": "The license of the OEMetadata. ", + "type": "object", + "properties": { + "name": { + "description": "The SPDX identifier.", + "type": ["string", "null"], + "examples": ["CC0-1.0"], + "badge": null, + "title": "License Name" + }, + "title": { + "description": "The official (human readable) title of the license.", + "type": ["string", "null"], + "examples": ["Creative Commons Zero v1.0 Universal"], + "badge": null, + "title": "License Title" + }, + "path": { + "description": "A link or path to the license text.", + "type": ["string", "null"], + "examples": ["https://creativecommons.org/publicdomain/zero/1.0"], + "badge": null, + "title": "License Path", + "format": "uri" + } + }, + "badge": null, + "title": "Metadata License" + } + }, + "title": "Meta Metadata", + "options": { + "hidden": true + } + } + } +} \ No newline at end of file diff --git a/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/provenance.json b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/provenance.json new file mode 100644 index 0000000..2eceff5 --- /dev/null +++ b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/provenance.json @@ -0,0 +1,76 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/OpenEnergyPlatform/oemetadata/production/metadata/v20/v20/build_source/schemas/provenance.json", + "type": "object", + "properties": { + "contributors": { + "description": "An array of objects of contributors and contributions to the data or metadata.", + "type": "array", + "items": { + "type": "object", + "properties": { + "title": { + "description": "A full name of the contributor.", + "type": ["string", "null"], + "examples": ["Ludwig Hülk"], + "badge": "Bronze", + "title": "Contributor Title" + }, + "path": { + "description": "A qualified link or path pointing to a relevant location online for the contributor. This can be the GitHub page or ORCID.", + "type": ["string", "null"], + "examples": ["https://github.com/Ludee"], + "badge": "Bronze", + "title": "Path" + }, + "organization": { + "description": "A string describing the organization this contributor is affiliated to. This can be relevant for the copyright.", + "type": ["string", "null"], + "examples": ["Reiner Lemoine Institut"], + "badge": "Bronze", + "title": "Organization" + }, + "roles": { + "description": "An array describing the roles of the contributor.", + "type": "array", + "items": { + "description": "A role is recommended to follow an established vocabulary: DataCite Metadata Schema’s contributorRole. Useful roles to indicate are: DataCollector, ContactPerson, and DataCurator.", + "type": ["string", "null"], + "examples": ["DataCollector", "DataCurator"], + "badge": "Bronze", + "title": "Role" + }, + "badge": "Bronze", + "title": "Roles" + }, + "date": { + "description": "The date of the final contribution. Date Format is ISO 8601.", + "type": ["string", "null"], + "examples": ["2024-10-21"], + "badge": "Bronze", + "title": "Date", + "format": "date" + }, + "object": { + "description": "The object of the contribution. Which part of the package was supplied or changed.", + "type": ["string", "null"], + "examples": ["data and metadata"], + "badge": "Bronze", + "title": "Object" + }, + "comment": { + "description": "A free-text commentary on what has been done.", + "type": ["string", "null"], + "examples": ["Add metadata example."], + "badge": "Bronze", + "title": "Comment" + } + }, + "badge": "Bronze", + "title": "Contributor" + }, + "badge": "Bronze", + "title": "Contributors" + } + } +} \ No newline at end of file diff --git a/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/review.json b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/review.json new file mode 100644 index 0000000..5d40519 --- /dev/null +++ b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/review.json @@ -0,0 +1,32 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/OpenEnergyPlatform/oemetadata/production/metadata/v20/v20/build_source/schemas/review.json", + "type": "object", + "properties": { + "review": { + "description": "The metadata on the OEP can go through an open peer review process. See the Academy course [Open Peer Review](https://openenergyplatform.github.io/academy/courses/09_peer_review/) for further information.", + "type": "object", + "properties": { + "path": { + "description": "A link or path to the documented open peer review.", + "type": ["string", "null"], + "examples": ["https://openenergyplatform.org/dataedit/view/model_draft/oep_table_example/open_peer_review/"], + "badge": null, + "title": "Path", + "format": "uri" + }, + "badge": { + "description": "A badge of either Iron, Bronze, Silver, Gold or Platinum is used to label the quality of the metadata.", + "type": ["string", "null"], + "examples": ["Platinum"], + "badge": null, + "title": "Badge" + } + }, + "title": "Review", + "options": { + "hidden": true + } + } + } +} \ No newline at end of file diff --git a/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/sources.json b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/sources.json new file mode 100644 index 0000000..45f322a --- /dev/null +++ b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/sources.json @@ -0,0 +1,118 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/OpenEnergyPlatform/oemetadata/production/metadata/v20/v20/build_source/schemas/sources.json", + "type": "object", + "properties": { + "sources": { + "description": "An array of objects with the used and underlying sources of the data and metadata.", + "type": "array", + "items": { + "type": "object", + "properties": { + "title": { + "description": "A human readable title of the source, a document title or organisation name.", + "type": ["string", "null"], + "examples": ["IPCC Sixth Assessment Report (AR6) - Climate Change 2023 - Synthesis Report"], + "badge": "Bronze", + "title": "Source Title" + }, + "authors": { + "description": "An array of the full names of the authors of the source material.", + "type": "array", + "items": { + "description": "The authors of the source.", + "type": ["string", "null"], + "examples": ["Hoesung Lee","José Romero", "The Core Writing Team"], + "badge": "Bronze", + "title": "Author" + }, + "badge": "Bronze", + "title": "Authors" + }, + "description": { + "description": "A free text description of the source.", + "type": ["string", "null"], + "examples": ["A Report of the Intergovernmental Panel on Climate Change."], + "badge": "Bronze", + "title": "Source Description" + }, + "publicationYear": { + "description": "Indicates the year when the work was published.", + "type": ["string", "null"], + "examples": ["2023"], + "badge": "Bronze", + "title": "Publication Year" + }, + "path": { + "description": "A DOI or link to the original source.", + "type": ["string", "null"], + "examples": ["https://www.ipcc.ch/report/ar6/syr/downloads/report/IPCC_AR6_SYR_FullVolume.pdf"], + "badge": "Bronze", + "title": "DOI", + "format": "uri" + }, + "sourceLicenses": { + "type": "array", + "items": { + "description": "An array of objects of licenses under which the described source is provided. See https://openenergyplatform.github.io/academy/courses/08_licensing/ for further information.", + "type": "object", + "properties": { + "name": { + "description": "The SPDX identifier.", + "type": ["string", "null"], + "examples": ["CC-BY-4.0"], + "badge": "Bronze", + "title": "Name" + }, + "title": { + "description": "The official (human readable) title of the license.", + "type": ["string", "null"], + "examples": ["Creative Commons Attribution 4.0 International"], + "badge": "Bronze", + "title": "Title" + }, + "path": { + "description": "A link or path to the license text.", + "type": ["string", "null"], + "examples": ["https://creativecommons.org/licenses/by/4.0/legalcode"], + "badge": "Bronze", + "title": "License Identifier", + "format": "uri" + }, + "instruction": { + "description": "A short description of rights and obligations. The use of tl;drLegal is recommended.", + "type": ["string", "null"], + "examples": ["You are free to share and change, but you must attribute. See https://tldrlegal.com/license/odc-open-database-license-odbl for further information."], + "badge": "Bronze", + "title": "Instruction" + }, + "attribution": { + "description": "A copyright owner of the source. Must be provided if attribution licenses are used.", + "type": ["string", "null"], + "examples": ["© Intergovernmental Panel on Climate Change 2023"], + "badge": "Bronze", + "title": "Attribution" + }, + "copyrightStatement": { + "description": "A link or path that proves that the source or data has the appropriate license. This can be a page number or website imprint.", + "type": ["string", "null"], + "examples": ["https://www.ipcc.ch/copyright/"], + "badge": "Bronze", + "title": "Copyright Statement" + } + }, + "badge": "Bronze", + "title": "Licenses" + }, + "badge": "Bronze", + "title": "Licenses" + } + }, + "badge": "Bronze", + "title": "Sources" + }, + "badge": "Bronze", + "title": "Sources" + } + } +} \ No newline at end of file diff --git a/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/spatial.json b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/spatial.json new file mode 100644 index 0000000..397a2cd --- /dev/null +++ b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/spatial.json @@ -0,0 +1,109 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/OpenEnergyPlatform/oemetadata/production/metadata/v20/v20/build_source/schemas/spatial.json", + "type": "object", + "properties": { + "spatial": { + "description": "An object that describes the spatial context of the data.", + "type": "object", + "properties": { + "location": { + "description": "An object that describes a covered area or region.", + "type": "object", + "properties": { + "address": { + "description": "An address of the location of the data. May be specified with street name, house number, zip code, and city name.", + "type": ["string", "null"], + "examples": ["Rudower Chaussee 12, 12489 Berlin"], + "badge": "Silver", + "title": "Address" + }, + "@id": { + "description": "A path or URI to a specific location. It can use Wikidata or OpenStreetMap.", + "type": ["string", "null"], + "examples": ["https://www.wikidata.org/wiki/Q77077223"], + "badge": "Platinum", + "title": "Address Identifier" + }, + "latitude": { + "description": "The latitude (lat) information of the location. Specifies the north / south position of the geometry.", + "type": ["string", "null"], + "examples": ["52.432822"], + "badge": "Gold", + "title": "Latitude" + }, + "longitude": { + "description": "The longitude (lon) information of the location. Specifies the east / west position of the geometry.", + "type": ["string", "null"], + "examples": ["13.5351004"], + "badge": "Gold", + "title": "Longitude" + } + }, + "badge": "Silver", + "title": "Location" + }, + "extent": { + "description": "An object that describes a covered area or region.", + "type": "object", + "properties": { + "name": { + "description": "The name of the region.", + "type": ["string", "null"], + "examples": ["Berlin"], + "badge": "Silver", + "title": "Extent Name" + }, + "@id": { + "description": "A URI reference for the region.", + "type": ["string", "null"], + "examples": ["https://www.wikidata.org/wiki/Q64"], + "format": "uri", + "badge": "Platinum", + "title": "Extent Identifier" + }, + "resolutionValue": { + "description": "The value of the spatial resolution.", + "type": ["string", "null"], + "examples": ["100"], + "badge": "Silver", + "title": "Spatial Resolution Value" + }, + "resolutionUnit": { + "description": "The unit of the spatial resolution.", + "type": ["string", "null"], + "examples": ["m"], + "badge": "Silver", + "title": "Spatial Resolution Unit" + }, + "boundingBox": { + "description": "The covered area specified by the coordinates of a bounding box. The format is [minLon, minLat, maxLon, maxLat] or [W,S,E,N].", + "type": "array", + "examples": [13.08825, 52.33859, 13.76104, 52.6754], + "items": { + "type": "number" + }, + "minItems": 4, + "maxItems": 4, + "badge": "Gold", + "title": "Bounding Box" + }, + "crs": { + "description": "The Coordinate Reference System, specified as an EPSG code.", + "type": ["string", "null"], + "examples": ["EPSG:4326"], + "badge": "Gold", + "title": " Coordinate Reference System (CRS)" + } + + + }, + "badge": "Silver", + "title": "Extent" + } + }, + "badge": "Silver", + "title": "Spatial" + } + } +} \ No newline at end of file diff --git a/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/temporal.json b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/temporal.json new file mode 100644 index 0000000..4604e48 --- /dev/null +++ b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/schemas/temporal.json @@ -0,0 +1,80 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/OpenEnergyPlatform/oemetadata/production/metadata/v20/v20/build_source/schemas/temporal.json", + "type": "object", + "properties": { + "temporal": { + "description": "An object with the time period covered in the data. Temporal information should contain either a \"referenceDate\" or the keys that describe a time series, in rare cases both.", + "type": "object", + "properties": { + "referenceDate": { + "description": "A base year, month or day. The time for which the data is should be accurate. Date Format is ISO 8601.", + "type": ["string", "null"], + "examples": ["2020-01-01"], + "badge": "Silver", + "title": "Reference Date", + "format": "date" + }, + "timeseries": { + "description": "An array that describe the timeseries.", + "type": "array", + "items": { + "type": "object", + "properties": { + "start": { + "description": "The start time of a time series.", + "type": ["string", "null"], + "examples": ["2020-01-01T00:00:00+01:00"], + "badge": "Silver", + "title": "Timeseries Start", + "format": "date-time" + }, + "end": { + "description": "The temporal end point of a time series.", + "type": ["string", "null"], + "examples": ["2020-01-01T23:59:30+01:00"], + "badge": "Silver", + "title": "Timeseries End", + "format": "date-time" + }, + "resolutionValue": { + "description": "The time span between individual information points in a time series. The value of the resolution.", + "type": ["string", "null"], + "examples": ["15"], + "badge": "Silver", + "title": "Timeseries Resolution Value" + }, + "resolutionUnit": { + "description": "The unit of the temporal resolution.", + "type": ["string", "null"], + "examples": ["min"], + "badge": "Silver", + "title": "Timeseries Resolution Unit" + }, + "alignment": { + "description": "An indicator of whether timestamps in a time series are to the left, right or in the centre.", + "type": ["string", "null"], + "examples": ["left"], + "badge": "Gold", + "title": "Timeseries Alignment" + }, + "aggregationType": { + "description": "An indicator of whether the values are a sum, an average or a current value.", + "type": ["string", "null"], + "examples": ["current"], + "badge": "Gold", + "title": "Timeseries Aggregation Type" + } + }, + "badge": "Silver", + "title": "Timeseries" + }, + "badge": "Silver", + "title": "Timeseries" + } + }, + "badge": "Silver", + "title": "Temporal" + } + } +} \ No newline at end of file diff --git a/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/scripts/__init__.py b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/scripts/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/scripts/create_example.py b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/scripts/create_example.py new file mode 100644 index 0000000..f114d26 --- /dev/null +++ b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/scripts/create_example.py @@ -0,0 +1,264 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# SPDX-FileCopyrightText: 2024 Ludwig Hülk <@Ludee> © Reiner Lemoine Institut +# SPDX-FileCopyrightText: 2024 Jonas Huber <jh-RLI> © Reiner Lemoine Institut +# +# SPDX-License-Identifier: MIT + +""" +Title: Create example from schema +Description: Create example.json from schema.json +Author: jh-RLI, Ludee +Email: jonas.huber@rl-institut.de +Date: 2024-05-30 +Version: 1.0.0 +""" + +# Import +import json +import logging +import os + +from typing import Any, Dict, Union, List +from pathlib import Path +from settings import RESOLVED_SCHEMA_FILE_NAME, EXAMPLE_PATH, LOG_FORMAT, SCHEMA_EXAMPLE_FIELDS, SCHEMA_EXAMPLE_PROV + +# Configuration +logging.basicConfig(level=logging.INFO, format=LOG_FORMAT) +logger = logging.getLogger(__name__) + + +def read_schema(filepath: str) -> Dict[str, Any]: + """Read a JSON schema from a file. + + Args: + filepath (str): The path to the JSON schema file. + + Returns: + Dict[str, Any]: The JSON schema as a dictionary. + """ + + with open(filepath, "r", encoding="utf-8") as file: + schema = json.load(file) + logger.info(f"Processing schema: {schema}") + return schema + + +def read_metadata_schema(filepath: str) -> Dict[str, Any]: + """Read a JSON schema from a file. + + Args: + filepath (str): The path to the JSON schema file. + + Returns: + Dict[str, Any]: The JSON schema as a dictionary. + """ + if not os.path.exists(filepath): + logger.info(f"Error: File '{filepath}' does not exist.") + return {} + + try: + with open(filepath, "r", encoding="utf-8") as file: + schema = json.load(file) + + # Basic validation of schema structure + if not isinstance(schema, dict): + print("Error: Schema is not a dictionary. Check the schema format.") + return {} + + logger.info(f"Schema loaded successfully from {filepath}") + logger.info(f"Schema top-level keys: {list(schema.keys())}") + + # Additional debugging info: Check expected keys + if "$schema" not in schema or "type" not in schema: + logger.info( + "Warning: Schema may be missing key fields like '$schema' or 'type'.") + + logger.info( + f"Full schema content (trimmed for large files): {str(schema)[:500]}...") + + return schema + + except json.JSONDecodeError as e: + logger.info(f"Error reading JSON: {e}") + return {} + except Exception as e: + logger.info(f"An unexpected error occurred while reading the schema: {e}") + return {} + + +# def generate_example_old( +# schema: Dict[str, Any] +# ) -> Union[Dict[str, Any], List[Any], str, None]: +# """Generate a JSON object from the schema using the +# example values provided. +# +# Args: +# schema (Dict[str, Any]): The JSON schema. +# +# Returns: +# Union[Dict[str, Any], List[Any], str, None]: +# A JSON object generated from the schema. +# """ +# if "examples" in schema: +# return schema["examples"] +# +# schema_type = schema.get("type", None) +# if isinstance(schema_type, list): +# schema_type = schema_type[0] +# +# if schema_type == "object": +# example_object = {} +# properties = schema.get("properties", {}) +# for key, value in properties.items(): +# example_object[key] = generate_example(value) +# return example_object +# +# elif schema_type == "array": +# items = schema.get("items", {}) +# +# # Fix: Avoid double-wrapping by checking if the generated +# # example is already a list +# example = generate_example(items) +# +# if isinstance(example, list): +# return example # If it's already a list, return it directly +# else: +# return [example] # Otherwise, wrap it in a list +# +# elif schema_type == "string": +# return "" +# +# elif schema_type == "null": +# return None +# +# return None + + +def extract_examples_from_schema(schema: Dict[str, Any]) -> Union[ + Dict[str, Any], List[Any], str, None]: + """Generate a valid example from the schema using the provided example values.""" + + # If the schema has an "examples" field, handle it appropriately + if "examples" in schema: + examples = schema["examples"] + if isinstance(examples, list): + # Return a single value if the list contains one item + if len(examples) == 1: + return examples[0] + return examples # If multiple items, return the whole list + return examples # If it's a single item, return the value + + # If the schema type is an object, process each property recursively + schema_type = schema.get("type") + if isinstance(schema_type, list): + schema_type = schema_type[0] + + if schema_type == "object": + example_object = {} + properties = schema.get("properties", {}) + for key, value in properties.items(): + example_object[key] = extract_examples_from_schema(value) + return example_object + + # If the schema type is an array, process the items recursively + elif schema_type == "array": + items = schema.get("items", {}) + example = extract_examples_from_schema(items) + return [example] if not isinstance(example, list) else example + + # Handle basic types like string, number, boolean, null + elif schema_type == "string": + return "" # Example string + elif schema_type == "number": + return 0 # Example number + elif schema_type == "boolean": + return True # Example boolean + elif schema_type == "null": + return None # Example null + + return None # Default fallback + + +def create_json_from_schema(schema_file: str) -> Dict[str, Any]: + """Generate a JSON object that conforms to the schema read from a file. + + Args: + schema_file (str): The path to the JSON schema file. + + Returns: + Dict[str, Any]: A JSON object generated from the schema. + """ + schema = read_metadata_schema(schema_file) + print(f"Create JSON from schema: {schema_file}") + return extract_examples_from_schema(schema) + print(f"Create JSON object: {result}") + + +def save_json(data: Dict[str, Any], filename: Path) -> None: + """Save the given data as a JSON file. + + Args: + data (Dict[str, Any]): The JSON data to be saved. + filename (str): The filename where the JSON data will be saved. + """ + with open(filename, "w", encoding="utf-8") as file: + json.dump(data, file, ensure_ascii=False, indent=4) + + logger.info(f"example JSON generated and saved to {filename}") + + +def test_oemetadata_schema_should_validate_oemetadata_example(example): + from jsonschema import validate, ValidationError + from metadata.v2.v20.schema import OEMETADATA_V20_SCHEMA + + try: + validate(example, OEMETADATA_V20_SCHEMA) + logger.info("OEMetadata Example is valid OEMetadata Schema (v2.0).") + except ValidationError as e: + logger.info("Cannot validate OEMetadata Example with Schema (v2.0)!", e) + + +def find_and_replace_key(data, target_key, new_value): + if isinstance(data, dict): + for key, value in data.items(): + if key == target_key: + data[key] = new_value + return True # Return True if replacement is successful + elif isinstance(value, (dict, list)): + if find_and_replace_key(value, target_key, new_value): + return True # Return True if replacement occurs in nested structure + elif isinstance(data, list): + for item in data: + if find_and_replace_key(item, target_key, new_value): + return True + return False # Return False if key not found + + +def replace_key_in_json(file_path, target_key, new_value): + # Open and read the JSON file + with open(file_path, 'r') as file: + data = json.load(file) + + # Perform the key replacement + if find_and_replace_key(data, target_key, new_value): + # Save the updated JSON data back to the file + with open(file_path, 'w', encoding="utf-8") as file: + json.dump(data, file, ensure_ascii=False, indent=4) + logger.info(f"Updated '{target_key}' to '{new_value}' in {file_path}") + else: + logger.info(f"Key '{target_key}' not found in JSON file.") + + +if __name__ == "__main__": + logger.info("Create OEMetadata Example from Schema.") + schema_filename = RESOLVED_SCHEMA_FILE_NAME + json_data = create_json_from_schema(schema_filename) + save_json(json_data, EXAMPLE_PATH) + logger.info("OEMetadata Example created!") + example_fields = read_schema(SCHEMA_EXAMPLE_FIELDS) + replace_key_in_json(EXAMPLE_PATH, 'fields', example_fields) + example_contributors = read_schema(SCHEMA_EXAMPLE_PROV) + replace_key_in_json(EXAMPLE_PATH, 'contributors', example_contributors) + test_oemetadata_schema_should_validate_oemetadata_example(json_data) diff --git a/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/scripts/create_schema.py b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/scripts/create_schema.py new file mode 100644 index 0000000..8a2d4c4 --- /dev/null +++ b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/scripts/create_schema.py @@ -0,0 +1,216 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# SPDX-FileCopyrightText: 2024 Ludwig Hülk <@Ludee> © Reiner Lemoine Institut +# SPDX-FileCopyrightText: 2024 Jonas Huber <jh-RLI> © Reiner Lemoine Institut +# +# SPDX-License-Identifier: MIT + +""" +Title: Create OEMetadata schema from schemas +Description: Resolve "$ref" elements in schema.json +Author: jh-RLI, Ludee +Email: jonas.huber@rl-institut.de +Date: 2024-05-30 +Version: 1.0.0 + +requires: "pip install jsonschema referencing" + +Usage: Script with additional arguments --debug for more detailed output. + Requires the folder structure introduced in OEMetadata v2.0.1. +""" + +# Standard Library Imports +# import os +import sys +import json +import logging + +# from datetime import datetime +from urllib.parse import urljoin +import argparse + +from referencing import Registry, Resource +from jsonschema import Draft7Validator, Draft202012Validator + +from settings import ( + MAIN_SCHEMA_PATH, + SCHEMA_REFS, + RESOLVED_SCHEMA_FILE_NAME, + EXPECTED_SCHEMA_PATH, + LOG_FORMAT, +) + +# Configuration + +logging.basicConfig(level=logging.INFO, format=LOG_FORMAT) +logger = logging.getLogger(__name__) + + +# Function Definitions +def setup(): + """ + Setup function to initialize resources or configurations. + """ + logger.info("Setup complete.") + + +# Load the main schema +def load_schema(schema_path): + with open(schema_path, "r", encoding="utf-8") as file: + return json.load(file) + + +# Ensure the schema has the $schema field +def ensure_schema_field(schema): + if "$schema" not in schema: + schema["$schema"] = "https://json-schema.org/draft/2020-12/schema" + return schema + + +# Debugging function to print registry contents +def print_registry_contents(registry, debug): + if debug: + print("Registry Contents:") + for uri, resource in registry._resources.items(): + print(f"{uri}: {resource.contents}") + + +# Resolve and merge references using referencing library +def resolve_and_merge(schema_path, debug): + schema = load_schema(schema_path) + schema = ensure_schema_field(schema) + + # Create a registry and register the schemas + base_uri = MAIN_SCHEMA_PATH.resolve().parent.as_uri() + "/" + registry = Registry().with_resource(base_uri, Resource.from_contents(schema)) + + for schema_file in SCHEMA_REFS.glob("*.json"): + try: + with open(schema_file, "r", encoding="utf-8") as file: + ref_schema = json.load(file) + ref_schema = ensure_schema_field(ref_schema) + schema_uri = urljoin(base_uri, schema_file.name) + registry = registry.with_resource( + schema_uri, Resource.from_contents(ref_schema) + ) + except json.JSONDecodeError as e: + logger.error(f"Error decoding JSON from {schema_file}: {e}") + continue + + # Print registry contents for debugging + print_registry_contents(registry, debug) + + # Resolve references in the schema + def resolve_references(schema, registry, base_uri): + if isinstance(schema, dict): + if "$ref" in schema: + ref_uri = urljoin(base_uri, schema["$ref"]) + if debug: + print(f"Resolving reference {ref_uri}") # Debugging + try: + ref_schema = registry[ref_uri] + if debug: + print( + f"Resolved reference {ref_uri} to {ref_schema.contents}" + ) # Debugging + return ref_schema.contents[ + "properties" + ] # Return only the properties + except KeyError as e: + raise ValueError(f"Reference {ref_uri} could not be resolved: {e}") + else: + return { + key: resolve_references(value, registry, base_uri) + for key, value in schema.items() + } + elif isinstance(schema, list): + return [resolve_references(item, registry, base_uri) for item in schema] + return schema + + # Resolve the top-level properties + def resolve_top_level_properties(schema, registry, base_uri): + resolved_properties = {} + for prop, value in schema["properties"].items(): + if isinstance(value, dict) and "properties" in value: + resolved_value = resolve_references( + value["properties"], registry, base_uri + ) + resolved_properties[prop] = resolved_value + else: + resolved_value = resolve_references(value, registry, base_uri) + for i, v in resolved_value.items(): + if isinstance(v, dict) and i != "items": + resolved_properties[i] = v + + elif prop == "resources": + resolved_value = resolve_references(value, registry, base_uri) + resources = {} + for _k, _v in resolved_value["items"].items(): + if isinstance(_v, dict): + # Update all values instead of key:values to + # avoid adding schema_structure.json wrapper + # objects + for element in _v.values(): + resources.update(element) + resolved_properties[prop] = resolved_value + # Patch the missing keys + resolved_properties[prop]["items"] = { + "type": "object", + "properties": {**resources}, + } + + else: + resolved_properties[prop] = resolved_value + return resolved_properties + + schema["properties"] = resolve_top_level_properties(schema, registry, base_uri) + return schema + + +def validate_schema(resolved_schema, expected_schema): + validator = Draft202012Validator(expected_schema) + errors = sorted(validator.iter_errors(resolved_schema), key=lambda e: e.path) + for error in errors: + print(f"Validation error at {list(error.path)}: {error.message}") + + +# Load expected schema (without refs) for validation +def load_expected_schema(expected_schema_path): + with open(expected_schema_path, "r", encoding="utf-8") as file: + return json.load(file) + + +def main(debug): + """ + Main function to execute the script's primary logic. + """ + try: + setup() + logger.info("Main execution started.") + + # Resolve and merge the schema + resolved_schema = resolve_and_merge(MAIN_SCHEMA_PATH, debug) + + # Save the resolved schema to a new file + with open(RESOLVED_SCHEMA_FILE_NAME, "w", encoding="utf-8") as output_file: + json.dump(resolved_schema, output_file, indent=2) + + # Load the expected schema and validate + expected_schema = load_expected_schema(EXPECTED_SCHEMA_PATH) + validate_schema(resolved_schema, expected_schema) + + logger.info("Main execution finished.") + except Exception as e: + logger.error("An error occurred: %s", e) + sys.exit(1) + + +if __name__ == "__main__": + parser = argparse.ArgumentParser( + description="Resolve and merge JSON schema references." + ) + parser.add_argument("--debug", action="store_true", help="Enable debugging output") + args = parser.parse_args() + + main(args.debug) diff --git a/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/scripts/create_template.py b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/scripts/create_template.py new file mode 100644 index 0000000..f2d9f18 --- /dev/null +++ b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/scripts/create_template.py @@ -0,0 +1,149 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# SPDX-FileCopyrightText: 2024 Ludwig Hülk <@Ludee> © Reiner Lemoine Institut +# SPDX-FileCopyrightText: 2024 Jonas Huber <jh-RLI> © Reiner Lemoine Institut +# +# SPDX-License-Identifier: MIT + +""" +Title: Create template from schema +Description: Create template.json from schema.json. +Author: jh-RLI, Ludee +Email: jonas.huber@rl-institut.de +Date: 2024-05-30 +Version: 1.0.0 +""" + +# Import + +import json +import logging + +from settings import RESOLVED_SCHEMA_FILE_NAME, TEMPLATE_PATH, LOG_FORMAT + +# Configuration + +logging.basicConfig(level=logging.INFO, format=LOG_FORMAT) +logger = logging.getLogger(__name__) + + +def generate_template(schema): + if isinstance(schema, bool): + return {} if schema else None + + if "type" not in schema and "properties" not in schema and "items" not in schema: + return None + + schema_type = schema.get("type") + + if isinstance(schema_type, list): + schema_type = schema_type[0] + + template = None + # Convert template string to actual type if necessary + # if schema_type == "array" and isinstance(template, str): + # try: + # template = json.loads(template.replace("'", '"')) + # except json.JSONDecodeError: + # pass + # return template + + if schema_type == "object" or "properties" in schema: + template = {} + properties = schema.get("properties", {}) + for prop, prop_schema in properties.items(): + template[prop] = generate_template(prop_schema) + additional_properties = schema.get("additionalProperties", True) + if isinstance(additional_properties, dict): + template["additional_property"] = generate_template(additional_properties) + return template + + if schema_type == "array": + item_schema = schema.get("items", {}) + return [generate_template(item_schema)] + + if schema_type == "string": + return "" + + if schema_type == "number": + return 0 + + if schema_type == "integer": + return 0 + + if schema_type == "boolean": + return False + + return None + + +def main(): + schema_file_path = RESOLVED_SCHEMA_FILE_NAME + + with open(schema_file_path, "r", encoding="utf-8") as schema_file: + schema = json.load(schema_file) + + template = generate_template(schema) + + template_file_path = TEMPLATE_PATH + with open(template_file_path, "w", encoding="utf-8") as template_file: + json.dump(template, template_file, indent=2, ensure_ascii=False) + + logger.info(f"template JSON generated and saved to {template_file_path}") + + # WARNING: The metaMetadata is missing and the boundingBox is wrong! + +def test_oemetadata_schema_should_validate_oemetadata_template(): + from jsonschema import validate, ValidationError + from metadata.v2.v20.template import OEMETADATA_V20_TEMPLATE + from metadata.v2.v20.schema import OEMETADATA_V20_SCHEMA + + try: + validate(OEMETADATA_V20_TEMPLATE, OEMETADATA_V20_SCHEMA) + print("OEMetadata Template is valid OEMetadata Schema (v2.0).") + except ValidationError as e: + print("Cannot validate OEMetadata Template with Schema (v2.0)!", e) + +def find_and_replace_key(data, target_key, new_value): + if isinstance(data, dict): + for key, value in data.items(): + if key == target_key: + data[key] = new_value + return True # Return True if replacement is successful + elif isinstance(value, (dict, list)): + if find_and_replace_key(value, target_key, new_value): + return True # Return True if replacement occurs in nested structure + elif isinstance(data, list): + for item in data: + if find_and_replace_key(item, target_key, new_value): + return True + return False # Return False if key not found + +def replace_key_in_json(file_path, target_key, new_value): + # Open and read the JSON file + with open(file_path, 'r') as file: + data = json.load(file) + + # Perform the key replacement + if find_and_replace_key(data, target_key, new_value): + # Save the updated JSON data back to the file + with open(file_path, 'w') as file: + json.dump(data, file, indent=4) + print(f"Updated '{target_key}' to '{new_value}' in {file_path}") + else: + print(f"Key '{target_key}' not found in JSON file.") + + +if __name__ == "__main__": + logger.info("Generation started.") + main() + replace_key_in_json(TEMPLATE_PATH, 'boundingBox', [0, 0, 0, 0]) + replace_key_in_json(TEMPLATE_PATH, 'metadataVersion', 'OEMetadata-2.0.1') + replace_key_in_json(TEMPLATE_PATH, 'metadataLicense', { + "name": "CC0-1.0", + "title": "Creative Commons Zero v1.0 Universal", + "path": "https://creativecommons.org/publicdomain/zero/1.0" + }) + test_oemetadata_schema_should_validate_oemetadata_template() + logger.info("Generation ended.") diff --git a/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/scripts/example/contributors.json b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/scripts/example/contributors.json new file mode 100644 index 0000000..9a50705 --- /dev/null +++ b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/scripts/example/contributors.json @@ -0,0 +1,20 @@ +[ + { + "title": "Ludwig Hülk", + "path": "https://github.com/Ludee", + "organization": "Reiner Lemoine Institut", + "roles": ["DataCollector"], + "date": "2024-11-19", + "object": "data", + "comment": "Date of data creation" + }, + { + "title": "Ludwig Hülk", + "path": "https://github.com/Ludee", + "organization": "Reiner Lemoine Institut", + "roles": ["DataCurator"], + "date": "2024-11-30", + "object": "metadata", + "comment": "Date of metadata creation" + } +] \ No newline at end of file diff --git a/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/scripts/example/contributors.json.license b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/scripts/example/contributors.json.license new file mode 100644 index 0000000..c3ac465 --- /dev/null +++ b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/scripts/example/contributors.json.license @@ -0,0 +1,4 @@ +# SPDX-FileCopyrightText: 2024 Ludwig Hülk <@Ludee> © Reiner Lemoine Institut +# SPDX-FileCopyrightText: 2024 Jonas Huber <jh-RLI> © Reiner Lemoine Institut +# +# SPDX-License-Identifier: MIT \ No newline at end of file diff --git a/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/scripts/example/fields.json b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/scripts/example/fields.json new file mode 100644 index 0000000..0d7d57e --- /dev/null +++ b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/scripts/example/fields.json @@ -0,0 +1,167 @@ +[ + { + "name": "id", + "description": "Unique identifier", + "type": "serial", + "nullable": false, + "unit": null, + "isAbout": [ + { + "name": "identifier", + "@id": "http://purl.obolibrary.org/obo/IAO_0020000" + } + ], + "valueReference": [ + { + "value": null, + "name": null, + "@id": null + } + ] + }, + { + "name": "name", + "description": "Technology Name", + "type": "text", + "nullable": true, + "unit": null, + "isAbout": [ + { + "name": "power generation technology", + "@id": "http://openenergy-platform.org/ontology/oeo/OEO_00010423" + } + ], + "valueReference": [ + { + "value": "wind", + "name": "wind power technology", + "@id": "http://openenergyplatform.org/ontology/oeo/OEO_00010424" + } + ] + }, + { + "name": "type", + "description": "Type of wind farm", + "type": "text", + "nullable": true, + "unit": null, + "isAbout": [ + { + "name": "wind farm", + "@id": "https://openenergyplatform.org/ontology/oeo/OEO_00000447/" + } + ], + "valueReference": [ + { + "value": "onshore", + "name": "onshore wind farm", + "@id": "https://openenergyplatform.org/ontology/oeo/OEO_00000311/" + }, + { + "value": "offshore", + "name": "offshore wind farm", + "@id": "https://openenergyplatform.org/ontology/oeo/OEO_00000308/" + } + ] + }, + { + "name": "year", + "description": "Reference year", + "type": "integer", + "nullable": true, + "unit": null, + "isAbout": [ + { + "name": "year", + "@id": "https://openenergyplatform.org/ontology/oeo/UO_0000036/" + } + ], + "valueReference": [ + { + "value": null, + "name": null, + "@id": null + } + ] + }, + { + "name": "value", + "description": "Bruttoleistung", + "type": "decimal", + "nullable": true, + "unit": "MW", + "isAbout": [ + { + "name": "nameplate capacity", + "@id": "https://openenergyplatform.org/ontology/oeo/OEO_00230003/" + } + ], + "valueReference": [ + { + "value": null, + "name": null, + "@id": null + } + ] + }, + { + "name": "is_active", + "description": "Betriebsstaus", + "type": "boolean", + "nullable": false, + "unit": null, + "isAbout": [ + { + "name": "Operating Mode Status", + "@id": "https://ontology.brickschema.org/brick/Operating_Mode_Status" + } + ], + "valueReference": [ + { + "value": null, + "name": null, + "@id": null + } + ] + }, + { + "name": "version", + "description": "Version", + "type": "integer", + "nullable": true, + "unit": null, + "isAbout": [ + { + "name": "version number", + "@id": "http://purl.obolibrary.org/obo/IAO_0000129" + } + ], + "valueReference": [ + { + "value": null, + "name": null, + "@id": null + } + ] + }, + { + "name": "comment", + "description": "", + "type": "text", + "nullable": true, + "unit": null, + "isAbout": [ + { + "name": "comment", + "@id": "http://semanticscience.org/resource/SIO_001167" + } + ], + "valueReference": [ + { + "value": null, + "name": null, + "@id": null + } + ] + } +] \ No newline at end of file diff --git a/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/scripts/example/fields.json.license b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/scripts/example/fields.json.license new file mode 100644 index 0000000..c3ac465 --- /dev/null +++ b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/scripts/example/fields.json.license @@ -0,0 +1,4 @@ +# SPDX-FileCopyrightText: 2024 Ludwig Hülk <@Ludee> © Reiner Lemoine Institut +# SPDX-FileCopyrightText: 2024 Jonas Huber <jh-RLI> © Reiner Lemoine Institut +# +# SPDX-License-Identifier: MIT \ No newline at end of file diff --git a/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/scripts/settings.py b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/scripts/settings.py new file mode 100644 index 0000000..ffaa68a --- /dev/null +++ b/services/backend_regimo/components/oep_access/oemeta/v2/v20/build_source/scripts/settings.py @@ -0,0 +1,23 @@ +# SPDX-FileCopyrightText: 2024 Ludwig Hülk <@Ludee> © Reiner Lemoine Institut +# SPDX-FileCopyrightText: 2024 Jonas Huber <jh-RLI> © Reiner Lemoine Institut +# +# SPDX-License-Identifier: MIT + +from pathlib import Path + +LOG_FORMAT = "%(asctime)s - %(name)s - %(levelname)s - %(message)s" + +BASE_PATH = Path("metadata/v2/") +VERSION = "v20" +VERSION_PATH = BASE_PATH / VERSION +SCHEMA_BUILD_PATH = VERSION_PATH / "build_source" +MAIN_SCHEMA_PATH = SCHEMA_BUILD_PATH / "schema_structure.json" +SCHEMA_REFS = SCHEMA_BUILD_PATH / "schemas" +SCHEMA_EXAMPLE_FIELDS = SCHEMA_BUILD_PATH / "scripts/example/fields.json" +SCHEMA_EXAMPLE_PROV = SCHEMA_BUILD_PATH / "scripts/example/contributors.json" +RESOLVED_SCHEMA_FILE_NAME = VERSION_PATH / "schema.json" +EXPECTED_SCHEMA_PATH = VERSION_PATH / "schema.json" + +EXAMPLE_PATH = VERSION_PATH / "example.json" + +TEMPLATE_PATH = VERSION_PATH / "template.json" diff --git a/services/backend_regimo/components/oep_access/oemeta/v2/v20/context.json b/services/backend_regimo/components/oep_access/oemeta/v2/v20/context.json new file mode 100644 index 0000000..c3c0969 --- /dev/null +++ b/services/backend_regimo/components/oep_access/oemeta/v2/v20/context.json @@ -0,0 +1,87 @@ +{ + "@context": { + "path": "@id", + "bfo": "http://purl.obolibrary.org/obo/bfo.owl#", + "csvw": "http://www.w3.org/ns/csvw#", + "dbo": "http://dbpedia.org/ontology/", + "dc": "http://purl.org/dc/elements/1.1/", + "dct": "http://purl.org/dc/terms/", + "obda": "https://w3id.org/obda/vocabulary#", + "oeo": "http://openenergyplatform.org/ontology/oeo/", + "owl": "http://www.w3.org/2002/07/owl#", + "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", + "rdfs": "http://www.w3.org/2000/01/rdf-schema#", + "saref": "https://saref.etsi.org/core/", + "time": "http://www.w3.org/2006/time#", + "xml": "http://www.w3.org/XML/1998/namespace", + "xsd": "http://www.w3.org/2001/XMLSchema#", + "title": { + "@id": "dct:title", + "@type": "xsd:string" + }, + "description": { + "@id": "dct:description", + "@type": "xsd:string" + }, + "comment": { + "@id": "rdfs:comment", + "@type": "xsd:string" + }, + "subject": { + "@id": "dc:subject", + "@type": "@id" + }, + "keywords": { + "@id": "dc:subject", + "@type": "xsd:string" + }, + "temporal": { + "@id": "time:hasTemporalDuration", + "@type": "@id" + }, + "timeseries": { + "@id": "time:hasDateTimeDescription", + "@type": "@id" + }, + "start": { + "@id": "dbo:startDateTime", + "@type": "xsd:dateTime" + }, + "end": { + "@id": "dbo:endDateTime", + "@type": "xsd:dateTime" + }, + "fields": { + "@id": "csvw:column", + "@type": "@id" + }, + "resources": { + "@id": "csvw:table", + "@type": "@id" + }, + "schema": { + "@id": "csvw:tableSchema", + "@type": "@id" + }, + "name": { + "@id": "rdfs:label", + "@type": "xsd:string" + }, + "type": { + "@id": "csvw:datatype", + "@type": "xsd:string" + }, + "unit": { + "@id": "oeo:OEO_00040010", + "@type": "xsd:string" + }, + "isAbout": { + "@id": "saref:isAbout", + "@type": "@id" + }, + "valueReference": { + "@id": "http://purl.org/goodrelations/v1#valueReference", + "@type": "@id" + } + } +} \ No newline at end of file diff --git a/services/backend_regimo/components/oep_access/oemeta/v2/v20/example.json b/services/backend_regimo/components/oep_access/oemeta/v2/v20/example.json new file mode 100644 index 0000000..3c62de51 --- /dev/null +++ b/services/backend_regimo/components/oep_access/oemeta/v2/v20/example.json @@ -0,0 +1,349 @@ +{ + "@context": "https://raw.githubusercontent.com/OpenEnergyPlatform/oemetadata/production/metadata/latest/context.json", + "name": "oep_oemetadata", + "title": "OEP OEMetadata", + "description": "A dataset for the OEMetadata examples.", + "id": "https://databus.openenergyplatform.org/oeplatform/reference", + "resources": [ + { + "@id": "https://databus.openenergyplatform.org/oeplatform/supply/wri_global_power_plant_database/2022-11-07", + "name": "oemetadata_table_template", + "topics": [ + "model_draft" + ], + "title": "OEMetadata Table Template", + "path": "http://openenergyplatform.org/dataedit/view/model_draft/oemetadata_table_template", + "description": "Example table used to illustrate the OEMetadata structure and features.", + "languages": [ + "en-GB", + "de-DE" + ], + "subject": [ + { + "name": "energy", + "@id": "https://openenergyplatform.org/ontology/oeo/OEO_00000150" + } + ], + "keywords": [ + "example", + "ODbL-1.0", + "NFDI4Energy" + ], + "publicationDate": "2024-10-15", + "embargoPeriod": { + "start": "2024-10-11", + "end": "2025-01-01", + "isActive": true + }, + "context": { + "title": "NFDI4Energy", + "homepage": "https://nfdi4energy.uol.de/", + "documentation": "https://nfdi4energy.uol.de/sites/about_us/", + "sourceCode": "https://github.com/NFDI4Energy", + "publisher": "Open Energy Platform (OEP)", + "publisherLogo": "https://github.com/OpenEnergyPlatform/organisation/blob/production/logo/OpenEnergyFamily_Logo_OpenEnergyPlatform.svg", + "contact": "contact@example.com", + "fundingAgency": " Deutsche Forschungsgemeinschaft (DFG)", + "fundingAgencyLogo": "https://upload.wikimedia.org/wikipedia/commons/8/86/DFG-logo-blau.svg", + "grantNo": "501865131" + }, + "spatial": { + "location": { + "address": "Rudower Chaussee 12, 12489 Berlin", + "@id": "https://www.wikidata.org/wiki/Q77077223", + "latitude": "52.432822", + "longitude": "13.5351004" + }, + "extent": { + "name": "Berlin", + "@id": "https://www.wikidata.org/wiki/Q64", + "resolutionValue": "100", + "resolutionUnit": "m", + "boundingBox": [ + 13.08825, + 52.33859, + 13.76104, + 52.6754 + ], + "crs": "EPSG:4326" + } + }, + "temporal": { + "referenceDate": "2020-01-01", + "timeseries": [ + { + "start": "2020-01-01T00:00:00+01:00", + "end": "2020-01-01T23:59:30+01:00", + "resolutionValue": "15", + "resolutionUnit": "min", + "alignment": "left", + "aggregationType": "current" + } + ] + }, + "sources": [ + { + "title": "IPCC Sixth Assessment Report (AR6) - Climate Change 2023 - Synthesis Report", + "authors": [ + "Hoesung Lee", + "José Romero", + "The Core Writing Team" + ], + "description": "A Report of the Intergovernmental Panel on Climate Change.", + "publicationYear": "2023", + "path": "https://www.ipcc.ch/report/ar6/syr/downloads/report/IPCC_AR6_SYR_FullVolume.pdf", + "sourceLicenses": [ + { + "name": "CC-BY-4.0", + "title": "Creative Commons Attribution 4.0 International", + "path": "https://creativecommons.org/licenses/by/4.0/legalcode", + "instruction": "You are free to share and change, but you must attribute. See https://tldrlegal.com/license/odc-open-database-license-odbl for further information.", + "attribution": "© Intergovernmental Panel on Climate Change 2023", + "copyrightStatement": "https://www.ipcc.ch/copyright/" + } + ] + } + ], + "licenses": [ + { + "name": "ODbL-1.0", + "title": "Open Data Commons Open Database License 1.0", + "path": "https://opendatacommons.org/licenses/odbl/1-0/index.html", + "instruction": "You are free to share and change, but you must attribute, and share derivations under the same license. See https://tldrlegal.com/license/odc-open-database-license-(odbl) for further information.", + "attribution": "© Reiner Lemoine Institut", + "copyrightStatement": "https://github.com/OpenEnergyPlatform/oemetadata/blob/develop/LICENSE.txt" + } + ], + "contributors": [ + { + "title": "Ludwig Hülk", + "path": "https://github.com/Ludee", + "organization": "Reiner Lemoine Institut", + "roles": [ + "DataCollector" + ], + "date": "2024-11-19", + "object": "data", + "comment": "Date of data creation" + }, + { + "title": "Ludwig Hülk", + "path": "https://github.com/Ludee", + "organization": "Reiner Lemoine Institut", + "roles": [ + "DataCurator" + ], + "date": "2024-11-30", + "object": "metadata", + "comment": "Date of metadata creation" + } + ], + "type": "table", + "format": "CSV", + "encoding": "UTF-8", + "schema": { + "fields": [ + { + "name": "id", + "description": "Unique identifier", + "type": "serial", + "nullable": false, + "unit": null, + "isAbout": [ + { + "name": "identifier", + "@id": "http://purl.obolibrary.org/obo/IAO_0020000" + } + ], + "valueReference": [ + { + "value": null, + "name": null, + "@id": null + } + ] + }, + { + "name": "name", + "description": "Technology Name", + "type": "text", + "nullable": true, + "unit": null, + "isAbout": [ + { + "name": "power generation technology", + "@id": "http://openenergy-platform.org/ontology/oeo/OEO_00010423" + } + ], + "valueReference": [ + { + "value": "wind", + "name": "wind power technology", + "@id": "http://openenergyplatform.org/ontology/oeo/OEO_00010424" + } + ] + }, + { + "name": "type", + "description": "Type of wind farm", + "type": "text", + "nullable": true, + "unit": null, + "isAbout": [ + { + "name": "wind farm", + "@id": "https://openenergyplatform.org/ontology/oeo/OEO_00000447/" + } + ], + "valueReference": [ + { + "value": "onshore", + "name": "onshore wind farm", + "@id": "https://openenergyplatform.org/ontology/oeo/OEO_00000311/" + }, + { + "value": "offshore", + "name": "offshore wind farm", + "@id": "https://openenergyplatform.org/ontology/oeo/OEO_00000308/" + } + ] + }, + { + "name": "year", + "description": "Reference year", + "type": "integer", + "nullable": true, + "unit": null, + "isAbout": [ + { + "name": "year", + "@id": "https://openenergyplatform.org/ontology/oeo/UO_0000036/" + } + ], + "valueReference": [ + { + "value": null, + "name": null, + "@id": null + } + ] + }, + { + "name": "value", + "description": "Bruttoleistung", + "type": "decimal", + "nullable": true, + "unit": "MW", + "isAbout": [ + { + "name": "nameplate capacity", + "@id": "https://openenergyplatform.org/ontology/oeo/OEO_00230003/" + } + ], + "valueReference": [ + { + "value": null, + "name": null, + "@id": null + } + ] + }, + { + "name": "is_active", + "description": "Betriebsstaus", + "type": "boolean", + "nullable": false, + "unit": null, + "isAbout": [ + { + "name": "Operating Mode Status", + "@id": "https://ontology.brickschema.org/brick/Operating_Mode_Status" + } + ], + "valueReference": [ + { + "value": null, + "name": null, + "@id": null + } + ] + }, + { + "name": "version", + "description": "Version", + "type": "integer", + "nullable": true, + "unit": null, + "isAbout": [ + { + "name": "version number", + "@id": "http://purl.obolibrary.org/obo/IAO_0000129" + } + ], + "valueReference": [ + { + "value": null, + "name": null, + "@id": null + } + ] + }, + { + "name": "comment", + "description": "", + "type": "text", + "nullable": true, + "unit": null, + "isAbout": [ + { + "name": "comment", + "@id": "http://semanticscience.org/resource/SIO_001167" + } + ], + "valueReference": [ + { + "value": null, + "name": null, + "@id": null + } + ] + } + ], + "primaryKey": [ + "id" + ], + "foreignKeys": [ + { + "fields": [ + "id", + "version" + ], + "reference": { + "resource": "model_draft.oep_oemetadata_table_example_version", + "fields": [ + "id", + "version" + ] + } + } + ] + }, + "dialect": { + "delimiter": ";", + "decimalSeparator": "." + }, + "review": { + "path": "https://openenergyplatform.org/dataedit/view/model_draft/oep_table_example/open_peer_review/", + "badge": "Platinum" + } + } + ], + "metaMetadata": { + "metadataVersion": "OEMetadata-2.0.1", + "metadataLicense": { + "name": "CC0-1.0", + "title": "Creative Commons Zero v1.0 Universal", + "path": "https://creativecommons.org/publicdomain/zero/1.0" + } + } +} \ No newline at end of file diff --git a/services/backend_regimo/components/oep_access/oemeta/v2/v20/example.py b/services/backend_regimo/components/oep_access/oemeta/v2/v20/example.py new file mode 100644 index 0000000..81ecfc9 --- /dev/null +++ b/services/backend_regimo/components/oep_access/oemeta/v2/v20/example.py @@ -0,0 +1,10 @@ +# SPDX-FileCopyrightText: 2024 Ludwig Hülk <@Ludee> © Reiner Lemoine Institut +# SPDX-FileCopyrightText: 2024 Jonas Huber <jh-RLI> © Reiner Lemoine Institut +# +# SPDX-License-Identifier: MIT + +import json +import os + +with open(os.path.join(os.path.dirname(__file__), "example.json"), "rb") as f: + OEMETADATA_V20_EXAMPLE = json.loads(f.read()) diff --git a/services/backend_regimo/components/oep_access/oemeta/v2/v20/metadata_key_description.md b/services/backend_regimo/components/oep_access/oemeta/v2/v20/metadata_key_description.md new file mode 100644 index 0000000..5b9d5a9 --- /dev/null +++ b/services/backend_regimo/components/oep_access/oemeta/v2/v20/metadata_key_description.md @@ -0,0 +1,227 @@ +<!-- +SPDX-FileCopyrightText: 2024 Ludwig Hülk <Ludee> © Reiner Lemoine Institut +SPDX-FileCopyrightText: 2024 Jonas Huber <jh-RLI> © Reiner Lemoine Institut + +SPDX-License-Identifier: MIT +--> + +# OEMetadata - Key Description + +This pages describes the key of **OEMetadata version 2.0 .** <br> +You can have a look at an empty [template](https://github.com/OpenEnergyPlatform/oemetadata/blob/production/metadata/latest/template.json) and a filled out [example](https://github.com/OpenEnergyPlatform/oemetadata/blob/production/metadata/latest/example.json) of the metadata string.<br> +The [`schema.json`](https://github.com/OpenEnergyPlatform/oemetadata/blob/production/metadata/latest/schema.json) contains the complete metadata schema. + +## JSON Format + +The JSON format offers different formats: + +* key-value pair: + ```JSON + {"key":"value"} + ``` +* array: + ```JSON + {"key": + ["value","value"]} + ``` +* object {nested key}: + ```JSON + {"key": { + "key_a":"value", + "key_b":"value"}} + ``` +* array of objects {nested array}: + ```JSON + {"key": [ + {"key_a":"value"}, + {"key_a":"value"}]} + ``` + + +## Metadata Keys + +### Cardinality +The cardinality defines the number of times an element can occur. + +* [1] Mandatory +* [0..1] Optional +* [*] Multiple optional +* [1..*] Mandatory and multiple optional + +### Badges +Badges indicate the priority of metadata keys.<br> +They are implemented as part of the [Open Peer Review Process](https://openenergyplatform.github.io/academy/courses/09_peer_review/). + +### Additional information:<br> +If a field is not applicable use: `null`.<br> +If a value is not yet available, use: `ToDo`. + +### Collection Keys +| <div style="width:1em">#</div> | <div style="width:6em">Key</div> | <div style="width:20em">Description</div> | <div style="width:20em">Example</div> | <div style="width:4em">Badge</div> | <div style="width:3em">Card.</div> | +|--------------------------------|----------------------------------|------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------|------------------------------------| +| 1 | @context | Explanation of metadata keys in ontology terms. | [context.json](https://raw.githubusercontent.com/OpenEnergyPlatform/oemetadata/production/metadata/latest/context.json) | Platinum | [0..1] | +| 2 | name | A filename or database conform dataset name. | oep_oemetadata | Iron | [1] | +| 3 | title | A human readable dataset name. | OEP OEMetadata | Bronze | [0..1] | +| 4 | description | A free text description of the dataset. | A collection of tables for the OEMetadata examples. | Bronze | [0..1] | +| 5 | id | A unique identifier (UUID/DOI) for the dataset. | [databus.openenergyplatform.org/oeplatform](https://databus.openenergyplatform.org/oeplatform/reference/) | Silver | [0..1] | +| 6 | resources | An array of objects of the resources. The dataset can contain several (database) tables. | | | [*] | + +### Resource - General Keys +| <div style="width:1em">#</div> | <div style="width:6em">Key</div> | <div style="width:20em">Description</div> | <div style="width:20em">Example</div> | <div style="width:4em">Badge</div> | <div style="width:3em">Card.</div> | +|--------------------------------|----------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|------------------------------------| +| 1 | @id | A Uniform Resource Identifier (URI) that links the resource via the OpenEnergyDatabus (DBpedia Databus). | [wri_global_power_plant_database](https://databus.openenergyplatform.org/oeplatform/supply/wri_global_power_plant_database/2022-11-07) | Platinum | [0..1] | +| 2 | name | A filename or database conform table name. | oemetadata_table_template | Iron | [1] | +| 3 | topics | An array of predefined topics that correspond to the database schemas of the OEP. | model_draft | Bronze | [*] | +| 4 | title | A human readable table name. | OEMetadata Table Template | Silver | [0..1] | +| 5 | path | A unique identifier (URI/UUID/DOI) for the table or file. | [model_draft/oemetadata_table_template](http://openenergyplatform.org/dataedit/view/model_draft/oemetadata_table_template) | Bronze | [0..1] | +| 6 | description | A description of the table. It should be usable as summary information for the table that is described by the metadata. | Example table used to illustrate the OEMetadata structure and features. | Silver | [0..1] | +| 7 | languages | An array of languages used within the described data structures (e.g. titles, descriptions). The language key can be repeated if more languages are used. Standard: IETF (BCP47) | en-GB, de-DE | Gold | [*] | +| 8 | **subject** | An array of objects that references to the subjects of the resource in ontology terms. | | | [*] | +| 8.1 | name | A class label of the ontology term. | energy | Platinum | [0..1] | +| 8.2 | @id | A unique identifier (URI/IRI) of the ontology class. | [openenergyplatform.org/ontology/oeo/OEO_00000150](https://openenergyplatform.org/ontology/oeo/OEO_00000150) | Platinum | [0..1] | +| 9 | keywords | An array of freely selectable keywords that help with searching and structuring. The keyword are used and managed in the OEP as table tags. | example, ODbL-1.0, NFDI4Energy | Silver | [*] | +| 10 | publicationDate | A date of publication of the data or metadata. The date format is ISO 8601 (YYYY-MM-DD). | 2024-10-15 | Bronze | [0..1] | +| 11 | **embargoPeriod** | An object that describes the embargo period during which public access to the data is not allowed. | | | [0..1] | +| 11.1 | start | The start date of the embargo period. The date of the data (metadata) upload. | 2024-10-11 | Bronze | [0..1] | +| 11.2 | end | The end date of the embargo period. This is the envisioned publication date. | 2025-01-01 | Bronze | [0..1] | +| 11.3 | isActive | A boolean key that indicates if the embargo period is currently active. Must be changed to False on the embargo period end date. | True | Bronze | [0..1] | + +### Resource - Context Keys +| <div style="width:1em">#</div> | <div style="width:6em">Key</div> | <div style="width:20em">Description</div> | <div style="width:20em">Example</div> | <div style="width:4em">Badge</div> | <div style="width:3em">Card.</div> | +|--------------------------------|----------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|------------------------------------| +| 1 | **context** | An object that describes the general setting, environment, or project leading to the creation or maintenance of this dataset. In science this is can be the research project. | | | [0..1] | +| 1.1 | title | A title of the associated project. | NFDI4Energy | Gold | [0..1] | +| 1.2 | homepage | A URL of the project. | [nfdi4energy.uol.de](https://nfdi4energy.uol.de/) | Gold | [0..1] | +| 1.3 | documentation | A URL of the project documentation. | [nfdi4energy.uol.de/sites/about_us](https://nfdi4energy.uol.de/sites/about_us/) | Gold | [0..1] | +| 1.4 | sourceCode | A URL of the source code of the project. | [github.com/NFDI4Energy](https://github.com/NFDI4Energy) | Gold | [0..1] | +| 1.5 | publisher | The publishing agency of the data. This can be the OEP. | Open Energy Platform (OEP) | Gold | [0..1] | +| 1.6 | publisherLogo | A URL to the logo of the publishing agency of data. | [OpenEnergyFamily_Logo_OpenEnergyPlatform.svg](https://github.com/OpenEnergyPlatform/organisation/blob/production/logo/OpenEnergyFamily_Logo_OpenEnergyPlatform.svg) | Gold | [0..1] | +| 1.7 | contact | A reference to the creator or maintainer of the data set. It can be an email address or a GitHub handle. | info@nfdi4energy.org | Gold | [0..1] | +| 1.8 | fundingAgency | A name of the entity providing the funding. This can be a government agency or a company. | Deutsche Forschungsgemeinschaft (DFG) | Gold | [0..1] | +| 1.9 | fundingAgencyLogo | A URL to the logo or image of the funding agency. | [DFG-logo-blau.svg](https://upload.wikimedia.org/wikipedia/commons/8/86/DFG-logo-blau.svg) | Gold | [0..1] | +| 1.10 | grantNo | An identifying grant number. In case of a publicly funded project, this number is assigned by the funding agency. | 501865131 | Gold | [0..1] | + +### Resource - Spatial Keys +| <div style="width:1em">#</div> | <div style="width:6em">Key</div> | <div style="width:20em">Description</div> | <div style="width:20em">Example</div> | <div style="width:4em">Badge</div> | <div style="width:3em">Card.</div> | +|--------------------------------|----------------------------------|-------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------|------------------------------------|------------------------------------| +| 1 | **spatial** | An object that describes the spatial context of the data. | | | [0..1] | +| 1.1 | **location** | An object that describes a covered area or region. | | | [0..1] | +| 1.1.1 | address | An address of the location of the data. May be specified with street name, house number, zip code, and city name. | Rudower Chaussee 12, 12489 Berlin | Silver | [0..1] | +| 1.1.2 | @id | A path or URI to a specific location. It can use Wikidata or OpenStreetMap. | [www.wikidata.org/wiki/Q77077223](https://www.wikidata.org/wiki/Q77077223) | Platinum | [0..1] | +| 1.1.3 | longitude | The latitude (lat) information of the location. | 52.432822 | Gold | [0..1] | +| 1.1.4 | longitude | The longitude (lon) information of the location. | 13.5351004 | Gold | [0..1] | +| 1.2 | **extent** | An object that describes a covered area or region. | | | [0..1] | +| 1.2.1 | name | The name of the region. | Berlin | Silver | [0..1] | +| 1.2.2 | @id | A URI reference for the region. | [www.wikidata.org/wiki/Q64](https://www.wikidata.org/wiki/Q64) | Platinum | [0..1] | +| 1.2.3 | resolutionValue | The value of the spatial resolution. | 100 | Silver | [0..1] | +| 1.2.4 | resolutionUnit | The unit of the spatial resolution. | m | Silver | [0..1] | +| 1.2.5 | boundingBox | The covered area specified by the coordinates of a bounding box. The format is [minLon, minLat, maxLon, maxLat] or [W,S,E,N]. | [13.08825, 52.33859, 13.76104, 52.6754] | Gold | [*] | +| 1.2.6 | crs | The Coordinate Reference System, specified as an EPSG code. | EPSG:4326 | Gold | [0..1] | + +### Resource - Temporal Keys +| <div style="width:1em">#</div> | <div style="width:6em">Key</div> | <div style="width:20em">Description</div> | <div style="width:20em">Example</div> | <div style="width:4em">Badge</div> | <div style="width:3em">Card.</div> | +|--------------------------------|----------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------|------------------------------------|------------------------------------| +| 1 | **temporal** | An object with the time period covered in the data. Temporal information should contain either a "referenceDate" or the keys that describe a time series, in rare cases both. | | | [0..1] | +| 1.1 | referenceDate | A base year, month or day. The time for which the data is should be accurate. Date Format is ISO 8601. | 2020-01-01 | Silver | [0..1] | +| 1.2 | **timeseries** | An array that describes the timeseries. | | | [*] | +| 1.2.1 | start | The start time of a time series. | 2020-01-01T00:00:00+00:00 | Silver | [0..1] | +| 1.2.2 | end | The temporal end point of a time series. | 2020-01-01T23:59:30+00:00 | Silver | [0..1] | +| 1.2.3 | resolutionValue | The time span between individual information points in a time series. The value of the resolution. | 30 s | Silver | [0..1] | +| 1.2.4 | resolutionUnit | The unit of the temporal resolution. | 30 s | Silver | [0..1] | +| 1.2.5 | alignment | An indicator of whether timestamps in a time series are to the left, right or in the centre. | left | Silver | [0..1] | +| 1.2.6 | aggregationType | An indicator of whether the values are a sum, an average or a current value. | current | Silver | [0..1] | + +### Resource - Sources Keys +| <div style="width:1em">#</div> | <div style="width:6em">Key</div> | <div style="width:20em">Description</div> | <div style="width:20em">Example</div> | <div style="width:4em">Badge</div> | <div style="width:3em">Card.</div> | +|--------------------------------|----------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|------------------------------------| +| 1 | **sources** | An array of objects with the used and underlying sources of the data and metadata. | | | [*] | +| 1.1 | title | A human readable title of the source, a document title or organisation name. | IPCC Sixth Assessment Report (AR6) - Climate Change 2023 - Synthesis Report | Bronze | [0..1] | +| 1.2 | authors | An array of the full names of the authors of the source material. | Hoesung Lee,José Romero, The Core Writing Team | Bronze | [*] | +| 1.3 | description | A free text description of the source. | A Report of the Intergovernmental Panel on Climate Change | Bronze | [0..1] | +| 1.4 | publicationYear | Indicates the year when the work was published. | 2023 | Bronze | [0..1] | +| 1.5 | path | A DOI or link to the original source. | [IPCC_AR6_SYR_FullVolume.pdf](https://www.ipcc.ch/report/ar6/syr/downloads/report/IPCC_AR6_SYR_FullVolume.pdf) | Bronze | [0..1] | +| 1.6 | **sourceLicenses** | An array of objects of licenses under which the described source is provided. See [academy/courses/08_licensing](https://openenergyplatform.github.io/academy/courses/08_licensing/) for further information. | | | [*] | +| 1.6.1 | name | The [SPDX](https://spdx.org/licenses/) identifier. | ODbL-1.0 | Bronze | [0..1] | +| 1.6.2 | title | The official (human-readable) title of the license. | Open Data Commons Open Database License 1.0 | Bronze | [0..1] | +| 1.6.3 | path | A link or path to the license text. | [opendatacommons.org/licenses/odbl/1-0/index.html](https://opendatacommons.org/licenses/odbl/1-0/index.html) | Bronze | [0..1] | +| 1.6.4 | instruction | A short description of rights and obligations. The use of [tl;drLegal](https://tldrlegal.com/) is recommended. | You are free to share and change, but you must attribute, and share derivations under the same license. See [tldrlegal.com](https://tldrlegal.com/license/odc-open-database-license-odbl) for further information. | Bronze | [0..1] | +| 1.6.5 | attribution | A copyright owner of the **source**. Must be provided if attribution licenses are used. | © Intergovernmental Panel on Climate Change 2023 | Bronze | [0..1] | +| 1.6.6 | copyrightStatement | A link or path that proves that the source or data has the appropriate license. This can be a page number or website imprint. | [www.ipcc.ch/copyright](https://www.ipcc.ch/copyright/) | Bronze | [0..1] | + +### Resource - Licenses Keys +| <div style="width:1em">#</div> | <div style="width:6em">Key</div> | <div style="width:20em">Description</div> | <div style="width:20em">Example</div> | <div style="width:4em">Badge</div> | <div style="width:3em">Card.</div> | +|--------------------------------|----------------------------------|---------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|------------------------------------| +| 1 | **licenses** | An array of objects of licenses under which the described data is provided. | | | [*] | +| 1.1 | name | The [SPDX](https://spdx.org/licenses/) identifier. | ODbL-1.0 | Bronze | [0..1] | +| 1.2 | title | The official (human-readable) title of the license. | Open Data Commons Open Database License 1.0 | Bronze | [0..1] | +| 1.3 | path | A link or path to the license text. | [opendatacommons.org/licenses/odbl/1-0/index.html](https://opendatacommons.org/licenses/odbl/1-0/index.html) | Bronze | [0..1] | +| 1.4 | instruction | A short description of rights and obligations. The use of [tl;drLegal](https://tldrlegal.com/) is recommended. | You are free to share and change, but you must attribute, and share derivations under the same license. See [tldrlegal.com](https://tldrlegal.com/license/odc-open-database-license-odbl) for further information. | Bronze | [0..1] | +| 1.5 | attribution | A copyright owner of the **data**. Must be provided if attribution licenses are used. | © Reiner Lemoine Institut | Bronze | [0..1] | +| 1.6 | copyrightStatement | A link or path that proves that the data has the appropriate license. This can be a page number or website imprint. | [www.ipcc.ch/copyright/](https://www.ipcc.ch/copyright/) | Bronze | [0..1] | + +### Resource - Provenance Keys +| <div style="width:1em">#</div> | <div style="width:6em">Key</div> | <div style="width:20em">Description</div> | <div style="width:20em">Example</div> | <div style="width:4em">Badge</div> | <div style="width:3em">Card.</div> | +|--------------------------------|----------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------|------------------------------------|------------------------------------| +| 1 | **contributors** | An array of objects of the people or organizations who contributed to the data or metadata. Should have "Date of data creation" and "Date of metadata creation" | | | [*] | +| 1.1 | title | A full name of the contributor. | Ludwig Hülk | Bronze | [0..1] | +| 1.2 | path | A qualified link or path pointing to a relevant location online for the contributor. This can be the GitHub page or ORCID. | https://github.com/Ludee | Bronze | [0..1] | +| 1.3 | organization | A string describing the organization this contributor is affiliated to. This can be relevant for the copyright. | Reiner Lemoine Institut | Bronze | [0..1] | +| 1.4 | roles | An array describing the roles of the contributor. A role is recommended to follow the established vocabulary: [DataCite Metadata Schema’s contributorRole](https://support.datacite.org/docs/datacite-metadata-schema-v44-recommended-and-optional-properties#7a-contributortype). Useful roles to indicate are: DataCollector, ContactPerson, and DataCurator. | DataCollector, DataCurator | Bronze | [*] | +| 1.5 | date | The date of the final contribution. Date Format is ISO 8601. | 2024-10-21 | Bronze | [0..1] | +| 1.6 | object | The target of the contribution. This can be the data, the metadata or both (data and metadata). | data and metadata | Bronze | [0..1] | +| 1.7 | comment | A free-text commentary on what has been done. | Add general context. | Bronze | [0..1] | + +### Resource - Type Keys +| <div style="width:1em">#</div> | <div style="width:6em">Key</div> | <div style="width:20em">Description</div> | <div style="width:20em">Example</div> | <div style="width:4em">Badge</div> | <div style="width:3em">Card.</div> | +|--------------------------------|----------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------|------------------------------------|------------------------------------| +| 1 | type | The 'table' type indicates that the resource is tabular as per 'Frictionless Tabular Data' definition. | table | Gold | [0..1] | +| 2 | format | A file extension format. Possible options are 'csv', 'xlsx', 'json', 'PostgreSQL', 'SQLite' and other standard file extensions. | PostgreSQL | Gold | [0..1] | +| 3 | encoding | Specifies the character encoding of the resource's data file. The default is 'UTF-8'. The values should be one of the 'Preferred MIME Names'. | UTF-8 | Gold | [0..1] | + +#### Resource - Fields Keys +| <div style="width:1em">#</div> | <div style="width:6em">Key</div> | <div style="width:20em">Description</div> | <div style="width:20em">Example</div> | <div style="width:4em">Badge</div> | <div style="width:3em">Card.</div> | +|--------------------------------|----------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------|------------------------------------|------------------------------------| +| 1 | **schema** | An object that describes the structure of a table. It contains all fields (columns of the table), the primary key and optional foreign keys. | | | [1] | +| 1.1 | **fields** | An array of objects that describes a field (column) and its detailed information. | | | [1] | +| 1.1.1 | name | The name of the field. The name may only consist of lowercase alphanumeric characters or underscores. It must not begin with a number or an underscore. | year | Iron | [1] | +| 1.1.2 | description | A text describing the field. | Reference year for which the data were collected. | Silver | [0..1] | +| 1.1.3 | type | The data type of the field. In case of a geom column in a database, also indicate the shape and CRS. | geometry(Point, 4326) | Iron | [1] | +| 1.1.4 | nullable | A boolean key to specify that a column can be nullable. True is the default value. | True | Iron | [1] | +| 1.1.5 | unit | The unit of a field. If it does not apply, use 'null'. If the unit is given in a separate field, reference this field (e.g. 'unit'). Use a space between numbers and units (100 m). | MW | Silver | [0..1] | +| 1.1.6 | **isAbout** | An array of objects that describes the field in ontology terms. | | | [*] | +| 1.1.6.1 | name | The class label of the ontology term. | wind energy converting unit | Platinum | [0..1] | +| 1.1.6.2 | @id | The path of the ontology term (IRI). | [OEO_00000044](https://openenergyplatform.org/ontology/oeo/OEO_00000044) | Platinum | [0..1] | +| 1.1.7 | **valueReference** | An array of objects for an extended description of the values in the column in ontology terms. | | | [*] | +| 1.1.7.1 | value | The name of the value in the column. | onshore | Platinum | [0..1] | +| 1.1.7.2 | name | The class label of the ontology term in the column. | onshore wind farm | Platinum | [0..1] | +| 1.1.7.3 | @id | The path of the ontology term (IRI) in the column. | [OEO_00000311](https://openenergyplatform.org/ontology/oeo/OEO_00000311) | Platinum | [0..1] | + +#### Resource - Properties Keys +| <div style="width:1em">#</div> | <div style="width:6em">Key</div> | <div style="width:20em">Description</div> | <div style="width:20em">Example</div> | <div style="width:4em">Badge</div> | <div style="width:3em">Card.</div> | +|--------------------------------|----------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------|------------------------------------|------------------------------------| +| 1.2 | primaryKey | An array of fields that uniquely identifies each row in the table. The default value is the “id†column. | id | Iron | [1..*] | +| 1.3 | **foreignKeys** | An array of objects with foreign keys that describe a field that relates to a field in another table. | | | [*] | +| 1.3.1 | fields | An array of fields in the table that is constrained by the foreign key. | id, version | Iron | [*] | +| 1.3.2 | **reference** | The reference to the foreign table. | | | [0..1] | +| 1.3.2.1 | resource | The referenced foreign table. | model_draft.oep_oemetadata_table_example_version | Iron | [0..1] | +| 1.3.2.2 | fields | The foreign resource column. | id, version | Iron | [*] | +| 1.4 | **dialect** | The Dialect defines a simple format for describing the various dialects of CSV files in a language-independent manner. In a database, the values in the fields are 'null'. | | | [1] | +| 1.4.1 | delimiter | The delimiter specifies the character sequence which should separate fields (columns). Common characters are ',' (comma), ';' (semicolon), '.' (point) and '\t' (tab). | , | Iron | [1] | +| 1.4.2 | decimalSeparator | The symbol used to separate the integer part from the fractional part of a number written in decimal form. Depending on language and region this symbol can be '.' or ','. | . | Iron | [1] | + +### Resource - Review Keys +| <div style="width:1em">#</div> | <div style="width:6em">Key</div> | <div style="width:20em">Description</div> | <div style="width:20em">Example</div> | <div style="width:3em">Card.</div> | +|--------------------------------|----------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------|------------------------------------| +| 1. | **review** | The metadata on the OEP can go through an open peer review process. See the Academy course [Open Peer Review](https://openenergyplatform.github.io/academy/courses/09_peer_review/) for further information. | | [0..1] | +| 1.1 | path | A link or path to the documented open peer review. | [open_peer_review/9](https://openenergyplatform.org/dataedit/view/model_draft/oep_table_example/open_peer_review/9/) | [0..1] | +| 1.2 | badge | A badge of either Iron, Bronze, Silver, Gold or Platinum is used to label the quality of the metadata. | Platinum | [0..1] | + +### MetaMetadata Keys +| <div style="width:1em">#</div> | <div style="width:6em">Key</div> | <div style="width:20em">Description</div> | <div style="width:20em">Example</div> | <div style="width:3em">Card.</div> | +|--------------------------------|----------------------------------|--------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------|------------------------------------| +| 1 | **metaMetadata** | An object that describes the metadata themselves, their format, version and license. | | [1] | +| 1.1 | metadataVersion | Type and version number of the metadata. | OEMetadata-2.0 | [1] | +| 1.2 | **metadataLicense** | The license of the provided metadata. | | [1] | +| 1.2.1 | name | The [SPDX](https://spdx.org/licenses/) identifier. | CC0-1.0 | [1] | +| 1.2.2 | title | The official (human-readable) title of the license. | Creative Commons Zero v1.0 Universal | [1] | +| 1.2.3 | path | A link or path to the license text. | [creativecommons.org/publicdomain/zero/1.0/](https://creativecommons.org/publicdomain/zero/1.0/) | [1] | diff --git a/services/backend_regimo/components/oep_access/oemeta/v2/v20/schema.json b/services/backend_regimo/components/oep_access/oemeta/v2/v20/schema.json new file mode 100644 index 0000000..f76755c --- /dev/null +++ b/services/backend_regimo/components/oep_access/oemeta/v2/v20/schema.json @@ -0,0 +1,1505 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/OpenEnergyPlatform/oemetadata/production/metadata/v20/v20/schema.json", + "description": "Open Energy Metadata (OEMetadata) - metadata schema", + "type": "object", + "required": [ + "resources" + ], + "properties": { + "@context": { + "description": "Explanation of metadata keys in ontology terms.", + "examples": [ + "https://raw.githubusercontent.com/OpenEnergyPlatform/oemetadata/production/metadata/latest/context.json" + ], + "type": [ + "string", + "null" + ], + "badge": "Platinum", + "title": "@context", + "readOnly": true + }, + "name": { + "description": "A filename or database conform dataset name.", + "type": [ + "string", + "null" + ], + "examples": [ + "oep_oemetadata" + ], + "badge": "Iron", + "title": "Dataset Name" + }, + "title": { + "description": "A human readable dataset name.", + "type": [ + "string", + "null" + ], + "examples": [ + "OEP OEMetadata" + ], + "badge": "Bronze", + "title": "Dataset Title" + }, + "description": { + "description": "A free text description of the dataset.", + "type": [ + "string", + "null" + ], + "examples": [ + "A dataset for the OEMetadata examples." + ], + "badge": "Bronze", + "title": "Dataset Description" + }, + "id": { + "description": "A unique identifier (UUID/DOI) for the collection.", + "type": [ + "string", + "null" + ], + "examples": [ + "https://databus.openenergyplatform.org/oeplatform/reference" + ], + "badge": "Silver", + "title": "Dataset Identifier", + "format": "uri", + "readOnly": true + }, + "resources": { + "description": "A collection of related resources.", + "type": "array", + "items": { + "type": "object", + "properties": { + "@id": { + "description": "A Uniform Resource Identifier (URI) that links the resource via the OpenEnergyDatabus (DBpedia Databus).", + "type": [ + "string", + "null" + ], + "examples": [ + "https://databus.openenergyplatform.org/oeplatform/supply/wri_global_power_plant_database/2022-11-07" + ], + "badge": "Platinum", + "title": "@Id", + "readOnly": true + }, + "name": { + "description": "A filename or database conform table name.", + "type": [ + "string", + "null" + ], + "examples": [ + "oemetadata_table_template" + ], + "badge": "Iron", + "title": "Name" + }, + "topics": { + "description": "An array of predefined topics that correspond to the database schemas of the OEP.", + "type": "array", + "items": { + "description": "The topics are used to group the data in the database.", + "type": [ + "string", + "null" + ], + "examples": [ + "model_draft" + ], + "badge": "Bronze", + "title": "Topic" + }, + "badge": "Bronze", + "title": "Topics" + }, + "title": { + "description": "A human readable table name.", + "type": [ + "string", + "null" + ], + "examples": [ + "OEMetadata Table Template" + ], + "badge": "Silver", + "title": "Title" + }, + "path": { + "description": "A unique identifier (URI/UUID/DOI) for the table or file.", + "type": [ + "string", + "null" + ], + "examples": [ + "http://openenergyplatform.org/dataedit/view/model_draft/oemetadata_table_template" + ], + "badge": "Bronze", + "title": "Path", + "readOnly": true + }, + "description": { + "description": "A description of the table. It should be usable as summary information for the table that is described by the metadata.", + "type": [ + "string", + "null" + ], + "examples": [ + "Example table used to illustrate the OEMetadata structure and features." + ], + "badge": "Silver", + "title": "Description" + }, + "languages": { + "description": "An array of languages used within the described data structures (e.g. titles, descriptions) or metadata.", + "type": "array", + "items": { + "description": "The language keys must follow the Standard IETF (BCP47) and can be repeated if more languages are used.", + "type": [ + "string", + "null" + ], + "examples": [ + "en-GB", + "de-DE" + ], + "badge": "Gold", + "title": "Language" + }, + "badge": "Gold", + "title": "Languages" + }, + "subject": { + "description": "An array of objects that references to the subjects of the resource in ontology terms.", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "A class label of the ontology term.", + "type": [ + "string", + "null" + ], + "examples": [ + "energy" + ], + "badge": "Platinum", + "title": "Subject Name" + }, + "@id": { + "description": "A unique identifier (URI/IRI) of the ontology class.", + "type": [ + "string", + "null" + ], + "examples": [ + "https://openenergyplatform.org/ontology/oeo/OEO_00000150" + ], + "badge": "Platinum", + "title": "Subject Identifier", + "format": "uri" + } + }, + "badge": "Platinum", + "title": "Subject" + }, + "badge": "Platinum", + "title": "Subject" + }, + "keywords": { + "description": "An array of freely selectable keywords that help with searching and structuring.", + "type": "array", + "items": { + "description": "The keyword are used and managed in the OEP as table tags.", + "type": [ + "string", + "null" + ], + "examples": [ + "example", + "ODbL-1.0", + "NFDI4Energy" + ], + "badge": "Silver", + "title": "Keyword" + }, + "badge": "Silver", + "title": "Keywords" + }, + "publicationDate": { + "description": "A date of publication of the data or metadata. The date format is ISO 8601 (YYYY-MM-DD).", + "type": [ + "string", + "null" + ], + "examples": [ + "2024-10-15" + ], + "badge": "Bronze", + "title": "Publication Date", + "format": "date" + }, + "embargoPeriod": { + "description": "An object that describes the embargo period during which public access to the data is not allowed.", + "type": "object", + "properties": { + "start": { + "description": "The start date of the embargo period. The date of the data (metadata) upload.", + "type": [ + "string", + "null" + ], + "examples": [ + "2024-10-11" + ], + "badge": "Bronze", + "title": "Embargo Period Start", + "format": "date" + }, + "end": { + "description": "The end date of the embargo period. This is the intended publication date.", + "type": [ + "string", + "null" + ], + "examples": [ + "2025-01-01" + ], + "badge": "Bronze", + "title": "Embargo Period End (Publication Date)", + "format": "date" + }, + "isActive": { + "description": "A boolean key that indicates if the embargo period is currently active. Must be changed to False on the embargo period end date.", + "type": [ + "boolean", + "null" + ], + "examples": [ + true + ], + "badge": "Bronze", + "title": "Embargo Period is Active " + } + }, + "badge": "Bronze", + "title": "Embargo Period" + }, + "context": { + "description": "An Object that describes the general setting, environment or project leading to the creation or maintenance of this dataset. In science this can be the research project.", + "type": "object", + "properties": { + "title": { + "description": "A title of the associated project.", + "type": [ + "string", + "null" + ], + "examples": [ + "NFDI4Energy" + ], + "badge": "Gold", + "title": "Context Title" + }, + "homepage": { + "description": "A URL of the project.", + "type": [ + "string", + "null" + ], + "examples": [ + "https://nfdi4energy.uol.de/" + ], + "badge": "Gold", + "title": "Homepage", + "format": "uri" + }, + "documentation": { + "description": "A URL of the project documentation.", + "type": [ + "string", + "null" + ], + "examples": [ + "https://nfdi4energy.uol.de/sites/about_us/" + ], + "badge": "Gold", + "title": "Documentation" + }, + "sourceCode": { + "description": "A URL of the source code of the project.", + "type": [ + "string", + "null" + ], + "examples": [ + "https://github.com/NFDI4Energy" + ], + "badge": "Gold", + "title": "Source Code" + }, + "publisher": { + "description": "The publishing agency of the data. This can be the OEP.", + "type": [ + "string", + "null" + ], + "examples": [ + "Open Energy Platform (OEP)" + ], + "badge": "Bronze", + "title": "Publisher" + }, + "publisherLogo": { + "description": "A URL to the logo of the publishing agency of data.", + "type": [ + "string", + "null" + ], + "examples": [ + "https://github.com/OpenEnergyPlatform/organisation/blob/production/logo/OpenEnergyFamily_Logo_OpenEnergyPlatform.svg" + ], + "badge": "Gold", + "title": "Publisher Logo", + "format": "uri" + }, + "contact": { + "description": "A reference to the creator or maintainer of the data set. This can be an email address or a GitHub handle.", + "type": [ + "string", + "null" + ], + "examples": [ + "contact@example.com" + ], + "badge": "Gold", + "title": "E-Mail Contact", + "format": "email" + }, + "fundingAgency": { + "description": "A name of the entity providing the funding. This can be a government agency or a company.", + "type": [ + "string", + "null" + ], + "examples": [ + " Deutsche Forschungsgemeinschaft (DFG)" + ], + "badge": "Gold", + "title": "Funding Agency" + }, + "fundingAgencyLogo": { + "description": "A URL to the logo or image of the funding agency.", + "type": [ + "string", + "null" + ], + "examples": [ + "https://upload.wikimedia.org/wikipedia/commons/8/86/DFG-logo-blau.svg" + ], + "badge": "Gold", + "title": "Funding Agency Logo", + "format": "uri" + }, + "grantNo": { + "description": "An identifying grant number. In case of a publicly funded project, this number is assigned by the funding agency.", + "type": [ + "string", + "null" + ], + "examples": [ + "501865131" + ], + "badge": "Gold", + "title": "Grant Number" + } + }, + "badge": "Gold", + "title": "Context" + }, + "spatial": { + "description": "An object that describes the spatial context of the data.", + "type": "object", + "properties": { + "location": { + "description": "An object that describes a covered area or region.", + "type": "object", + "properties": { + "address": { + "description": "An address of the location of the data. May be specified with street name, house number, zip code, and city name.", + "type": [ + "string", + "null" + ], + "examples": [ + "Rudower Chaussee 12, 12489 Berlin" + ], + "badge": "Silver", + "title": "Address" + }, + "@id": { + "description": "A path or URI to a specific location. It can use Wikidata or OpenStreetMap.", + "type": [ + "string", + "null" + ], + "examples": [ + "https://www.wikidata.org/wiki/Q77077223" + ], + "badge": "Platinum", + "title": "Address Identifier" + }, + "latitude": { + "description": "The latitude (lat) information of the location. Specifies the north / south position of the geometry.", + "type": [ + "string", + "null" + ], + "examples": [ + "52.432822" + ], + "badge": "Gold", + "title": "Latitude" + }, + "longitude": { + "description": "The longitude (lon) information of the location. Specifies the east / west position of the geometry.", + "type": [ + "string", + "null" + ], + "examples": [ + "13.5351004" + ], + "badge": "Gold", + "title": "Longitude" + } + }, + "badge": "Silver", + "title": "Location" + }, + "extent": { + "description": "An object that describes a covered area or region.", + "type": "object", + "properties": { + "name": { + "description": "The name of the region.", + "type": [ + "string", + "null" + ], + "examples": [ + "Berlin" + ], + "badge": "Silver", + "title": "Extent Name" + }, + "@id": { + "description": "A URI reference for the region.", + "type": [ + "string", + "null" + ], + "examples": [ + "https://www.wikidata.org/wiki/Q64" + ], + "format": "uri", + "badge": "Platinum", + "title": "Extent Identifier" + }, + "resolutionValue": { + "description": "The value of the spatial resolution.", + "type": [ + "string", + "null" + ], + "examples": [ + "100" + ], + "badge": "Silver", + "title": "Spatial Resolution Value" + }, + "resolutionUnit": { + "description": "The unit of the spatial resolution.", + "type": [ + "string", + "null" + ], + "examples": [ + "m" + ], + "badge": "Silver", + "title": "Spatial Resolution Unit" + }, + "boundingBox": { + "description": "The covered area specified by the coordinates of a bounding box. The format is [minLon, minLat, maxLon, maxLat] or [W,S,E,N].", + "type": "array", + "examples": [ + 13.08825, + 52.33859, + 13.76104, + 52.6754 + ], + "items": { + "type": "number" + }, + "minItems": 4, + "maxItems": 4, + "badge": "Gold", + "title": "Bounding Box" + }, + "crs": { + "description": "The Coordinate Reference System, specified as an EPSG code.", + "type": [ + "string", + "null" + ], + "examples": [ + "EPSG:4326" + ], + "badge": "Gold", + "title": " Coordinate Reference System (CRS)" + } + }, + "badge": "Silver", + "title": "Extent" + } + }, + "badge": "Silver", + "title": "Spatial" + }, + "temporal": { + "description": "An object with the time period covered in the data. Temporal information should contain either a \"referenceDate\" or the keys that describe a time series, in rare cases both.", + "type": "object", + "properties": { + "referenceDate": { + "description": "A base year, month or day. The time for which the data is should be accurate. Date Format is ISO 8601.", + "type": [ + "string", + "null" + ], + "examples": [ + "2020-01-01" + ], + "badge": "Silver", + "title": "Reference Date", + "format": "date" + }, + "timeseries": { + "description": "An array that describe the timeseries.", + "type": "array", + "items": { + "type": "object", + "properties": { + "start": { + "description": "The start time of a time series.", + "type": [ + "string", + "null" + ], + "examples": [ + "2020-01-01T00:00:00+01:00" + ], + "badge": "Silver", + "title": "Timeseries Start", + "format": "date-time" + }, + "end": { + "description": "The temporal end point of a time series.", + "type": [ + "string", + "null" + ], + "examples": [ + "2020-01-01T23:59:30+01:00" + ], + "badge": "Silver", + "title": "Timeseries End", + "format": "date-time" + }, + "resolutionValue": { + "description": "The time span between individual information points in a time series. The value of the resolution.", + "type": [ + "string", + "null" + ], + "examples": [ + "15" + ], + "badge": "Silver", + "title": "Timeseries Resolution Value" + }, + "resolutionUnit": { + "description": "The unit of the temporal resolution.", + "type": [ + "string", + "null" + ], + "examples": [ + "min" + ], + "badge": "Silver", + "title": "Timeseries Resolution Unit" + }, + "alignment": { + "description": "An indicator of whether timestamps in a time series are to the left, right or in the centre.", + "type": [ + "string", + "null" + ], + "examples": [ + "left" + ], + "badge": "Gold", + "title": "Timeseries Alignment" + }, + "aggregationType": { + "description": "An indicator of whether the values are a sum, an average or a current value.", + "type": [ + "string", + "null" + ], + "examples": [ + "current" + ], + "badge": "Gold", + "title": "Timeseries Aggregation Type" + } + }, + "badge": "Silver", + "title": "Timeseries" + }, + "badge": "Silver", + "title": "Timeseries" + } + }, + "badge": "Silver", + "title": "Temporal" + }, + "sources": { + "description": "An array of objects with the used and underlying sources of the data and metadata.", + "type": "array", + "items": { + "type": "object", + "properties": { + "title": { + "description": "A human readable title of the source, a document title or organisation name.", + "type": [ + "string", + "null" + ], + "examples": [ + "IPCC Sixth Assessment Report (AR6) - Climate Change 2023 - Synthesis Report" + ], + "badge": "Bronze", + "title": "Source Title" + }, + "authors": { + "description": "An array of the full names of the authors of the source material.", + "type": "array", + "items": { + "description": "The authors of the source.", + "type": [ + "string", + "null" + ], + "examples": [ + "Hoesung Lee", + "Jos\u00e9 Romero", + "The Core Writing Team" + ], + "badge": "Bronze", + "title": "Author" + }, + "badge": "Bronze", + "title": "Authors" + }, + "description": { + "description": "A free text description of the source.", + "type": [ + "string", + "null" + ], + "examples": [ + "A Report of the Intergovernmental Panel on Climate Change." + ], + "badge": "Bronze", + "title": "Source Description" + }, + "publicationYear": { + "description": "Indicates the year when the work was published.", + "type": [ + "string", + "null" + ], + "examples": [ + "2023" + ], + "badge": "Bronze", + "title": "Publication Year" + }, + "path": { + "description": "A DOI or link to the original source.", + "type": [ + "string", + "null" + ], + "examples": [ + "https://www.ipcc.ch/report/ar6/syr/downloads/report/IPCC_AR6_SYR_FullVolume.pdf" + ], + "badge": "Bronze", + "title": "DOI", + "format": "uri" + }, + "sourceLicenses": { + "type": "array", + "items": { + "description": "An array of objects of licenses under which the described source is provided. See https://openenergyplatform.github.io/academy/courses/08_licensing/ for further information.", + "type": "object", + "properties": { + "name": { + "description": "The SPDX identifier.", + "type": [ + "string", + "null" + ], + "examples": [ + "CC-BY-4.0" + ], + "badge": "Bronze", + "title": "Name" + }, + "title": { + "description": "The official (human readable) title of the license.", + "type": [ + "string", + "null" + ], + "examples": [ + "Creative Commons Attribution 4.0 International" + ], + "badge": "Bronze", + "title": "Title" + }, + "path": { + "description": "A link or path to the license text.", + "type": [ + "string", + "null" + ], + "examples": [ + "https://creativecommons.org/licenses/by/4.0/legalcode" + ], + "badge": "Bronze", + "title": "License Identifier", + "format": "uri" + }, + "instruction": { + "description": "A short description of rights and obligations. The use of tl;drLegal is recommended.", + "type": [ + "string", + "null" + ], + "examples": [ + "You are free to share and change, but you must attribute. See https://tldrlegal.com/license/odc-open-database-license-odbl for further information." + ], + "badge": "Bronze", + "title": "Instruction" + }, + "attribution": { + "description": "A copyright owner of the source. Must be provided if attribution licenses are used.", + "type": [ + "string", + "null" + ], + "examples": [ + "\u00a9 Intergovernmental Panel on Climate Change 2023" + ], + "badge": "Bronze", + "title": "Attribution" + }, + "copyrightStatement": { + "description": "A link or path that proves that the source or data has the appropriate license. This can be a page number or website imprint.", + "type": [ + "string", + "null" + ], + "examples": [ + "https://www.ipcc.ch/copyright/" + ], + "badge": "Bronze", + "title": "Copyright Statement" + } + }, + "badge": "Bronze", + "title": "Licenses" + }, + "badge": "Bronze", + "title": "Licenses" + } + }, + "badge": "Bronze", + "title": "Sources" + }, + "badge": "Bronze", + "title": "Sources" + }, + "licenses": { + "description": "An array of objects of licenses under which the described data is provided.", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "The SPDX identifier.", + "type": [ + "string", + "null" + ], + "examples": [ + "ODbL-1.0" + ], + "badge": "Bronze", + "title": "Name" + }, + "title": { + "description": "The official (human readable) title of the license.", + "type": [ + "string", + "null" + ], + "examples": [ + "Open Data Commons Open Database License 1.0" + ], + "badge": "Bronze", + "title": "Title" + }, + "path": { + "description": "A link or path to the license text.", + "type": [ + "string", + "null" + ], + "examples": [ + "https://opendatacommons.org/licenses/odbl/1-0/index.html" + ], + "badge": "Bronze", + "title": "Path", + "format": "uri" + }, + "instruction": { + "description": "A short description of rights and obligations. The use of tl;drLegal is recommended.", + "type": [ + "string", + "null" + ], + "examples": [ + "You are free to share and change, but you must attribute, and share derivations under the same license. See https://tldrlegal.com/license/odc-open-database-license-(odbl) for further information." + ], + "badge": "Bronze", + "title": "Instruction" + }, + "attribution": { + "description": "A copyright holder of the data. Must be provided if attribution licenses are used.", + "type": [ + "string", + "null" + ], + "examples": [ + "\u00a9 Reiner Lemoine Institut" + ], + "badge": "Bronze", + "title": "Attribution" + }, + "copyrightStatement": { + "description": "A link or path that proves that the source or data has the appropriate license. This can be a page number or website imprint.", + "type": [ + "string", + "null" + ], + "examples": [ + "https://github.com/OpenEnergyPlatform/oemetadata/blob/develop/LICENSE.txt" + ], + "badge": "Bronze", + "title": "Copyright Statement" + } + }, + "badge": "Bronze", + "title": "License" + }, + "badge": "Bronze", + "title": "Licenses" + }, + "contributors": { + "description": "An array of objects of contributors and contributions to the data or metadata.", + "type": "array", + "items": { + "type": "object", + "properties": { + "title": { + "description": "A full name of the contributor.", + "type": [ + "string", + "null" + ], + "examples": [ + "Ludwig H\u00fclk" + ], + "badge": "Bronze", + "title": "Contributor Title" + }, + "path": { + "description": "A qualified link or path pointing to a relevant location online for the contributor. This can be the GitHub page or ORCID.", + "type": [ + "string", + "null" + ], + "examples": [ + "https://github.com/Ludee" + ], + "badge": "Bronze", + "title": "Path" + }, + "organization": { + "description": "A string describing the organization this contributor is affiliated to. This can be relevant for the copyright.", + "type": [ + "string", + "null" + ], + "examples": [ + "Reiner Lemoine Institut" + ], + "badge": "Bronze", + "title": "Organization" + }, + "roles": { + "description": "An array describing the roles of the contributor.", + "type": "array", + "items": { + "description": "A role is recommended to follow an established vocabulary: DataCite Metadata Schema\u2019s contributorRole. Useful roles to indicate are: DataCollector, ContactPerson, and DataCurator.", + "type": [ + "string", + "null" + ], + "examples": [ + "DataCollector", + "DataCurator" + ], + "badge": "Bronze", + "title": "Role" + }, + "badge": "Bronze", + "title": "Roles" + }, + "date": { + "description": "The date of the final contribution. Date Format is ISO 8601.", + "type": [ + "string", + "null" + ], + "examples": [ + "2024-10-21" + ], + "badge": "Bronze", + "title": "Date", + "format": "date" + }, + "object": { + "description": "The object of the contribution. Which part of the package was supplied or changed.", + "type": [ + "string", + "null" + ], + "examples": [ + "data and metadata" + ], + "badge": "Bronze", + "title": "Object" + }, + "comment": { + "description": "A free-text commentary on what has been done.", + "type": [ + "string", + "null" + ], + "examples": [ + "Add metadata example." + ], + "badge": "Bronze", + "title": "Comment" + } + }, + "badge": "Bronze", + "title": "Contributor" + }, + "badge": "Bronze", + "title": "Contributors" + }, + "type": { + "description": "The 'table' type indicates that the resource is tabular as per 'Frictionless Tabular Data' definition.", + "type": [ + "string", + "null" + ], + "examples": [ + "table" + ], + "badge": "Gold", + "title": "Type", + "options": { + "hidden": true + } + }, + "format": { + "description": "A file extension format. Possible options are 'csv', 'xlsx', 'json', 'PostgreSQL', 'SQLite' and other standard file extensions.", + "type": [ + "string", + "null" + ], + "examples": [ + "CSV" + ], + "badge": "Gold", + "title": "Format", + "options": { + "hidden": true + } + }, + "encoding": { + "description": "Specifies the character encoding of the resource's data file. The default is 'UTF-8'. The values should be one of the 'Preferred MIME Names'.", + "type": [ + "string", + "null" + ], + "examples": [ + "UTF-8" + ], + "badge": "Gold", + "title": "Encoding", + "options": { + "hidden": true + } + }, + "schema": { + "description": "An object that describes the structure of a table. It contains all fields (columns of the table), the primary key and optional foreign keys.", + "type": "object", + "properties": { + "fields": { + "description": "An array of objects that describes a field (column) and its detailed information.", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "The name of the field. The name may only consist of lowercase alphanumeric characters or underscores. It must not begin with a number or an underscore.", + "type": [ + "string", + "null" + ], + "examples": [ + "year" + ], + "badge": "Iron", + "title": "Column Name", + "readOnly": true + }, + "description": { + "description": "A text describing the field.", + "type": [ + "string", + "null" + ], + "examples": [ + "Reference year for which the data was collected." + ], + "badge": "Silver", + "title": "Description" + }, + "type": { + "description": "The data type of the field. In case of a geom column in a database, also indicate the shape and CRS.", + "type": [ + "string", + "null" + ], + "examples": [ + "geometry(Point, 4326)" + ], + "badge": "Iron", + "title": "Type", + "readOnly": true + }, + "nullable": { + "description": "A boolean key to specify that a column can be nullable. True is the default value.", + "type": [ + "boolean", + "null" + ], + "examples": [ + true + ], + "badge": "Iron", + "title": "Nullable", + "readOnly": true + }, + "unit": { + "description": "The unit of a field. If it does not apply, use 'null'. If the unit is given in a separate field, reference this field (e.g. 'unit'). Use a space between numbers and units (100 m).", + "type": [ + "string", + "null" + ], + "examples": [ + "MW" + ], + "badge": "Silver", + "title": "Unit" + }, + "isAbout": { + "description": "An array of objects that describes the field in ontology terms.", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "The class label of the ontology term.", + "type": [ + "string", + "null" + ], + "examples": [ + "wind energy converting unit" + ], + "badge": "Platinum", + "title": "Is About Name" + }, + "@id": { + "description": "The path of the ontology term (IRI).", + "type": [ + "string", + "null" + ], + "examples": [ + "https://openenergyplatform.org/ontology/oeo/OEO_00000044" + ], + "badge": "Platinum", + "title": "Is About Identifier", + "format": "uri" + } + }, + "badge": "Platinum", + "title": "isAbout" + }, + "badge": "Platinum", + "title": "isAbout" + }, + "valueReference": { + "description": "An array of objects for an extended description of the values in the column in ontology terms.", + "type": "array", + "items": { + "type": "object", + "properties": { + "value": { + "description": "The name of the value in the column.", + "type": [ + "string", + "null" + ], + "examples": [ + "onshore" + ], + "badge": "Platinum", + "title": "Value Reference" + }, + "name": { + "description": "The class label of the ontology term in the column.", + "type": [ + "string", + "null" + ], + "examples": [ + "onshore wind farm" + ], + "badge": "Platinum", + "title": "Value Reference Name" + }, + "@id": { + "description": "The path of the ontology term (IRI) in the column.", + "type": [ + "string", + "null" + ], + "examples": [ + "https://openenergyplatform.org/ontology/oeo/OEO_00000311" + ], + "badge": "Platinum", + "title": "Value Reference Identifier", + "format": "uri" + } + }, + "badge": "Platinum", + "title": "valueReference" + }, + "badge": "Platinum", + "title": "valueReference" + } + }, + "title": "Field", + "required": [ + "name", + "type", + "nullable" + ] + }, + "title": "Field" + }, + "primaryKey": { + "description": "An array of fields that uniquely identifies each row in the table.", + "type": "array", + "items": { + "description": "The default value is the \u201cid\u201d column.", + "type": [ + "string", + "null" + ], + "examples": [ + "id" + ], + "badge": "Iron", + "title": "Primary key" + }, + "badge": "Iron", + "title": "Primary key" + }, + "foreignKeys": { + "description": "List of foreign keys.", + "type": "array", + "items": { + "description": "An array of objects with foreign keys that describe a field that relates to a field in another table.", + "type": "object", + "properties": { + "fields": { + "description": "An array of fields in the table that is constrained by the foreign key.", + "type": "array", + "items": { + "description": "The column in the table that is constrained by the foreign key.", + "type": [ + "string", + "null" + ], + "examples": [ + "id", + "version" + ], + "badge": "Iron", + "title": "Foreign Key Field" + }, + "badge": "Iron", + "title": "Fields" + }, + "reference": { + "description": "The reference to the foreign table.", + "type": "object", + "properties": { + "resource": { + "description": "The referenced foreign table.", + "type": [ + "string", + "null" + ], + "examples": [ + "model_draft.oep_oemetadata_table_example_version" + ], + "badge": "Iron", + "title": "Foreign Resource" + }, + "fields": { + "description": "The foreign resource column.", + "type": "array", + "items": { + "description": "The foreign resource column.", + "type": [ + "string", + "null" + ], + "examples": [ + "id", + "version" + ], + "badge": "Iron", + "title": "Field" + }, + "badge": "Iron", + "title": "Field" + } + }, + "badge": "Iron", + "title": "Reference", + "required": [ + "resource", + "fields" + ] + } + }, + "title": "Foreign Key", + "required": [ + "fields" + ] + }, + "badge": "Iron", + "title": "Foreign Keys" + } + }, + "title": "Schema", + "required": [ + "primaryKey" + ] + }, + "dialect": { + "description": "The Dialect defines a simple format for describing the various dialects of CSV files in a language-independent manner. In a database, the values in the fields are 'null'.", + "type": "object", + "properties": { + "delimiter": { + "description": "The delimiter specifies the character sequence which should separate fields (columns). Common characters are ',' (comma), ';' (semicolon), '.' (point) and '\\t' (tab).", + "type": [ + "string", + "null" + ], + "examples": [ + ";" + ], + "badge": "Silver", + "title": "Delimiter" + }, + "decimalSeparator": { + "description": "The symbol used to separate the integer part from the fractional part of a number written in decimal form. Depending on language and region this symbol can be '.' or ','.", + "type": [ + "string", + "null" + ], + "examples": [ + "." + ], + "badge": "Silver", + "title": "Decimal separator" + } + }, + "badge": "Silver", + "title": "Dialect", + "options": { + "hidden": true + } + }, + "review": { + "description": "The metadata on the OEP can go through an open peer review process. See the Academy course [Open Peer Review](https://openenergyplatform.github.io/academy/courses/09_peer_review/) for further information.", + "type": "object", + "properties": { + "path": { + "description": "A link or path to the documented open peer review.", + "type": [ + "string", + "null" + ], + "examples": [ + "https://openenergyplatform.org/dataedit/view/model_draft/oep_table_example/open_peer_review/" + ], + "badge": null, + "title": "Path", + "format": "uri" + }, + "badge": { + "description": "A badge of either Iron, Bronze, Silver, Gold or Platinum is used to label the quality of the metadata.", + "type": [ + "string", + "null" + ], + "examples": [ + "Platinum" + ], + "badge": null, + "title": "Badge" + } + }, + "title": "Review", + "options": { + "hidden": true + } + } + } + }, + "title": "Resources" + }, + "metaMetadata": { + "description": "An object that describes the metadata themselves, their format, version and license.", + "type": "object", + "properties": { + "metadataVersion": { + "description": "Type and version number of the metadata.", + "examples": [ + "OEMetadata-2.0.1" + ], + "type": [ + "string", + "null" + ], + "badge": null, + "title": "Metadata Version" + }, + "metadataLicense": { + "description": "The license of the OEMetadata. ", + "type": "object", + "properties": { + "name": { + "description": "The SPDX identifier.", + "type": [ + "string", + "null" + ], + "examples": [ + "CC0-1.0" + ], + "badge": null, + "title": "License Name" + }, + "title": { + "description": "The official (human readable) title of the license.", + "type": [ + "string", + "null" + ], + "examples": [ + "Creative Commons Zero v1.0 Universal" + ], + "badge": null, + "title": "License Title" + }, + "path": { + "description": "A link or path to the license text.", + "type": [ + "string", + "null" + ], + "examples": [ + "https://creativecommons.org/publicdomain/zero/1.0" + ], + "badge": null, + "title": "License Path", + "format": "uri" + } + }, + "badge": null, + "title": "Metadata License" + } + }, + "title": "Meta Metadata", + "options": { + "hidden": true + } + } + }, + "additionalProperties": true +} \ No newline at end of file diff --git a/services/backend_regimo/components/oep_access/oemeta/v2/v20/schema.py b/services/backend_regimo/components/oep_access/oemeta/v2/v20/schema.py new file mode 100644 index 0000000..c9d1d27 --- /dev/null +++ b/services/backend_regimo/components/oep_access/oemeta/v2/v20/schema.py @@ -0,0 +1,10 @@ +# SPDX-FileCopyrightText: 2024 Ludwig Hülk <@Ludee> © Reiner Lemoine Institut +# SPDX-FileCopyrightText: 2024 Jonas Huber <jh-RLI> © Reiner Lemoine Institut +# +# SPDX-License-Identifier: MIT + +import json +import os + +with open(os.path.join(os.path.dirname(__file__), "schema.json"), "rb") as f: + OEMETADATA_V20_SCHEMA = json.loads(f.read()) diff --git a/services/backend_regimo/components/oep_access/oemeta/v2/v20/template.json b/services/backend_regimo/components/oep_access/oemeta/v2/v20/template.json new file mode 100644 index 0000000..37f5961 --- /dev/null +++ b/services/backend_regimo/components/oep_access/oemeta/v2/v20/template.json @@ -0,0 +1,186 @@ +{ + "@context": "", + "name": "", + "title": "", + "description": "", + "id": "", + "resources": [ + { + "@id": "", + "name": "", + "topics": [ + "" + ], + "title": "", + "path": "", + "description": "", + "languages": [ + "" + ], + "subject": [ + { + "name": "", + "@id": "" + } + ], + "keywords": [ + "" + ], + "publicationDate": "", + "embargoPeriod": { + "start": "", + "end": "", + "isActive": false + }, + "context": { + "title": "", + "homepage": "", + "documentation": "", + "sourceCode": "", + "publisher": "", + "publisherLogo": "", + "contact": "", + "fundingAgency": "", + "fundingAgencyLogo": "", + "grantNo": "" + }, + "spatial": { + "location": { + "address": "", + "@id": "", + "latitude": "", + "longitude": "" + }, + "extent": { + "name": "", + "@id": "", + "resolutionValue": "", + "resolutionUnit": "", + "boundingBox": [ + 0, + 0, + 0, + 0 + ], + "crs": "" + } + }, + "temporal": { + "referenceDate": "", + "timeseries": [ + { + "start": "", + "end": "", + "resolutionValue": "", + "resolutionUnit": "", + "alignment": "", + "aggregationType": "" + } + ] + }, + "sources": [ + { + "title": "", + "authors": [ + "" + ], + "description": "", + "publicationYear": "", + "path": "", + "sourceLicenses": [ + { + "name": "", + "title": "", + "path": "", + "instruction": "", + "attribution": "", + "copyrightStatement": "" + } + ] + } + ], + "licenses": [ + { + "name": "", + "title": "", + "path": "", + "instruction": "", + "attribution": "", + "copyrightStatement": "" + } + ], + "contributors": [ + { + "title": "", + "path": "", + "organization": "", + "roles": [ + "" + ], + "date": "", + "object": "", + "comment": "" + } + ], + "type": "", + "format": "", + "encoding": "", + "schema": { + "fields": [ + { + "name": "", + "description": "", + "type": "", + "nullable": false, + "unit": "", + "isAbout": [ + { + "name": "", + "@id": "" + } + ], + "valueReference": [ + { + "value": "", + "name": "", + "@id": "" + } + ] + } + ], + "primaryKey": [ + "" + ], + "foreignKeys": [ + { + "fields": [ + "" + ], + "reference": { + "resource": "", + "fields": [ + "" + ] + } + } + ] + }, + "dialect": { + "delimiter": "", + "decimalSeparator": "" + }, + "review": { + "path": "", + "badge": "" + } + } + ], + "metaMetadata": { + "metadataVersion": "OEMetadata-2.0.1", + "metadataLicense": { + "name": "CC0-1.0", + "title": "Creative Commons Zero v1.0 Universal", + "path": "https://creativecommons.org/publicdomain/zero/1.0" + } + } +} \ No newline at end of file diff --git a/services/backend_regimo/components/oep_access/oemeta/v2/v20/template.py b/services/backend_regimo/components/oep_access/oemeta/v2/v20/template.py new file mode 100644 index 0000000..1872b9a --- /dev/null +++ b/services/backend_regimo/components/oep_access/oemeta/v2/v20/template.py @@ -0,0 +1,10 @@ +# SPDX-FileCopyrightText: 2024 Ludwig Hülk <@Ludee> © Reiner Lemoine Institut +# SPDX-FileCopyrightText: 2024 Jonas Huber <jh-RLI> © Reiner Lemoine Institut +# +# SPDX-License-Identifier: MIT + +import json +import os + +with open(os.path.join(os.path.dirname(__file__), "template.json"), "rb") as f: + OEMETADATA_V20_TEMPLATE = json.loads(f.read()) -- GitLab