-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from HDRUK/add/hdruk/2.1.3
Add/hdruk/2.1.3
- Loading branch information
Showing
28 changed files
with
2,086 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"HDRUK": [ | ||
"2.1.2", | ||
"2.1.3", | ||
"2.1.0", | ||
"2.0.2" | ||
], | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from .v2_1_2 import Hdruk212 | ||
from .v2_1_3 import Hdruk213 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from pydantic import ValidationError | ||
import v2_1_2 | ||
import v2_1_3 | ||
import json | ||
|
||
v2_1_2.Hdruk212.save_schema() | ||
v2_1_3.Hdruk213.save_schema() | ||
v2_1_3.Hdruk213.save_schema("latest/dev/schema.json") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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.
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from hdr_schemata.models.HDRUK.v2_1_2 import Provenance as BaseProvenance | ||
from .Temporal import Temporal | ||
|
||
|
||
class Provenance(BaseProvenance): | ||
temporal: Temporal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from pydantic import Field | ||
from hdr_schemata.definitions.HDRUK import Periodicity | ||
from hdr_schemata.models.HDRUK.v2_1_2.Temporal import Temporal as BaseTemporal | ||
from pydantic import BaseModel, Field | ||
from hdr_schemata.models import remove_fields_from_cls | ||
|
||
|
||
class Temporal(BaseTemporal): | ||
publishingFrequency: Periodicity = Field( | ||
..., | ||
title="Publishing Frequency", | ||
description="Please indicate the frequency of distribution release. If a dataset is distributed regularly please choose a distribution release periodicity from the constrained list and indicate the next release date. When the release date becomes historical, a new release date will be calculated based on the publishing periodicity. If a dataset has been published and will remain static please indicate that it is static and indicated when it was released. If a dataset is released on an irregular basis or “on-demand” please indicate that it is Irregular and leave release date as null. If a dataset can be published in real-time or near-real-time please indicate that it is continuous and leave release date as null. Notes: see https://www.dublincore.org/specifications/dublin-core/collection-description/frequency/", | ||
) | ||
|
||
|
||
remove_fields_from_cls(Temporal, ["accrualPeriodicity"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from hdr_schemata.models.HDRUK.v2_1_2 import Hdruk212 | ||
import json | ||
from typing import Optional | ||
from pydantic import Field | ||
from .Provenance import Provenance | ||
|
||
|
||
class Hdruk213(Hdruk212): | ||
provenance: Optional[Provenance] = Field( | ||
None, | ||
description="Provenance information allows researchers to understand data within the context of its origins and can be an indicator of quality, authenticity and timeliness.", | ||
title="Provenance", | ||
) | ||
|
||
@classmethod | ||
def save_schema(cls, location="./2.1.3/schema.json"): | ||
with open(location, "w") as f: | ||
json.dump(cls.model_json_schema(), f, indent=6) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters