From 0715cafaf582d1dd86cd6ab6d19c20331fac19a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludwig=20H=C3=BClk?= Date: Thu, 9 Apr 2026 09:52:40 +0200 Subject: [PATCH 01/30] Update CHANGELOG #293 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 453e8fef..f4852e6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Add badges for Zenodo publication, FAIRsharing DOI and RDA MSC [(#273)](https://github.com/OpenEnergyPlatform/oemetadata/pull/273) +- Dataset creator to contributors [(#304)](https://github.com/OpenEnergyPlatform/oemetadata/pull/304) ### Changed - Update TLDR URL in example sourceLicenses [(#275)](https://github.com/OpenEnergyPlatform/oemetadata/pull/275) From e225d732c7a13006fca2907b06f30b297a93ec15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludwig=20H=C3=BClk?= Date: Thu, 9 Apr 2026 00:57:27 +0200 Subject: [PATCH 02/30] Add frictionless validate tests #290 #296 --- test/oemetadata/v2/v21/test_example.py | 33 +++++++++++++++++++++++++ test/oemetadata/v2/v21/test_template.py | 33 +++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 test/oemetadata/v2/v21/test_example.py create mode 100644 test/oemetadata/v2/v21/test_template.py diff --git a/test/oemetadata/v2/v21/test_example.py b/test/oemetadata/v2/v21/test_example.py new file mode 100644 index 00000000..b43d8b9c --- /dev/null +++ b/test/oemetadata/v2/v21/test_example.py @@ -0,0 +1,33 @@ +# SPDX-FileCopyrightText: 2026 Jonas Huber © Reiner Lemoine Institut +# SPDX-FileCopyrightText: 2026 Ludwig Hülk <@Ludee> © Reiner Lemoine Institut +# SPDX-FileCopyrightText: oemetadata +# SPDX-License-Identifier: MIT + + +def test_oemetadata_example_should_load(): + try: + pass + except Warning: + print("Cannot open OEMetadata Example (v2.1)!") + + +def test_oemetadata_schema_should_validate_oemetadata_example(): + from jsonschema import ValidationError, validate + + from oemetadata.v2.v21.example import OEMETADATA_V21_EXAMPLE + from oemetadata.v2.v21.schema import OEMETADATA_V21_SCHEMA + + try: + validate(OEMETADATA_V21_EXAMPLE, OEMETADATA_V21_SCHEMA) + print("OEMetadata Example is valid OEMetadata Schema (v2.1).") + except ValidationError as e: + print("Cannot validate OEMetadata Example with Schema (v2.1)!", e) + + +def test_oemetadata_example_is_datapackage(): + from frictionless import validate + + from oemetadata.v2.v21.example import OEMETADATA_V21_EXAMPLE + + report = validate(OEMETADATA_V21_EXAMPLE) + assert report.valid, report.flatten(["message"]) diff --git a/test/oemetadata/v2/v21/test_template.py b/test/oemetadata/v2/v21/test_template.py new file mode 100644 index 00000000..c56fc17d --- /dev/null +++ b/test/oemetadata/v2/v21/test_template.py @@ -0,0 +1,33 @@ +# SPDX-FileCopyrightText: 2026 Jonas Huber © Reiner Lemoine Institut +# SPDX-FileCopyrightText: 2026 Ludwig Hülk <@Ludee> © Reiner Lemoine Institut +# SPDX-FileCopyrightText: oemetadata +# SPDX-License-Identifier: MIT + + +def test_oemetadata_template_should_load(): + try: + pass + except Warning: + print("Cannot open OEMetadata Template (v2.1)!") + + +def test_oemetadata_schema_should_validate_oemetadata_template(): + from jsonschema import ValidationError, validate + + from oemetadata.v2.v21.schema import OEMETADATA_V21_SCHEMA + from oemetadata.v2.v21.template import OEMETADATA_V21_TEMPLATE + + try: + validate(OEMETADATA_V21_TEMPLATE, OEMETADATA_V21_SCHEMA) + print("OEMetadata Template is valid OEMetadata Schema (v2.1).") + except ValidationError as e: + print("Cannot validate OEMetadata Template with Schema (v2.1)!", e) + + +def test_oemetadata_template_is_datapackage(): + from frictionless import validate + + from oemetadata.v2.v21.template import OEMETADATA_V21_TEMPLATE + + report = validate(OEMETADATA_V21_TEMPLATE) + assert report.valid, report.flatten(["message"]) From 771eca6c07c42ca7227355ae1e54b47cec4c2572 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludwig=20H=C3=BClk?= Date: Thu, 9 Apr 2026 09:59:51 +0200 Subject: [PATCH 03/30] Update CHANGELOG #290 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4852e6f..23275639 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Introduce scoped context for spatial and temporal objects [(#260)](https://github.com/OpenEnergyPlatform/oemetadata/pull/260) - Add script to manage latest folder [(#264)](https://github.com/OpenEnergyPlatform/oemetadata/pull/264) +- Tests for example and template to be valid frictionless datapackage [(#305)](https://github.com/OpenEnergyPlatform/oemetadata/pull/305) ### Changed - Fix bugs in JSON-LD context [(#260)](https://github.com/OpenEnergyPlatform/oemetadata/pull/260) From b52dffd8fbf07c8dfe23294ed06ab8f1305f2353 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludwig=20H=C3=BClk?= Date: Thu, 9 Apr 2026 11:33:18 +0200 Subject: [PATCH 04/30] Update package #290 --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index ee17da02..8e57c952 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,6 +6,7 @@ argparse build bump-my-version +frictionless jsonschema mike mkdocs @@ -23,4 +24,4 @@ tox twine uv wheel --e . \ No newline at end of file +-e . From 79e82f572eb8b8731b75311306a7a03b6ccad95e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludwig=20H=C3=BClk?= Date: Thu, 9 Apr 2026 14:15:08 +0200 Subject: [PATCH 05/30] Fix global variables #290 --- oemetadata/v2/v21/example.py | 2 +- oemetadata/v2/v21/schema.py | 2 +- oemetadata/v2/v21/template.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/oemetadata/v2/v21/example.py b/oemetadata/v2/v21/example.py index 27d29285..1be67c59 100644 --- a/oemetadata/v2/v21/example.py +++ b/oemetadata/v2/v21/example.py @@ -8,4 +8,4 @@ with open(os.path.join(os.path.dirname(__file__), "example.json"), "rb") as f: - OEMETADATA_V20_EXAMPLE = json.loads(f.read()) + OEMETADATA_V21_EXAMPLE = json.loads(f.read()) diff --git a/oemetadata/v2/v21/schema.py b/oemetadata/v2/v21/schema.py index 4cc852e4..fb169d3a 100644 --- a/oemetadata/v2/v21/schema.py +++ b/oemetadata/v2/v21/schema.py @@ -8,4 +8,4 @@ with open(os.path.join(os.path.dirname(__file__), "schema.json"), "rb") as f: - OEMETADATA_V20_SCHEMA = json.loads(f.read()) + OEMETADATA_V21_SCHEMA = json.loads(f.read()) diff --git a/oemetadata/v2/v21/template.py b/oemetadata/v2/v21/template.py index 3dfb748c..d59359d2 100644 --- a/oemetadata/v2/v21/template.py +++ b/oemetadata/v2/v21/template.py @@ -8,4 +8,4 @@ with open(os.path.join(os.path.dirname(__file__), "template.json"), "rb") as f: - OEMETADATA_V20_TEMPLATE = json.loads(f.read()) + OEMETADATA_V21_TEMPLATE = json.loads(f.read()) From 3cf6b6f15b86987794d66944466e481f8f23bd36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludwig=20H=C3=BClk?= Date: Thu, 9 Apr 2026 14:29:16 +0200 Subject: [PATCH 06/30] Update field type from serial to integer #290 --- oemetadata/v2/v21/build_source/scripts/example/fields.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oemetadata/v2/v21/build_source/scripts/example/fields.json b/oemetadata/v2/v21/build_source/scripts/example/fields.json index 13817d22..ea7f6e6d 100644 --- a/oemetadata/v2/v21/build_source/scripts/example/fields.json +++ b/oemetadata/v2/v21/build_source/scripts/example/fields.json @@ -2,7 +2,7 @@ { "name": "id", "description": "Unique identifier", - "type": "serial", + "type": "integer", "nullable": false, "unit": null, "isAbout": [ From 7efa942694cf45320ef85ab9f1da207c29b3fd33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludwig=20H=C3=BClk?= Date: Thu, 9 Apr 2026 14:34:25 +0200 Subject: [PATCH 07/30] Update example #290 --- oemetadata/v2/v21/build_source/scripts/settings.py | 2 +- oemetadata/v2/v21/example.json | 2 +- oemetadata/v2/v21/schema.json | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/oemetadata/v2/v21/build_source/scripts/settings.py b/oemetadata/v2/v21/build_source/scripts/settings.py index 9009a258..40f3cbc2 100644 --- a/oemetadata/v2/v21/build_source/scripts/settings.py +++ b/oemetadata/v2/v21/build_source/scripts/settings.py @@ -9,7 +9,7 @@ LOG_FORMAT = "%(asctime)s - %(name)s - %(levelname)s - %(message)s" BASE_PATH = Path("oemetadata/v2/") -VERSION = "v20" +VERSION = "v21" VERSION_PATH = BASE_PATH / VERSION SCHEMA_BUILD_PATH = VERSION_PATH / "build_source" MAIN_SCHEMA_PATH = SCHEMA_BUILD_PATH / "schema_structure.json" diff --git a/oemetadata/v2/v21/example.json b/oemetadata/v2/v21/example.json index bbd466e8..4e1d58ac 100644 --- a/oemetadata/v2/v21/example.json +++ b/oemetadata/v2/v21/example.json @@ -146,7 +146,7 @@ { "name": "id", "description": "Unique identifier", - "type": "serial", + "type": "integer", "nullable": false, "unit": null, "isAbout": [ diff --git a/oemetadata/v2/v21/schema.json b/oemetadata/v2/v21/schema.json index a4a62c88..ef386ee5 100644 --- a/oemetadata/v2/v21/schema.json +++ b/oemetadata/v2/v21/schema.json @@ -1033,7 +1033,10 @@ ], "badge": "Bronze", "title": "Comment" - } + }, + "required": [ + "title" + ] }, "badge": "Bronze", "title": "Contributor" From fba1dc7b7f3fb23d42f14dad6e9ebcd38fae3e68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludwig=20H=C3=BClk?= Date: Thu, 9 Apr 2026 22:15:30 +0200 Subject: [PATCH 08/30] Update required structure #290 --- .../v2/v21/build_source/schemas/provenance.json | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/oemetadata/v2/v21/build_source/schemas/provenance.json b/oemetadata/v2/v21/build_source/schemas/provenance.json index 7cc63f1c..6f2a63b1 100644 --- a/oemetadata/v2/v21/build_source/schemas/provenance.json +++ b/oemetadata/v2/v21/build_source/schemas/provenance.json @@ -100,19 +100,14 @@ ], "badge": "Bronze", "title": "Comment" - }, - "required": [ - "title" - ] + } }, + "required": [ + "title" + ], "badge": "Bronze", "title": "Contributor" - }, - "badge": "Bronze", - "title": "Contributors" + } } - }, - "required": [ - "contributors" - ] + } } From 04d868301386037e0b0fd4902a4762d0bb300c99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludwig=20H=C3=BClk?= Date: Mon, 27 Apr 2026 09:36:50 +0200 Subject: [PATCH 09/30] Update schema and tests #290 --- .../build_source/scripts/example/fields.json | 57 ++-- oemetadata/v2/v21/example.json | 57 ++-- oemetadata/v2/v21/schema.json | 272 ++---------------- oemetadata/v2/v21/template.json | 6 +- 4 files changed, 108 insertions(+), 284 deletions(-) diff --git a/oemetadata/v2/v21/build_source/scripts/example/fields.json b/oemetadata/v2/v21/build_source/scripts/example/fields.json index ea7f6e6d..69214dfd 100644 --- a/oemetadata/v2/v21/build_source/scripts/example/fields.json +++ b/oemetadata/v2/v21/build_source/scripts/example/fields.json @@ -8,59 +8,66 @@ "isAbout": [ { "name": "identifier", - "@id": "http://purl.obolibrary.org/obo/IAO_0020000" + "@id": "http://purl.obolibrary.org/obo/IAO_0020000", + "mappingRelation": "skos:exactMatch" } ], "valueReference": [ { "value": null, "name": null, - "@id": null + "@id": null, + "mappingRelation": null } ] }, { "name": "name", "description": "Technology Name", - "type": "text", + "type": "string", "nullable": true, "unit": null, "isAbout": [ { "name": "power generation technology", - "@id": "http://openenergy-platform.org/ontology/oeo/OEO_00010423" + "@id": "http://openenergy-platform.org/ontology/oeo/OEO_00010423", + "mappingRelation": "skos:exactMatch" } ], "valueReference": [ { "value": "wind", "name": "wind power technology", - "@id": "http://openenergyplatform.org/ontology/oeo/OEO_00010424" + "@id": "http://openenergyplatform.org/ontology/oeo/OEO_00010424", + "mappingRelation": "skos:exactMatch" } ] }, { "name": "type", "description": "Type of wind farm", - "type": "text", + "type": "string", "nullable": true, "unit": null, "isAbout": [ { "name": "wind farm", - "@id": "https://openenergyplatform.org/ontology/oeo/OEO_00000447/" + "@id": "https://openenergyplatform.org/ontology/oeo/OEO_00000447/", + "mappingRelation": "skos:exactMatch" } ], "valueReference": [ { "value": "onshore", "name": "onshore wind farm", - "@id": "https://openenergyplatform.org/ontology/oeo/OEO_00000311/" + "@id": "https://openenergyplatform.org/ontology/oeo/OEO_00000311/", + "mappingRelation": "skos:exactMatch" }, { "value": "offshore", "name": "offshore wind farm", - "@id": "https://openenergyplatform.org/ontology/oeo/OEO_00000308/" + "@id": "https://openenergyplatform.org/ontology/oeo/OEO_00000308/", + "mappingRelation": "skos:exactMatch" } ] }, @@ -73,14 +80,16 @@ "isAbout": [ { "name": "year", - "@id": "https://openenergyplatform.org/ontology/oeo/UO_0000036/" + "@id": "https://openenergyplatform.org/ontology/oeo/UO_0000036/", + "mappingRelation": "skos:exactMatch" } ], "valueReference": [ { "value": null, "name": null, - "@id": null + "@id": null, + "mappingRelation": null } ] }, @@ -93,14 +102,16 @@ "isAbout": [ { "name": "nameplate capacity", - "@id": "https://openenergyplatform.org/ontology/oeo/OEO_00230003/" + "@id": "https://openenergyplatform.org/ontology/oeo/OEO_00230003/", + "mappingRelation": "skos:exactMatch" } ], "valueReference": [ { "value": null, "name": null, - "@id": null + "@id": null, + "mappingRelation": null } ] }, @@ -113,14 +124,16 @@ "isAbout": [ { "name": "Operating Mode Status", - "@id": "https://ontology.brickschema.org/brick/Operating_Mode_Status" + "@id": "https://ontology.brickschema.org/brick/Operating_Mode_Status", + "mappingRelation": "skos:exactMatch" } ], "valueReference": [ { "value": null, "name": null, - "@id": null + "@id": null, + "mappingRelation": null } ] }, @@ -133,34 +146,38 @@ "isAbout": [ { "name": "version number", - "@id": "http://purl.obolibrary.org/obo/IAO_0000129" + "@id": "http://purl.obolibrary.org/obo/IAO_0000129", + "mappingRelation": "skos:exactMatch" } ], "valueReference": [ { "value": null, "name": null, - "@id": null + "@id": null, + "mappingRelation": null } ] }, { "name": "comment", "description": "", - "type": "text", + "type": "string", "nullable": true, "unit": null, "isAbout": [ { "name": "comment", - "@id": "http://semanticscience.org/resource/SIO_001167" + "@id": "http://semanticscience.org/resource/SIO_001167", + "mappingRelation": "skos:exactMatch" } ], "valueReference": [ { "value": null, "name": null, - "@id": null + "@id": null, + "mappingRelation": null } ] } diff --git a/oemetadata/v2/v21/example.json b/oemetadata/v2/v21/example.json index cd02d89c..aeea5700 100644 --- a/oemetadata/v2/v21/example.json +++ b/oemetadata/v2/v21/example.json @@ -190,59 +190,66 @@ "isAbout": [ { "name": "identifier", - "@id": "http://purl.obolibrary.org/obo/IAO_0020000" + "@id": "http://purl.obolibrary.org/obo/IAO_0020000", + "mappingRelation": "skos:exactMatch" } ], "valueReference": [ { "value": null, "name": null, - "@id": null + "@id": null, + "mappingRelation": null } ] }, { "name": "name", "description": "Technology Name", - "type": "text", + "type": "string", "nullable": true, "unit": null, "isAbout": [ { "name": "power generation technology", - "@id": "http://openenergy-platform.org/ontology/oeo/OEO_00010423" + "@id": "http://openenergy-platform.org/ontology/oeo/OEO_00010423", + "mappingRelation": "skos:exactMatch" } ], "valueReference": [ { "value": "wind", "name": "wind power technology", - "@id": "http://openenergyplatform.org/ontology/oeo/OEO_00010424" + "@id": "http://openenergyplatform.org/ontology/oeo/OEO_00010424", + "mappingRelation": "skos:exactMatch" } ] }, { "name": "type", "description": "Type of wind farm", - "type": "text", + "type": "string", "nullable": true, "unit": null, "isAbout": [ { "name": "wind farm", - "@id": "https://openenergyplatform.org/ontology/oeo/OEO_00000447/" + "@id": "https://openenergyplatform.org/ontology/oeo/OEO_00000447/", + "mappingRelation": "skos:exactMatch" } ], "valueReference": [ { "value": "onshore", "name": "onshore wind farm", - "@id": "https://openenergyplatform.org/ontology/oeo/OEO_00000311/" + "@id": "https://openenergyplatform.org/ontology/oeo/OEO_00000311/", + "mappingRelation": "skos:exactMatch" }, { "value": "offshore", "name": "offshore wind farm", - "@id": "https://openenergyplatform.org/ontology/oeo/OEO_00000308/" + "@id": "https://openenergyplatform.org/ontology/oeo/OEO_00000308/", + "mappingRelation": "skos:exactMatch" } ] }, @@ -255,14 +262,16 @@ "isAbout": [ { "name": "year", - "@id": "https://openenergyplatform.org/ontology/oeo/UO_0000036/" + "@id": "https://openenergyplatform.org/ontology/oeo/UO_0000036/", + "mappingRelation": "skos:exactMatch" } ], "valueReference": [ { "value": null, "name": null, - "@id": null + "@id": null, + "mappingRelation": null } ] }, @@ -275,14 +284,16 @@ "isAbout": [ { "name": "nameplate capacity", - "@id": "https://openenergyplatform.org/ontology/oeo/OEO_00230003/" + "@id": "https://openenergyplatform.org/ontology/oeo/OEO_00230003/", + "mappingRelation": "skos:exactMatch" } ], "valueReference": [ { "value": null, "name": null, - "@id": null + "@id": null, + "mappingRelation": null } ] }, @@ -295,14 +306,16 @@ "isAbout": [ { "name": "Operating Mode Status", - "@id": "https://ontology.brickschema.org/brick/Operating_Mode_Status" + "@id": "https://ontology.brickschema.org/brick/Operating_Mode_Status", + "mappingRelation": "skos:exactMatch" } ], "valueReference": [ { "value": null, "name": null, - "@id": null + "@id": null, + "mappingRelation": null } ] }, @@ -315,34 +328,38 @@ "isAbout": [ { "name": "version number", - "@id": "http://purl.obolibrary.org/obo/IAO_0000129" + "@id": "http://purl.obolibrary.org/obo/IAO_0000129", + "mappingRelation": "skos:exactMatch" } ], "valueReference": [ { "value": null, "name": null, - "@id": null + "@id": null, + "mappingRelation": null } ] }, { "name": "comment", "description": "", - "type": "text", + "type": "string", "nullable": true, "unit": null, "isAbout": [ { "name": "comment", - "@id": "http://semanticscience.org/resource/SIO_001167" + "@id": "http://semanticscience.org/resource/SIO_001167", + "mappingRelation": "skos:exactMatch" } ], "valueReference": [ { "value": null, "name": null, - "@id": null + "@id": null, + "mappingRelation": null } ] } diff --git a/oemetadata/v2/v21/schema.json b/oemetadata/v2/v21/schema.json index 4e437246..860e85de 100644 --- a/oemetadata/v2/v21/schema.json +++ b/oemetadata/v2/v21/schema.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://raw.githubusercontent.com/OpenEnergyPlatform/oemetadata/production/oemetadata/v2/v20/schema.json", + "$id": "https://raw.githubusercontent.com/OpenEnergyPlatform/oemetadata/production/oemetadata/v2/v21/schema.json", "description": "Open Energy Metadata (OEMetadata) - metadata schema", "type": "object", "required": [ @@ -420,11 +420,12 @@ "title": "Comment" } }, + "required": [ + "title" + ], "badge": "Bronze", "title": "Contributor" - }, - "badge": "Bronze", - "title": "Contributors" + } }, "datasetLicenses": { "description": "An array of objects of licenses under which the described data is provided.", @@ -732,138 +733,6 @@ "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", @@ -1376,111 +1245,6 @@ "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ü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 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": [ @@ -1629,6 +1393,18 @@ "badge": "Platinum", "title": "Is About Identifier", "format": "uri" + }, + "mappingRelation": { + "description": "Using SKOS mapping properties to state mapping (alignment).", + "type": [ + "string", + "null" + ], + "examples": [ + "skos:closeMatch" + ], + "badge": "Platinum", + "title": "Is About SKOS Mapping Relation" } }, "badge": "Platinum", @@ -1679,6 +1455,18 @@ "badge": "Platinum", "title": "Value Reference Identifier", "format": "uri" + }, + "mappingRelation": { + "description": "Using SKOS mapping properties to state mapping (alignment).", + "type": [ + "string", + "null" + ], + "examples": [ + "skos:exactMatch" + ], + "badge": "Platinum", + "title": "Value Reference SKOS Mapping Relation" } }, "badge": "Platinum", @@ -1880,7 +1668,7 @@ "metadataVersion": { "description": "Type and version number of the metadata.", "examples": [ - "OEMetadata-2.0.4" + "OEMetadata-2.1.0" ], "type": [ "string", diff --git a/oemetadata/v2/v21/template.json b/oemetadata/v2/v21/template.json index 8de40a63..1bb82c22 100644 --- a/oemetadata/v2/v21/template.json +++ b/oemetadata/v2/v21/template.json @@ -161,14 +161,16 @@ "isAbout": [ { "name": "", - "@id": "" + "@id": "", + "mappingRelation": "" } ], "valueReference": [ { "value": "", "name": "", - "@id": "" + "@id": "", + "mappingRelation": "" } ] } From 331f432ec0e6aa62b5817f35f8d1e4b55a6cbf6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludwig=20H=C3=BClk?= Date: Mon, 27 Apr 2026 09:40:14 +0200 Subject: [PATCH 10/30] Update example data type #290 --- oemetadata/v2/v21/build_source/scripts/example/fields.json | 2 +- oemetadata/v2/v21/example.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/oemetadata/v2/v21/build_source/scripts/example/fields.json b/oemetadata/v2/v21/build_source/scripts/example/fields.json index 69214dfd..189e5c93 100644 --- a/oemetadata/v2/v21/build_source/scripts/example/fields.json +++ b/oemetadata/v2/v21/build_source/scripts/example/fields.json @@ -96,7 +96,7 @@ { "name": "value", "description": "Bruttoleistung", - "type": "decimal", + "type": "float", "nullable": true, "unit": "MW", "isAbout": [ diff --git a/oemetadata/v2/v21/example.json b/oemetadata/v2/v21/example.json index aeea5700..94a13c18 100644 --- a/oemetadata/v2/v21/example.json +++ b/oemetadata/v2/v21/example.json @@ -278,7 +278,7 @@ { "name": "value", "description": "Bruttoleistung", - "type": "decimal", + "type": "float", "nullable": true, "unit": "MW", "isAbout": [ From 8703499df6a9326e4da8994c5bb33dee9bcdffa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludwig=20H=C3=BClk?= Date: Mon, 27 Apr 2026 09:51:05 +0200 Subject: [PATCH 11/30] Update example data type float #290 --- oemetadata/v2/v21/build_source/scripts/example/fields.json | 2 +- oemetadata/v2/v21/example.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/oemetadata/v2/v21/build_source/scripts/example/fields.json b/oemetadata/v2/v21/build_source/scripts/example/fields.json index 189e5c93..816d3243 100644 --- a/oemetadata/v2/v21/build_source/scripts/example/fields.json +++ b/oemetadata/v2/v21/build_source/scripts/example/fields.json @@ -96,7 +96,7 @@ { "name": "value", "description": "Bruttoleistung", - "type": "float", + "type": "number", "nullable": true, "unit": "MW", "isAbout": [ diff --git a/oemetadata/v2/v21/example.json b/oemetadata/v2/v21/example.json index 94a13c18..fc2c2e70 100644 --- a/oemetadata/v2/v21/example.json +++ b/oemetadata/v2/v21/example.json @@ -278,7 +278,7 @@ { "name": "value", "description": "Bruttoleistung", - "type": "float", + "type": "number", "nullable": true, "unit": "MW", "isAbout": [ From 98747e612b52d81f4947ee6c94c7b94e4515be74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludwig=20H=C3=BClk?= Date: Mon, 27 Apr 2026 09:58:01 +0200 Subject: [PATCH 12/30] Update example format csv #290 --- oemetadata/v2/v21/build_source/schemas/fields.json | 2 +- oemetadata/v2/v21/example.json | 2 +- oemetadata/v2/v21/schema.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/oemetadata/v2/v21/build_source/schemas/fields.json b/oemetadata/v2/v21/build_source/schemas/fields.json index 7a4a758b..d71d2fc5 100644 --- a/oemetadata/v2/v21/build_source/schemas/fields.json +++ b/oemetadata/v2/v21/build_source/schemas/fields.json @@ -25,7 +25,7 @@ "null" ], "examples": [ - "CSV" + "csv" ], "badge": "Gold", "title": "Format", diff --git a/oemetadata/v2/v21/example.json b/oemetadata/v2/v21/example.json index fc2c2e70..d80ec416 100644 --- a/oemetadata/v2/v21/example.json +++ b/oemetadata/v2/v21/example.json @@ -177,7 +177,7 @@ } ], "type": "table", - "format": "CSV", + "format": "csv", "encoding": "UTF-8", "schema": { "fields": [ diff --git a/oemetadata/v2/v21/schema.json b/oemetadata/v2/v21/schema.json index 860e85de..543891d5 100644 --- a/oemetadata/v2/v21/schema.json +++ b/oemetadata/v2/v21/schema.json @@ -1267,7 +1267,7 @@ "null" ], "examples": [ - "CSV" + "csv" ], "badge": "Gold", "title": "Format", From fef6dae2a2fc7669821535a7d34951df60912ad6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludwig=20H=C3=BClk?= Date: Mon, 27 Apr 2026 10:23:53 +0200 Subject: [PATCH 13/30] Update example fk #290 --- .../v2/v21/build_source/schemas/fields.json | 2 +- .../v2/v21/build_source/schemas/general.json | 2 +- test/oemetadata/v2/v21/test_template.py | 15 ++++++++------- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/oemetadata/v2/v21/build_source/schemas/fields.json b/oemetadata/v2/v21/build_source/schemas/fields.json index d71d2fc5..cef6b9ab 100644 --- a/oemetadata/v2/v21/build_source/schemas/fields.json +++ b/oemetadata/v2/v21/build_source/schemas/fields.json @@ -298,7 +298,7 @@ "null" ], "examples": [ - "model_draft.oep_oemetadata_table_example_version" + "oemetadata_table_example_version" ], "badge": "Iron", "title": "Foreign Resource" diff --git a/oemetadata/v2/v21/build_source/schemas/general.json b/oemetadata/v2/v21/build_source/schemas/general.json index 6b90b3e2..1404e157 100644 --- a/oemetadata/v2/v21/build_source/schemas/general.json +++ b/oemetadata/v2/v21/build_source/schemas/general.json @@ -36,7 +36,7 @@ "null" ], "examples": [ - "oemetadata_table_template" + "oemetadata_table_example" ], "badge": "Iron", "title": "Name" diff --git a/test/oemetadata/v2/v21/test_template.py b/test/oemetadata/v2/v21/test_template.py index c56fc17d..afc1293a 100644 --- a/test/oemetadata/v2/v21/test_template.py +++ b/test/oemetadata/v2/v21/test_template.py @@ -24,10 +24,11 @@ def test_oemetadata_schema_should_validate_oemetadata_template(): print("Cannot validate OEMetadata Template with Schema (v2.1)!", e) -def test_oemetadata_template_is_datapackage(): - from frictionless import validate - - from oemetadata.v2.v21.template import OEMETADATA_V21_TEMPLATE - - report = validate(OEMETADATA_V21_TEMPLATE) - assert report.valid, report.flatten(["message"]) +# Template is not a valid datapackage +# def test_oemetadata_template_is_datapackage(): +# from frictionless import validate +# +# from oemetadata.v2.v21.template import OEMETADATA_V21_TEMPLATE +# +# report = validate(OEMETADATA_V21_TEMPLATE) +# assert report.valid, report.flatten(["message"]) From c394fa05a6ce106f7471dcb5abff7a37ee3d1cac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludwig=20H=C3=BClk?= Date: Mon, 27 Apr 2026 10:26:26 +0200 Subject: [PATCH 14/30] Update example fk #290 --- oemetadata/v2/v21/example.json | 4 ++-- oemetadata/v2/v21/schema.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/oemetadata/v2/v21/example.json b/oemetadata/v2/v21/example.json index d80ec416..a2878dea 100644 --- a/oemetadata/v2/v21/example.json +++ b/oemetadata/v2/v21/example.json @@ -89,7 +89,7 @@ { "@id": "https://databus.openenergyplatform.org/oeplatform/supply/wri_global_power_plant_database/2022-11-07/wri_global_power_plant_database_variant=data.csv", "path": "http://openenergyplatform.org/dataedit/view/model_draft/oemetadata_table_template", - "name": "oemetadata_table_template", + "name": "oemetadata_table_example", "title": "OEMetadata Table Template", "description": "Example table used to illustrate the OEMetadata structure and features.", "publicationDate": "2024-10-15", @@ -374,7 +374,7 @@ "version" ], "reference": { - "resource": "model_draft.oep_oemetadata_table_example_version", + "resource": "oemetadata_table_example_version", "fields": [ "id", "version" diff --git a/oemetadata/v2/v21/schema.json b/oemetadata/v2/v21/schema.json index 543891d5..188c70d9 100644 --- a/oemetadata/v2/v21/schema.json +++ b/oemetadata/v2/v21/schema.json @@ -587,7 +587,7 @@ "null" ], "examples": [ - "oemetadata_table_template" + "oemetadata_table_example" ], "badge": "Iron", "title": "Name" @@ -1540,7 +1540,7 @@ "null" ], "examples": [ - "model_draft.oep_oemetadata_table_example_version" + "oemetadata_table_example_version" ], "badge": "Iron", "title": "Foreign Resource" From 16652134a812436afe8968bf0a971418bb971083 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludwig=20H=C3=BClk?= Date: Mon, 27 Apr 2026 10:55:25 +0200 Subject: [PATCH 15/30] Update example for fk #290 --- REUSE.toml | 8 + .../build_source/scripts/example/fields.json | 2 +- oemetadata/v2/v21/example.json | 2 +- .../v2/v21/oemetadata_table_example.csv | 5 + .../v21/oemetadata_table_example_version.csv | 3 + .../v21/oemetadata_table_example_version.json | 288 ++++++++++++++++++ 6 files changed, 306 insertions(+), 2 deletions(-) create mode 100644 oemetadata/v2/v21/oemetadata_table_example.csv create mode 100644 oemetadata/v2/v21/oemetadata_table_example_version.csv create mode 100644 oemetadata/v2/v21/oemetadata_table_example_version.json diff --git a/REUSE.toml b/REUSE.toml index dd15fbbc..2a8805f8 100644 --- a/REUSE.toml +++ b/REUSE.toml @@ -118,6 +118,14 @@ SPDX-FileCopyrightText = ["2026 Ludwig Hülk <@Ludee> © Reiner Lemoine Institut "oemetadata "] SPDX-License-Identifier = "MIT" +[[annotations]] +path = "oemetadata/v2/v21/*.csv" +precedence = "override" +SPDX-FileCopyrightText = ["2026 Ludwig Hülk <@Ludee> © Reiner Lemoine Institut", + "2026 Jonas Huber <@jh-RLI> © Reiner Lemoine Institut", + "oemetadata "] +SPDX-License-Identifier = "CC0-1.0" + [[annotations]] path = "oemetadata/v2/v21/build_source/schemas/*.json" precedence = "override" diff --git a/oemetadata/v2/v21/build_source/scripts/example/fields.json b/oemetadata/v2/v21/build_source/scripts/example/fields.json index 816d3243..00b325a7 100644 --- a/oemetadata/v2/v21/build_source/scripts/example/fields.json +++ b/oemetadata/v2/v21/build_source/scripts/example/fields.json @@ -140,7 +140,7 @@ { "name": "version", "description": "Version", - "type": "integer", + "type": "string", "nullable": true, "unit": null, "isAbout": [ diff --git a/oemetadata/v2/v21/example.json b/oemetadata/v2/v21/example.json index a2878dea..6cd83ceb 100644 --- a/oemetadata/v2/v21/example.json +++ b/oemetadata/v2/v21/example.json @@ -322,7 +322,7 @@ { "name": "version", "description": "Version", - "type": "integer", + "type": "string", "nullable": true, "unit": null, "isAbout": [ diff --git a/oemetadata/v2/v21/oemetadata_table_example.csv b/oemetadata/v2/v21/oemetadata_table_example.csv new file mode 100644 index 00000000..d66be5d1 --- /dev/null +++ b/oemetadata/v2/v21/oemetadata_table_example.csv @@ -0,0 +1,5 @@ +"id","name","type","year","value","is_active","version","comment" +1,"wind","onshore",2021,55.93,true,"0.1.0","" +2,"wind","offshore",2021,7.79,true,"0.1.0","" +3,"wind","onshore",2022,58.05,true,"0.1.1","" +4,"wind","offshore",2022,8.13,true,"0.1.1","" diff --git a/oemetadata/v2/v21/oemetadata_table_example_version.csv b/oemetadata/v2/v21/oemetadata_table_example_version.csv new file mode 100644 index 00000000..cd8f71e7 --- /dev/null +++ b/oemetadata/v2/v21/oemetadata_table_example_version.csv @@ -0,0 +1,3 @@ +"id","version","date","comment" +1,"0.1.0","2021-12-31","2021" +1,"0.1.1","2022-12-31","2022" diff --git a/oemetadata/v2/v21/oemetadata_table_example_version.json b/oemetadata/v2/v21/oemetadata_table_example_version.json new file mode 100644 index 00000000..8ab848d8 --- /dev/null +++ b/oemetadata/v2/v21/oemetadata_table_example_version.json @@ -0,0 +1,288 @@ +{ + "@context": "https://raw.githubusercontent.com/OpenEnergyPlatform/oemetadata/production/oemetadata/latest/context.json", + "@id": "https://databus.openenergyplatform.org/oeplatform/supply/wri_global_power_plant_database/", + "name": "oep_oemetadata", + "title": "OEP OEMetadata Dataset", + "description": "A dataset for the OEMetadata examples.", + "topics": [ + "model_draft" + ], + "languages": [ + "en-GB", + "de-DE" + ], + "version": "0.1.0", + "image": "https://openenergyplatform.org/static/img/about/OpenEnergyFamily_GroupPhoto2.png", + "subject": [ + { + "name": "energy", + "@id": "https://openenergyplatform.org/ontology/oeo/OEO_00000150" + } + ], + "keywords": [ + "example", + "ODbL-1.0", + "NFDI4Energy" + ], + "projectContext": { + "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" + }, + "contributors": [ + { + "title": "Ludwig Hülk", + "path": "https://github.com/Ludee", + "organization": "Reiner Lemoine Institut", + "roles": [ + "Creator" + ], + "date": "2026-04-09", + "object": "dataset", + "comment": "Date of dataset creation" + }, + { + "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" + } + ], + "datasetLicenses": [ + { + "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/production/LICENSE.txt" + } + ], + "review": { + "path": "https://openenergyplatform.org/dataedit/view/model_draft/oep_table_example/open_peer_review/", + "badge": "Platinum" + }, + "resources": [ + { + "@id": "https://databus.openenergyplatform.org/oeplatform/supply/wri_global_power_plant_database/2022-11-07/wri_global_power_plant_database_variant=data.csv", + "path": "http://openenergyplatform.org/dataedit/view/model_draft/oemetadata_table_example_version", + "name": "oemetadata_table_example_version", + "title": "OEMetadata Table Example Version", + "description": "Example table used to illustrate the OEMetadata structure and features.", + "publicationDate": "2024-10-15", + "subject": [ + { + "name": "energy", + "@id": "https://openenergyplatform.org/ontology/oeo/OEO_00000150" + } + ], + "keywords": [ + "example", + "ODbL-1.0", + "NFDI4Energy" + ], + "embargoPeriod": { + "start": "2024-10-11", + "end": "2025-01-01", + "isActive": true + }, + "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://www.tldrlegal.com/license/creative-commons-attribution-4-0-international-cc-by-4 for further information.", + "attribution": "© Intergovernmental Panel on Climate Change 2023", + "copyrightStatement": "https://www.ipcc.ch/copyright/" + } + ] + } + ], + "resourceLicenses": [ + { + "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/production/LICENSE.txt" + } + ], + "type": "table", + "format": "csv", + "encoding": "UTF-8", + "schema": { + "fields": [ + { + "name": "id", + "description": "Unique identifier", + "type": "integer", + "nullable": false, + "unit": null, + "isAbout": [ + { + "name": "identifier", + "@id": "http://purl.obolibrary.org/obo/IAO_0020000", + "mappingRelation": "skos:exactMatch" + } + ], + "valueReference": [ + { + "value": null, + "name": null, + "@id": null, + "mappingRelation": null + } + ] + }, + { + "name": "version", + "description": "Version", + "type": "string", + "nullable": true, + "unit": null, + "isAbout": [ + { + "name": "version number", + "@id": "http://purl.obolibrary.org/obo/IAO_0000129", + "mappingRelation": "skos:exactMatch" + } + ], + "valueReference": [ + { + "value": null, + "name": null, + "@id": null, + "mappingRelation": null + } + ] + }, + { + "name": "comment", + "description": "", + "type": "string", + "nullable": true, + "unit": null, + "isAbout": [ + { + "name": "comment", + "@id": "http://semanticscience.org/resource/SIO_001167", + "mappingRelation": "skos:exactMatch" + } + ], + "valueReference": [ + { + "value": null, + "name": null, + "@id": null, + "mappingRelation": null + } + ] + } + ], + "primaryKey": [ + "id" + ], + "foreignKeys": [ + { + "fields": [ + "id", + "version" + ], + "reference": { + "resource": "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.1.0", + "metadataLicense": { + "name": "CC0-1.0", + "title": "Creative Commons Zero v1.0 Universal", + "path": "https://creativecommons.org/publicdomain/zero/1.0" + } + } +} From a5176cea730eefc05910e0ff2668b88aeb7dfb58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludwig=20H=C3=BClk?= Date: Mon, 27 Apr 2026 13:12:22 +0200 Subject: [PATCH 16/30] Remove fk for test #290 --- REUSE.toml | 24 +- oemetadata/v2/v21/example.json | 16 +- .../v2/v21/oemetadata_table_example.csv | 5 - .../v21/oemetadata_table_example_version.csv | 3 - .../v21/oemetadata_table_example_version.json | 288 ------------------ 5 files changed, 17 insertions(+), 319 deletions(-) delete mode 100644 oemetadata/v2/v21/oemetadata_table_example.csv delete mode 100644 oemetadata/v2/v21/oemetadata_table_example_version.csv delete mode 100644 oemetadata/v2/v21/oemetadata_table_example_version.json diff --git a/REUSE.toml b/REUSE.toml index 2a8805f8..edbb7727 100644 --- a/REUSE.toml +++ b/REUSE.toml @@ -118,14 +118,6 @@ SPDX-FileCopyrightText = ["2026 Ludwig Hülk <@Ludee> © Reiner Lemoine Institut "oemetadata "] SPDX-License-Identifier = "MIT" -[[annotations]] -path = "oemetadata/v2/v21/*.csv" -precedence = "override" -SPDX-FileCopyrightText = ["2026 Ludwig Hülk <@Ludee> © Reiner Lemoine Institut", - "2026 Jonas Huber <@jh-RLI> © Reiner Lemoine Institut", - "oemetadata "] -SPDX-License-Identifier = "CC0-1.0" - [[annotations]] path = "oemetadata/v2/v21/build_source/schemas/*.json" precedence = "override" @@ -149,3 +141,19 @@ SPDX-FileCopyrightText = ["2024 Ludwig Hülk <@Ludee> © Reiner Lemoine Institut "2024 Jonas Huber <@jh-RLI> © Reiner Lemoine Institut", "oemetadata "] SPDX-License-Identifier = "MIT" + +[[annotations]] +path = "test/oemetadata/v2/v21/example/*.csv" +precedence = "override" +SPDX-FileCopyrightText = ["2026 Ludwig Hülk <@Ludee> © Reiner Lemoine Institut", + "2026 Jonas Huber <@jh-RLI> © Reiner Lemoine Institut", + "oemetadata "] +SPDX-License-Identifier = "CC0-1.0" + +[[annotations]] +path = "test/oemetadata/v2/v21/example/*.json" +precedence = "override" +SPDX-FileCopyrightText = ["2026 Ludwig Hülk <@Ludee> © Reiner Lemoine Institut", + "2024 Jonas Huber <@jh-RLI> © Reiner Lemoine Institut", + "oemetadata "] +SPDX-License-Identifier = "CC0-1.0" diff --git a/oemetadata/v2/v21/example.json b/oemetadata/v2/v21/example.json index 6cd83ceb..fa81cacd 100644 --- a/oemetadata/v2/v21/example.json +++ b/oemetadata/v2/v21/example.json @@ -367,21 +367,7 @@ "primaryKey": [ "id" ], - "foreignKeys": [ - { - "fields": [ - "id", - "version" - ], - "reference": { - "resource": "oemetadata_table_example_version", - "fields": [ - "id", - "version" - ] - } - } - ] + "foreignKeys": [] }, "dialect": { "delimiter": ";", diff --git a/oemetadata/v2/v21/oemetadata_table_example.csv b/oemetadata/v2/v21/oemetadata_table_example.csv deleted file mode 100644 index d66be5d1..00000000 --- a/oemetadata/v2/v21/oemetadata_table_example.csv +++ /dev/null @@ -1,5 +0,0 @@ -"id","name","type","year","value","is_active","version","comment" -1,"wind","onshore",2021,55.93,true,"0.1.0","" -2,"wind","offshore",2021,7.79,true,"0.1.0","" -3,"wind","onshore",2022,58.05,true,"0.1.1","" -4,"wind","offshore",2022,8.13,true,"0.1.1","" diff --git a/oemetadata/v2/v21/oemetadata_table_example_version.csv b/oemetadata/v2/v21/oemetadata_table_example_version.csv deleted file mode 100644 index cd8f71e7..00000000 --- a/oemetadata/v2/v21/oemetadata_table_example_version.csv +++ /dev/null @@ -1,3 +0,0 @@ -"id","version","date","comment" -1,"0.1.0","2021-12-31","2021" -1,"0.1.1","2022-12-31","2022" diff --git a/oemetadata/v2/v21/oemetadata_table_example_version.json b/oemetadata/v2/v21/oemetadata_table_example_version.json deleted file mode 100644 index 8ab848d8..00000000 --- a/oemetadata/v2/v21/oemetadata_table_example_version.json +++ /dev/null @@ -1,288 +0,0 @@ -{ - "@context": "https://raw.githubusercontent.com/OpenEnergyPlatform/oemetadata/production/oemetadata/latest/context.json", - "@id": "https://databus.openenergyplatform.org/oeplatform/supply/wri_global_power_plant_database/", - "name": "oep_oemetadata", - "title": "OEP OEMetadata Dataset", - "description": "A dataset for the OEMetadata examples.", - "topics": [ - "model_draft" - ], - "languages": [ - "en-GB", - "de-DE" - ], - "version": "0.1.0", - "image": "https://openenergyplatform.org/static/img/about/OpenEnergyFamily_GroupPhoto2.png", - "subject": [ - { - "name": "energy", - "@id": "https://openenergyplatform.org/ontology/oeo/OEO_00000150" - } - ], - "keywords": [ - "example", - "ODbL-1.0", - "NFDI4Energy" - ], - "projectContext": { - "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" - }, - "contributors": [ - { - "title": "Ludwig Hülk", - "path": "https://github.com/Ludee", - "organization": "Reiner Lemoine Institut", - "roles": [ - "Creator" - ], - "date": "2026-04-09", - "object": "dataset", - "comment": "Date of dataset creation" - }, - { - "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" - } - ], - "datasetLicenses": [ - { - "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/production/LICENSE.txt" - } - ], - "review": { - "path": "https://openenergyplatform.org/dataedit/view/model_draft/oep_table_example/open_peer_review/", - "badge": "Platinum" - }, - "resources": [ - { - "@id": "https://databus.openenergyplatform.org/oeplatform/supply/wri_global_power_plant_database/2022-11-07/wri_global_power_plant_database_variant=data.csv", - "path": "http://openenergyplatform.org/dataedit/view/model_draft/oemetadata_table_example_version", - "name": "oemetadata_table_example_version", - "title": "OEMetadata Table Example Version", - "description": "Example table used to illustrate the OEMetadata structure and features.", - "publicationDate": "2024-10-15", - "subject": [ - { - "name": "energy", - "@id": "https://openenergyplatform.org/ontology/oeo/OEO_00000150" - } - ], - "keywords": [ - "example", - "ODbL-1.0", - "NFDI4Energy" - ], - "embargoPeriod": { - "start": "2024-10-11", - "end": "2025-01-01", - "isActive": true - }, - "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://www.tldrlegal.com/license/creative-commons-attribution-4-0-international-cc-by-4 for further information.", - "attribution": "© Intergovernmental Panel on Climate Change 2023", - "copyrightStatement": "https://www.ipcc.ch/copyright/" - } - ] - } - ], - "resourceLicenses": [ - { - "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/production/LICENSE.txt" - } - ], - "type": "table", - "format": "csv", - "encoding": "UTF-8", - "schema": { - "fields": [ - { - "name": "id", - "description": "Unique identifier", - "type": "integer", - "nullable": false, - "unit": null, - "isAbout": [ - { - "name": "identifier", - "@id": "http://purl.obolibrary.org/obo/IAO_0020000", - "mappingRelation": "skos:exactMatch" - } - ], - "valueReference": [ - { - "value": null, - "name": null, - "@id": null, - "mappingRelation": null - } - ] - }, - { - "name": "version", - "description": "Version", - "type": "string", - "nullable": true, - "unit": null, - "isAbout": [ - { - "name": "version number", - "@id": "http://purl.obolibrary.org/obo/IAO_0000129", - "mappingRelation": "skos:exactMatch" - } - ], - "valueReference": [ - { - "value": null, - "name": null, - "@id": null, - "mappingRelation": null - } - ] - }, - { - "name": "comment", - "description": "", - "type": "string", - "nullable": true, - "unit": null, - "isAbout": [ - { - "name": "comment", - "@id": "http://semanticscience.org/resource/SIO_001167", - "mappingRelation": "skos:exactMatch" - } - ], - "valueReference": [ - { - "value": null, - "name": null, - "@id": null, - "mappingRelation": null - } - ] - } - ], - "primaryKey": [ - "id" - ], - "foreignKeys": [ - { - "fields": [ - "id", - "version" - ], - "reference": { - "resource": "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.1.0", - "metadataLicense": { - "name": "CC0-1.0", - "title": "Creative Commons Zero v1.0 Universal", - "path": "https://creativecommons.org/publicdomain/zero/1.0" - } - } -} From 9c4b5be5b47daf3dc2fed850fac60a433df7fb92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludwig=20H=C3=BClk?= Date: Mon, 27 Apr 2026 13:21:19 +0200 Subject: [PATCH 17/30] Update example file #290 --- REUSE.toml | 8 ++++++++ oemetadata/v2/v21/build_source/schemas/general.json | 6 +++--- oemetadata/v2/v21/example.csv | 5 +++++ oemetadata/v2/v21/example.json | 6 +++--- oemetadata/v2/v21/schema.json | 6 +++--- 5 files changed, 22 insertions(+), 9 deletions(-) create mode 100644 oemetadata/v2/v21/example.csv diff --git a/REUSE.toml b/REUSE.toml index edbb7727..e42c6016 100644 --- a/REUSE.toml +++ b/REUSE.toml @@ -118,6 +118,14 @@ SPDX-FileCopyrightText = ["2026 Ludwig Hülk <@Ludee> © Reiner Lemoine Institut "oemetadata "] SPDX-License-Identifier = "MIT" +[[annotations]] +path = "oemetadata/v2/v21/*.csv" +precedence = "override" +SPDX-FileCopyrightText = ["2026 Ludwig Hülk <@Ludee> © Reiner Lemoine Institut", + "2026 Jonas Huber <@jh-RLI> © Reiner Lemoine Institut", + "oemetadata "] +SPDX-License-Identifier = "CC0-1.0" + [[annotations]] path = "oemetadata/v2/v21/build_source/schemas/*.json" precedence = "override" diff --git a/oemetadata/v2/v21/build_source/schemas/general.json b/oemetadata/v2/v21/build_source/schemas/general.json index 1404e157..8320d40f 100644 --- a/oemetadata/v2/v21/build_source/schemas/general.json +++ b/oemetadata/v2/v21/build_source/schemas/general.json @@ -36,7 +36,7 @@ "null" ], "examples": [ - "oemetadata_table_example" + "example.csv" ], "badge": "Iron", "title": "Name" @@ -48,7 +48,7 @@ "null" ], "examples": [ - "OEMetadata Table Template" + "OEMetadata Table Example" ], "badge": "Silver", "title": "Title" @@ -60,7 +60,7 @@ "null" ], "examples": [ - "Example table used to illustrate the OEMetadata structure and features." + "Example metadata and table used to illustrate the OEMetadata structure and features." ], "badge": "Silver", "title": "Description" diff --git a/oemetadata/v2/v21/example.csv b/oemetadata/v2/v21/example.csv new file mode 100644 index 00000000..d66be5d1 --- /dev/null +++ b/oemetadata/v2/v21/example.csv @@ -0,0 +1,5 @@ +"id","name","type","year","value","is_active","version","comment" +1,"wind","onshore",2021,55.93,true,"0.1.0","" +2,"wind","offshore",2021,7.79,true,"0.1.0","" +3,"wind","onshore",2022,58.05,true,"0.1.1","" +4,"wind","offshore",2022,8.13,true,"0.1.1","" diff --git a/oemetadata/v2/v21/example.json b/oemetadata/v2/v21/example.json index fa81cacd..4e5505df 100644 --- a/oemetadata/v2/v21/example.json +++ b/oemetadata/v2/v21/example.json @@ -89,9 +89,9 @@ { "@id": "https://databus.openenergyplatform.org/oeplatform/supply/wri_global_power_plant_database/2022-11-07/wri_global_power_plant_database_variant=data.csv", "path": "http://openenergyplatform.org/dataedit/view/model_draft/oemetadata_table_template", - "name": "oemetadata_table_example", - "title": "OEMetadata Table Template", - "description": "Example table used to illustrate the OEMetadata structure and features.", + "name": "example.csv", + "title": "OEMetadata Table Example", + "description": "Example metadata and table used to illustrate the OEMetadata structure and features.", "publicationDate": "2024-10-15", "subject": [ { diff --git a/oemetadata/v2/v21/schema.json b/oemetadata/v2/v21/schema.json index 188c70d9..07ce3e08 100644 --- a/oemetadata/v2/v21/schema.json +++ b/oemetadata/v2/v21/schema.json @@ -587,7 +587,7 @@ "null" ], "examples": [ - "oemetadata_table_example" + "example.csv" ], "badge": "Iron", "title": "Name" @@ -599,7 +599,7 @@ "null" ], "examples": [ - "OEMetadata Table Template" + "OEMetadata Table Example" ], "badge": "Silver", "title": "Title" @@ -611,7 +611,7 @@ "null" ], "examples": [ - "Example table used to illustrate the OEMetadata structure and features." + "Example metadata and table used to illustrate the OEMetadata structure and features." ], "badge": "Silver", "title": "Description" From 9bf63489e58a82be86191f94064fafac3104b1f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludwig=20H=C3=BClk?= Date: Mon, 27 Apr 2026 13:27:32 +0200 Subject: [PATCH 18/30] Update example path #290 --- oemetadata/v2/v21/build_source/schemas/general.json | 2 +- oemetadata/v2/v21/example.json | 2 +- oemetadata/v2/v21/schema.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/oemetadata/v2/v21/build_source/schemas/general.json b/oemetadata/v2/v21/build_source/schemas/general.json index 8320d40f..8b28ebf3 100644 --- a/oemetadata/v2/v21/build_source/schemas/general.json +++ b/oemetadata/v2/v21/build_source/schemas/general.json @@ -23,7 +23,7 @@ "null" ], "examples": [ - "http://openenergyplatform.org/dataedit/view/model_draft/oemetadata_table_template" + "example.csv" ], "badge": "Bronze", "title": "Path", diff --git a/oemetadata/v2/v21/example.json b/oemetadata/v2/v21/example.json index 4e5505df..430fca8d 100644 --- a/oemetadata/v2/v21/example.json +++ b/oemetadata/v2/v21/example.json @@ -88,7 +88,7 @@ "resources": [ { "@id": "https://databus.openenergyplatform.org/oeplatform/supply/wri_global_power_plant_database/2022-11-07/wri_global_power_plant_database_variant=data.csv", - "path": "http://openenergyplatform.org/dataedit/view/model_draft/oemetadata_table_template", + "path": "example.csv", "name": "example.csv", "title": "OEMetadata Table Example", "description": "Example metadata and table used to illustrate the OEMetadata structure and features.", diff --git a/oemetadata/v2/v21/schema.json b/oemetadata/v2/v21/schema.json index 07ce3e08..962a2745 100644 --- a/oemetadata/v2/v21/schema.json +++ b/oemetadata/v2/v21/schema.json @@ -574,7 +574,7 @@ "null" ], "examples": [ - "http://openenergyplatform.org/dataedit/view/model_draft/oemetadata_table_template" + "example.csv" ], "badge": "Bronze", "title": "Path", From 5e8aecb2d95d081bd603102c07fb13fe49146edd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludwig=20H=C3=BClk?= Date: Mon, 27 Apr 2026 13:38:25 +0200 Subject: [PATCH 19/30] Update test path #290 --- test/oemetadata/v2/v21/test_example.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/oemetadata/v2/v21/test_example.py b/test/oemetadata/v2/v21/test_example.py index b43d8b9c..a5abecea 100644 --- a/test/oemetadata/v2/v21/test_example.py +++ b/test/oemetadata/v2/v21/test_example.py @@ -25,9 +25,13 @@ def test_oemetadata_schema_should_validate_oemetadata_example(): def test_oemetadata_example_is_datapackage(): + import pathlib + from frictionless import validate from oemetadata.v2.v21.example import OEMETADATA_V21_EXAMPLE - report = validate(OEMETADATA_V21_EXAMPLE) + basepath = pathlib.Path(__file__).parent + + report = validate(OEMETADATA_V21_EXAMPLE, basepath=basepath) assert report.valid, report.flatten(["message"]) From d07af3ff4da3c19c4fb76f49a76d87623cc6b77a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludwig=20H=C3=BClk?= Date: Mon, 27 Apr 2026 13:42:15 +0200 Subject: [PATCH 20/30] Update test path #290 --- test/oemetadata/v2/v21/test_example.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/oemetadata/v2/v21/test_example.py b/test/oemetadata/v2/v21/test_example.py index a5abecea..125be241 100644 --- a/test/oemetadata/v2/v21/test_example.py +++ b/test/oemetadata/v2/v21/test_example.py @@ -31,7 +31,7 @@ def test_oemetadata_example_is_datapackage(): from oemetadata.v2.v21.example import OEMETADATA_V21_EXAMPLE - basepath = pathlib.Path(__file__).parent + base = pathlib.Path(__file__).parent.resolve() - report = validate(OEMETADATA_V21_EXAMPLE, basepath=basepath) + report = validate(OEMETADATA_V21_EXAMPLE, basepath=str(base)) assert report.valid, report.flatten(["message"]) From 4e41a88e3a67b5dc9f01803bd609b86e39b18669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludwig=20H=C3=BClk?= Date: Mon, 27 Apr 2026 13:50:11 +0200 Subject: [PATCH 21/30] Update example package #290 --- oemetadata/v2/v21/example.py | 10 ++++++++-- test/oemetadata/v2/v21/test_example.py | 6 +----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/oemetadata/v2/v21/example.py b/oemetadata/v2/v21/example.py index 1be67c59..486f4711 100644 --- a/oemetadata/v2/v21/example.py +++ b/oemetadata/v2/v21/example.py @@ -6,6 +6,12 @@ import json import os +from frictionless import Package -with open(os.path.join(os.path.dirname(__file__), "example.json"), "rb") as f: - OEMETADATA_V21_EXAMPLE = json.loads(f.read()) + +BASE_PATH = os.path.dirname(__file__) + +with open(os.path.join(BASE_PATH, "example.json"), encoding="utf-8") as f: + descriptor = json.load(f) + +OEMETADATA_V21_EXAMPLE = Package(descriptor, basepath=BASE_PATH) diff --git a/test/oemetadata/v2/v21/test_example.py b/test/oemetadata/v2/v21/test_example.py index 125be241..b43d8b9c 100644 --- a/test/oemetadata/v2/v21/test_example.py +++ b/test/oemetadata/v2/v21/test_example.py @@ -25,13 +25,9 @@ def test_oemetadata_schema_should_validate_oemetadata_example(): def test_oemetadata_example_is_datapackage(): - import pathlib - from frictionless import validate from oemetadata.v2.v21.example import OEMETADATA_V21_EXAMPLE - base = pathlib.Path(__file__).parent.resolve() - - report = validate(OEMETADATA_V21_EXAMPLE, basepath=str(base)) + report = validate(OEMETADATA_V21_EXAMPLE) assert report.valid, report.flatten(["message"]) From 5acae30313c0dc4c18996b8e3a42db58134734e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludwig=20H=C3=BClk?= Date: Mon, 27 Apr 2026 13:57:19 +0200 Subject: [PATCH 22/30] Update example package #290 --- oemetadata/v2/v21/example.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/oemetadata/v2/v21/example.py b/oemetadata/v2/v21/example.py index 486f4711..f622ef7c 100644 --- a/oemetadata/v2/v21/example.py +++ b/oemetadata/v2/v21/example.py @@ -4,14 +4,17 @@ # SPDX-License-Identifier: MIT import json -import os +from pathlib import Path from frictionless import Package -BASE_PATH = os.path.dirname(__file__) +BASE_PATH = Path(__file__).parent -with open(os.path.join(BASE_PATH, "example.json"), encoding="utf-8") as f: - descriptor = json.load(f) +descriptor = json.loads((BASE_PATH / "example.json").read_text(encoding="utf-8")) -OEMETADATA_V21_EXAMPLE = Package(descriptor, basepath=BASE_PATH) +for resource in descriptor.get("resources", []): + if "path" in resource: + resource["path"] = str(BASE_PATH / resource["path"]) + +OEMETADATA_V21_EXAMPLE = Package(descriptor) From b52800b612982305ea7b12d10ca12828871a66bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludwig=20H=C3=BClk?= Date: Mon, 27 Apr 2026 14:22:19 +0200 Subject: [PATCH 23/30] Update example package #290 --- oemetadata/v2/v21/example.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/oemetadata/v2/v21/example.py b/oemetadata/v2/v21/example.py index f622ef7c..d9d9d4d6 100644 --- a/oemetadata/v2/v21/example.py +++ b/oemetadata/v2/v21/example.py @@ -13,8 +13,4 @@ descriptor = json.loads((BASE_PATH / "example.json").read_text(encoding="utf-8")) -for resource in descriptor.get("resources", []): - if "path" in resource: - resource["path"] = str(BASE_PATH / resource["path"]) - -OEMETADATA_V21_EXAMPLE = Package(descriptor) +OEMETADATA_V21_EXAMPLE = Package(descriptor, basepath=str(BASE_PATH)) From 99188e42448e130793c891da4392b75a4b84b9a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludwig=20H=C3=BClk?= Date: Mon, 27 Apr 2026 14:32:22 +0200 Subject: [PATCH 24/30] Update example package #290 --- oemetadata/v2/v21/example.py | 11 +++-------- test/oemetadata/v2/v21/test_example.py | 6 ++---- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/oemetadata/v2/v21/example.py b/oemetadata/v2/v21/example.py index d9d9d4d6..8e55ff66 100644 --- a/oemetadata/v2/v21/example.py +++ b/oemetadata/v2/v21/example.py @@ -4,13 +4,8 @@ # SPDX-License-Identifier: MIT import json -from pathlib import Path +import os -from frictionless import Package - -BASE_PATH = Path(__file__).parent - -descriptor = json.loads((BASE_PATH / "example.json").read_text(encoding="utf-8")) - -OEMETADATA_V21_EXAMPLE = Package(descriptor, basepath=str(BASE_PATH)) +with open(os.path.join(os.path.dirname(__file__), "example.json"), "rb") as f: + OEMETADATA_V21_SCHEMA = json.loads(f.read()) diff --git a/test/oemetadata/v2/v21/test_example.py b/test/oemetadata/v2/v21/test_example.py index b43d8b9c..e5b63258 100644 --- a/test/oemetadata/v2/v21/test_example.py +++ b/test/oemetadata/v2/v21/test_example.py @@ -25,9 +25,7 @@ def test_oemetadata_schema_should_validate_oemetadata_example(): def test_oemetadata_example_is_datapackage(): - from frictionless import validate - from oemetadata.v2.v21.example import OEMETADATA_V21_EXAMPLE - report = validate(OEMETADATA_V21_EXAMPLE) - assert report.valid, report.flatten(["message"]) + report = OEMETADATA_V21_EXAMPLE.metadata_valid + assert report, OEMETADATA_V21_EXAMPLE.metadata_errors From 89ef56dc3c36adc885b6f9fd11354dfdfc0e1f8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludwig=20H=C3=BClk?= Date: Mon, 27 Apr 2026 14:35:00 +0200 Subject: [PATCH 25/30] Update example package #290 --- oemetadata/v2/v21/example.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oemetadata/v2/v21/example.py b/oemetadata/v2/v21/example.py index 8e55ff66..1be67c59 100644 --- a/oemetadata/v2/v21/example.py +++ b/oemetadata/v2/v21/example.py @@ -8,4 +8,4 @@ with open(os.path.join(os.path.dirname(__file__), "example.json"), "rb") as f: - OEMETADATA_V21_SCHEMA = json.loads(f.read()) + OEMETADATA_V21_EXAMPLE = json.loads(f.read()) From 23a12d32c54260e7bdfd55b3ef2a3513578bb734 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludwig=20H=C3=BClk?= Date: Mon, 27 Apr 2026 14:38:49 +0200 Subject: [PATCH 26/30] Update example package #290 --- oemetadata/v2/v21/example.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/oemetadata/v2/v21/example.py b/oemetadata/v2/v21/example.py index 1be67c59..4410e2f9 100644 --- a/oemetadata/v2/v21/example.py +++ b/oemetadata/v2/v21/example.py @@ -4,8 +4,14 @@ # SPDX-License-Identifier: MIT import json -import os +from pathlib import Path +from frictionless import Package -with open(os.path.join(os.path.dirname(__file__), "example.json"), "rb") as f: - OEMETADATA_V21_EXAMPLE = json.loads(f.read()) + +BASE_PATH = Path(__file__).parent + +with open(BASE_PATH / "example.json", encoding="utf-8") as f: + descriptor = json.load(f) + +OEMETADATA_V21_EXAMPLE = Package(descriptor, basepath=str(BASE_PATH)) From 53c5f9fa97f2df8d5be1be109da71cc685044ec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludwig=20H=C3=BClk?= Date: Mon, 27 Apr 2026 14:41:12 +0200 Subject: [PATCH 27/30] Update example package #290 --- test/oemetadata/v2/v21/test_example.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/oemetadata/v2/v21/test_example.py b/test/oemetadata/v2/v21/test_example.py index e5b63258..8dbdf36b 100644 --- a/test/oemetadata/v2/v21/test_example.py +++ b/test/oemetadata/v2/v21/test_example.py @@ -27,5 +27,5 @@ def test_oemetadata_schema_should_validate_oemetadata_example(): def test_oemetadata_example_is_datapackage(): from oemetadata.v2.v21.example import OEMETADATA_V21_EXAMPLE - report = OEMETADATA_V21_EXAMPLE.metadata_valid - assert report, OEMETADATA_V21_EXAMPLE.metadata_errors + errors = OEMETADATA_V21_EXAMPLE.metadata_validate() + assert not errors, [str(e) for e in errors] From bbbaa6cce916df9446a569def2ef1e2a92fbd086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludwig=20H=C3=BClk?= Date: Mon, 27 Apr 2026 14:44:03 +0200 Subject: [PATCH 28/30] Update example package #290 --- test/oemetadata/v2/v21/test_example.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/oemetadata/v2/v21/test_example.py b/test/oemetadata/v2/v21/test_example.py index 8dbdf36b..68369cbb 100644 --- a/test/oemetadata/v2/v21/test_example.py +++ b/test/oemetadata/v2/v21/test_example.py @@ -25,7 +25,10 @@ def test_oemetadata_schema_should_validate_oemetadata_example(): def test_oemetadata_example_is_datapackage(): + from frictionless import Package + from oemetadata.v2.v21.example import OEMETADATA_V21_EXAMPLE - errors = OEMETADATA_V21_EXAMPLE.metadata_validate() + descriptor = OEMETADATA_V21_EXAMPLE.to_descriptor() + errors = Package.metadata_validate(descriptor) assert not errors, [str(e) for e in errors] From 81094696ae2a22ef9df386a60621ec0cd12f9577 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludwig=20H=C3=BClk?= Date: Mon, 27 Apr 2026 14:46:24 +0200 Subject: [PATCH 29/30] Update example package #290 --- test/oemetadata/v2/v21/test_example.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/oemetadata/v2/v21/test_example.py b/test/oemetadata/v2/v21/test_example.py index 68369cbb..40283264 100644 --- a/test/oemetadata/v2/v21/test_example.py +++ b/test/oemetadata/v2/v21/test_example.py @@ -30,5 +30,5 @@ def test_oemetadata_example_is_datapackage(): from oemetadata.v2.v21.example import OEMETADATA_V21_EXAMPLE descriptor = OEMETADATA_V21_EXAMPLE.to_descriptor() - errors = Package.metadata_validate(descriptor) + errors = list(Package.metadata_validate(descriptor)) assert not errors, [str(e) for e in errors] From 848bb196e8d7e29eb6f5707d4c4659ccfc3e4a5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludwig=20H=C3=BClk?= Date: Mon, 27 Apr 2026 14:54:40 +0200 Subject: [PATCH 30/30] Update fk example #290 --- oemetadata/v2/v21/build_source/schemas/fields.json | 4 +--- oemetadata/v2/v21/example.json | 14 +++++++++++++- oemetadata/v2/v21/schema.json | 4 +--- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/oemetadata/v2/v21/build_source/schemas/fields.json b/oemetadata/v2/v21/build_source/schemas/fields.json index cef6b9ab..743322c0 100644 --- a/oemetadata/v2/v21/build_source/schemas/fields.json +++ b/oemetadata/v2/v21/build_source/schemas/fields.json @@ -278,7 +278,6 @@ "null" ], "examples": [ - "id", "version" ], "badge": "Iron", @@ -298,7 +297,7 @@ "null" ], "examples": [ - "oemetadata_table_example_version" + "example_version.csv" ], "badge": "Iron", "title": "Foreign Resource" @@ -313,7 +312,6 @@ "null" ], "examples": [ - "id", "version" ], "badge": "Iron", diff --git a/oemetadata/v2/v21/example.json b/oemetadata/v2/v21/example.json index 430fca8d..5c80deb9 100644 --- a/oemetadata/v2/v21/example.json +++ b/oemetadata/v2/v21/example.json @@ -367,7 +367,19 @@ "primaryKey": [ "id" ], - "foreignKeys": [] + "foreignKeys": [ + { + "fields": [ + "version" + ], + "reference": { + "resource": "example_version.csv", + "fields": [ + "version" + ] + } + } + ] }, "dialect": { "delimiter": ";", diff --git a/oemetadata/v2/v21/schema.json b/oemetadata/v2/v21/schema.json index 962a2745..239b1a9a 100644 --- a/oemetadata/v2/v21/schema.json +++ b/oemetadata/v2/v21/schema.json @@ -1520,7 +1520,6 @@ "null" ], "examples": [ - "id", "version" ], "badge": "Iron", @@ -1540,7 +1539,7 @@ "null" ], "examples": [ - "oemetadata_table_example_version" + "example_version.csv" ], "badge": "Iron", "title": "Foreign Resource" @@ -1555,7 +1554,6 @@ "null" ], "examples": [ - "id", "version" ], "badge": "Iron",