From 2a9fa0ef97e66925563401dafa6d2bc9a11527db Mon Sep 17 00:00:00 2001 From: Calum Macdonald Date: Wed, 20 Mar 2024 11:28:36 +0000 Subject: [PATCH] add 2.2.1 annotations --- hdr_schemata/models/HDRUK/v2_2_1/Access.py | 10 ++++++---- hdr_schemata/models/HDRUK/v2_2_1/Accessibility.py | 10 +++++----- .../models/HDRUK/v2_2_1/EnrichmentAndLinkage.py | 9 +++++---- .../models/HDRUK/v2_2_1/annotations/__init__.py | 5 +++++ .../models/HDRUK/v2_2_1/annotations/config.yaml | 12 ++++++++++++ 5 files changed, 33 insertions(+), 13 deletions(-) create mode 100644 hdr_schemata/models/HDRUK/v2_2_1/annotations/__init__.py create mode 100644 hdr_schemata/models/HDRUK/v2_2_1/annotations/config.yaml diff --git a/hdr_schemata/models/HDRUK/v2_2_1/Access.py b/hdr_schemata/models/HDRUK/v2_2_1/Access.py index 681b04d..94c71eb 100644 --- a/hdr_schemata/models/HDRUK/v2_2_1/Access.py +++ b/hdr_schemata/models/HDRUK/v2_2_1/Access.py @@ -5,10 +5,12 @@ from hdr_schemata.models.HDRUK.v2_2_0 import Access as BaseAccess +from .annotations import annotations + +an = annotations.accessibility.access + + class Access(BaseAccess): accessServiceCategory: Optional[List[AccessService]] = Field( - None, - description="Where access to data come from: TRE/SED, direct access, open acccess, varies based on project.", - example="", - title="Access/governance requirementss", + None, **an.accessServiceCategory.__dict__ ) diff --git a/hdr_schemata/models/HDRUK/v2_2_1/Accessibility.py b/hdr_schemata/models/HDRUK/v2_2_1/Accessibility.py index ee8ec58..df2402a 100644 --- a/hdr_schemata/models/HDRUK/v2_2_1/Accessibility.py +++ b/hdr_schemata/models/HDRUK/v2_2_1/Accessibility.py @@ -4,10 +4,10 @@ from hdr_schemata.models.HDRUK.v2_2_0 import Accessibility as BaseAccessibility from .Access import Access +from .annotations import annotations + +an = annotations.accessibility + class Accessibility(BaseAccessibility): - access: Access = Field( - ..., - description="This section includes information about data access", - title="Access", - ) + access: Access = Field(..., description=an.description, title=an.title) diff --git a/hdr_schemata/models/HDRUK/v2_2_1/EnrichmentAndLinkage.py b/hdr_schemata/models/HDRUK/v2_2_1/EnrichmentAndLinkage.py index 9dc6d8d..079da72 100644 --- a/hdr_schemata/models/HDRUK/v2_2_1/EnrichmentAndLinkage.py +++ b/hdr_schemata/models/HDRUK/v2_2_1/EnrichmentAndLinkage.py @@ -6,11 +6,12 @@ from hdr_schemata.definitions.HDRUK import Url +from .annotations import annotations + +an = annotations.enrichmentAndLinkage + class EnrichmentAndLinkage(BaseEnrichmentAndLinkage): syntheticDataWebLink: Optional[List[Url]] = Field( - None, - description="Links to locations of information and or raw downloads of synthetic data associated with this dataset", - example="", - title="Synthetic Data Web Links", + None, **an.syntheticDataWebLink.__dict__ ) diff --git a/hdr_schemata/models/HDRUK/v2_2_1/annotations/__init__.py b/hdr_schemata/models/HDRUK/v2_2_1/annotations/__init__.py new file mode 100644 index 0000000..4781503 --- /dev/null +++ b/hdr_schemata/models/HDRUK/v2_2_1/annotations/__init__.py @@ -0,0 +1,5 @@ +from hdr_schemata.models.annotations import get_annotations +from hdr_schemata.models.HDRUK.v2_2_0.annotations import annotations +import os + +annotations = get_annotations(os.path.dirname(os.path.abspath(__file__)), annotations) diff --git a/hdr_schemata/models/HDRUK/v2_2_1/annotations/config.yaml b/hdr_schemata/models/HDRUK/v2_2_1/annotations/config.yaml new file mode 100644 index 0000000..6634818 --- /dev/null +++ b/hdr_schemata/models/HDRUK/v2_2_1/annotations/config.yaml @@ -0,0 +1,12 @@ +accessibility: + access: + accessServiceCategory: + description: "Where access to data come from: TRE/SED, direct access, open acccess, varies based on project." + examples: + - TRE/SDE + title: Access/governance requirements + +enrichmentAndLinkage: + syntheticDataWebLink: + description: Links to locations of information and or raw downloads of synthetic data associated with this dataset + title: Synthetic Data Web Links