Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance oem draft v200 #149

Merged
merged 7 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading