Skip to content

Commit

Permalink
Merge pull request #168 from OpenEnergyPlatform/feature-21-semver
Browse files Browse the repository at this point in the history
Refactor version to v20 (2.0) in all files #21
  • Loading branch information
jh-RLI authored Oct 16, 2024
2 parents 2b8afae + 6778f0c commit b175751
Show file tree
Hide file tree
Showing 42 changed files with 40 additions and 39 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ Here is a template for new release sections
- Update broken Link in key description example [(#159)](https://github.com/OpenEnergyPlatform/oemetadata/pull/159)
- Update resource/profile to resource/type [(#164)](https://github.com/OpenEnergyPlatform/oemetadata/pull/164)
- Update links in context.json and example.json for all versions [(#167)](https://github.com/OpenEnergyPlatform/oemetadata/pull/167)
- Restrict the version number to only major and minor versions since 2.0 [(#168)](https://github.com/OpenEnergyPlatform/oemetadata/pull/168)

### Removed

Expand Down
2 changes: 1 addition & 1 deletion metadata/latest/build_source/schemas/context.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "general.json#metadata/v200_draft/schemas/context.json",
"$id": "general.json#metadata/v20/schemas/context.json",
"type": "object",
"properties": {
"context": {
Expand Down
2 changes: 1 addition & 1 deletion metadata/latest/build_source/schemas/contribution.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "general.json#metadata/v200_draft/schemas/contribution.json",
"$id": "general.json#metadata/v20/schemas/contribution.json",
"type": "object",
"properties": {
"contributors": {
Expand Down
2 changes: 1 addition & 1 deletion metadata/latest/build_source/schemas/general.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "general.json#metadata/v200_draft/schemas/general.json",
"$id": "general.json#metadata/v20/schemas/general.json",
"type": "object",
"properties": {
"name": {
Expand Down
2 changes: 1 addition & 1 deletion metadata/latest/build_source/schemas/json_ld.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "json_ld.json#metadata/v200_draft/schemas/json_ld.json",
"$id": "json_ld.json#metadata/v20/schemas/json_ld.json",
"type": "object",
"properties": {
"@id": {
Expand Down
2 changes: 1 addition & 1 deletion metadata/latest/build_source/schemas/licences.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "general.json#metadata/v200_draft/schemas/licences.json",
"$id": "general.json#metadata/v20/schemas/licences.json",
"type": "object",
"properties": {
"licenses": {
Expand Down
2 changes: 1 addition & 1 deletion metadata/latest/build_source/schemas/meta.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "general.json#metadata/v200_draft/schemas/meta.json",
"$id": "general.json#metadata/v20/schemas/meta.json",
"type": "object",
"properties": {
"metaMetadata": {
Expand Down
2 changes: 1 addition & 1 deletion metadata/latest/build_source/schemas/resources.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "general.json#metadata/v200_draft/schemas/resources.json",
"$id": "general.json#metadata/v20/schemas/resources.json",
"type": "object",
"properties": {
"resources": {
Expand Down
2 changes: 1 addition & 1 deletion metadata/latest/build_source/schemas/review.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "general.json#metadata/v200_draft/schemas/review.json",
"$id": "general.json#metadata/v20/schemas/review.json",
"type": "object",
"properties": {
"review": {
Expand Down
2 changes: 1 addition & 1 deletion metadata/latest/build_source/schemas/sources.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "general.json#metadata/v200_draft/schemas/sources.json",
"$id": "general.json#metadata/v20/schemas/sources.json",
"type": "object",
"properties": {
"sources": {
Expand Down
2 changes: 1 addition & 1 deletion metadata/latest/build_source/schemas/spatial.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "general.json#metadata/v200_draft/schemas/spatial.json",
"$id": "general.json#metadata/v20/schemas/spatial.json",
"type": "object",
"properties": {
"spatial": {
Expand Down
2 changes: 1 addition & 1 deletion metadata/latest/build_source/schemas/temporal.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "general.json#metadata/v200_draft/schemas/temporal.json",
"$id": "general.json#metadata/v20/schemas/temporal.json",
"type": "object",
"properties": {
"temporal": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

# Constants
BASE_PATH = Path("metadata/")
VERSION = "v200_draft"
VERSION = "v20"
VERSION_PATH = BASE_PATH / VERSION
SCHEMA_BUILD_PATH = VERSION_PATH / "build"
MAIN_SCHEMA_PATH = SCHEMA_BUILD_PATH / "main_schema.json"
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"$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",
"description": "Open Energy Platform (OEP) metadata schema latest",
"type": "object",
"properties": {
"generalCollection": {
"$ref": "general_collection.json#"
"collection": {
"$ref": "collection.json#"
},
"resources": {
"description": "A collection of related data resource descriptions and metadata. This may include relational data models which are technically related",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "general.json#metadata/v200_draft/schemas/general_collection.json",
"$id": "general.json#metadata/v20/schemas/collection.json",
"type": "object",
"properties": {
"name": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "general.json#metadata/v200_draft/schemas/context.json",
"$id": "general.json#metadata/v20/schemas/context.json",
"type": "object",
"properties": {
"context": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "general.json#metadata/v200_draft/schemas/general.json",
"$id": "general.json#metadata/v20/schemas/general.json",
"type": "object",
"properties": {
"name": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "general.json#metadata/v200_draft/schemas/licences.json",
"$id": "general.json#metadata/v20/schemas/licences.json",
"type": "object",
"properties": {
"licenses": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "general.json#metadata/v200_draft/schemas/linked_data.json",
"$id": "general.json#metadata/v20/schemas/linked_data.json",
"type": "object",
"properties": {
"linkedData": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "general.json#metadata/v200_draft/schemas/meta.json",
"$id": "general.json#metadata/v20/schemas/meta.json",
"type": "object",
"properties": {
"metaMetadata": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "general.json#metadata/v200_draft/schemas/provenance.json",
"$id": "general.json#metadata/v20/schemas/provenance.json",
"type": "object",
"properties": {
"provenance": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "general.json#metadata/v200_draft/schemas/resource.json",
"$id": "general.json#metadata/v20/schemas/resource.json",
"type": "object",
"properties": {
"type": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "general.json#metadata/v200_draft/schemas/review.json",
"$id": "general.json#metadata/v20/schemas/review.json",
"type": "object",
"properties": {
"review": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "general.json#metadata/v200_draft/schemas/sources.json",
"$id": "general.json#metadata/v20/schemas/sources.json",
"type": "object",
"properties": {
"sources": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "general.json#metadata/v200_draft/schemas/spatial.json",
"$id": "general.json#metadata/v20/schemas/spatial.json",
"type": "object",
"properties": {
"spatial": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "general.json#metadata/v200_draft/schemas/temporal.json",
"$id": "general.json#metadata/v20/schemas/temporal.json",
"type": "object",
"properties": {
"temporal": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

# Constants
BASE_PATH = Path("metadata/")
VERSION = "v200_draft"
VERSION = "v20"
VERSION_PATH = BASE_PATH / VERSION
SCHEMA_BUILD_PATH = VERSION_PATH / "build_source"
MAIN_SCHEMA_PATH = SCHEMA_BUILD_PATH / "schema_structure.json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

# Constants
BASE_PATH = Path("metadata/")
VERSION = "v200_draft"
VERSION = "v20"
VERSION_PATH = BASE_PATH / VERSION
SCHEMA_BUILD_PATH = VERSION_PATH / "build_source"
MAIN_SCHEMA_PATH = SCHEMA_BUILD_PATH / "schema_structure.json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

# Constants
BASE_PATH = Path("metadata/")
VERSION = "v200_draft"
VERSION = "v20"
VERSION_PATH = BASE_PATH / VERSION
SCHEMA_BUILD_PATH = VERSION_PATH / "build_source"
MAIN_SCHEMA_PATH = SCHEMA_BUILD_PATH / "schema_structure.json"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
def test_if_example_json_loads_successfully():
from metadata.v200_draft.example import OEMETADATA_V200_EXAMPLE
from metadata.v20.example import OEMETADATA_V200_EXAMPLE


def test_example_against_schema_which_should_succeed():
import jsonschema
from metadata.v200_draft.example import OEMETADATA_V200_EXAMPLE
from metadata.v200_draft.schema import OEMETADATA_V200_SCHEMA
from metadata.v20.example import OEMETADATA_V200_EXAMPLE
from metadata.v20.schema import OEMETADATA_V200_SCHEMA

assert jsonschema.validate(OEMETADATA_V200_EXAMPLE, OEMETADATA_V200_SCHEMA) == None
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
def test_if_schema_json_loads_successfully():
try:
from metadata.v200_draft.schema import OEMETADATA_V200_SCHEMA
from metadata.v20.schema import OEMETADATA_V200_SCHEMA
except Warning:
print("Metadata Schema v2.0.0 cant load. Check if the files are missing!")


def test_if_schema_json_has_correct_schema_and_id_set():
from metadata.v200_draft.schema import OEMETADATA_V200_SCHEMA
from metadata.v20.schema import OEMETADATA_V200_SCHEMA
import string

def get_string(s):
Expand All @@ -23,7 +23,7 @@ def get_string(s):

def test_schema_against_metaschema_which_should_succeed():
import jsonschema
from metadata.v200_draft.schema import OEMETADATA_V200_SCHEMA
from metadata.v20.schema import OEMETADATA_V200_SCHEMA
from metadata.metaschema.draft07.schema import OEMETADATA_METASCHEMA_DRAFT07_SCHEMA

assert (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
def test_if_template_json_loads_successfully():
from metadata.v200_draft.template import OEMETADATA_V200_TEMPLATE
from metadata.v20.template import OEMETADATA_V200_TEMPLATE


def test_template_against_schema_which_should_succeed():
import jsonschema
from metadata.v200_draft.template import OEMETADATA_V200_TEMPLATE
from metadata.v200_draft.schema import OEMETADATA_V200_SCHEMA
from metadata.v20.template import OEMETADATA_V200_TEMPLATE
from metadata.v20.schema import OEMETADATA_V200_SCHEMA

assert jsonschema.validate(OEMETADATA_V200_TEMPLATE, OEMETADATA_V200_SCHEMA) == None

0 comments on commit b175751

Please sign in to comment.