Skip to content

Commit

Permalink
Merge pull request #149 from OpenEnergyPlatform/enhance-oem-v200
Browse files Browse the repository at this point in the history
Enhance oem draft v200 - Template test fails only for v200Draft
  • Loading branch information
jh-RLI authored Aug 13, 2024
2 parents b17555e + 443f974 commit 5ba9f41
Show file tree
Hide file tree
Showing 4 changed files with 1,054 additions and 1,074 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ Here is a template for new release sections

- Remove comment field as it holds information on how to fill out the metadata and therefore should not be part of the actual oemetadata but the documentation. [#???](https://github.com/OpenEnergyPlatform/oemetadata/pull/)

- Update the schema json file content (schema generation still broken, add desired output) and fix the schema path in the script for generating examples (it pointed to an incorrect directory and file name) [(#149)](https://github.com/OpenEnergyPlatform/oemetadata/pull/149)

### Removed

-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ def read_schema(filename: str) -> Dict[str, Any]:
Returns:
Dict[str, Any]: The JSON schema as a dictionary.
"""
pwd = dirname(__file__)
with open(pwd + filename, "r", encoding="utf-8") as file:
# pwd = dirname(__file__)
with open(VERSION_PATH / filename, "r", encoding="utf-8") as file:
schema = json.load(file)
return schema

Expand Down Expand Up @@ -120,6 +120,6 @@ def save_json(data: Dict[str, Any], filename: Path) -> None:


if __name__ == "__main__":
schema_filename = "/res_schema.json"
schema_filename = "schema.json"
json_data = generate_json_from_schema(schema_filename)
save_json(json_data, EXAMPLE_PATH)
26 changes: 17 additions & 9 deletions metadata/v200_draft/example.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
"@id": "https://databus.dbpedia.org/kurzum/mastr/bnetza-mastr/01.04.00",
"@context": "https://raw.githubusercontent.com/LOD-GEOSS/databus-snippets/master/oep_metadata/context.jsonld",
"wasGeneratedBy": {
"@id": "todo",
"@id": "https://todo.do",
"@type": "moss:OEMetadataMod",
"version": "1.0.0",
"used": "todo",
"license": "CC0"
"used": "https://todo.do",
"license": "https://todo.do"
},
"name": "oep_metadata_table_example_v160",
"title": "RLI - OEMetadata - Metadata example table",
Expand All @@ -23,8 +23,8 @@
"path": "https://openenergy-platform.org/ontology/oeo/OEO_00000150"
}
],
"language": "[en-GB, de-DE, fr-FR]",
"keywords": "[example, template, test]",
"language": ["en-GB", "de-DE", "fr-FR"],
"keywords": ["example", "template", "test"],
"publicationDate": "2019-02-06",
"context": {
"homepage": "https://openenergy-platform.org/",
Expand Down Expand Up @@ -115,13 +115,13 @@
"unit": "MW"
}
],
"primaryKey": "id",
"primaryKey": ["id"],
"foreignKeys": [
{
"fields": "version",
"fields": ["version"],
"reference": {
"resource": "schema.table",
"fields": "version"
"fields": ["version"]
}
}
]
Expand All @@ -136,5 +136,13 @@
}
}
}
]
],
"metaMetadata": {
"metadataVersion": "OEP-2.0.0",
"metadataLicense": {
"name": "CC0-1.0",
"title": "Creative Commons Zero v1.0 Universal",
"path": "https://creativecommons.org/publicdomain/zero/1.0/"
}
}
}
Loading

0 comments on commit 5ba9f41

Please sign in to comment.