From 9e962e5ea3d19905c1445da132cd3533ff9979fc Mon Sep 17 00:00:00 2001 From: jh-RLI Date: Thu, 15 Sep 2022 00:30:16 +0200 Subject: [PATCH 01/43] remove uri format --- metadata/latest/schema.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/metadata/latest/schema.json b/metadata/latest/schema.json index 49ebcaaf..44a1101d 100644 --- a/metadata/latest/schema.json +++ b/metadata/latest/schema.json @@ -638,8 +638,7 @@ "string", "null" ], - "title": "Name", - "format": "uri" + "title": "Name" }, "path": { "description": "Path to the OEO", From 5fc4712ba4eb08ac46db3e0cc46560e04f19c010 Mon Sep 17 00:00:00 2001 From: jh-RLI Date: Thu, 15 Sep 2022 11:35:14 +0200 Subject: [PATCH 02/43] fix isAbout, valueReference field names and remove uri field, reformat file --- metadata/latest/schema.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/metadata/latest/schema.json b/metadata/latest/schema.json index 44a1101d..bf303a77 100644 --- a/metadata/latest/schema.json +++ b/metadata/latest/schema.json @@ -614,9 +614,9 @@ } }, "additionalProperties": false, - "title": "IsAbout" + "title": "isAbout" }, - "title": "IsAbout" + "title": "isAbout" }, "valueReference": { "description": "Ontology URI for an extended description of the values in the column", @@ -651,7 +651,7 @@ } }, "additionalProperties": false, - "title": "Value reference" + "title": "valueReference" }, "title": "valueReference" }, From 25155171c47393eaf79a4bc7e121de8a896a698f Mon Sep 17 00:00:00 2001 From: jh-RLI Date: Tue, 20 Sep 2022 17:03:19 +0200 Subject: [PATCH 03/43] update requrements: - update pipy build package --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 165cef15..dcbbd822 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,3 +5,4 @@ pytest tox twine wheel +build From 35e3d434617a5a2a2fd30a3ca158d36dca457f30 Mon Sep 17 00:00:00 2001 From: jh-RLI Date: Tue, 20 Sep 2022 17:06:49 +0200 Subject: [PATCH 04/43] fix missing json files that are relevant for each release --- setup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.py b/setup.py index 8e3d33f3..b0e0d3bf 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,4 @@ +import json from os import path from setuptools import find_packages, setup @@ -25,5 +26,6 @@ ], keywords="JSON metadata schema open energy platform oep", packages=find_packages(exclude=["tests"]), + package_data={"oemetadata":["metadata/../*.json"]}, python_requires=">=3.6", ) From 96fbd13123e68f590589ccc99d383955ba37df3b Mon Sep 17 00:00:00 2001 From: jh-RLI Date: Tue, 20 Sep 2022 17:09:51 +0200 Subject: [PATCH 05/43] update author email, later change authors too --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index b0e0d3bf..480ba7a4 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ long_description_content_type="text/markdown", url="https://github.com/OpenEnergyPlatform/oemetadata", author="Alexis Michaltsis", - author_email="a.michaltsis@rl-institut.de", + author_email="oep_dev@lists.riseup.net", license="MIT", classifiers=[ "Intended Audience :: Developers", From b8884fe622753fccbc7dc1fb96e8733c6659f059 Mon Sep 17 00:00:00 2001 From: jh-RLI Date: Tue, 20 Sep 2022 17:16:36 +0200 Subject: [PATCH 06/43] format file --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 480ba7a4..6fe9db4b 100644 --- a/setup.py +++ b/setup.py @@ -26,6 +26,6 @@ ], keywords="JSON metadata schema open energy platform oep", packages=find_packages(exclude=["tests"]), - package_data={"oemetadata":["metadata/../*.json"]}, + package_data={"oemetadata": ["metadata/../*.json"]}, python_requires=">=3.6", ) From f8e2c2e244c9e309139203f5c10f8d103261ca72 Mon Sep 17 00:00:00 2001 From: jh-RLI Date: Tue, 20 Sep 2022 17:27:59 +0200 Subject: [PATCH 07/43] fix file path --- .github/workflows/test-pypi-publish.yml | 34 +++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/test-pypi-publish.yml diff --git a/.github/workflows/test-pypi-publish.yml b/.github/workflows/test-pypi-publish.yml new file mode 100644 index 00000000..feec0617 --- /dev/null +++ b/.github/workflows/test-pypi-publish.yml @@ -0,0 +1,34 @@ +jobs: + build-n-publish: + name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + + - name: Install pypa/build + run: >- + python -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + run: >- + python -m + build + --sdist + --wheel + --outdir dist/ + - name: Publish distribution 📦 to Test PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.TEST_PYPI_API_TOKEN }} + repository_url: https://test.pypi.org/legacy/ + - name: Publish distribution 📦 to PyPI + if: startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} \ No newline at end of file From 519cf8c461c055566d3ff5280d5b93df2ab1b5aa Mon Sep 17 00:00:00 2001 From: jh-RLI Date: Tue, 20 Sep 2022 17:36:23 +0200 Subject: [PATCH 08/43] add workflow name --- .github/workflows/test-pypi-publish.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-pypi-publish.yml b/.github/workflows/test-pypi-publish.yml index feec0617..5e4fb3bc 100644 --- a/.github/workflows/test-pypi-publish.yml +++ b/.github/workflows/test-pypi-publish.yml @@ -1,3 +1,5 @@ +name: Build and release on pypi tests and production + jobs: build-n-publish: name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI From 9c849f9a5dd8a4f6ed45303b9b3a4111a94fbe9a Mon Sep 17 00:00:00 2001 From: jh-RLI Date: Tue, 20 Sep 2022 17:37:26 +0200 Subject: [PATCH 09/43] add workflow trigger --- .github/workflows/test-pypi-publish.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/test-pypi-publish.yml b/.github/workflows/test-pypi-publish.yml index 5e4fb3bc..52dc886d 100644 --- a/.github/workflows/test-pypi-publish.yml +++ b/.github/workflows/test-pypi-publish.yml @@ -1,5 +1,11 @@ name: Build and release on pypi tests and production +on: + # push: + # branches: [ develop, master] + pull_request: + branches: [ develop, master ] + jobs: build-n-publish: name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI From 0e0eb0eb4b2fd86952faf436c2ddb428867b4300 Mon Sep 17 00:00:00 2001 From: jh-RLI <38939526+jh-RLI@users.noreply.github.com> Date: Tue, 20 Sep 2022 21:08:24 +0200 Subject: [PATCH 10/43] update workflow rename secret names --- .github/workflows/test-pypi-publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-pypi-publish.yml b/.github/workflows/test-pypi-publish.yml index 52dc886d..afea18e3 100644 --- a/.github/workflows/test-pypi-publish.yml +++ b/.github/workflows/test-pypi-publish.yml @@ -33,10 +33,10 @@ jobs: - name: Publish distribution 📦 to Test PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: - password: ${{ secrets.TEST_PYPI_API_TOKEN }} + password: ${{ secrets.PYPI_TEST }} repository_url: https://test.pypi.org/legacy/ - name: Publish distribution 📦 to PyPI if: startsWith(github.ref, 'refs/tags') uses: pypa/gh-action-pypi-publish@release/v1 with: - password: ${{ secrets.PYPI_API_TOKEN }} \ No newline at end of file + password: ${{ secrets.PYPI }} From 5d6f0713d71a4f0a24ecf75ba0096b2e9c979ba2 Mon Sep 17 00:00:00 2001 From: jh-RLI <38939526+jh-RLI@users.noreply.github.com> Date: Tue, 20 Sep 2022 21:33:35 +0200 Subject: [PATCH 11/43] Update pypi workflow --- .github/workflows/test-pypi-publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-pypi-publish.yml b/.github/workflows/test-pypi-publish.yml index afea18e3..a157f1d5 100644 --- a/.github/workflows/test-pypi-publish.yml +++ b/.github/workflows/test-pypi-publish.yml @@ -10,6 +10,7 @@ jobs: build-n-publish: name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI runs-on: ubuntu-latest + environment: pypi-publish steps: - uses: actions/checkout@master - name: Set up Python 3.10 From a0ba45bd8d26a01bbb015200438c05c8898119d3 Mon Sep 17 00:00:00 2001 From: jh-RLI Date: Wed, 21 Sep 2022 11:06:35 +0200 Subject: [PATCH 12/43] fix package data search path to include json data in pip release --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 6fe9db4b..2cb38337 100644 --- a/setup.py +++ b/setup.py @@ -26,6 +26,6 @@ ], keywords="JSON metadata schema open energy platform oep", packages=find_packages(exclude=["tests"]), - package_data={"oemetadata": ["metadata/../*.json"]}, + package_data={"": ["./*.json"]}, python_requires=">=3.6", ) From 733cc0ccd6e81a092ba0032453b2230ca1c26339 Mon Sep 17 00:00:00 2001 From: jh-RLI Date: Wed, 21 Sep 2022 11:39:43 +0200 Subject: [PATCH 13/43] raise oemetadata version to be able to test pypi(test) release with json files) --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 2cb38337..0b5ccae3 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ setup( name="oemetadata", - version="1.5.1", + version="1.5.1a1", description="Open Energy Platform (OEP) - metadata schemas, examples and templates package", long_description=long_description, long_description_content_type="text/markdown", From c80dd8e4b8659765b1ca5b955fdeeea294698599 Mon Sep 17 00:00:00 2001 From: jh-RLI Date: Wed, 21 Sep 2022 11:56:12 +0200 Subject: [PATCH 14/43] update gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index cbfcb184..0043f215 100644 --- a/.gitignore +++ b/.gitignore @@ -89,6 +89,8 @@ celerybeat-schedule .env .venv env/ +/env +/envs venv/ ENV/ env.bak/ From da853a73f289e145b705c5ed4b0635b808bb3894 Mon Sep 17 00:00:00 2001 From: jh-RLI Date: Wed, 21 Sep 2022 12:18:37 +0200 Subject: [PATCH 15/43] split pyi test and publish workflow into two parts and change triggers to on release and on deployment-test branch --- .github/workflows/pypi-publish.yml | 43 +++++++++++++++++++++++++ .github/workflows/test-pypi-publish.yml | 15 +++------ 2 files changed, 47 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/pypi-publish.yml diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml new file mode 100644 index 00000000..a157f1d5 --- /dev/null +++ b/.github/workflows/pypi-publish.yml @@ -0,0 +1,43 @@ +name: Build and release on pypi tests and production + +on: + # push: + # branches: [ develop, master] + pull_request: + branches: [ develop, master ] + +jobs: + build-n-publish: + name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI + runs-on: ubuntu-latest + environment: pypi-publish + steps: + - uses: actions/checkout@master + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + + - name: Install pypa/build + run: >- + python -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + run: >- + python -m + build + --sdist + --wheel + --outdir dist/ + - name: Publish distribution 📦 to Test PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_TEST }} + repository_url: https://test.pypi.org/legacy/ + - name: Publish distribution 📦 to PyPI + if: startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI }} diff --git a/.github/workflows/test-pypi-publish.yml b/.github/workflows/test-pypi-publish.yml index a157f1d5..b6948c1a 100644 --- a/.github/workflows/test-pypi-publish.yml +++ b/.github/workflows/test-pypi-publish.yml @@ -1,14 +1,12 @@ -name: Build and release on pypi tests and production +name: Build and release on pypi tests on: - # push: - # branches: [ develop, master] - pull_request: - branches: [ develop, master ] + push: + branches: [ deployment-test ] jobs: build-n-publish: - name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI + name: Build and publish Python 🐍 distributions 📦 to TestPyPI runs-on: ubuntu-latest environment: pypi-publish steps: @@ -36,8 +34,3 @@ jobs: with: password: ${{ secrets.PYPI_TEST }} repository_url: https://test.pypi.org/legacy/ - - name: Publish distribution 📦 to PyPI - if: startsWith(github.ref, 'refs/tags') - uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ secrets.PYPI }} From 4fc61307724f0195d9c29050792578eba7b3a37a Mon Sep 17 00:00:00 2001 From: jh-RLI Date: Wed, 21 Sep 2022 12:21:46 +0200 Subject: [PATCH 16/43] update workflow --- .github/workflows/pypi-publish.yml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index a157f1d5..ea327803 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -1,14 +1,12 @@ -name: Build and release on pypi tests and production +name: Build 📦 and release on pypi on: - # push: - # branches: [ develop, master] - pull_request: - branches: [ develop, master ] + release: + types: [published] jobs: build-n-publish: - name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI + name: Build and publish Python 🐍 distributions 📦 to PyPI runs-on: ubuntu-latest environment: pypi-publish steps: @@ -31,11 +29,6 @@ jobs: --sdist --wheel --outdir dist/ - - name: Publish distribution 📦 to Test PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ secrets.PYPI_TEST }} - repository_url: https://test.pypi.org/legacy/ - name: Publish distribution 📦 to PyPI if: startsWith(github.ref, 'refs/tags') uses: pypa/gh-action-pypi-publish@release/v1 From 544e1f795e5d7dda0ddb344f114474f46b43fe2d Mon Sep 17 00:00:00 2001 From: jh-RLI Date: Wed, 21 Sep 2022 12:27:58 +0200 Subject: [PATCH 17/43] update changelog --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06fe78a2..166aa86e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,13 +26,16 @@ Here is a template for new release sections ### Removed - ``` + ## Current +- Fix missing json files in pypi oemetadata package +- Add github actions/workflwos to automate package build and upload process on test and production pypi index + ### Added ### Changed - ## [1.5.1] - Release - Ontology-Ready - 2022-02-21 ### Added From 727813e63c57b1f94664d06575822bd771368d8a Mon Sep 17 00:00:00 2001 From: jh-RLI <38939526+jh-RLI@users.noreply.github.com> Date: Wed, 21 Sep 2022 14:50:29 +0200 Subject: [PATCH 18/43] Update Release Procedere Add info on release process automation --- RELEASE_PROCEDURE.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/RELEASE_PROCEDURE.md b/RELEASE_PROCEDURE.md index eb3fbeb4..7dc93cf6 100644 --- a/RELEASE_PROCEDURE.md +++ b/RELEASE_PROCEDURE.md @@ -22,4 +22,15 @@ test directory. - 4 Create the Pull Request via the GitHub website and merge changes to develop then merge develop in master branch. - 5 Create a new release via the GitHub website and tag the master branch. -- 6 Update the PyPi (pip) Package [oep-metadata](https://pypi.org/project/oep-metadata/) \ No newline at end of file + +# Publish and Deploy Release automation +We provide automation workflows that will build and upload PyPi Packages. + +Keep in mind that specific package versions (as specified in the [setup.py](https://github.com/OpenEnergyPlatform/oemetadata/blob/5fc02df0a5efeb01cc8d9b78929c3dfe9eebd8cb/setup.py#L13)) can only be release once. This stands for test and official PyPi package index. + +**Test workflows** are triggered when pushing commits to the permanent branch called `deployment-test`. + +**Release Deployment Workflow** is triggered as soon as one publishes a new github release. + +- [Test Workflow](https://github.com/OpenEnergyPlatform/oemetadata/actions/workflows/test-pypi-publish.yml): Update test PyPi (pip) Package [oemetadata pypi test](https://test.pypi.org/project/oemetadata/) +- [Release Deployment Workflow](https://github.com/OpenEnergyPlatform/oemetadata/actions/workflows/pypi-publish.yml) Update the PyPi (pip) Package [oemetadata](https://pypi.org/project/oemetadata/) From 0ef56cf70ee9784ce41ee09d9c496ea7774bd6aa Mon Sep 17 00:00:00 2001 From: chrwm Date: Fri, 4 Nov 2022 18:02:35 +0100 Subject: [PATCH 19/43] Update context file #98 Update to latest LOD-GEOSS implementation https://github.com/LOD-GEOSS/databus-snippets/blob/b28a42adb17663c3b736b1bfd8d30062f26fc9db/KS80_example/context.jsonld --- metadata/latest/context.json | 48 ++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/metadata/latest/context.json b/metadata/latest/context.json index 2875c27f..5fe9e363 100644 --- a/metadata/latest/context.json +++ b/metadata/latest/context.json @@ -1,5 +1,6 @@ { "@context": { + "id": "@id", "path": "@id", "rdfs": "http://www.w3.org/2000/01/rdf-schema#", "dct": "http://purl.org/dc/terms/", @@ -7,7 +8,10 @@ "xsd": "http://www.w3.org/2001/XMLSchema#", "oeo": "http://openenergy-platform.org/ontology/oeo/", "csvw": "http://www.w3.org/ns/csvw#", - "obo": "http://purl.obolibrary.org/obo/", + "obo":"http://purl.obolibrary.org/obo/", + "time":"http://www.w3.org/2006/time#", + "dbo": "http://dbpedia.org/ontology/", + "saref": "https://saref.etsi.org/core/", "title": { "@id": "dct:title", "@type": "xsd:string" @@ -20,6 +24,34 @@ "@id": "rdfs:comment", "@type": "xsd:string" }, + "subject": { + "@id": "dc:subject", + "@type": "@id" + }, + "about": { + "@id": "saref:isAbout", + "@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" @@ -32,10 +64,6 @@ "@id": "csvw:tableSchema", "@type": "@id" }, - "subject": { - "@id": "dc:subject", - "@type": "@id" - }, "name": { "@id": "rdfs:label", "@type": "xsd:string" @@ -48,9 +76,13 @@ "@id": "oeo:OEO_00040010", "@type": "xsd:string" }, - "about": { - "@id": "obo:IAO_0000136", + "isAbout": { + "@id": "saref:isAbout", + "@type": "@id" + }, + "valueReference": { + "@id": "http://purl.org/goodrelations/v1#valueReference", "@type": "@id" } } -} \ No newline at end of file +} From afdc5d22e38d7a958a9093dccff613f219e2131d Mon Sep 17 00:00:00 2001 From: chrwm Date: Fri, 4 Nov 2022 18:48:48 +0100 Subject: [PATCH 20/43] Fix isAbout query #98 --- metadata/latest/context.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/metadata/latest/context.json b/metadata/latest/context.json index 5fe9e363..241f6349 100644 --- a/metadata/latest/context.json +++ b/metadata/latest/context.json @@ -28,10 +28,6 @@ "@id": "dc:subject", "@type": "@id" }, - "about": { - "@id": "saref:isAbout", - "@type": "@id" - }, "keywords": { "@id": "dc:subject", "@type": "xsd:string" From 38345e82fed3fed2f831801103844e816b64e450 Mon Sep 17 00:00:00 2001 From: chrwm Date: Fri, 4 Nov 2022 18:54:48 +0100 Subject: [PATCH 21/43] Fix isAbout query #98 --- metadata/latest/context.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/metadata/latest/context.json b/metadata/latest/context.json index 241f6349..51c687f8 100644 --- a/metadata/latest/context.json +++ b/metadata/latest/context.json @@ -11,7 +11,6 @@ "obo":"http://purl.obolibrary.org/obo/", "time":"http://www.w3.org/2006/time#", "dbo": "http://dbpedia.org/ontology/", - "saref": "https://saref.etsi.org/core/", "title": { "@id": "dct:title", "@type": "xsd:string" @@ -73,7 +72,7 @@ "@type": "xsd:string" }, "isAbout": { - "@id": "saref:isAbout", + "@id": "https://saref.etsi.org/core/isAbout", "@type": "@id" }, "valueReference": { From 0259a006c4f56be66cd80243e10083110ea7680a Mon Sep 17 00:00:00 2001 From: chrwm Date: Fri, 4 Nov 2022 19:04:08 +0100 Subject: [PATCH 22/43] Try if saref link is reason for error #98 --- metadata/latest/context.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata/latest/context.json b/metadata/latest/context.json index 51c687f8..596fae97 100644 --- a/metadata/latest/context.json +++ b/metadata/latest/context.json @@ -72,7 +72,7 @@ "@type": "xsd:string" }, "isAbout": { - "@id": "https://saref.etsi.org/core/isAbout", + "@id": "http://purl.org/goodrelations/v1#valueReference", "@type": "@id" }, "valueReference": { From e7c496bf393d4f251d4118a3ec214919aaef3e9a Mon Sep 17 00:00:00 2001 From: chrwm Date: Thu, 10 Nov 2022 14:12:16 +0100 Subject: [PATCH 23/43] Revert to saref:isAbout #98 Reason that MOSS didn't show in the MOSS search was its sparql query, not in the context.json. See issue: https://github.com/LOD-GEOSS/databus-snippets/issues/21 --- metadata/latest/context.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/metadata/latest/context.json b/metadata/latest/context.json index 596fae97..241f6349 100644 --- a/metadata/latest/context.json +++ b/metadata/latest/context.json @@ -11,6 +11,7 @@ "obo":"http://purl.obolibrary.org/obo/", "time":"http://www.w3.org/2006/time#", "dbo": "http://dbpedia.org/ontology/", + "saref": "https://saref.etsi.org/core/", "title": { "@id": "dct:title", "@type": "xsd:string" @@ -72,7 +73,7 @@ "@type": "xsd:string" }, "isAbout": { - "@id": "http://purl.org/goodrelations/v1#valueReference", + "@id": "saref:isAbout", "@type": "@id" }, "valueReference": { From 417bfeeaca03d70aa246bc11eb0128b50e3f265a Mon Sep 17 00:00:00 2001 From: chrwm Date: Thu, 10 Nov 2022 18:02:46 +0100 Subject: [PATCH 24/43] Delete id:@id #98 --- metadata/latest/context.json | 1 - 1 file changed, 1 deletion(-) diff --git a/metadata/latest/context.json b/metadata/latest/context.json index 241f6349..9f34efb2 100644 --- a/metadata/latest/context.json +++ b/metadata/latest/context.json @@ -1,6 +1,5 @@ { "@context": { - "id": "@id", "path": "@id", "rdfs": "http://www.w3.org/2000/01/rdf-schema#", "dct": "http://purl.org/dc/terms/", From 557a07a4c1704c9495fe19e00171939d8d47cef4 Mon Sep 17 00:00:00 2001 From: chrwm Date: Thu, 17 Nov 2022 18:07:23 +0100 Subject: [PATCH 25/43] Add specific v151 version #98 --- metadata/v151/context.json | 43 +++++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/metadata/v151/context.json b/metadata/v151/context.json index 2875c27f..9f34efb2 100644 --- a/metadata/v151/context.json +++ b/metadata/v151/context.json @@ -7,7 +7,10 @@ "xsd": "http://www.w3.org/2001/XMLSchema#", "oeo": "http://openenergy-platform.org/ontology/oeo/", "csvw": "http://www.w3.org/ns/csvw#", - "obo": "http://purl.obolibrary.org/obo/", + "obo":"http://purl.obolibrary.org/obo/", + "time":"http://www.w3.org/2006/time#", + "dbo": "http://dbpedia.org/ontology/", + "saref": "https://saref.etsi.org/core/", "title": { "@id": "dct:title", "@type": "xsd:string" @@ -20,6 +23,30 @@ "@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" @@ -32,10 +59,6 @@ "@id": "csvw:tableSchema", "@type": "@id" }, - "subject": { - "@id": "dc:subject", - "@type": "@id" - }, "name": { "@id": "rdfs:label", "@type": "xsd:string" @@ -48,9 +71,13 @@ "@id": "oeo:OEO_00040010", "@type": "xsd:string" }, - "about": { - "@id": "obo:IAO_0000136", + "isAbout": { + "@id": "saref:isAbout", + "@type": "@id" + }, + "valueReference": { + "@id": "http://purl.org/goodrelations/v1#valueReference", "@type": "@id" } } -} \ No newline at end of file +} From 74d91ea4f41d0e4d29b31412d47ed240123f950b Mon Sep 17 00:00:00 2001 From: chrwm Date: Thu, 17 Nov 2022 18:14:56 +0100 Subject: [PATCH 26/43] Update CHANGELOG.md #98 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 166aa86e..8013295b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ Here is a template for new release sections ### Added ### Changed +- Update context.json in latest & v151 to ensure ontologically annotated metadata can be sparqled #99 ## [1.5.1] - Release - Ontology-Ready - 2022-02-21 From 8540d7179fcf3200a3253f1b7226ca32d1e0cd91 Mon Sep 17 00:00:00 2001 From: jh-RLI Date: Thu, 17 Nov 2022 20:02:42 +0100 Subject: [PATCH 27/43] update pypi test workflow trigger branches to 'deployment-test' and 'release/*' * for any following text --- .github/workflows/test-pypi-publish.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-pypi-publish.yml b/.github/workflows/test-pypi-publish.yml index b6948c1a..0c90499f 100644 --- a/.github/workflows/test-pypi-publish.yml +++ b/.github/workflows/test-pypi-publish.yml @@ -2,7 +2,9 @@ name: Build and release on pypi tests on: push: - branches: [ deployment-test ] + branches: + - deployment-test + - 'release/*' jobs: build-n-publish: From e6c0e68ff266f4b0a2c242d0bc5413f97945fea6 Mon Sep 17 00:00:00 2001 From: jh-RLI Date: Fri, 18 Nov 2022 14:43:31 +0100 Subject: [PATCH 28/43] update changes from latest to v151 --- metadata/v151/schema.json | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/metadata/v151/schema.json b/metadata/v151/schema.json index 8cc3d65b..bf303a77 100644 --- a/metadata/v151/schema.json +++ b/metadata/v151/schema.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://raw.githubusercontent.com/OpenEnergyPlatform/oemetadata/master/oemetadata/v151/schema.json", + "$id": "https://raw.githubusercontent.com/OpenEnergyPlatform/oemetadata/master/oemetadata/latest/schema.json", "description": "Open Energy Plaftorm (OEP) metadata schema latest", "type": "object", "properties": { @@ -614,9 +614,9 @@ } }, "additionalProperties": false, - "title": "IsAbout" + "title": "isAbout" }, - "title": "IsAbout" + "title": "isAbout" }, "valueReference": { "description": "Ontology URI for an extended description of the values in the column", @@ -638,8 +638,7 @@ "string", "null" ], - "title": "Name", - "format": "uri" + "title": "Name" }, "path": { "description": "Path to the OEO", @@ -652,7 +651,7 @@ } }, "additionalProperties": false, - "title": "Value reference" + "title": "valueReference" }, "title": "valueReference" }, From 3eafddd47caa2eb9654a1f459b836d240a48134d Mon Sep 17 00:00:00 2001 From: jh-RLI Date: Fri, 18 Nov 2022 14:49:12 +0100 Subject: [PATCH 29/43] fix version in template --- metadata/v151/template.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata/v151/template.json b/metadata/v151/template.json index 670ff605..7eacba01 100644 --- a/metadata/v151/template.json +++ b/metadata/v151/template.json @@ -176,7 +176,7 @@ "badge": null }, "metaMetadata": { - "metadataVersion": "OEP-1.5.0", + "metadataVersion": "OEP-1.5.1", "metadataLicense": { "name": "CC0-1.0", "title": "Creative Commons Zero v1.0 Universal", From a2a20546d839883c3d6c65e39d318849de890376 Mon Sep 17 00:00:00 2001 From: jh-RLI Date: Fri, 18 Nov 2022 14:49:37 +0100 Subject: [PATCH 30/43] fix url in field --- metadata/v151/schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata/v151/schema.json b/metadata/v151/schema.json index bf303a77..da326a36 100644 --- a/metadata/v151/schema.json +++ b/metadata/v151/schema.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://raw.githubusercontent.com/OpenEnergyPlatform/oemetadata/master/oemetadata/latest/schema.json", + "$id": "https://raw.githubusercontent.com/OpenEnergyPlatform/oemetadata/master/metadata/v151/schema.json", "description": "Open Energy Plaftorm (OEP) metadata schema latest", "type": "object", "properties": { From a8bf9d2237831bdb11041fc3f24095eb66521646 Mon Sep 17 00:00:00 2001 From: jh-RLI Date: Fri, 18 Nov 2022 14:54:41 +0100 Subject: [PATCH 31/43] fix schmea url in test --- tests/metadata/v151/test_schema.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/metadata/v151/test_schema.py b/tests/metadata/v151/test_schema.py index ea6c488f..4a724766 100644 --- a/tests/metadata/v151/test_schema.py +++ b/tests/metadata/v151/test_schema.py @@ -16,7 +16,7 @@ def get_string(s): # https://raw.githubusercontent.com/OpenEnergyPlatform/oemetadata/master/oemetadata/v150/schema.json assert get_string(OEMETADATA_V151_SCHEMA["$id"]) == get_string( - "https://raw.githubusercontent.com/OpenEnergyPlatform/oemetadata/master/oemetadata/v151/schema.json" + "https://raw.githubusercontent.com/OpenEnergyPlatform/oemetadata/master/metadata/v151/schema.json" ) From 7c8129cc99ca718285f3aa1388a22bf6d50c4552 Mon Sep 17 00:00:00 2001 From: jh-RLI Date: Fri, 18 Nov 2022 15:03:04 +0100 Subject: [PATCH 32/43] raise string versions to v1.5.2 --- metadata/latest/example.json | 19 +++++++++++++------ metadata/latest/metadata_key_description.md | 4 ++-- metadata/latest/template.json | 2 +- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/metadata/latest/example.json b/metadata/latest/example.json index 1bb3ef20..1335d0bb 100644 --- a/metadata/latest/example.json +++ b/metadata/latest/example.json @@ -1,7 +1,7 @@ { - "name": "oep_metadata_table_example_v151", - "title": "Example title for metadata example - Version 1.5.1", - "id": "http://openenergyplatform.org/dataedit/view/model_draft/oep_metadata_table_example_v151", + "name": "oep_metadata_table_example_v152", + "title": "Example title for metadata example - Version 1.5.2", + "id": "http://openenergyplatform.org/dataedit/view/model_draft/oep_metadata_table_example_v152", "description": "This is an metadata example for example data. There is a corresponding table on the OEP for each metadata version.", "language": [ "en-GB", @@ -218,13 +218,20 @@ "date": "2022-02-15", "object": "metadata", "comment": "Release metadata version OEP-1.5.1" + }, + { + "title": "jh-RLI", + "email": null, + "date": "2022-11-18", + "object": "metadata", + "comment": "Release metadata version OEP-1.5.2" } ], "resources": [ { "profile": "tabular-data-resource", - "name": "model_draft.oep_metadata_table_example_v151", - "path": "http://openenergyplatform.org/dataedit/view/model_draft/oep_metadata_table_example_v151", + "name": "model_draft.oep_metadata_table_example_v152", + "path": "http://openenergyplatform.org/dataedit/view/model_draft/oep_metadata_table_example_v152", "format": "PostgreSQL", "encoding": "UTF-8", "schema": { @@ -379,7 +386,7 @@ "badge": "Platinum" }, "metaMetadata": { - "metadataVersion": "OEP-1.5.1", + "metadataVersion": "OEP-1.5.2", "metadataLicense": { "name": "CC0-1.0", "title": "Creative Commons Zero v1.0 Universal", diff --git a/metadata/latest/metadata_key_description.md b/metadata/latest/metadata_key_description.md index 6492a3c6..f02a5a47 100644 --- a/metadata/latest/metadata_key_description.md +++ b/metadata/latest/metadata_key_description.md @@ -1,6 +1,6 @@ # OEMetadata - Key Description -This pages describes the key of **OEMetadata version 1.5.1.**
+This pages describes the key of **OEMetadata version 1.5.2 .**
You can have a look at an empty [template](https://github.com/OpenEnergyPlatform/metadata/blob/master/metadata/v151/template.json) and a filled out [example](https://github.com/OpenEnergyPlatform/metadata/blob/master/metadata/v151/example.json) of the metadata string. @@ -162,7 +162,7 @@ The JSON format offers different formats: |#|Key |Description |Example | |---|---|---|---| | 19 | **metaMetadata** | An object that describes the metadata themselves, their format, version and license. These fields should already be provided when you are filling out your metadata. | | -| 19.1 | metadataVersion | The type and version number of the metadata. | OEP-1.5.1 | +| 19.1 | metadataVersion | The type and version number of the metadata. | OEP-1.5.2 | | 19.2 | **metadataLicense** | The license of the provided metadata. | | | 19.2.1 | name | The [SPDX](https://spdx.org/licenses/) identifier. | CC0-1.0 | | 19.2.2 | title | The official (human readable) title of the license. | Creative Commons Zero v1.0 Universal | diff --git a/metadata/latest/template.json b/metadata/latest/template.json index 670ff605..23d8783e 100644 --- a/metadata/latest/template.json +++ b/metadata/latest/template.json @@ -176,7 +176,7 @@ "badge": null }, "metaMetadata": { - "metadataVersion": "OEP-1.5.0", + "metadataVersion": "OEP-1.5.2", "metadataLicense": { "name": "CC0-1.0", "title": "Creative Commons Zero v1.0 Universal", From 6a876499277be50f40944426b26813c38a9fa2c8 Mon Sep 17 00:00:00 2001 From: jh-RLI Date: Fri, 18 Nov 2022 15:04:46 +0100 Subject: [PATCH 33/43] add directory for 152 version --- metadata/v152/README.md | 16 + metadata/v152/__init__.py | 0 metadata/v152/context.json | 56 ++ metadata/v152/example.json | 406 ++++++++++ metadata/v152/example.py | 5 + metadata/v152/metadata_key_description.md | 182 +++++ metadata/v152/schema.json | 925 ++++++++++++++++++++++ metadata/v152/schema.py | 5 + metadata/v152/template.json | 196 +++++ metadata/v152/template.py | 5 + 10 files changed, 1796 insertions(+) create mode 100644 metadata/v152/README.md create mode 100644 metadata/v152/__init__.py create mode 100644 metadata/v152/context.json create mode 100644 metadata/v152/example.json create mode 100644 metadata/v152/example.py create mode 100644 metadata/v152/metadata_key_description.md create mode 100644 metadata/v152/schema.json create mode 100644 metadata/v152/schema.py create mode 100644 metadata/v152/template.json create mode 100644 metadata/v152/template.py diff --git a/metadata/v152/README.md b/metadata/v152/README.md new file mode 100644 index 00000000..dee9fa23 --- /dev/null +++ b/metadata/v152/README.md @@ -0,0 +1,16 @@ +OpenEnergyMetadata +OpenEnergyPlatform + + +# Open Energy Metadata (OEM) - Latest-Release + +This version of the OEM represents the latest released version. This release is fully integrated +into the OEP. + +The OEM contains the following files: + +* [template.json](https://github.com/OpenEnergyPlatform/oemetadata/blob/master/metadata/latest/template.json) contains an empty metadata string with all fields. +* [metadata_key_description.md](https://github.com/OpenEnergyPlatform/oemetadata/blob/master/metadata/latest/metadata_key_description.md) contains a full description of each metadata key and an example. +* [example.json](https://github.com/OpenEnergyPlatform/oemetadata/blob/master/metadata/latest/example.json) contains a basic metadata example. + +For further information see the [Changelog](https://github.com/OpenEnergyPlatform/oemetadata/blob/master/CHANGELOG.md). diff --git a/metadata/v152/__init__.py b/metadata/v152/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/metadata/v152/context.json b/metadata/v152/context.json new file mode 100644 index 00000000..2875c27f --- /dev/null +++ b/metadata/v152/context.json @@ -0,0 +1,56 @@ +{ + "@context": { + "path": "@id", + "rdfs": "http://www.w3.org/2000/01/rdf-schema#", + "dct": "http://purl.org/dc/terms/", + "dc": "http://purl.org/dc/elements/1.1/", + "xsd": "http://www.w3.org/2001/XMLSchema#", + "oeo": "http://openenergy-platform.org/ontology/oeo/", + "csvw": "http://www.w3.org/ns/csvw#", + "obo": "http://purl.obolibrary.org/obo/", + "title": { + "@id": "dct:title", + "@type": "xsd:string" + }, + "description": { + "@id": "dct:description", + "@type": "xsd:string" + }, + "comment": { + "@id": "rdfs:comment", + "@type": "xsd:string" + }, + "fields": { + "@id": "csvw:column", + "@type": "@id" + }, + "resources": { + "@id": "csvw:table", + "@type": "@id" + }, + "schema": { + "@id": "csvw:tableSchema", + "@type": "@id" + }, + "subject": { + "@id": "dc:subject", + "@type": "@id" + }, + "name": { + "@id": "rdfs:label", + "@type": "xsd:string" + }, + "type": { + "@id": "csvw:datatype", + "@type": "xsd:string" + }, + "unit": { + "@id": "oeo:OEO_00040010", + "@type": "xsd:string" + }, + "about": { + "@id": "obo:IAO_0000136", + "@type": "@id" + } + } +} \ No newline at end of file diff --git a/metadata/v152/example.json b/metadata/v152/example.json new file mode 100644 index 00000000..1335d0bb --- /dev/null +++ b/metadata/v152/example.json @@ -0,0 +1,406 @@ +{ + "name": "oep_metadata_table_example_v152", + "title": "Example title for metadata example - Version 1.5.2", + "id": "http://openenergyplatform.org/dataedit/view/model_draft/oep_metadata_table_example_v152", + "description": "This is an metadata example for example data. There is a corresponding table on the OEP for each metadata version.", + "language": [ + "en-GB", + "en-US", + "de-DE", + "fr-FR" + ], + "subject": [ + { + "name": "energy", + "path": "https://openenergy-platform.org/ontology/oeo/OEO_00000150" + }, + { + "name": "test dataset", + "path": "https://openenergy-platform.org/ontology/oeo/OEO_00000408" + } + ], + "keywords": [ + "energy", + "example", + "template", + "test" + ], + "publicationDate": "2022-02-15", + "context": { + "homepage": "https://reiner-lemoine-institut.de/lod-geoss/", + "documentation": "https://openenergy-platform.org/tutorials/jupyter/OEMetadata/", + "sourceCode": "https://github.com/OpenEnergyPlatform/oemetadata/tree/master", + "contact": "https://github.com/Ludee", + "grantNo": "03EI1005", + "fundingAgency": "Bundesministerium für Wirtschaft und Klimaschutz", + "fundingAgencyLogo": "https://commons.wikimedia.org/wiki/File:BMWi_Logo_2021.svg#/media/File:BMWi_Logo_2021.svg", + "publisherLogo": "https://reiner-lemoine-institut.de//wp-content/uploads/2015/09/rlilogo.png" + }, + "spatial": { + "location": null, + "extent": "europe", + "resolution": "100 m" + }, + "temporal": { + "referenceDate": "2016-01-01", + "timeseries": [ + { + "start": "2017-01-01T00:00+01", + "end": "2017-12-31T23:00+01", + "resolution": "1 h", + "alignment": "left", + "aggregationType": "sum" + }, + { + "start": "2018-01-01T00:00+01", + "end": "2019-06-01T23:00+01", + "resolution": "15 min", + "alignment": "right", + "aggregationType": "sum" + } + ] + }, + "sources": [ + { + "title": "OpenEnergyPlatform Metadata Example", + "description": "Metadata description", + "path": "https://github.com/OpenEnergyPlatform", + "licenses": [ + { + "name": "CC0-1.0", + "title": "Creative Commons Zero v1.0 Universal", + "path": "https://creativecommons.org/publicdomain/zero/1.0/legalcode", + "instruction": "You are free: To Share, To Create, To Adapt", + "attribution": "© Reiner Lemoine Institut" + } + ] + }, + { + "title": "OpenStreetMap", + "description": "A collaborative project to create a free editable map of the world", + "path": "https://www.openstreetmap.org/", + "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, To Create, To Adapt; As long as you: Attribute, Share-Alike, Keep open!", + "attribution": "© OpenStreetMap contributors" + } + ] + } + ], + "licenses": [ + { + "name": "ODbL-1.0", + "title": "Open Data Commons Open Database License 1.0", + "path": "https://opendatacommons.org/licenses/odbl/1.0/", + "instruction": "You are free: To Share, To Create, To Adapt; As long as you: Attribute, Share-Alike, Keep open!", + "attribution": "© Reiner Lemoine Institut © OpenStreetMap contributors" + } + ], + "contributors": [ + { + "title": "Ludee", + "email": null, + "date": "2016-06-16", + "object": "metadata", + "comment": "Create metadata" + }, + { + "title": "Ludee", + "email": null, + "date": "2016-11-22", + "object": "metadata", + "comment": "Update metadata" + }, + { + "title": "Ludee", + "email": null, + "date": "2016-11-22", + "object": "metadata", + "comment": "Update header and license" + }, + { + "title": "Ludee", + "email": null, + "date": "2017-03-16", + "object": "metadata", + "comment": "Add license to source" + }, + { + "title": "Ludee", + "email": null, + "date": "2017-03-28", + "object": "metadata", + "comment": "Add copyright to source and license" + }, + { + "title": "Ludee", + "email": null, + "date": "2017-05-30", + "object": "metadata", + "comment": "Release metadata version 1.3" + }, + { + "title": "Ludee", + "email": null, + "date": "2017-06-26", + "object": "metadata", + "comment": "Move referenceDate into temporal and remove array" + }, + { + "title": "Ludee", + "email": null, + "date": "2018-07-19", + "object": "metadata", + "comment": "Start metadata version 1.4" + }, + { + "title": "Ludee", + "email": null, + "date": "2018-07-26", + "object": "data", + "comment": "Rename table and files" + }, + { + "title": "Ludee", + "email": null, + "date": "2018-10-18", + "object": "metadata", + "comment": "Add contribution object" + }, + { + "title": "christian-rli", + "email": null, + "date": "2018-10-18", + "object": "metadata", + "comment": "Add datapackage compatibility" + }, + { + "title": "Ludee", + "email": null, + "date": "2018-11-02", + "object": "metadata", + "comment": "Release metadata version 1.4" + }, + { + "title": "christian-rli", + "email": null, + "date": "2019-02-05", + "object": "metadata", + "comment": "Apply template structure to example" + }, + { + "title": "Ludee", + "email": null, + "date": "2019-03-22", + "object": "metadata", + "comment": "Hotfix foreignKeys" + }, + { + "title": "Ludee", + "email": null, + "date": "2019-07-09", + "object": "metadata", + "comment": "Release metadata version OEP-1.3.0" + }, + { + "title": "Ludee", + "email": null, + "date": "2021-11-15", + "object": "metadata", + "comment": "Release metadata version OEP-1.5.0" + }, + { + "title": "Ludee", + "email": null, + "date": "2022-02-15", + "object": "metadata", + "comment": "Release metadata version OEP-1.5.1" + }, + { + "title": "jh-RLI", + "email": null, + "date": "2022-11-18", + "object": "metadata", + "comment": "Release metadata version OEP-1.5.2" + } + ], + "resources": [ + { + "profile": "tabular-data-resource", + "name": "model_draft.oep_metadata_table_example_v152", + "path": "http://openenergyplatform.org/dataedit/view/model_draft/oep_metadata_table_example_v152", + "format": "PostgreSQL", + "encoding": "UTF-8", + "schema": { + "fields": [ + { + "name": "id", + "description": "Unique identifier", + "type": "serial", + "unit": null, + "isAbout": [ + { + "name": null, + "path": null + } + ], + "valueReference": [ + { + "value": null, + "name": null, + "path": null + } + ] + }, + { + "name": "name", + "description": "Example name", + "type": "text", + "unit": null, + "isAbout": [ + { + "name": "written name", + "path": "https://openenergy-platform.org/ontology/oeo/IAO_0000590" + } + ], + "valueReference": [ + { + "value": null, + "name": null, + "path": null + } + ] + }, + { + "name": "type", + "description": "Type of wind farm", + "type": "text", + "unit": null, + "isAbout": [ + { + "name": "wind farm", + "path": "https://openenergy-platform.org/ontology/oeo/OEO_00000447" + } + ], + "valueReference": [ + { + "value": "onshore ", + "name": "onshore wind farm", + "path": "https://openenergy-platform.org/ontology/oeo/OEO_00000311" + }, + { + "value": "offshore ", + "name": "offshore wind farm", + "path": "https://openenergy-platform.org/ontology/oeo/OEO_00000308" + } + ] + }, + { + "name": "year", + "description": "Reference year", + "type": "integer", + "unit": null, + "isAbout": [ + { + "name": "year", + "path": "https://openenergy-platform.org/ontology/oeo/UO_0000036" + } + ], + "valueReference": [ + { + "value": null, + "name": null, + "path": null + } + ] + }, + { + "name": "value", + "description": "Example value", + "type": "double precision", + "unit": "MW", + "isAbout": [ + { + "name": "quantity value", + "path": "https://openenergy-platform.org/ontology/oeo/OEO_00000350" + } + ], + "valueReference": [ + { + "value": null, + "name": null, + "path": null + } + ] + }, + { + "name": "geom", + "description": "Geometry", + "type": "geometry(Point, 4326)", + "unit": null, + "isAbout": [ + { + "name": "spatial region", + "path": "https://openenergy-platform.org/ontology/oeo/BFO_0000006" + } + ], + "valueReference": [ + { + "value": null, + "name": null, + "path": null + } + ] + } + ], + "primaryKey": [ + "id" + ], + "foreignKeys": [ + { + "fields": [ + "year" + ], + "reference": { + "resource": "schema.table", + "fields": [ + "year" + ] + } + } + ] + }, + "dialect": { + "delimiter": null, + "decimalSeparator": "." + } + } + ], + "@id": "https://databus.dbpedia.org/kurzum/mastr/bnetza-mastr/01.04.00", + "@context": "https://github.com/OpenEnergyPlatform/oemetadata/blob/master/metadata/latest/context.json", + "review": { + "path": "https://github.com/OpenEnergyPlatform/data-preprocessing/issues", + "badge": "Platinum" + }, + "metaMetadata": { + "metadataVersion": "OEP-1.5.2", + "metadataLicense": { + "name": "CC0-1.0", + "title": "Creative Commons Zero v1.0 Universal", + "path": "https://creativecommons.org/publicdomain/zero/1.0/" + } + }, + "_comment": { + "metadata": "Metadata documentation and explanation (https://github.com/OpenEnergyPlatform/oemetadata)", + "dates": "Dates and time must follow the ISO8601 including time zone (YYYY-MM-DD or YYYY-MM-DDThh:mm:ss±hh)", + "units": "Use a space between numbers and units (100 m)", + "languages": "Languages must follow the IETF (BCP47) format (en-GB, en-US, de-DE)", + "licenses": "License name must follow the SPDX License List (https://spdx.org/licenses/)", + "review": "Following the OEP Data Review (https://github.com/OpenEnergyPlatform/data-preprocessing/blob/master/data-review/manual/review_manual.md)", + "null": "If not applicable use: null", + "todo": "If a value is not yet available, use: todo" + } +} \ No newline at end of file diff --git a/metadata/v152/example.py b/metadata/v152/example.py new file mode 100644 index 00000000..1d30161e --- /dev/null +++ b/metadata/v152/example.py @@ -0,0 +1,5 @@ +import json +import os + +with open(os.path.join(os.path.dirname(__file__), "example.json"), "rb") as f: + OEMETADATA_LATEST_EXAMPLE = json.loads(f.read()) diff --git a/metadata/v152/metadata_key_description.md b/metadata/v152/metadata_key_description.md new file mode 100644 index 00000000..f02a5a47 --- /dev/null +++ b/metadata/v152/metadata_key_description.md @@ -0,0 +1,182 @@ +# OEMetadata - Key Description + +This pages describes the key of **OEMetadata version 1.5.2 .**
+You can have a look at an empty [template](https://github.com/OpenEnergyPlatform/metadata/blob/master/metadata/v151/template.json) and a filled out [example](https://github.com/OpenEnergyPlatform/metadata/blob/master/metadata/v151/example.json) of the metadata string. + + +## 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":"value"}, + {"key":"value"}} + ``` +* array of objects {nested array}: + ```JSON + {"key": [ + {"key":"value"}, + {"key":"value"}]} + ``` + + +## Metadata keys with a description and example + + +### General Keys +|#|Key |Description |Example | +|---|---|---|---| +| 1 | name | A file name or database table name. | oep_metadata_table_example_v15 | +| 2 | title | A human readable full title including author. | RLI - OEMetadata - Metadata example table | +| 3 | id | An Uniform Resource Identifier (URI) that unambiguously identifies the resource. This can be a URL on the data set. It can also be a Digital Object Identifier (DOI). | https://example.com | +| 4 | description | A description or abstract of the package. It should be usable as summary information for the entire package that is described by the metadata. | Example table used to illustrate the metadata structure and meaning. | +| 5 | language | 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, fr-FR | +| 6 | **subject** | An array of objects with topics of the data in OEO terms. | +| 6.1 | name | The class label of the OEO terms. | energy | +| 6.2 | path | The URI of the class. | https://openenergy-platform.org/ontology/oeo/OEO_00000150 | +| 7 | keywords | An array of keywords to assist users searching for the package in catalogs. | example, template, test | +| 8 | publicationDate | A date of publishing of the data or metadata. Date format is ISO 8601 (YYYY-MM-DD). | 2019-02-06 | + +### Context Keys +|#|Key |Description |Example | +|---|---|---|---| +| 9 | **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. | | +| 9.1 | homepage | A URL of the project. | https://openenergy-platform.org/ | +| 9.2 | documentation | A URL of the project documentation. | https://openenergy-platform.org/about/ | +| 9.3 | sourceCode | A URL of the projects source code. | https://github.com/OpenEnergyPlatform | +| 9.4 | contact | A reference to the creator or maintainer of the data set. It can be an email address or a GitHub handle. | contact@example.com | +| 9.5 | grantNo | An identifying grant number. In case of a publicly funded project, this number is assigned by the funding agency. | 01AB2345 | +| 9.6 | fundingAgency | A name of the entity providing the funding. This can be a government agency or a company. | Bundesministerium für Wirtschaft und Klimaschutz | +| 9.7 | fundingAgencyLogo | A URL to the logo or image of the funding agency. | https://commons.wikimedia.org/wiki/File:BMWi_Logo_2021.svg#/media/File:BMWi_Logo_2021.svg | +| 9.8 | publisherLogo | A URL to the logo of the publishing agency of data. | https://reiner-lemoine-institut.de//wp-content/uploads/2015/09/rlilogo.png | + +### Spatial and Temporal Keys +|#|Key |Description |Example | +|---|---|---|---| +| 10 | **spatial** | An object that describes the spatial context of the data it contains. | | +| 10.1 | location | A location of the data. In case of data where the location can be described as a point. May be specified as coordinates, URI or addresses with street, house number and zip code. | 52.433509, 13.535855 | +| 10.2 | extent | A covered area. May be the name of a region, or the geometry of a bounding box. | Europe | +| 10.3 | resolution | Pixel size in case of a regular raster image. Reference to administrative level or other spatial division that is present as the smallest spatially distinguished unit size. | 1 ha | +| 11 | **temporal** | An object with the time period covered in the data. Temporal information should either contain a "referenceDate" or the keys describing a time series; in rare cases both. | | +| 11.1 | referenceDate | The base year, month or day. Point in time for which the data is meant to be accurate. The census data or a satellite image will have a reference date. Date Format is ISO 8601. | 2016-01-01 | +| 11.2 | **timeseries** | An array that describes the timeseries. || +| 11.2.1 | start | The beginning point in time of a time series. | 2019-02-06T10:12:04+00:00 | +| 11.2.2 | end | The end point in time of a time series. | 2019-02-07T10:12:04+00:00 | +| 11.2.3 | resolution | The time span between individual points of information in a time series. | 30 s | +| 11.2.4 | alignment | An indicator whether stamps in a time series are left, right or middle. | left | +| 11.2.5 | aggregationType | Indicates whether the values are a sum, average or current. | sum | + +### Source Keys +|#|Key |Description |Example | +|---|---|---|---| +| 12 | **sources** | An array of objects with the used and underlying sources of the data and metadata. | | +| 12.1 | title | A human readable title of the source, a document title or organisation name. | IPCC Fifth Assessment Report | +| 12.2 | description | A free text description of the data set. | Scientific climate change report by the UN | +| 12.3 | path | A URL to the original source. | https://www.ipcc.ch/site/assets/uploads/2018/02/ipcc_wg3_ar5_full.pdf | +| 12.4 | **licenses** | An array of objects under which the source is provided. | | +| 12.4.1 | name | The [SPDX](https://spdx.org/licenses/) identifier. | ODbL-1.0 | +| 12.4.2 | title | The official (human readable) title of the license. | Open Data Commons Open Database License 1.0 | +| 12.4.3 | path | A link to the license text. | https://opendatacommons.org/licenses/odbl/1-0/index.html | +| 12.4.4 | instruction | A short description of rights and restrictions. 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 https://tldrlegal.com/license/odc-open-database-license-(odbl) for further information. | +| 12.4.5 | attribution | The copyright owner of the **source**. If attribution licenses are used, that name must be acknowledged. | © Intergovernmental Panel on Climate Change 2014 | + +### License Keys +|#|Key |Description |Example | +|---|---|---|---| +| 13 | **licenses** | An array of objects of the license(s) under which the described package is provided. It can depend on the licenses of the sources (copyleft or share-alike) or can be granted by the creator of the data. | | +| 13.1 | name | The [SPDX](https://spdx.org/licenses/) identifier. | ODbL-1.0 | +| 13.2 | title | The official (human readable) title of the license. | Open Data Commons Open Database License 1.0 | +| 13.3 | path | A link to the license text. | https://opendatacommons.org/licenses/odbl/1-0/index.html | +| 13.4 | instruction | A short description of rights and restrictions. 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 https://tldrlegal.com/license/odc-open-database-license-(odbl) for further information. | +| 13.5 | attribution | The copyright owner of the **data**. If attribution licenses are used, that name must be acknowledged. | © Reiner Lemoine Institut | + +### Provenience Keys +|#|Key |Description |Example | +|---|---|---|---| +| 14 | **contributors** | An array of objects of the people or organizations who contributed to the data or metadata. Each object refers to one contributor. Every contributor must have a title and property. The path, email, role and organization properties are optional. | | +| 14.1 | title | A name of the contributor. | Ludwig Hülk | +| 14.2 | email | A email address of the contributor or GitHub handle. | @Ludee | +| 14.3 | date | The date of the contribution. If the contribution took more than a day, use the date of the final contribiution. Date Format is ISO 8601. | 2016-06-16 | +| 14.4 | object | The target of the contribution. Which part of the package was supplied or changed. Can be the data, metadata or both (data and metadata). | data and metadata | +| 14.5 | comment | A free text commentary on what has been done. | Fixed a typo in the title. | + +### Resource Keys +|#|Key |Description |Example | +|---|---|---|---| +| 15 | **resources** | An array of objects of the data. It describes the data resource as an individual file or (database) table. | | +| 15.1 | profile | The profile of this descriptor according to the profiles specification. This information is retained in order to comply with the "Tabular Data Package" standard. Use "tabular-data-resource" for all tables. | tabular-data-resource | +| 15.2 | name | A name for the entire data package. To comply with the data package standard it must consist of only lowercase alphanumeric character plus ".", "-" and "_". It may not start with a number. In a database, this will be the name of the table within the schema containing it. The name usually corresponds to the file name (minus the file-extension) of the data file describing the resource. | openstreetmap.osm_deu_line | +| 15.3 | path | A URL that should be a permanent http(s) address or other path directly linking to the resource. | https://openenergy-platform.org/dataedit/view/openstreetmap/osm_deu_line | +| 15.4 | format | The file extension. 'csv', 'xls', 'json' etc. would be expected to be the standard file extension for this type of resource. When you upload your data to the OEDB, in the shown metadata string, the format will be changed accordingly to 'PostgreSQL', since the data there are stored in a database. | PostgreSQL | +| 15.5 | encoding | Specifies the character encoding of the resource's data file. The values should be one of the ["Preferred MIME Names"](https://www.iana.org/assignments/character-sets/character-sets.xhtml) for a character encoding registered with IANA. If no value for this key is specified then the default is UTF-8. | UTF-8 | + +#### Resource Keys - Schema +|#|Key |Description |Example | +|---|---|---|---| +| 15.6 | **schema** | An object that describes the structure of the present data. It contains all fields (columns of the table), the primary key and optional foreign keys. | | +| 15.6.1 | **fields** | An array of objects describing a column and providing name, description, type and unit. | | +| 15.6.1.1 | name | The name of the field. | year | +| 15.6.1.2 | description | A text describing the field. | Reference year for which the data were collected. | +| 15.6.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) | +| 15.6.1.4 | unit | The unit, preferably SI-unit, that values in this field are mapped to. If 'unit' doesn't apply to a field, use 'null'. If the unit is given in a seperate field, reference this field. | MW | +| 15.6.1.5 | **isAbout** | An array of objects with describe the field in [OEO](https://openenergy-platform.org/ontology/oeo/) terms. | +| 15.6.1.5.1 | name | The class label of the OEO terms. | wind energy converting unit | +| 15.6.1.5.2 | path | The URI of the class. | https://openenergy-platform.org/ontology/oeo/OEO_00000044 | +| 15.6.1.6 | **valueReference** | An array of objects for an extended description of the values in the column in [OEO](https://openenergy-platform.org/ontology/oeo/) terms. | | +| 15.6.1.6.1 | value | The name of the value in the column. | onshore | +| 15.6.1.6.2 | name | The class label of the OEO terms. | onshore wind farm | +| 15.6.1.6.3 | path | The URI of the class. | https://openenergy-platform.org/ontology/oeo/OEO_00000311 | + +#### Resource Keys - Properties +|#|Key |Description |Example | +|---|---|---|---| +| 15.6.2 | primaryKey | A primary key is a field or set of fields that uniquely identifies each row in the table. It is recorded as an array, since it is possible to define the primary key as made up of several columns. | id | +| 15.6.3 | **foreignKeys** | A foreign key is a field that refers to a column in another table. | | +| 15.6.3.1 | fields | The column in the table that is constrainted by the foreign key. | version | +| 15.6.3.2 | **reference** | The reference to the foreign table. | | +| 15.6.3.2.1 | resource | The foreign resource (table). | schema.table | +| 15.6.3.2.2 | fields | The foreign resource column. | version | +| 15.7 | **dialect** | Object. A CSV Dialect defines a simple format to describe the various dialects of CSV files in a language agnostic manner. In case of a database, the values in the containing fields are 'null'. | | +| 15.7.1 | delimiter | The delimiter specifies the character sequence which should separate fields (columns). Common characters are "," (comma), "." (point) and "\t" (tab). | , | +| 15.7.2 | decimalSeparator | A 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 ",". | . | + +### Review Keys +|#|Key |Description |Example | +|---|---|---|---| +| 16 | @id | A Uniform Resource Identifier (URI) that links the resource via the [DBedia Databus](https://www.dbpedia.org/resources/databus/). | https://databus.dbpedia.org/kurzum/mastr/bnetza-mastr/01.04.00 | +| 17 | @context | Explanation of metadata keys in ontology terms. | https://github.com/OpenEnergyPlatform/oemetadata/blob/master/metadata/latest/context.json | +| 18. | **review** | Data uploaded through the OEP will go through a review process. The review will cover the data and metadata. It is done by the OEP community. See the [OEP Data Review](https://github.com/OpenEnergyPlatform/data-preprocessing/blob/master/data-review/manual/review_manual.md) for detailed information. The review itself is documented at the specified path and a badge is rewarded with regards to completeness. | | +| 18.1 | path | A URL that should be a permanent http(s) address directly linking to the documented review. | https://www.example.com | +| 18.2 | badge | A badge of either Bronze, Silver, Gold or Platinum is used to label the given data and metadata based on its quality. | Platinum | + +### MetaMetadata Keys +|#|Key |Description |Example | +|---|---|---|---| +| 19 | **metaMetadata** | An object that describes the metadata themselves, their format, version and license. These fields should already be provided when you are filling out your metadata. | | +| 19.1 | metadataVersion | The type and version number of the metadata. | OEP-1.5.2 | +| 19.2 | **metadataLicense** | The license of the provided metadata. | | +| 19.2.1 | name | The [SPDX](https://spdx.org/licenses/) identifier. | CC0-1.0 | +| 19.2.2 | title | The official (human readable) title of the license. | Creative Commons Zero v1.0 Universal | +| 19.2.3 | path | A link to the license text. | https://creativecommons.org/publicdomain/zero/1.0/ | + +### Comments +|#|Key |Description |Example | +|---|---|---|---| +| 20 | **_comment** | An array of objects. This section is used as a self-description of the final metadata file. It is text, intended for humans and includes a link to the metadata documentation, required value formats and similar remarks. | | +| 20.1 | metadata | Reference to the metadata documentation in use. | Metadata documentation and explanation (https://github.com/OpenEnergyPlatform/oemetadata) | +| 20.2 | dates | Comment on data and time format. | Dates and time must follow the ISO8601 including time zone (YYYY-MM-DD or YYYY-MM-DDThh:mm:ss±hh) | +| 20.3 | units | Comment on units. | Use a space between numbers and units (100 m) | +| 20.4 | languages | Comment on language format. | Languages must follow the IETF (BCP47) format (en-GB, en-US, de-DE) | +| 20.5 | licenses | Comment on license format. | License name must follow the SPDX License List (https://spdx.org/licenses/) | +| 20.6 | review | Reference to review documentation. | Following the OEP Data Review (https://github.com/OpenEnergyPlatform/data-preprocessing/blob/master/data-review/manual/review_manual.md) | +| 20.7 | null | Comment on fields that don't apply. | If not applicable use: null | +| 20.8 | todo | Comment on fields that are not yet available and will be inserted later on. | If a value is not yet available, use: todo | diff --git a/metadata/v152/schema.json b/metadata/v152/schema.json new file mode 100644 index 00000000..bf303a77 --- /dev/null +++ b/metadata/v152/schema.json @@ -0,0 +1,925 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://raw.githubusercontent.com/OpenEnergyPlatform/oemetadata/master/oemetadata/latest/schema.json", + "description": "Open Energy Plaftorm (OEP) metadata schema latest", + "type": "object", + "properties": { + "@context": { + "description": "Explanation of metadata keys in ontology terms. Example: https://raw.githubusercontent.com/LOD-GEOSS/databus-snippets/master/oep_metadata/context.jsonld", + "type": [ + "string", + "null" + ], + "title": "@context" + }, + "name": { + "description": "File name or database table name. Example: oep_metadata_table_example_v15", + "type": [ + "string", + "null" + ], + "title": "Name" + }, + "title": { + "description": "Human readable title. Example: Metadata Example Table", + "type": [ + "string", + "null" + ], + "title": "Title" + }, + "id": { + "description": "Uniform Resource Identifier (URI) that unambiguously identifies the resource. This can be a URL on the data set. It can also be a Digital Object Identifier (DOI). Example: https://example.com", + "type": [ + "string", + "null" + ], + "title": "Id", + "readonly": true + }, + "@id": { + "description": "Uniform Resource Identifier (URI) that links the resource via the databus", + "type": [ + "string", + "null" + ], + "title": "@Id", + "readonly": true + }, + "description": { + "description": "A description of the package. It should be usable as summary information for the entire package that is described by the metadata. Example: Example table used to illustrate the metadata structure and meaning", + "type": [ + "string", + "null" + ], + "title": "Description" + }, + "subject": { + "description": "Reference the topic of the resource in ontology terms", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "Name of the OEO Class", + "type": [ + "string", + "null" + ], + "title": "Name" + }, + "path": { + "description": "Path to the OEO (URL)", + "type": [ + "string", + "null" + ], + "title": "Path", + "format": "uri" + } + }, + "additionalProperties": false, + "title": "Subject" + }, + "title": "Subject" + }, + "language": { + "description": "Language used within the described data structures (e.g. titles, descriptions). The language key can be repeated if more languages are used. Standard: IETF (BCP47). Example: [en-GB, de-DE, fr-FR]", + "type": "array", + "items": { + "type": [ + "string", + "null" + ], + "title": "Language" + }, + "title": "Language" + }, + "keywords": { + "description": "An array of string keywords to assist users searching for the package in catalogs. Example: [example, template, test]", + "type": "array", + "items": { + "type": [ + "string", + "null" + ], + "title": "Keyword" + }, + "title": "Keyword" + }, + "publicationDate": { + "description": "Date of publishing. Date Format is ISO 8601 (YYYY-MM-DD). Example: 2019-02-06", + "type": [ + "string", + "null" + ], + "title": "Publication date", + "format": "date" + }, + "context": { + "description": "Object. Contains name-value-pairs that describe the general setting, evironment or project leading to the creation or maintenance of this dataset.", + "type": "object", + "properties": { + "homepage": { + "description": "URL of project. Example: https://openenergy-platform.org/", + "type": [ + "string", + "null" + ], + "title": "Homepage", + "format": "uri" + }, + "documentation": { + "description": "URL of project documentation. Example: https://github.com/OpenEnergyPlatform/metadata/wiki/Metadata-Description", + "type": [ + "string", + "null" + ], + "title": "Documentation" + }, + "sourceCode": { + "description": "Url of project source code. Example: https://github.com/OpenEnergyPlatform", + "type": [ + "string", + "null" + ], + "title": "Source code" + }, + "contact": { + "description": "Reference to the creator or maintainer of the data set. Example: contact@example.com", + "type": [ + "string", + "null" + ], + "title": "E-Mail contact", + "format": "email" + }, + "grantNo": { + "description": "In a publicly funded Project: the identifying grant number. Example: 01AB2345", + "type": [ + "string", + "null" + ], + "title": "Grant no" + }, + "fundingAgency": { + "description": "In a funded Project: The name of the funding agency. Example: Bundesministerium für Wirtschaft und Energie", + "type": [ + "string", + "null" + ], + "title": "Funding agency" + }, + "fundingAgencyLogo": { + "description": "In a publicly funded Project: A link to the Logo of the funding agency. Example: https://www.innovation-beratung-foerderung.de/INNO/Redaktion/DE/Bilder/Titelbilder/titel_foerderlogo_bmwi.jpg?__blob=poster&v=2", + "type": [ + "string", + "null" + ], + "title": "Funding agency logo", + "format": "uri" + }, + "publisherLogo": { + "description": "Link to the logo of the publishing institution. Example: https://reiner-lemoine-institut.de//wp-content/uploads/2015/09/rlilogo.png", + "type": [ + "string", + "null" + ], + "title": "Publisher logo", + "format": "uri" + } + }, + "additionalProperties": false, + "title": "Context" + }, + "spatial": { + "description": "Object. Contains name-value-pairs describing the spatial context of the contained data.", + "type": "object", + "properties": { + "location": { + "description": "In the case of data where the location can be described as a point. May come as coordinates, URI or addresses with street, house number and zip code. Example: 52.433509, 13.535855", + "type": [ + "string", + "null" + ], + "title": "Location" + }, + "extent": { + "description": "Covered area. May be the name of a region, or the geometry of a bounding box. Example: Europe", + "type": [ + "string", + "null" + ], + "title": "Extent" + }, + "resolution": { + "description": "Pixel size in case of a regular raster image. Reference to administrative level or other spatial division that is present as the smallest spatially distinguished unit size. Example: 30 m", + "type": [ + "string", + "null" + ], + "title": "Resolution" + } + }, + "additionalProperties": false, + "title": "Spatial" + }, + "temporal": { + "description": "Temporal object. Time period covered in the data. Temporal information should either contain a \"referenceDate\" or the keys describing a time series; in rare cases both. Use null for the ones that don't apply.", + "type": "object", + "properties": { + "referenceDate": { + "description": "Base year, month or day. Point in time for which the data is meant to be accurate. A census will generally have a reference year. A satellite image will have a reference date. Date Format is ISO 8601. Example: 2016-01-01", + "type": [ + "string", + "null" + ], + "title": "Reference date", + "format": "date" + }, + "timeseries": { + "description": "Times series object in temporal object, contains start, end, resolution, alignment and aggregation type properties.", + "type": "array", + "items": { + "type": "object", + "properties": { + "start": { + "description": "The beginning point in time of a time series. Example: 2019-02-06T10:12:04+00:00", + "type": [ + "string", + "null" + ], + "title": "Start", + "format": "date-time" + }, + "end": { + "description": "The end point in time of a time series. Example: 2019-02-07T10:12:04+00:00", + "type": [ + "string", + "null" + ], + "title": "End", + "format": "date-time" + }, + "resolution": { + "description": "The time span between individual points of information in a time series. Example: 30 s", + "type": [ + "string", + "null" + ], + "title": "Resolution" + }, + "alignment": { + "description": "Indicator whether stamps in a time series are left, right or middle. \"null\" if there is no time series. Example: left", + "type": [ + "string", + "null" + ], + "title": "Alignment" + }, + "aggregationType": { + "description": "Indicates whether the values are a sum, average or current. Example: sum", + "type": [ + "string", + "null" + ], + "title": "Aggregation type" + } + }, + "additionalProperties": false, + "title": "Timeseries" + }, + "title": "Timeseries" + } + }, + "additionalProperties": false, + "title": "Temporal" + }, + "sources": { + "description": "List of source objects. Each object has all name-value-pairs.", + "type": "array", + "items": { + "description": "Source object in list of source objects. Each object has all name-value-pairs.", + "type": "object", + "properties": { + "title": { + "description": "Human readable title of the source, e.g. document title or organisation name. Example: IPCC Fifth Assessment Report", + "type": [ + "string", + "null" + ], + "title": "Title" + }, + "description": { + "description": "Free text description of the data set. Example: Scientific climate change report by the UN", + "type": [ + "string", + "null" + ], + "title": "Description" + }, + "path": { + "description": "URL to original source. Example: https://www.ipcc.ch/site/assets/uploads/2018/02/ipcc_wg3_ar5_full.pdf", + "type": [ + "string", + "null" + ], + "title": "Path", + "format": "uri" + }, + "licenses": { + "description": "The license(s) under which the source(s) is/are provided. List of objects.", + "type": "array", + "items": { + "description": "A license object under which the described source is provided. Each object has all name-value-pairs.", + "type": "object", + "properties": { + "name": { + "description": "SPDX identifier: Example: ODbL-1.0", + "type": [ + "string", + "null" + ], + "title": "Name" + }, + "title": { + "description": "Official (human readable) title. Example: Open Data Commons Open Database License 1.0", + "type": [ + "string", + "null" + ], + "title": "Title" + }, + "path": { + "description": "A link to the license. Example: https://opendatacommons.org/licenses/odbl/1-0/index.html", + "type": [ + "string", + "null" + ], + "title": "Path" + }, + "instruction": { + "description": "Short description of rights and restrictions. Example: You are free to share and change, but you must attribute, and share derivations under the same license.", + "type": [ + "string", + "null" + ], + "title": "Instruction" + }, + "attribution": { + "description": "Copyrightholder of the source. Example: © Intergovernmental Panel on Climate Change 2014", + "type": [ + "string", + "null" + ], + "title": "Attribution" + } + }, + "title": "Licenses" + }, + "title": "Licenses" + } + }, + "additionalProperties": false, + "title": "Sources" + }, + "title": "Sources" + }, + "licenses": { + "description": "The license(s) under which the described package is provided. List of objects.", + "type": "array", + "items": { + "description": "A license object under which the described package is provided. Each object has all name-value-pairs.", + "type": "object", + "properties": { + "name": { + "description": "SPDX identifier. Example: ODbL-1.0", + "type": [ + "string", + "null" + ], + "title": "Name" + }, + "title": { + "description": "Official (human readable) title. Example: Open Data Commons Open Database License 1.0", + "type": [ + "string", + "null" + ], + "title": "Title" + }, + "path": { + "description": "A url-or-path string, that is a fully qualified HTTP address, or a relative POSIX path (see the url-or-path definition in Data Resource for details). Example: https://opendatacommons.org/licenses/odbl/1-0/index.html", + "type": [ + "string", + "null" + ], + "title": "Path" + }, + "instruction": { + "description": "Short description of rights and restrictions. Example: You are free to share and change, but you must attribute, and share derivations under the same license.", + "type": [ + "string", + "null" + ], + "title": "Instruction" + }, + "attribution": { + "description": "Copyrightholder of the produced data set. Example: © Reiner Lemoine Institut", + "type": [ + "string", + "null" + ], + "title": "Attribution" + } + }, + "additionalProperties": false, + "title": "Licenses" + }, + "title": "Licenses" + }, + "contributors": { + "description": "The people or organizations who contributed to this data package. List of objects.", + "type": "array", + "items": { + "description": "A person or organizations who contributed to this data package. Each object refers to one contributor. Every contributor must have a title and property. A path, email, role and organization properties are optional extras.", + "type": "object", + "properties": { + "title": { + "description": "Name/title of the contributor (name for a person, name or title for an organization). Example: Jon Doe", + "type": [ + "string", + "null" + ], + "title": "Title" + }, + "email": { + "description": "E-mail address of the contributor. Example: contact@example.com", + "type": [ + "string", + "null" + ], + "title": "Email", + "format": "email" + }, + "date": { + "description": "Date of the contribution. If the contribution took more than a day, use the date of the final contribiution. Date Format is ISO 8601. Example: 2016-06-16", + "type": [ + "string", + "null" + ], + "title": "Date", + "format": "date" + }, + "object": { + "description": "Target of contribution. Which part of the package was supplied/changed. Example: Metadata", + "type": [ + "string", + "null" + ], + "title": "Object" + }, + "comment": { + "description": "Free text comment on what's been done. Example: Fixed a typo in the title", + "type": [ + "string", + "null" + ], + "title": "Comment" + } + }, + "additionalProperties": false, + "title": "Contributors" + }, + "title": "Contributors" + }, + "resources": { + "description": "Resources, described as a list of data resource format objects.", + "type": "array", + "items": { + "description": "The data resource format describes a data resource as an individual file or table.", + "type": "object", + "properties": { + "profile": { + "description": "A string identifying the profile of this descriptor as per the profiles specification. This information is retained in order to comply with the \"Tabular Data Package\" standard. If at all in doubt the value should read \"tabular-data-resource\". Example: tabular-data-resource", + "type": [ + "string", + "null" + ], + "title": "Profile", + "options": { + "hidden": true + } + }, + "name": { + "description": "A resource MUST contain a name unique to amongst all resources in this data package. To comply with the data package standard it must consist of only lowercase alphanumeric character plus \".\", \"-\" and \"_\". It may not start with a number. In a database this will be the name of the table within its containing schema. It would be usual for the name to correspond to the file name (minus the file-extension) of the data file the resource describes. Example: sandbox.example_table", + "type": [ + "string", + "null" + ], + "title": "Name" + }, + "path": { + "description": "A url-or-path string, that should be a permanent http(s) address or other path directly linking to the resource. Example: directly linking to the resource. https://openenergy-platform.org/dataedit/view/openstreetmap/osm_deu_roads", + "type": [ + "string", + "null" + ], + "title": "Path", + "options": { + "hidden": true + } + }, + "format": { + "description": "\"csv\", \"xls\", \"json\" etc. would be expected to be the standard file extension for this type of resource. When you upload your data to the OEDB, in the shown metadata string, the format will be changed accordingly to \"PostgreSQL\", since the data there are stored in a database. Example: csv", + "type": [ + "string", + "null" + ], + "title": "Format", + "options": { + "hidden": true + } + }, + "encoding": { + "description": "Specifies the character encoding of the resource's data file. The values should be one of the \"Preferred MIME Names\" for a character encoding registered with IANA. If no value for this key is specified then the default is UTF-8. Example: UTF-8", + "type": [ + "string", + "null" + ], + "title": "Encoding", + "options": { + "hidden": true + } + }, + "schema": { + "description": "Object containing fields, primary key and for foreign keys. Describes the structure of the present data.", + "type": "object", + "properties": { + "fields": { + "description": "List of field objects.", + "type": "array", + "items": { + "description": "Field object. Every object describes a column and provides name, description, type and unit.", + "type": "object", + "properties": { + "name": { + "description": "Name string unique within its scope. Example: year", + "type": [ + "string", + "null" + ], + "title": "Name", + "readonly": true + }, + "description": { + "description": "Free-text describing the field. Example: Reference year for which the data were collected.", + "type": [ + "string", + "null" + ], + "title": "Description" + }, + "type": { + "description": "Data type of the field. In case of a geom-column in a database, also indicate the shape and CRS. Example: geometry(Point, 4326)", + "type": [ + "string", + "null" + ], + "title": "Type", + "readonly": true + }, + "isAbout": { + "description": "Ontology URI to describe the column header", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "Name of the Dataset", + "type": [ + "string", + "null" + ], + "title": "Name" + }, + "path": { + "description": "Path to the OEO (URL)", + "type": [ + "string", + "null" + ], + "title": "Path", + "format": "uri" + } + }, + "additionalProperties": false, + "title": "isAbout" + }, + "title": "isAbout" + }, + "valueReference": { + "description": "Ontology URI for an extended description of the values in the column", + "type": "array", + "items": { + "type": "object", + "properties": { + "value": { + "description": "The value this reference is assinged to.", + "type": [ + "string", + "null" + ], + "title": "Value" + }, + "name": { + "description": "Full name of the value", + "type": [ + "string", + "null" + ], + "title": "Name" + }, + "path": { + "description": "Path to the OEO", + "type": [ + "string", + "null" + ], + "title": "Path", + "format": "uri" + } + }, + "additionalProperties": false, + "title": "valueReference" + }, + "title": "valueReference" + }, + "unit": { + "description": "Unit, preferably SI-Unit, that values in this field are mapped to. If \"unit\" doesn't apply to a field, use \"null\". Example: MW", + "type": [ + "string", + "null" + ], + "title": "Unit" + } + }, + "additionalProperties": false, + "title": "Field" + }, + "title": "Field" + }, + "primaryKey": { + "description": "A primary key is a field or set of fields that uniquely identifies each row in the table. It's recorded as a list of strings, since it is possible to define the primary key as made up of several columns. Example: id", + "type": "array", + "items": { + "type": [ + "string", + "null" + ], + "title": "Primary key" + }, + "title": "Primary key" + }, + "foreignKeys": { + "description": "List of foreign keys.", + "type": "array", + "items": { + "description": "A foreign key is a field that refers to a column in another table.", + "type": "object", + "properties": { + "fields": { + "description": "The column (as list of items) in the table that is constrainted by the foreign key. Example: version", + "type": "array", + "items": { + "type": [ + "string", + "null" + ], + "title": "Field" + }, + "title": "Fields" + }, + "reference": { + "description": "The reference to the foreign table.", + "type": "object", + "properties": { + "resource": { + "description": "The foreign resource (table). Example: schema.table", + "type": [ + "string", + "null" + ], + "title": "Resource" + }, + "fields": { + "description": "The foreign resource column. List of fields. Example: version", + "type": "array", + "items": { + "type": [ + "string", + "null" + ], + "title": "Field" + }, + "title": "Field" + } + }, + "additionalProperties": false, + "title": "Reference" + } + }, + "additionalProperties": false, + "title": "Foreign Key" + }, + "title": "Foreign Keys" + } + }, + "additionalProperties": false, + "title": "Schema" + }, + "dialect": { + "description": "Object. A CSV Dialect defines a simple format to describe the various dialects of CSV files in a language agnostic manner. In case of a database, the values in the containing fields are \"null\".", + "type": "object", + "properties": { + "delimiter": { + "description": "Specifies the character sequence which should separate fields (aka columns). Common characters are \",\" (comma), \".\" (point) and \"\t\" (tab). Example: ,", + "type": [ + "string", + "null" + ], + "title": "Delimiter" + }, + "decimalSeparator": { + "description": "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 \",\". Example: .", + "type": [ + "string", + "null" + ], + "title": "Decimal separator" + } + }, + "additionalProperties": false, + "title": "Dialect", + "options": { + "hidden": true + } + } + }, + "additionalProperties": false, + "title": "Resource" + }, + "title": "Resource" + }, + "review": { + "description": "Data uploaded through the OEP needs to go through review. The review will cover the areas described here: https://github.com/OpenEnergyPlatform/data-preprocessing/wiki and carried out by a team of the platform. The review itself is documented at the specified path and a badge is rewarded with regards to completeness.", + "type": "object", + "properties": { + "path": { + "description": "A URL or path string, that should be a permanent http(s) address directly linking to the documented review. Example: https://www.example.com", + "type": [ + "string", + "null" + ], + "title": "Path" + }, + "badge": { + "description": "A badge of either Bronze, Silver, Gold or Platin is used to label the given metadata based on its quality. Example: Platin", + "type": [ + "string", + "null" + ], + "title": "Badge" + } + }, + "additionalProperties": false, + "title": "Review", + "options": { + "hidden": true + } + }, + "metaMetadata": { + "description": "Object. Description about the metadata themselves, their format, version and license. These fields should already be provided when you’re filling out your metadata.", + "type": "object", + "properties": { + "metadataVersion": { + "description": "Type and version number of the metadata. Example: OEP-1.5", + "type": [ + "string", + "null" + ], + "title": "Metadata version" + }, + "metadataLicense": { + "description": "Object describing the license of the provided metadata.", + "type": "object", + "properties": { + "name": { + "description": "SPDX identifier. Example: CC0-1.0", + "type": [ + "string", + "null" + ], + "title": "Name" + }, + "title": { + "description": "Official (human readable) license title. Example: Creative Commons Zero v1.0 Universal", + "type": [ + "string", + "null" + ], + "title": "Title" + }, + "path": { + "description": "Url or path string, that is a fully qualified HTTP address. Example: https://creativecommons.org/publicdomain/zero/1.0/", + "type": [ + "string", + "null" + ], + "title": "Path" + } + }, + "additionalProperties": false, + "title": "Metadata license" + } + }, + "additionalProperties": false, + "title": "Meta metadata", + "options": { + "hidden": true + } + }, + "_comment": { + "description": "Object. The “_comment”-section is used as a self-description of the final metadata-file. It is text, intended for humans and can include a link to the metadata documentation(s), required value formats and similar remarks. The comment section has no fix structure or mandatory values, but a useful self-description, similar to the one depicted here, is encouraged.", + "type": "object", + "properties": { + "metadata": { + "description": "Reference to the metadata documentation in use. Example: Metadata documentation and explanation (https://github.com/OpenEnergyPlatform/organisation/wiki/metadata)", + "type": [ + "string", + "null" + ], + "title": "Metadata" + }, + "dates": { + "description": "Comment on data/time format. Example: Dates and time must follow the ISO8601 including time zone (YYYY-MM-DD or YYYY-MM-DDThh:mm:ss±hh)", + "type": [ + "string", + "null" + ], + "title": "Dates" + }, + "units": { + "description": "Comment on units. Example: If you must use units in cells (which is discouraged), leave a space between numbers and units (100 m)", + "type": [ + "string", + "null" + ], + "title": "Units" + }, + "languages": { + "description": "Comment on language format. Example: Languages must follow the IETF (BCP47) format (en-GB, en-US, de-DE)", + "type": [ + "string", + "null" + ], + "title": "Languages" + }, + "licenses": { + "description": "Reference to license format. Example: License name must follow the SPDX License List (https://spdx.org/licenses/)", + "type": [ + "string", + "null" + ], + "title": "Licenses" + }, + "review": { + "description": "Reference to review documentation. Example: Following the OEP Data Review (https://github.com/OpenEnergyPlatform/data-preprocessing/wiki)", + "type": [ + "string", + "null" + ], + "title": "Review" + }, + "null": { + "description": "Feel free to add more descriptive comments. Like \"null\". Example: If a field is not applicable just enter \"null\"", + "type": [ + "string", + "null" + ], + "title": "Null" + }, + "todo": { + "description": "If an applicable value is not yet available and will be inserted later on use: 'todo' ", + "type": [ + "string", + "null" + ], + "title": "Todo" + } + }, + "title": "_comment" + } + }, + "additionalProperties": false +} \ No newline at end of file diff --git a/metadata/v152/schema.py b/metadata/v152/schema.py new file mode 100644 index 00000000..2af91a92 --- /dev/null +++ b/metadata/v152/schema.py @@ -0,0 +1,5 @@ +import json +import os + +with open(os.path.join(os.path.dirname(__file__), "schema.json"), "rb") as f: + OEMETADATA_LATEST_SCHEMA = json.loads(f.read()) diff --git a/metadata/v152/template.json b/metadata/v152/template.json new file mode 100644 index 00000000..23d8783e --- /dev/null +++ b/metadata/v152/template.json @@ -0,0 +1,196 @@ +{ + "name": null, + "title": null, + "id": null, + "description": null, + "language": [ + null + ], + "subject": [ + { + "name": null, + "path": null + } + ], + "keywords": [ + null + ], + "publicationDate": null, + "context": { + "homepage": null, + "documentation": null, + "sourceCode": null, + "contact": null, + "grantNo": null, + "fundingAgency": null, + "fundingAgencyLogo": null, + "publisherLogo": null + }, + "spatial": { + "location": null, + "extent": null, + "resolution": null + }, + "temporal": { + "referenceDate": null, + "timeseries": [ + { + "start": null, + "end": null, + "resolution": null, + "alignment": null, + "aggregationType": null + }, + { + "start": null, + "end": null, + "resolution": null, + "alignment": null, + "aggregationType": null + } + ] + }, + "sources": [ + { + "title": null, + "description": null, + "path": null, + "licenses": [ + { + "name": null, + "title": null, + "path": null, + "instruction": null, + "attribution": null + } + ] + }, + { + "title": null, + "description": null, + "path": null, + "licenses": [ + { + "name": null, + "title": null, + "path": null, + "instruction": null, + "attribution": null + } + ] + } + ], + "licenses": [ + { + "name": null, + "title": null, + "path": null, + "instruction": null, + "attribution": null + } + ], + "contributors": [ + { + "title": null, + "email": null, + "date": null, + "object": null, + "comment": null + } + ], + "resources": [ + { + "profile": null, + "name": null, + "path": null, + "format": null, + "encoding": null, + "schema": { + "fields": [ + { + "name": null, + "description": null, + "type": null, + "unit": null, + "isAbout": [ + { + "name": null, + "path": null + } + ], + "valueReference": [ + { + "value": null, + "name": null, + "path": null + } + ] + }, + { + "name": null, + "description": null, + "type": null, + "unit": null, + "isAbout": [ + { + "name": null, + "path": null + } + ], + "valueReference": [ + { + "value": null, + "name": null, + "path": null + } + ] + } + ], + "primaryKey": [ + null + ], + "foreignKeys": [ + { + "fields": [ + null + ], + "reference": { + "resource": null, + "fields": [ + null + ] + } + } + ] + }, + "dialect": { + "delimiter": null, + "decimalSeparator": "." + } + } + ], + "@id": null, + "@context": null, + "review": { + "path": null, + "badge": null + }, + "metaMetadata": { + "metadataVersion": "OEP-1.5.2", + "metadataLicense": { + "name": "CC0-1.0", + "title": "Creative Commons Zero v1.0 Universal", + "path": "https://creativecommons.org/publicdomain/zero/1.0/" + } + }, + "_comment": { + "metadata": "Metadata documentation and explanation (https://github.com/OpenEnergyPlatform/oemetadata)", + "dates": "Dates and time must follow the ISO8601 including time zone (YYYY-MM-DD or YYYY-MM-DDThh:mm:ss±hh)", + "units": "Use a space between numbers and units (100 m)", + "languages": "Languages must follow the IETF (BCP47) format (en-GB, en-US, de-DE)", + "licenses": "License name must follow the SPDX License List (https://spdx.org/licenses/)", + "review": "Following the OEP Data Review (https://github.com/OpenEnergyPlatform/data-preprocessing/blob/master/data-review/manual/review_manual.md)", + "null": "If not applicable use: null", + "todo": "If a value is not yet available, use: todo" + } +} \ No newline at end of file diff --git a/metadata/v152/template.py b/metadata/v152/template.py new file mode 100644 index 00000000..78a3a705 --- /dev/null +++ b/metadata/v152/template.py @@ -0,0 +1,5 @@ +import json +import os + +with open(os.path.join(os.path.dirname(__file__), "template.json"), "rb") as f: + OEMETADATA_LATEST_TEMPLATE = json.loads(f.read()) From 31a1df49e93c8541a7cb94a0d8b80a39dac4fedc Mon Sep 17 00:00:00 2001 From: jh-RLI Date: Fri, 18 Nov 2022 15:10:28 +0100 Subject: [PATCH 34/43] update version in variable name that is for metadata import in python --- metadata/v152/example.py | 2 +- metadata/v152/schema.py | 2 +- metadata/v152/template.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/metadata/v152/example.py b/metadata/v152/example.py index 1d30161e..29b5852a 100644 --- a/metadata/v152/example.py +++ b/metadata/v152/example.py @@ -2,4 +2,4 @@ import os with open(os.path.join(os.path.dirname(__file__), "example.json"), "rb") as f: - OEMETADATA_LATEST_EXAMPLE = json.loads(f.read()) + OEMETADATA_V152_EXAMPLE = json.loads(f.read()) diff --git a/metadata/v152/schema.py b/metadata/v152/schema.py index 2af91a92..fe0f567f 100644 --- a/metadata/v152/schema.py +++ b/metadata/v152/schema.py @@ -2,4 +2,4 @@ import os with open(os.path.join(os.path.dirname(__file__), "schema.json"), "rb") as f: - OEMETADATA_LATEST_SCHEMA = json.loads(f.read()) + OEMETADATA_V152_SCHEMA = json.loads(f.read()) diff --git a/metadata/v152/template.py b/metadata/v152/template.py index 78a3a705..859f17ef 100644 --- a/metadata/v152/template.py +++ b/metadata/v152/template.py @@ -2,4 +2,4 @@ import os with open(os.path.join(os.path.dirname(__file__), "template.json"), "rb") as f: - OEMETADATA_LATEST_TEMPLATE = json.loads(f.read()) + OEMETADATA_V152_TEMPLATE = json.loads(f.read()) From 63d64de9e07de6d358882c30eed3d0bc51732b97 Mon Sep 17 00:00:00 2001 From: jh-RLI Date: Fri, 18 Nov 2022 15:11:05 +0100 Subject: [PATCH 35/43] add tests for v152 --- tests/metadata/v152/__init__.py | 0 tests/metadata/v152/test_example.py | 10 ++++++++++ tests/metadata/v152/test_schema.py | 28 ++++++++++++++++++++++++++++ tests/metadata/v152/test_template.py | 10 ++++++++++ 4 files changed, 48 insertions(+) create mode 100644 tests/metadata/v152/__init__.py create mode 100644 tests/metadata/v152/test_example.py create mode 100644 tests/metadata/v152/test_schema.py create mode 100644 tests/metadata/v152/test_template.py diff --git a/tests/metadata/v152/__init__.py b/tests/metadata/v152/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/metadata/v152/test_example.py b/tests/metadata/v152/test_example.py new file mode 100644 index 00000000..df2aee0b --- /dev/null +++ b/tests/metadata/v152/test_example.py @@ -0,0 +1,10 @@ +def test_if_example_json_loads_successfully(): + from metadata.v152.example import OEMETADATA_V152_EXAMPLE + + +def test_example_against_schema_which_should_succeed(): + import jsonschema + from metadata.v152.example import OEMETADATA_V152_EXAMPLE + from metadata.v152.schema import OEMETADATA_V152_SCHEMA + + assert jsonschema.validate(OEMETADATA_V152_EXAMPLE, OEMETADATA_V152_SCHEMA) == None diff --git a/tests/metadata/v152/test_schema.py b/tests/metadata/v152/test_schema.py new file mode 100644 index 00000000..ff51c0fe --- /dev/null +++ b/tests/metadata/v152/test_schema.py @@ -0,0 +1,28 @@ +def test_if_schema_json_loads_successfully(): + try: + from metadata.v152.schema import OEMETADATA_V152_SCHEMA + except Warning: + print("Metadata Schema v1.5.2 cant load. Check if the files are missing!") + + +def test_if_schema_json_has_correct_schema_and_id_set(): + from metadata.v152.schema import OEMETADATA_V152_SCHEMA + import string + + def get_string(s): + return string.printable + s + string.printable + + assert get_string(OEMETADATA_V151_SCHEMA["$schema"]) == get_string("http://json-schema.org/draft-07/schema#") + + # https://raw.githubusercontent.com/OpenEnergyPlatform/oemetadata/master/oemetadata/v150/schema.json + assert get_string(OEMETADATA_V151_SCHEMA["$id"]) == get_string( + "https://raw.githubusercontent.com/OpenEnergyPlatform/oemetadata/master/metadata/v151/schema.json" + ) + + +def test_schema_against_metaschema_which_should_succeed(): + import jsonschema + from metadata.v151.schema import OEMETADATA_V151_SCHEMA + from metadata.metaschema.draft07.schema import OEMETADATA_METASCHEMA_DRAFT07_SCHEMA + + assert jsonschema.validate(OEMETADATA_V151_SCHEMA, OEMETADATA_METASCHEMA_DRAFT07_SCHEMA) is None diff --git a/tests/metadata/v152/test_template.py b/tests/metadata/v152/test_template.py new file mode 100644 index 00000000..67794689 --- /dev/null +++ b/tests/metadata/v152/test_template.py @@ -0,0 +1,10 @@ +def test_if_template_json_loads_successfully(): + from metadata.v152.template import OEMETADATA_V152_TEMPLATE + + +def test_template_against_schema_which_should_succeed(): + import jsonschema + from metadata.v152.template import OEMETADATA_V152_TEMPLATE + from metadata.v152.schema import OEMETADATA_V152_SCHEMA + + assert jsonschema.validate(OEMETADATA_V152_TEMPLATE, OEMETADATA_V152_SCHEMA) == None From b19d54ed2b67d5b440202abe4898a44edee4419f Mon Sep 17 00:00:00 2001 From: jh-RLI Date: Fri, 18 Nov 2022 15:19:27 +0100 Subject: [PATCH 36/43] update test to v152 --- tests/metadata/v152/test_schema.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/metadata/v152/test_schema.py b/tests/metadata/v152/test_schema.py index ff51c0fe..9fd82f3a 100644 --- a/tests/metadata/v152/test_schema.py +++ b/tests/metadata/v152/test_schema.py @@ -12,17 +12,16 @@ def test_if_schema_json_has_correct_schema_and_id_set(): def get_string(s): return string.printable + s + string.printable - assert get_string(OEMETADATA_V151_SCHEMA["$schema"]) == get_string("http://json-schema.org/draft-07/schema#") + assert get_string(OEMETADATA_V152_SCHEMA["$schema"]) == get_string("http://json-schema.org/draft-07/schema#") - # https://raw.githubusercontent.com/OpenEnergyPlatform/oemetadata/master/oemetadata/v150/schema.json - assert get_string(OEMETADATA_V151_SCHEMA["$id"]) == get_string( - "https://raw.githubusercontent.com/OpenEnergyPlatform/oemetadata/master/metadata/v151/schema.json" + assert get_string(OEMETADATA_V152_SCHEMA["$id"]) == get_string( + "https://raw.githubusercontent.com/OpenEnergyPlatform/oemetadata/master/metadata/v152/schema.json" ) def test_schema_against_metaschema_which_should_succeed(): import jsonschema - from metadata.v151.schema import OEMETADATA_V151_SCHEMA + from metadata.v152.schema import OEMETADATA_V152_SCHEMA from metadata.metaschema.draft07.schema import OEMETADATA_METASCHEMA_DRAFT07_SCHEMA - assert jsonschema.validate(OEMETADATA_V151_SCHEMA, OEMETADATA_METASCHEMA_DRAFT07_SCHEMA) is None + assert jsonschema.validate(OEMETADATA_V152_SCHEMA, OEMETADATA_METASCHEMA_DRAFT07_SCHEMA) is None From 7a40c3e2ccd595f3af8016f93132251afa20f69b Mon Sep 17 00:00:00 2001 From: jh-RLI Date: Fri, 18 Nov 2022 15:20:17 +0100 Subject: [PATCH 37/43] fix description field in v151 schema --- metadata/v151/schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata/v151/schema.json b/metadata/v151/schema.json index da326a36..f40f355a 100644 --- a/metadata/v151/schema.json +++ b/metadata/v151/schema.json @@ -1,7 +1,7 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "$id": "https://raw.githubusercontent.com/OpenEnergyPlatform/oemetadata/master/metadata/v151/schema.json", - "description": "Open Energy Plaftorm (OEP) metadata schema latest", + "description": "Open Energy Plaftorm (OEP) metadata schema v1.5.1", "type": "object", "properties": { "@context": { From f0984dae4a89b8ca4527e02ffef8d5c7f5e17d83 Mon Sep 17 00:00:00 2001 From: jh-RLI Date: Fri, 18 Nov 2022 15:20:53 +0100 Subject: [PATCH 38/43] update schmea to v152 --- metadata/v152/schema.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/metadata/v152/schema.json b/metadata/v152/schema.json index bf303a77..a0e3b07b 100644 --- a/metadata/v152/schema.json +++ b/metadata/v152/schema.json @@ -1,7 +1,7 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://raw.githubusercontent.com/OpenEnergyPlatform/oemetadata/master/oemetadata/latest/schema.json", - "description": "Open Energy Plaftorm (OEP) metadata schema latest", + "$id": "https://raw.githubusercontent.com/OpenEnergyPlatform/oemetadata/master/metadata/v152/schema.json", + "description": "Open Energy Plaftorm (OEP) metadata schema v1.5.2", "type": "object", "properties": { "@context": { From 5e8f7f192d5928a8f533b2c831992fb74ff57a43 Mon Sep 17 00:00:00 2001 From: jh-RLI Date: Fri, 18 Nov 2022 15:35:31 +0100 Subject: [PATCH 39/43] update changes --- metadata/v152/context.json | 43 +++++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/metadata/v152/context.json b/metadata/v152/context.json index 2875c27f..9f34efb2 100644 --- a/metadata/v152/context.json +++ b/metadata/v152/context.json @@ -7,7 +7,10 @@ "xsd": "http://www.w3.org/2001/XMLSchema#", "oeo": "http://openenergy-platform.org/ontology/oeo/", "csvw": "http://www.w3.org/ns/csvw#", - "obo": "http://purl.obolibrary.org/obo/", + "obo":"http://purl.obolibrary.org/obo/", + "time":"http://www.w3.org/2006/time#", + "dbo": "http://dbpedia.org/ontology/", + "saref": "https://saref.etsi.org/core/", "title": { "@id": "dct:title", "@type": "xsd:string" @@ -20,6 +23,30 @@ "@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" @@ -32,10 +59,6 @@ "@id": "csvw:tableSchema", "@type": "@id" }, - "subject": { - "@id": "dc:subject", - "@type": "@id" - }, "name": { "@id": "rdfs:label", "@type": "xsd:string" @@ -48,9 +71,13 @@ "@id": "oeo:OEO_00040010", "@type": "xsd:string" }, - "about": { - "@id": "obo:IAO_0000136", + "isAbout": { + "@id": "saref:isAbout", + "@type": "@id" + }, + "valueReference": { + "@id": "http://purl.org/goodrelations/v1#valueReference", "@type": "@id" } } -} \ No newline at end of file +} From 36c3161c36833da05d394550bedfa99d828b6f3b Mon Sep 17 00:00:00 2001 From: jh-RLI Date: Fri, 18 Nov 2022 15:35:47 +0100 Subject: [PATCH 40/43] update version string to v152 --- metadata/v152/metadata_key_description.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata/v152/metadata_key_description.md b/metadata/v152/metadata_key_description.md index f02a5a47..508f4975 100644 --- a/metadata/v152/metadata_key_description.md +++ b/metadata/v152/metadata_key_description.md @@ -1,7 +1,7 @@ # OEMetadata - Key Description This pages describes the key of **OEMetadata version 1.5.2 .**
-You can have a look at an empty [template](https://github.com/OpenEnergyPlatform/metadata/blob/master/metadata/v151/template.json) and a filled out [example](https://github.com/OpenEnergyPlatform/metadata/blob/master/metadata/v151/example.json) of the metadata string. +You can have a look at an empty [template](https://github.com/OpenEnergyPlatform/metadata/blob/master/metadata/v152/template.json) and a filled out [example](https://github.com/OpenEnergyPlatform/metadata/blob/master/metadata/v152/example.json) of the metadata string. ## JSON Format From 1aae2a7d27d2cc6a34bfdb3edc3ca796cb4d0bb9 Mon Sep 17 00:00:00 2001 From: jh-RLI Date: Fri, 18 Nov 2022 15:39:14 +0100 Subject: [PATCH 41/43] raise pypu version for test release --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 0b5ccae3..20b796f4 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ setup( name="oemetadata", - version="1.5.1a1", + version="1.5.2a1", description="Open Energy Platform (OEP) - metadata schemas, examples and templates package", long_description=long_description, long_description_content_type="text/markdown", From a54fc79be197907b48510fef89edd330d9e12d1d Mon Sep 17 00:00:00 2001 From: jh-RLI Date: Fri, 18 Nov 2022 16:10:22 +0100 Subject: [PATCH 42/43] update changelog for release v1.5.2 --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8013295b..efdd73ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,15 @@ Here is a template for new release sections ## Current +### Added +- +### Changed +- +### Removed +- + +## [1.5.2] - Release - Fix missing json files in pypi package, Improve context.jsonld - 2022-11-18 + - Fix missing json files in pypi oemetadata package - Add github actions/workflwos to automate package build and upload process on test and production pypi index From 3690788c1b4b273b6b9a149d09c4708f8e29dd14 Mon Sep 17 00:00:00 2001 From: jh-RLI Date: Fri, 18 Nov 2022 16:26:29 +0100 Subject: [PATCH 43/43] raise version for offical release v152 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 20b796f4..bcdc20cf 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ setup( name="oemetadata", - version="1.5.2a1", + version="1.5.2", description="Open Energy Platform (OEP) - metadata schemas, examples and templates package", long_description=long_description, long_description_content_type="text/markdown",