From 53b4b0ee1f6e8244db9de6cd271ede46f5c7c829 Mon Sep 17 00:00:00 2001 From: Branwen Snelling Date: Wed, 15 May 2024 10:41:55 +0100 Subject: [PATCH 1/7] update some annotations --- docs/HDRUK/2.2.1.form.json | 6 ++++-- docs/HDRUK/2.2.1.md | 8 +++++--- docs/HDRUK/2.2.1.structure.json | 6 ++++-- .../models/HDRUK/v2_1_2/annotations/config.yaml | 6 ++++++ hdr_schemata/utils/create_markdown.py | 12 ++++++------ 5 files changed, 25 insertions(+), 13 deletions(-) diff --git a/docs/HDRUK/2.2.1.form.json b/docs/HDRUK/2.2.1.form.json index c16ed17..43d0f57 100644 --- a/docs/HDRUK/2.2.1.form.json +++ b/docs/HDRUK/2.2.1.form.json @@ -401,9 +401,11 @@ }, { "required": false, - "title": "Age Range", + "title": "Typical Age Range", "description": "Please indicate the age range in whole years of participants in the dataset. Please provide range in the following format '[min age] \u2013 [max age]' where both the minimum and maximum are whole numbers (integers).", - "examples": null, + "examples": [ + "18-90" + ], "is_list": false, "is_optional": true, "types": { diff --git a/docs/HDRUK/2.2.1.md b/docs/HDRUK/2.2.1.md index 1972506..051efec 100644 --- a/docs/HDRUK/2.2.1.md +++ b/docs/HDRUK/2.2.1.md @@ -348,11 +348,13 @@ Examples: Please indicate the age range in whole years of participants in the dataset. Please provide range in the following format '[min age] – [max age]' where both the minimum and maximum are whole numbers (integers). -| title | is_list | is_optional | required | type | -|:----------|:----------|:--------------|:-----------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| Age Range | False | True | False | ["AgeRange[{'anyOf': [{'pattern': 'Not Known|(150|1[0-4][0-9]|[0-9]|[1-8][0-9]|9[0-9])-(150|1[0-4][0-9]|[0-9]|[1-8][0-9]|9[0-9])', 'type': 'string'}, {'type': 'null'}]}]", 'null'] | +| title | is_list | is_optional | required | type | +|:------------------|:----------|:--------------|:-----------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Typical Age Range | False | True | False | ["AgeRange[{'anyOf': [{'pattern': 'Not Known|(150|1[0-4][0-9]|[0-9]|[1-8][0-9]|9[0-9])-(150|1[0-4][0-9]|[0-9]|[1-8][0-9]|9[0-9])', 'type': 'string'}, {'type': 'null'}]}]", 'null'] | +Examples: + * 18-90 ### followup diff --git a/docs/HDRUK/2.2.1.structure.json b/docs/HDRUK/2.2.1.structure.json index 2f3447f..739bdb7 100644 --- a/docs/HDRUK/2.2.1.structure.json +++ b/docs/HDRUK/2.2.1.structure.json @@ -444,9 +444,11 @@ { "name": "typicalAgeRange", "required": false, - "title": "Age Range", + "title": "Typical Age Range", "description": "Please indicate the age range in whole years of participants in the dataset. Please provide range in the following format '[min age] \u2013 [max age]' where both the minimum and maximum are whole numbers (integers).", - "examples": null, + "examples": [ + "18-90" + ], "type": [ "AgeRange[{'anyOf': [{'pattern': 'Not Known|(150|1[0-4][0-9]|[0-9]|[1-8][0-9]|9[0-9])-(150|1[0-4][0-9]|[0-9]|[1-8][0-9]|9[0-9])', 'type': 'string'}, {'type': 'null'}]}]", "null" diff --git a/hdr_schemata/models/HDRUK/v2_1_2/annotations/config.yaml b/hdr_schemata/models/HDRUK/v2_1_2/annotations/config.yaml index 5933212..2934603 100644 --- a/hdr_schemata/models/HDRUK/v2_1_2/annotations/config.yaml +++ b/hdr_schemata/models/HDRUK/v2_1_2/annotations/config.yaml @@ -73,3 +73,9 @@ enrichmentAndLinkage: tools: description: "Please provide the URL of any analysis tools or models that have been created for this dataset and are available for further use. Multiple tools may be provided. Note: We encourage users to adopt a model along the lines of https://www.ga4gh.org/news/tool-registry-service-api-enabling-an-interoperable-library-of-genomics-analysis-tools/" title: Tools + +coverage: + title: Coverage + typicalAgeRange: + examples: + - 18-90 diff --git a/hdr_schemata/utils/create_markdown.py b/hdr_schemata/utils/create_markdown.py index 68fe80e..a80cc84 100644 --- a/hdr_schemata/utils/create_markdown.py +++ b/hdr_schemata/utils/create_markdown.py @@ -221,15 +221,15 @@ def remove_types(data): from hdr_schemata.models.GWDM.v1_2 import Gwdm12 -create_markdown(Hdruk220, "./docs/HDRUK/", "2.2.0") +# create_markdown(Hdruk220, "./docs/HDRUK/", "2.2.0") create_markdown(Hdruk221, "./docs/HDRUK/", "2.2.1") -create_markdown(Hdruk212, "./docs/HDRUK/", "2.1.2") -create_markdown(Hdruk213, "./docs/HDRUK/", "2.1.3") +# create_markdown(Hdruk212, "./docs/HDRUK/", "2.1.2") +# create_markdown(Hdruk213, "./docs/HDRUK/", "2.1.3") from hdr_schemata.models.GWDM.v1_1 import Gwdm10 from hdr_schemata.models.GWDM.v1_1 import Gwdm11 from hdr_schemata.models.GWDM.v1_2 import Gwdm12 -create_markdown(Gwdm10, "./docs/GWDM/", "1.0") -create_markdown(Gwdm11, "./docs/GWDM/", "1.1") -create_markdown(Gwdm12, "./docs/GWDM/", "1.2") +# create_markdown(Gwdm10, "./docs/GWDM/", "1.0") +# create_markdown(Gwdm11, "./docs/GWDM/", "1.1") +# create_markdown(Gwdm12, "./docs/GWDM/", "1.2") From f8cda201ee13165b22a55aac4b22247851f5c921 Mon Sep 17 00:00:00 2001 From: Branwen Snelling Date: Wed, 15 May 2024 15:44:59 +0100 Subject: [PATCH 2/7] updates to form json creation --- docs/HDRUK/2.2.1.form.json | 159 +----------------- docs/HDRUK/2.2.1.md | 126 +++++++------- docs/HDRUK/2.2.1.structure.json | 42 ++--- .../definitions/HDRUK/MeasuredProperty.py | 4 +- hdr_schemata/utils/create_markdown.py | 25 ++- 5 files changed, 107 insertions(+), 249 deletions(-) diff --git a/docs/HDRUK/2.2.1.form.json b/docs/HDRUK/2.2.1.form.json index 43d0f57..f4b7093 100644 --- a/docs/HDRUK/2.2.1.form.json +++ b/docs/HDRUK/2.2.1.form.json @@ -68,16 +68,6 @@ }, "location": "revisions.url" }, - { - "required": true, - "title": "Metadata Version Revisions", - "description": "A list of persistent identifiers and version numbers for previous versions of metadata for this dataset", - "examples": null, - "is_list": true, - "is_optional": false, - "types": "Revision", - "location": "revisions" - }, { "required": true, "title": "Metadata Issued Datetime',", @@ -224,16 +214,6 @@ }, "location": "summary.publisher.memberOf" }, - { - "required": true, - "title": "Dataset publisher", - "description": "This is the organisation responsible for running or supporting the data access request process, as well as publishing and maintaining the metadata. In most this will be the same as the HDR UK Organisation (Hub or Alliance Member). However, in some cases this will be different i.e. Tissue Directory are an HDR UK Gateway organisation but coordinate activities across a number of data publishers i.e. Cambridge Blood and Stem Cell Biobank.", - "examples": null, - "is_list": false, - "is_optional": false, - "types": "Organisation", - "location": "summary.publisher" - }, { "required": true, "title": "Contact Point", @@ -401,7 +381,7 @@ }, { "required": false, - "title": "Typical Age Range", + "title": "Age Range", "description": "Please indicate the age range in whole years of participants in the dataset. Please provide range in the following format '[min age] \u2013 [max age]' where both the minimum and maximum are whole numbers (integers).", "examples": [ "18-90" @@ -1001,16 +981,6 @@ }, "location": "accessibility.formatAndStandards.format" }, - { - "required": false, - "title": "Format and Standards", - "description": "Section includes technical attributes for language vocabularies, sizes etc. and gives researchers facts about and processing the underlying data in the dataset.", - "examples": null, - "is_list": false, - "is_optional": true, - "types": "FormatAndStandards", - "location": "accessibility.formatAndStandards" - }, { "required": false, "title": "Linked Datasets", @@ -1068,16 +1038,6 @@ }, "location": "enrichmentAndLinkage.syntheticDataWebLink" }, - { - "required": false, - "title": "Enrichment and Linkage", - "description": "This section includes information about related datasets that may have previously been linked, as well as indicating if there is the opportunity to link to other datasets in the future. If a dataset has been enriched and/or derivations, scores and existing tools are available this section allows providers to indicate this to researchers.", - "examples": null, - "is_list": false, - "is_optional": true, - "types": "EnrichmentAndLinkage", - "location": "enrichmentAndLinkage" - }, { "required": true, "title": "Statistical Population'", @@ -1140,102 +1100,13 @@ "is_list": false, "is_optional": false, "types": { - "title": "MeasuredProperty" + "maxLength": 100, + "minLength": 1, + "title": "MeasuredProperty", + "type": "string" }, "location": "observations.measuredProperty" }, - { - "required": true, - "title": "Observations", - "description": "Multiple observations about the dataset may be provided and users are expected to provide at least one observation \n(1..*). We will be supporting the schema.org observation model (https://schema.org/Observation) with default values. Users will be encouraged to provide their own statistical populations as the project progresses. \nExample: \n <b> Statistical Population 1 \n </b> type: StatisticalPopulation populationType: Persons numConstraints: 0 \n <b> Statistical Population 2 </b> type: StatisticalPopulation populationType: Events numConstraints: 0 <b> Statistical Population 3 </b> type: StatisticalPopulation populationType: Findings numConstraints: 0 typeOf: Observation observedNode: <b> Statistical Population 1 </b> measuredProperty: count measuredValue: 32937 observationDate: \u201c2017\u201d\"\n", - "examples": null, - "is_list": true, - "is_optional": false, - "types": "Observation", - "location": "observations" - }, - { - "required": true, - "title": "Table Name", - "description": "The name of a table in a dataset.", - "examples": null, - "is_list": false, - "is_optional": true, - "types": "str", - "location": "structuralMetadata.name" - }, - { - "required": false, - "title": "Table Name", - "description": "The name of a table in a dataset.", - "examples": null, - "is_list": false, - "is_optional": true, - "types": "str", - "location": "structuralMetadata.description" - }, - { - "required": true, - "title": "Column Name", - "description": "The name of a column in a table.", - "examples": null, - "is_list": false, - "is_optional": false, - "types": { - "title": "Name" - }, - "location": "structuralMetadata.elements.name" - }, - { - "required": true, - "title": "Data Type", - "description": "The data type of values in the column", - "examples": null, - "is_list": false, - "is_optional": false, - "types": "str", - "location": "structuralMetadata.elements.dataType" - }, - { - "required": false, - "title": "Column Description", - "description": "A description of a column in a table.", - "examples": null, - "is_list": false, - "is_optional": true, - "types": "str", - "location": "structuralMetadata.elements.description" - }, - { - "required": true, - "title": "Sensitive", - "description": "A True or False value, indicating if the field is sensitive or not", - "examples": null, - "is_list": false, - "is_optional": false, - "types": "bool", - "location": "structuralMetadata.elements.sensitive" - }, - { - "required": true, - "title": "Table Name", - "description": "The name of a table in a dataset.", - "examples": null, - "is_list": true, - "is_optional": false, - "types": "DataElement", - "location": "structuralMetadata.elements" - }, - { - "required": false, - "title": "Structural Metadata", - "description": "Structural metadata about tables, columns and values", - "examples": null, - "is_list": true, - "is_optional": true, - "types": "DataClass", - "location": "structuralMetadata" - }, { "required": false, "title": "Data Categories", @@ -1309,16 +1180,6 @@ }, "location": "tissuesSampleCollection.tissueSampleMetadata.AnatomicalSiteOntologyCode" }, - { - "required": false, - "title": "Tissue Sample Metadata", - "description": "Metadata related to the tissue sample", - "examples": null, - "is_list": false, - "is_optional": true, - "types": "TissueSampleMetadata", - "location": "tissuesSampleCollection.tissueSampleMetadata" - }, { "required": false, "title": "Collection Type", @@ -1342,16 +1203,6 @@ ] }, "location": "tissuesSampleCollection.collectionType" - }, - { - "required": false, - "title": "Tissues Sample Collection", - "description": "Metadata collection for Tissue Samples datasets", - "examples": null, - "is_list": true, - "is_optional": true, - "types": "TissuesSampleCollection", - "location": "tissuesSampleCollection" } ] } \ No newline at end of file diff --git a/docs/HDRUK/2.2.1.md b/docs/HDRUK/2.2.1.md index 051efec..84972de 100644 --- a/docs/HDRUK/2.2.1.md +++ b/docs/HDRUK/2.2.1.md @@ -175,9 +175,9 @@ Please provide a URL that describes the organisation. Organisation contact point(s) -| title | is_list | is_optional | required | type | -|:---------------------------|:----------|:--------------|:-----------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| Organisation Contact Point | False | True | True | ["EmailAddress[{'anyOf': [{'format': 'email', 'type': 'string'}, {'type': 'null'}]}]", 'typing.List[typing.Optional[hdr_schemata.definitions.HDRUK.EmailAddress.EmailAddress]]', 'null'] | +| title | is_list | is_optional | required | type | +|:---------------------------|:----------|:--------------|:-----------|:-------------------------------------------------------------------------------------------------------| +| Organisation Contact Point | False | True | True | ["EmailAddress[{'anyOf': [{'format': 'email', 'type': 'string'}, {'type': 'null'}]}]", 'List', 'null'] | @@ -210,9 +210,9 @@ Examples: Please provide a list of relevant and specific keywords that can improve the SEO of your dataset as a comma separated list. Notes: Onboarding portal will suggest keywords based on title, abstract and description. We are compiling a standardised list of keywords and synonyms across datasets to make filtering easier for users. -| title | is_list | is_optional | required | type | -|:---------|:----------|:--------------|:-----------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| Keywords | False | True | True | ["CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", 'typing.List[hdr_schemata.definitions.HDRUK.OneHundredFiftyCharacters.OneHundredFiftyCharacters]', 'null'] | +| title | is_list | is_optional | required | type | +|:---------|:----------|:--------------|:-----------|:------------------------------------------------------------------------------------------------------------------| +| Keywords | False | True | True | ["CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", 'List', 'null'] | Examples: @@ -223,9 +223,9 @@ Examples: Alternate dataset identifiers or local identifiers -| title | is_list | is_optional | required | type | -|:------------------------------|:----------|:--------------|:-----------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| Alternate dataset identifiers | False | True | False | ["CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", 'typing.List[typing.Optional[hdr_schemata.definitions.HDRUK.ShortDescription.ShortDescription]]', 'null'] | +| title | is_list | is_optional | required | type | +|:------------------------------|:----------|:--------------|:-----------|:------------------------------------------------------------------------------------------------------------------| +| Alternate dataset identifiers | False | True | False | ["CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", 'List', 'null'] | @@ -300,9 +300,9 @@ A free-text description of the dataset. Gateway Feature: Keywords and text may b Please provide any media associated with the Gateway Organisation using a valid URI for the content. This is an opportunity to provide additional context that could be useful for researchers wanting to understand more about the dataset and its relevance to their research question. The following formats will be accepted .jpg, .png or .svg, .pdf, .xslx or .docx. Note: media asset can be hosted by the organisation or uploaded using the onboarding portal. -| title | is_list | is_optional | required | type | -|:-----------------|:----------|:--------------|:-----------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| Associated Media | False | True | False | ["CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", 'typing.List[typing.Optional[hdr_schemata.definitions.HDRUK.Url.Url]]', 'null'] | +| title | is_list | is_optional | required | type | +|:-----------------|:----------|:--------------|:-----------|:------------------------------------------------------------------------------------------------------------------| +| Associated Media | False | True | False | ["CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", 'List', 'null'] | Examples: @@ -313,9 +313,9 @@ Examples: Please complete only if the dataset is part of a group or family -| title | is_list | is_optional | required | type | -|:--------|:----------|:--------------|:-----------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| Group | False | True | False | ["CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", 'typing.List[typing.Union[hdr_schemata.definitions.HDRUK.Url.Url, NoneType, hdr_schemata.definitions.HDRUK.OneHundredFiftyCharacters.OneHundredFiftyCharacters, hdr_schemata.definitions.HDRUK.IsPartOfEnum.IsPartOfEnum]]', 'null'] | +| title | is_list | is_optional | required | type | +|:--------|:----------|:--------------|:-----------|:------------------------------------------------------------------------------------------------------------------| +| Group | False | True | False | ["CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", 'List', 'null'] | Examples: @@ -335,9 +335,9 @@ Observational, Spatial and Temporal coverage The geographical area covered by the dataset. It is recommended that links are to entries in a well-maintained gazetteer such as https://www.geonames.org/ or https://what3words.com/daring.lion.race. -| title | is_list | is_optional | required | type | -|:--------------------|:----------|:--------------|:-----------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| Geographic Coverage | False | True | False | ["CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", 'typing.List[typing.Optional[hdr_schemata.definitions.HDRUK.Url.Url]]', 'null'] | +| title | is_list | is_optional | required | type | +|:--------------------|:----------|:--------------|:-----------|:------------------------------------------------------------------------------------------------------------------| +| Geographic Coverage | False | True | False | ["CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", 'List', 'null'] | Examples: @@ -348,9 +348,9 @@ Examples: Please indicate the age range in whole years of participants in the dataset. Please provide range in the following format '[min age] – [max age]' where both the minimum and maximum are whole numbers (integers). -| title | is_list | is_optional | required | type | -|:------------------|:----------|:--------------|:-----------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| Typical Age Range | False | True | False | ["AgeRange[{'anyOf': [{'pattern': 'Not Known|(150|1[0-4][0-9]|[0-9]|[1-8][0-9]|9[0-9])-(150|1[0-4][0-9]|[0-9]|[1-8][0-9]|9[0-9])', 'type': 'string'}, {'type': 'null'}]}]", 'null'] | +| title | is_list | is_optional | required | type | +|:----------|:----------|:--------------|:-----------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Age Range | False | True | False | ["AgeRange[{'anyOf': [{'pattern': 'Not Known|(150|1[0-4][0-9]|[0-9]|[1-8][0-9]|9[0-9])-(150|1[0-4][0-9]|[0-9]|[1-8][0-9]|9[0-9])', 'type': 'string'}, {'type': 'null'}]}]", 'null'] | Examples: @@ -593,9 +593,9 @@ This section includes information about how the data can be used and how it is c Please provide an indication of consent permissions for datasets and/or materials, and relates to the purposes for which datasets and/or material might be removed, stored or used. NOTE: we have extended the DUO to include a value for NO LINKAGE -| title | is_list | is_optional | required | type | -|:--------------------|:----------|:--------------|:-----------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| Data Use Limitation | False | True | False | ["CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", 'typing.List[hdr_schemata.definitions.HDRUK.DataUseLimitation.DataUseLimitation]', 'null'] | +| title | is_list | is_optional | required | type | +|:--------------------|:----------|:--------------|:-----------|:------------------------------------------------------------------------------------------------------------------| +| Data Use Limitation | False | True | False | ["CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", 'List', 'null'] | @@ -604,9 +604,9 @@ Please provide an indication of consent permissions for datasets and/or material Please indicate fit here are any additional conditions set for use if any, multiple requirements may be provided. Please ensure that these restrictions are documented in access rights information. -| title | is_list | is_optional | required | type | -|:----------------------|:----------|:--------------|:-----------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| Data Use Requirements | False | True | False | ["CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", 'typing.List[hdr_schemata.definitions.HDRUK.DataUseRequirements.DataUseRequirements]', 'null'] | +| title | is_list | is_optional | required | type | +|:----------------------|:----------|:--------------|:-----------|:------------------------------------------------------------------------------------------------------------------| +| Data Use Requirements | False | True | False | ["CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", 'List', 'null'] | @@ -615,9 +615,9 @@ Please indicate fit here are any additional conditions set for use if any, multi Please provide the text that you would like included as part of any citation that credits this dataset. This is typically just the name of the publisher. No employee details should be provided.' -| title | is_list | is_optional | required | type | -|:-----------------------|:----------|:--------------|:-----------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| Citation Requirements' | False | True | False | ["ShortDescription[{'anyOf': [{'maxLength': 1000, 'minLength': 2, 'type': 'string'}, {'type': 'null'}]}]", 'typing.List[typing.Optional[hdr_schemata.definitions.HDRUK.ShortDescription.ShortDescription]]', 'null'] | +| title | is_list | is_optional | required | type | +|:-----------------------|:----------|:--------------|:-----------|:---------------------------------------------------------------------------------------------------------------------------| +| Citation Requirements' | False | True | False | ["ShortDescription[{'anyOf': [{'maxLength': 1000, 'minLength': 2, 'type': 'string'}, {'type': 'null'}]}]", 'List', 'null'] | @@ -626,9 +626,9 @@ Please provide the text that you would like included as part of any citation tha None -| title | is_list | is_optional | required | type | -|:---------------|:----------|:--------------|:-----------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| Investigations | False | True | False | ["CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", 'typing.List[typing.Optional[hdr_schemata.definitions.HDRUK.Url.Url]]', 'null'] | +| title | is_list | is_optional | required | type | +|:---------------|:----------|:--------------|:-----------|:------------------------------------------------------------------------------------------------------------------| +| Investigations | False | True | False | ["CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", 'List', 'null'] | @@ -637,9 +637,9 @@ None Please provide the keystone paper associated with the dataset. Also include a list of known citations, if available and should be links to existing resources where the dataset has been used or referenced. Please provide multiple entries, or if you are using a csv upload please provide them as a tab separated list. -| title | is_list | is_optional | required | type | -|:----------|:----------|:--------------|:-----------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| Citations | False | True | False | ["Doi[{'anyOf': [{'pattern': '^10.\\\\d{4,9}/[-._;()/:a-zA-Z0-9]+$', 'type': 'string'}, {'type': 'null'}]}]", 'str', 'typing.List[typing.Optional[hdr_schemata.definitions.HDRUK.Doi.Doi]]', 'null'] | +| title | is_list | is_optional | required | type | +|:----------|:----------|:--------------|:-----------|:-------------------------------------------------------------------------------------------------------------------------------------| +| Citations | False | True | False | ["Doi[{'anyOf': [{'pattern': '^10.\\\\d{4,9}/[-._;()/:a-zA-Z0-9]+$', 'type': 'string'}, {'type': 'null'}]}]", 'str', 'List', 'null'] | @@ -681,9 +681,9 @@ Examples: Please provide link(s) to a webpage detailing the commercial model for processing data access requests for the organisation (if available) Definition: Indication of commercial model or cost (in GBP) for processing each data access request by the data custodian. -| title | is_list | is_optional | required | type | -|:---------------------------------|:----------|:--------------|:-----------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| Organisation Access Request Cost | False | True | False | ["LongDescription[{'anyOf': [{'maxLength': 50000, 'minLength': 2, 'type': 'string'}, {'type': 'null'}]}]", 'typing.List[typing.Optional[hdr_schemata.definitions.HDRUK.Url.Url]]', 'null'] | +| title | is_list | is_optional | required | type | +|:---------------------------------|:----------|:--------------|:-----------|:---------------------------------------------------------------------------------------------------------------------------| +| Organisation Access Request Cost | False | True | False | ["LongDescription[{'anyOf': [{'maxLength': 50000, 'minLength': 2, 'type': 'string'}, {'type': 'null'}]}]", 'List', 'null'] | @@ -703,9 +703,9 @@ Please provide an indication of the typical processing times based on the types Please use country code from ISO 3166-1 country codes and the associated ISO 3166-2 for regions, cities, states etc. for the country/state under whose laws the data subjects' data is collected, processed and stored. -| title | is_list | is_optional | required | type | -|:-------------|:----------|:--------------|:-----------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| Jurisdiction | False | True | True | ["CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", 'typing.List[hdr_schemata.definitions.HDRUK.Isocountrycode.Isocountrycode]', 'null'] | +| title | is_list | is_optional | required | type | +|:-------------|:----------|:--------------|:-----------|:------------------------------------------------------------------------------------------------------------------| +| Jurisdiction | False | True | True | ["CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", 'List', 'null'] | @@ -758,9 +758,9 @@ Section includes technical attributes for language vocabularies, sizes etc. and List any relevant terminologies / ontologies / controlled vocabularies, such as ICD 10 Codes, NHS Data Dictionary National Codes or SNOMED CT International, that are being used by the dataset. If the controlled vocabularies are local standards, please make that explicit. If you are using a standard that has not been included in the list, please use “other” and contact support desk to ask for an addition. Notes: More than one vocabulary may be provided. -| title | is_list | is_optional | required | type | -|:----------------------|:----------|:--------------|:-----------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| Controlled Vocabulary | False | True | True | ["CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", 'typing.List[hdr_schemata.definitions.HDRUK.ControlledVocabulary.ControlledVocabulary]', 'null'] | +| title | is_list | is_optional | required | type | +|:----------------------|:----------|:--------------|:-----------|:------------------------------------------------------------------------------------------------------------------| +| Controlled Vocabulary | False | True | True | ["CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", 'List', 'null'] | @@ -780,9 +780,9 @@ List standardised data models that the dataset has been stored in or transformed This should list all the languages in which the dataset metadata and underlying data is made available. -| title | is_list | is_optional | required | type | -|:---------|:----------|:--------------|:-----------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| Language | False | True | True | ["CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", 'typing.List[hdr_schemata.definitions.HDRUK.Language.Language]', 'null'] | +| title | is_list | is_optional | required | type | +|:---------|:----------|:--------------|:-----------|:------------------------------------------------------------------------------------------------------------------| +| Language | False | True | True | ["CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", 'List', 'null'] | @@ -791,9 +791,9 @@ This should list all the languages in which the dataset metadata and underlying If multiple formats are available please specify. See application, audio, image, message, model, multipart, text, video, https://www.iana.org/assignments/media-types/media-types.xhtml Note: If your file format is not included in the current list of formats, please indicate other. If you are using the HOP you will be directed to a service desk page where you can request your additional format. If not please go to: https://metadata.atlassian.net/servicedesk/customer/portal/4 to request your format. -| title | is_list | is_optional | required | type | -|:--------|:----------|:--------------|:-----------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| Format | False | True | True | ["CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", 'typing.List[hdr_schemata.definitions.HDRUK.Format.Format]', 'null'] | +| title | is_list | is_optional | required | type | +|:--------|:----------|:--------------|:-----------|:------------------------------------------------------------------------------------------------------------------| +| Format | False | True | True | ["CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", 'List', 'null'] | @@ -811,9 +811,9 @@ This section includes information about related datasets that may have previousl If applicable, please provide the DOI of other datasets that have previously been linked to this dataset and their availability. If no DOI is available, please provide the title of the datasets that can be linked, where possible using the same title of a dataset previously onboarded to the HOP. Note: If all the datasets from Gateway organisation can be linked please indicate “ALL” and the onboarding portal will automate linkage across the datasets submitted. -| title | is_list | is_optional | required | type | -|:----------------|:----------|:--------------|:-----------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| Linked Datasets | False | True | False | ["CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", 'typing.List[typing.Union[hdr_schemata.definitions.HDRUK.Url.Url, NoneType, hdr_schemata.definitions.HDRUK.OneHundredFiftyCharacters.OneHundredFiftyCharacters]]', 'null'] | +| title | is_list | is_optional | required | type | +|:----------------|:----------|:--------------|:-----------|:------------------------------------------------------------------------------------------------------------------| +| Linked Datasets | False | True | False | ["CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", 'List', 'null'] | @@ -822,9 +822,9 @@ If applicable, please provide the DOI of other datasets that have previously bee Indicate if derived datasets or predefined extracts are available and the type of derivation available. Notes. Single or multiple dimensions can be provided as a derived extract alongside the dataset. -| title | is_list | is_optional | required | type | -|:------------|:----------|:--------------|:-----------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| Derivations | False | True | False | ["CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", 'typing.List[typing.Optional[hdr_schemata.definitions.HDRUK.AbstractText.AbstractText]]', 'null'] | +| title | is_list | is_optional | required | type | +|:------------|:----------|:--------------|:-----------|:------------------------------------------------------------------------------------------------------------------| +| Derivations | False | True | False | ["CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", 'List', 'null'] | @@ -833,9 +833,9 @@ Indicate if derived datasets or predefined extracts are available and the type o Please provide the URL of any analysis tools or models that have been created for this dataset and are available for further use. Multiple tools may be provided. Note: We encourage users to adopt a model along the lines of https://www.ga4gh.org/news/tool-registry-service-api-enabling-an-interoperable-library-of-genomics-analysis-tools/ -| title | is_list | is_optional | required | type | -|:--------|:----------|:--------------|:-----------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| Tools | False | True | False | ["CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", 'typing.List[typing.Optional[hdr_schemata.definitions.HDRUK.Url.Url]]', 'null'] | +| title | is_list | is_optional | required | type | +|:--------|:----------|:--------------|:-----------|:------------------------------------------------------------------------------------------------------------------| +| Tools | False | True | False | ["CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", 'List', 'null'] | @@ -916,9 +916,9 @@ Please provide the date that the observation was made. Some datasets may be cont Initially this will be defaulted to "COUNT" -| title | is_list | is_optional | required | type | -|:------------------|:----------|:--------------|:-----------|:-------------------------| -| Measured Property | False | False | True | ['MeasuredProperty[{}]'] | +| title | is_list | is_optional | required | type | +|:------------------|:----------|:--------------|:-----------|:---------------------------------------------------------------------------| +| Measured Property | False | False | True | ["MeasuredProperty[{'maxLength': 100, 'minLength': 1, 'type': 'string'}]"] | diff --git a/docs/HDRUK/2.2.1.structure.json b/docs/HDRUK/2.2.1.structure.json index 739bdb7..e4377fe 100644 --- a/docs/HDRUK/2.2.1.structure.json +++ b/docs/HDRUK/2.2.1.structure.json @@ -219,7 +219,7 @@ "examples": null, "type": [ "EmailAddress[{'anyOf': [{'format': 'email', 'type': 'string'}, {'type': 'null'}]}]", - "typing.List[typing.Optional[hdr_schemata.definitions.HDRUK.EmailAddress.EmailAddress]]", + "List", "null" ], "is_list": false, @@ -267,7 +267,7 @@ ], "type": [ "CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", - "typing.List[hdr_schemata.definitions.HDRUK.OneHundredFiftyCharacters.OneHundredFiftyCharacters]", + "List", "null" ], "is_list": false, @@ -282,7 +282,7 @@ "examples": null, "type": [ "CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", - "typing.List[typing.Optional[hdr_schemata.definitions.HDRUK.ShortDescription.ShortDescription]]", + "List", "null" ], "is_list": false, @@ -385,7 +385,7 @@ ], "type": [ "CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", - "typing.List[typing.Optional[hdr_schemata.definitions.HDRUK.Url.Url]]", + "List", "null" ], "is_list": false, @@ -402,7 +402,7 @@ ], "type": [ "CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", - "typing.List[typing.Union[hdr_schemata.definitions.HDRUK.Url.Url, NoneType, hdr_schemata.definitions.HDRUK.OneHundredFiftyCharacters.OneHundredFiftyCharacters, hdr_schemata.definitions.HDRUK.IsPartOfEnum.IsPartOfEnum]]", + "List", "null" ], "is_list": false, @@ -434,7 +434,7 @@ ], "type": [ "CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", - "typing.List[typing.Optional[hdr_schemata.definitions.HDRUK.Url.Url]]", + "List", "null" ], "is_list": false, @@ -444,7 +444,7 @@ { "name": "typicalAgeRange", "required": false, - "title": "Typical Age Range", + "title": "Age Range", "description": "Please indicate the age range in whole years of participants in the dataset. Please provide range in the following format '[min age] \u2013 [max age]' where both the minimum and maximum are whole numbers (integers).", "examples": [ "18-90" @@ -751,7 +751,7 @@ "examples": null, "type": [ "CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", - "typing.List[hdr_schemata.definitions.HDRUK.DataUseLimitation.DataUseLimitation]", + "List", "null" ], "is_list": false, @@ -766,7 +766,7 @@ "examples": null, "type": [ "CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", - "typing.List[hdr_schemata.definitions.HDRUK.DataUseRequirements.DataUseRequirements]", + "List", "null" ], "is_list": false, @@ -781,7 +781,7 @@ "examples": null, "type": [ "ShortDescription[{'anyOf': [{'maxLength': 1000, 'minLength': 2, 'type': 'string'}, {'type': 'null'}]}]", - "typing.List[typing.Optional[hdr_schemata.definitions.HDRUK.ShortDescription.ShortDescription]]", + "List", "null" ], "is_list": false, @@ -796,7 +796,7 @@ "examples": null, "type": [ "CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", - "typing.List[typing.Optional[hdr_schemata.definitions.HDRUK.Url.Url]]", + "List", "null" ], "is_list": false, @@ -812,7 +812,7 @@ "type": [ "Doi[{'anyOf': [{'pattern': '^10.\\\\d{4,9}/[-._;()/:a-zA-Z0-9]+$', 'type': 'string'}, {'type': 'null'}]}]", "str", - "typing.List[typing.Optional[hdr_schemata.definitions.HDRUK.Doi.Doi]]", + "List", "null" ], "is_list": false, @@ -871,7 +871,7 @@ "examples": null, "type": [ "LongDescription[{'anyOf': [{'maxLength': 50000, 'minLength': 2, 'type': 'string'}, {'type': 'null'}]}]", - "typing.List[typing.Optional[hdr_schemata.definitions.HDRUK.Url.Url]]", + "List", "null" ], "is_list": false, @@ -899,7 +899,7 @@ "examples": null, "type": [ "CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", - "typing.List[hdr_schemata.definitions.HDRUK.Isocountrycode.Isocountrycode]", + "List", "null" ], "is_list": false, @@ -971,7 +971,7 @@ "examples": null, "type": [ "CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", - "typing.List[hdr_schemata.definitions.HDRUK.ControlledVocabulary.ControlledVocabulary]", + "List", "null" ], "is_list": false, @@ -999,7 +999,7 @@ "examples": null, "type": [ "CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", - "typing.List[hdr_schemata.definitions.HDRUK.Language.Language]", + "List", "null" ], "is_list": false, @@ -1014,7 +1014,7 @@ "examples": null, "type": [ "CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", - "typing.List[hdr_schemata.definitions.HDRUK.Format.Format]", + "List", "null" ], "is_list": false, @@ -1046,7 +1046,7 @@ "examples": null, "type": [ "CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", - "typing.List[typing.Union[hdr_schemata.definitions.HDRUK.Url.Url, NoneType, hdr_schemata.definitions.HDRUK.OneHundredFiftyCharacters.OneHundredFiftyCharacters]]", + "List", "null" ], "is_list": false, @@ -1061,7 +1061,7 @@ "examples": null, "type": [ "CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", - "typing.List[typing.Optional[hdr_schemata.definitions.HDRUK.AbstractText.AbstractText]]", + "List", "null" ], "is_list": false, @@ -1076,7 +1076,7 @@ "examples": null, "type": [ "CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]", - "typing.List[typing.Optional[hdr_schemata.definitions.HDRUK.Url.Url]]", + "List", "null" ], "is_list": false, @@ -1170,7 +1170,7 @@ "description": "Initially this will be defaulted to \"COUNT\"", "examples": null, "type": [ - "MeasuredProperty[{}]" + "MeasuredProperty[{'maxLength': 100, 'minLength': 1, 'type': 'string'}]" ], "is_list": false, "is_optional": false, diff --git a/hdr_schemata/definitions/HDRUK/MeasuredProperty.py b/hdr_schemata/definitions/HDRUK/MeasuredProperty.py index 999bee9..181971e 100644 --- a/hdr_schemata/definitions/HDRUK/MeasuredProperty.py +++ b/hdr_schemata/definitions/HDRUK/MeasuredProperty.py @@ -1,6 +1,6 @@ -from pydantic import RootModel +from pydantic import RootModel, constr class MeasuredProperty(RootModel): - pass + root: constr(min_length=1, max_length=100) diff --git a/hdr_schemata/utils/create_markdown.py b/hdr_schemata/utils/create_markdown.py index a80cc84..d7f68f7 100644 --- a/hdr_schemata/utils/create_markdown.py +++ b/hdr_schemata/utils/create_markdown.py @@ -142,6 +142,9 @@ def form_structure(data, form, parent=None): if subItems: form_structure(subItems, form, parent=k) + if "structuralMetadata" in k: + continue + types = item.pop("types") infos = [] for t in types: @@ -157,6 +160,8 @@ def form_structure(data, form, parent=None): info = {**title, **t_sch["anyOf"][0]} else: info = t_sch + elif issubclass(t, BaseModel): + continue else: info = t.__name__ except: @@ -170,10 +175,12 @@ def form_structure(data, form, parent=None): _ = item.pop("type") if isinstance(infos, list): - # Skip fields where the type is a pydantic type we have defined e.g. "Organisation" - # because we drill down into the subtypes instead - if isinstance(infos[0], str) and infos[0].lower() == k.split(".")[-1]: + if len(infos) == 0: continue + # # Skip fields where the type is a pydantic type we have defined e.g. "Organisation" + # # because we drill down into the subtypes instead + # elif isinstance(infos[0], str) and infos[0].lower() == k.split(".")[-1]: + # continue else: item["types"] = infos[0] else: @@ -221,15 +228,15 @@ def remove_types(data): from hdr_schemata.models.GWDM.v1_2 import Gwdm12 -# create_markdown(Hdruk220, "./docs/HDRUK/", "2.2.0") +reate_markdown(Hdruk220, "./docs/HDRUK/", "2.2.0") create_markdown(Hdruk221, "./docs/HDRUK/", "2.2.1") -# create_markdown(Hdruk212, "./docs/HDRUK/", "2.1.2") -# create_markdown(Hdruk213, "./docs/HDRUK/", "2.1.3") +create_markdown(Hdruk212, "./docs/HDRUK/", "2.1.2") +create_markdown(Hdruk213, "./docs/HDRUK/", "2.1.3") from hdr_schemata.models.GWDM.v1_1 import Gwdm10 from hdr_schemata.models.GWDM.v1_1 import Gwdm11 from hdr_schemata.models.GWDM.v1_2 import Gwdm12 -# create_markdown(Gwdm10, "./docs/GWDM/", "1.0") -# create_markdown(Gwdm11, "./docs/GWDM/", "1.1") -# create_markdown(Gwdm12, "./docs/GWDM/", "1.2") +create_markdown(Gwdm10, "./docs/GWDM/", "1.0") +create_markdown(Gwdm11, "./docs/GWDM/", "1.1") +create_markdown(Gwdm12, "./docs/GWDM/", "1.2") From 0f29025b9836b9b700300aa89de766776a7345d3 Mon Sep 17 00:00:00 2001 From: Branwen Snelling Date: Wed, 15 May 2024 15:55:37 +0100 Subject: [PATCH 3/7] correct typos --- hdr_schemata/utils/create_markdown.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/hdr_schemata/utils/create_markdown.py b/hdr_schemata/utils/create_markdown.py index d7f68f7..a0c9ebe 100644 --- a/hdr_schemata/utils/create_markdown.py +++ b/hdr_schemata/utils/create_markdown.py @@ -175,12 +175,10 @@ def form_structure(data, form, parent=None): _ = item.pop("type") if isinstance(infos, list): + # Skip fields where the type is a pydantic type we have defined e.g. "Organisation" + # because we drill down into the subtypes instead if len(infos) == 0: continue - # # Skip fields where the type is a pydantic type we have defined e.g. "Organisation" - # # because we drill down into the subtypes instead - # elif isinstance(infos[0], str) and infos[0].lower() == k.split(".")[-1]: - # continue else: item["types"] = infos[0] else: @@ -228,7 +226,7 @@ def remove_types(data): from hdr_schemata.models.GWDM.v1_2 import Gwdm12 -reate_markdown(Hdruk220, "./docs/HDRUK/", "2.2.0") +create_markdown(Hdruk220, "./docs/HDRUK/", "2.2.0") create_markdown(Hdruk221, "./docs/HDRUK/", "2.2.1") create_markdown(Hdruk212, "./docs/HDRUK/", "2.1.2") create_markdown(Hdruk213, "./docs/HDRUK/", "2.1.3") From 450c3a80844de2305c185993fc8ce7355d9052af Mon Sep 17 00:00:00 2001 From: Branwen Snelling Date: Thu, 16 May 2024 10:29:13 +0100 Subject: [PATCH 4/7] update schemas to fix tests --- hdr_schemata/models/GWDM/1.0/schema.json | 5 ++++- hdr_schemata/models/GWDM/1.1/schema.json | 5 ++++- hdr_schemata/models/GWDM/1.2/schema.json | 5 ++++- hdr_schemata/models/HDRUK/2.1.2/schema.json | 11 ++++++++++- hdr_schemata/models/HDRUK/2.1.3/schema.json | 11 ++++++++++- hdr_schemata/models/HDRUK/2.2.0/schema.json | 11 ++++++++++- hdr_schemata/models/HDRUK/2.2.1/schema.json | 11 ++++++++++- .../models/HDRUK/v2_1_2/annotations/config.yaml | 12 ++++++++++++ 8 files changed, 64 insertions(+), 7 deletions(-) diff --git a/hdr_schemata/models/GWDM/1.0/schema.json b/hdr_schemata/models/GWDM/1.0/schema.json index 8d8bf4a..7276222 100644 --- a/hdr_schemata/models/GWDM/1.0/schema.json +++ b/hdr_schemata/models/GWDM/1.0/schema.json @@ -744,7 +744,10 @@ "title": "LongDescription" }, "MeasuredProperty": { - "title": "MeasuredProperty" + "maxLength": 100, + "minLength": 1, + "title": "MeasuredProperty", + "type": "string" }, "Name": { "title": "Name" diff --git a/hdr_schemata/models/GWDM/1.1/schema.json b/hdr_schemata/models/GWDM/1.1/schema.json index 30bd7b1..3780ef7 100644 --- a/hdr_schemata/models/GWDM/1.1/schema.json +++ b/hdr_schemata/models/GWDM/1.1/schema.json @@ -820,7 +820,10 @@ "title": "LongDescription" }, "MeasuredProperty": { - "title": "MeasuredProperty" + "maxLength": 100, + "minLength": 1, + "title": "MeasuredProperty", + "type": "string" }, "Name": { "title": "Name" diff --git a/hdr_schemata/models/GWDM/1.2/schema.json b/hdr_schemata/models/GWDM/1.2/schema.json index 06d3303..cf7afe9 100644 --- a/hdr_schemata/models/GWDM/1.2/schema.json +++ b/hdr_schemata/models/GWDM/1.2/schema.json @@ -849,7 +849,10 @@ "title": "LongDescription" }, "MeasuredProperty": { - "title": "MeasuredProperty" + "maxLength": 100, + "minLength": 1, + "title": "MeasuredProperty", + "type": "string" }, "Name": { "title": "Name" diff --git a/hdr_schemata/models/HDRUK/2.1.2/schema.json b/hdr_schemata/models/HDRUK/2.1.2/schema.json index 0d58128..8239cd5 100644 --- a/hdr_schemata/models/HDRUK/2.1.2/schema.json +++ b/hdr_schemata/models/HDRUK/2.1.2/schema.json @@ -302,6 +302,9 @@ ], "default": null, "description": "Please indicate the age range in whole years of participants in the dataset. Please provide range in the following format '[min age] \u2013 [max age]' where both the minimum and maximum are whole numbers (integers).", + "examples": [ + "18-90" + ], "title": "Age Range" }, "physicalSampleAvailability": { @@ -771,6 +774,9 @@ } ], "description": "List standardised data models that the dataset has been stored in or transformed to, such as OMOP or FHIR. If the data is only available in a local format, please make that explicit. If you are using a standard that has not been included in the list, please use \u201cother\u201d and contact support desk to ask for an addition.", + "examples": [ + "LOCAL,NHS DATA DICTIONARY" + ], "title": "Conforms To" }, "language": { @@ -1044,7 +1050,10 @@ "title": "LongDescription" }, "MeasuredProperty": { - "title": "MeasuredProperty" + "maxLength": 100, + "minLength": 1, + "title": "MeasuredProperty", + "type": "string" }, "MemberOf": { "enum": [ diff --git a/hdr_schemata/models/HDRUK/2.1.3/schema.json b/hdr_schemata/models/HDRUK/2.1.3/schema.json index 9160778..66a87d5 100644 --- a/hdr_schemata/models/HDRUK/2.1.3/schema.json +++ b/hdr_schemata/models/HDRUK/2.1.3/schema.json @@ -302,6 +302,9 @@ ], "default": null, "description": "Please indicate the age range in whole years of participants in the dataset. Please provide range in the following format '[min age] \u2013 [max age]' where both the minimum and maximum are whole numbers (integers).", + "examples": [ + "18-90" + ], "title": "Age Range" }, "physicalSampleAvailability": { @@ -771,6 +774,9 @@ } ], "description": "List standardised data models that the dataset has been stored in or transformed to, such as OMOP or FHIR. If the data is only available in a local format, please make that explicit. If you are using a standard that has not been included in the list, please use \u201cother\u201d and contact support desk to ask for an addition.", + "examples": [ + "LOCAL,NHS DATA DICTIONARY" + ], "title": "Conforms To" }, "language": { @@ -1044,7 +1050,10 @@ "title": "LongDescription" }, "MeasuredProperty": { - "title": "MeasuredProperty" + "maxLength": 100, + "minLength": 1, + "title": "MeasuredProperty", + "type": "string" }, "MemberOf": { "enum": [ diff --git a/hdr_schemata/models/HDRUK/2.2.0/schema.json b/hdr_schemata/models/HDRUK/2.2.0/schema.json index 6ed3bba..59bb1b5 100644 --- a/hdr_schemata/models/HDRUK/2.2.0/schema.json +++ b/hdr_schemata/models/HDRUK/2.2.0/schema.json @@ -323,6 +323,9 @@ ], "default": null, "description": "Please indicate the age range in whole years of participants in the dataset. Please provide range in the following format '[min age] \u2013 [max age]' where both the minimum and maximum are whole numbers (integers).", + "examples": [ + "18-90" + ], "title": "Age Range" }, "followup": { @@ -897,6 +900,9 @@ } ], "description": "List standardised data models that the dataset has been stored in or transformed to, such as OMOP or FHIR. If the data is only available in a local format, please make that explicit. If you are using a standard that has not been included in the list, please use \u201cother\u201d and contact support desk to ask for an addition.", + "examples": [ + "LOCAL,NHS DATA DICTIONARY" + ], "title": "Conforms To" }, "language": { @@ -1220,7 +1226,10 @@ "type": "string" }, "MeasuredProperty": { - "title": "MeasuredProperty" + "maxLength": 100, + "minLength": 1, + "title": "MeasuredProperty", + "type": "string" }, "MemberOf": { "enum": [ diff --git a/hdr_schemata/models/HDRUK/2.2.1/schema.json b/hdr_schemata/models/HDRUK/2.2.1/schema.json index be4ba6f..0e59d07 100644 --- a/hdr_schemata/models/HDRUK/2.2.1/schema.json +++ b/hdr_schemata/models/HDRUK/2.2.1/schema.json @@ -353,6 +353,9 @@ ], "default": null, "description": "Please indicate the age range in whole years of participants in the dataset. Please provide range in the following format '[min age] \u2013 [max age]' where both the minimum and maximum are whole numbers (integers).", + "examples": [ + "18-90" + ], "title": "Age Range" }, "followup": { @@ -940,6 +943,9 @@ } ], "description": "List standardised data models that the dataset has been stored in or transformed to, such as OMOP or FHIR. If the data is only available in a local format, please make that explicit. If you are using a standard that has not been included in the list, please use \u201cother\u201d and contact support desk to ask for an addition.", + "examples": [ + "LOCAL,NHS DATA DICTIONARY" + ], "title": "Conforms To" }, "language": { @@ -1263,7 +1269,10 @@ "type": "string" }, "MeasuredProperty": { - "title": "MeasuredProperty" + "maxLength": 100, + "minLength": 1, + "title": "MeasuredProperty", + "type": "string" }, "MemberOf": { "enum": [ diff --git a/hdr_schemata/models/HDRUK/v2_1_2/annotations/config.yaml b/hdr_schemata/models/HDRUK/v2_1_2/annotations/config.yaml index 2934603..8e274d1 100644 --- a/hdr_schemata/models/HDRUK/v2_1_2/annotations/config.yaml +++ b/hdr_schemata/models/HDRUK/v2_1_2/annotations/config.yaml @@ -79,3 +79,15 @@ coverage: typicalAgeRange: examples: - 18-90 + +accessibility: + formatAndStandards: + conformsTo: + description: List standardised data models that the dataset has been stored in or transformed to, such as OMOP or FHIR. If the data is only available in a local format, please make that explicit. If you are using a standard that has not been included in the list, please use “other” and contact support desk to ask for an addition. + examples: + - "LOCAL,NHS DATA DICTIONARY" + title: Conforms To + +structuralMetadata: + title: Structural Metadata + description: Structural metadata about tables, columns and values From 4fa1ceb432c65a2ba25f94ff6f9524b793e8d8ce Mon Sep 17 00:00:00 2001 From: Branwen Snelling Date: Thu, 16 May 2024 11:15:28 +0100 Subject: [PATCH 5/7] use updated measured property for hdruk221 only --- hdr_schemata/definitions/HDRUK/MeasuredProperty.py | 5 ++--- hdr_schemata/models/GWDM/1.0/schema.json | 5 +---- hdr_schemata/models/GWDM/1.1/schema.json | 5 +---- hdr_schemata/models/GWDM/1.2/schema.json | 5 +---- hdr_schemata/models/HDRUK/2.1.2/schema.json | 5 +---- hdr_schemata/models/HDRUK/2.1.3/schema.json | 5 +---- hdr_schemata/models/HDRUK/2.2.0/schema.json | 5 +---- hdr_schemata/models/HDRUK/v2_2_1/MeasuredProperty.py | 5 +++++ hdr_schemata/models/HDRUK/v2_2_1/Observations.py | 10 ++++++++++ hdr_schemata/models/HDRUK/v2_2_1/__init__.py | 5 +++++ 10 files changed, 28 insertions(+), 27 deletions(-) create mode 100644 hdr_schemata/models/HDRUK/v2_2_1/MeasuredProperty.py create mode 100644 hdr_schemata/models/HDRUK/v2_2_1/Observations.py diff --git a/hdr_schemata/definitions/HDRUK/MeasuredProperty.py b/hdr_schemata/definitions/HDRUK/MeasuredProperty.py index 181971e..c530cc2 100644 --- a/hdr_schemata/definitions/HDRUK/MeasuredProperty.py +++ b/hdr_schemata/definitions/HDRUK/MeasuredProperty.py @@ -1,6 +1,5 @@ -from pydantic import RootModel, constr +from pydantic import RootModel class MeasuredProperty(RootModel): - root: constr(min_length=1, max_length=100) - + pass diff --git a/hdr_schemata/models/GWDM/1.0/schema.json b/hdr_schemata/models/GWDM/1.0/schema.json index 7276222..8d8bf4a 100644 --- a/hdr_schemata/models/GWDM/1.0/schema.json +++ b/hdr_schemata/models/GWDM/1.0/schema.json @@ -744,10 +744,7 @@ "title": "LongDescription" }, "MeasuredProperty": { - "maxLength": 100, - "minLength": 1, - "title": "MeasuredProperty", - "type": "string" + "title": "MeasuredProperty" }, "Name": { "title": "Name" diff --git a/hdr_schemata/models/GWDM/1.1/schema.json b/hdr_schemata/models/GWDM/1.1/schema.json index 3780ef7..30bd7b1 100644 --- a/hdr_schemata/models/GWDM/1.1/schema.json +++ b/hdr_schemata/models/GWDM/1.1/schema.json @@ -820,10 +820,7 @@ "title": "LongDescription" }, "MeasuredProperty": { - "maxLength": 100, - "minLength": 1, - "title": "MeasuredProperty", - "type": "string" + "title": "MeasuredProperty" }, "Name": { "title": "Name" diff --git a/hdr_schemata/models/GWDM/1.2/schema.json b/hdr_schemata/models/GWDM/1.2/schema.json index cf7afe9..06d3303 100644 --- a/hdr_schemata/models/GWDM/1.2/schema.json +++ b/hdr_schemata/models/GWDM/1.2/schema.json @@ -849,10 +849,7 @@ "title": "LongDescription" }, "MeasuredProperty": { - "maxLength": 100, - "minLength": 1, - "title": "MeasuredProperty", - "type": "string" + "title": "MeasuredProperty" }, "Name": { "title": "Name" diff --git a/hdr_schemata/models/HDRUK/2.1.2/schema.json b/hdr_schemata/models/HDRUK/2.1.2/schema.json index 8239cd5..1d8f44c 100644 --- a/hdr_schemata/models/HDRUK/2.1.2/schema.json +++ b/hdr_schemata/models/HDRUK/2.1.2/schema.json @@ -1050,10 +1050,7 @@ "title": "LongDescription" }, "MeasuredProperty": { - "maxLength": 100, - "minLength": 1, - "title": "MeasuredProperty", - "type": "string" + "title": "MeasuredProperty" }, "MemberOf": { "enum": [ diff --git a/hdr_schemata/models/HDRUK/2.1.3/schema.json b/hdr_schemata/models/HDRUK/2.1.3/schema.json index 66a87d5..2100a4f 100644 --- a/hdr_schemata/models/HDRUK/2.1.3/schema.json +++ b/hdr_schemata/models/HDRUK/2.1.3/schema.json @@ -1050,10 +1050,7 @@ "title": "LongDescription" }, "MeasuredProperty": { - "maxLength": 100, - "minLength": 1, - "title": "MeasuredProperty", - "type": "string" + "title": "MeasuredProperty" }, "MemberOf": { "enum": [ diff --git a/hdr_schemata/models/HDRUK/2.2.0/schema.json b/hdr_schemata/models/HDRUK/2.2.0/schema.json index 59bb1b5..25ca632 100644 --- a/hdr_schemata/models/HDRUK/2.2.0/schema.json +++ b/hdr_schemata/models/HDRUK/2.2.0/schema.json @@ -1226,10 +1226,7 @@ "type": "string" }, "MeasuredProperty": { - "maxLength": 100, - "minLength": 1, - "title": "MeasuredProperty", - "type": "string" + "title": "MeasuredProperty" }, "MemberOf": { "enum": [ diff --git a/hdr_schemata/models/HDRUK/v2_2_1/MeasuredProperty.py b/hdr_schemata/models/HDRUK/v2_2_1/MeasuredProperty.py new file mode 100644 index 0000000..425d794 --- /dev/null +++ b/hdr_schemata/models/HDRUK/v2_2_1/MeasuredProperty.py @@ -0,0 +1,5 @@ +from pydantic import RootModel, constr + +class MeasuredProperty(RootModel): + root: constr(min_length=1, max_length=100) + diff --git a/hdr_schemata/models/HDRUK/v2_2_1/Observations.py b/hdr_schemata/models/HDRUK/v2_2_1/Observations.py new file mode 100644 index 0000000..87a9e2d --- /dev/null +++ b/hdr_schemata/models/HDRUK/v2_2_1/Observations.py @@ -0,0 +1,10 @@ +from hdr_schemata.models.HDRUK.v2_2_0 import Observation as BaseObservation +from pydantic import Field +from .MeasuredProperty import MeasuredProperty + +from .annotations import annotations + +an = annotations.observations + +class Observation(BaseObservation): + measuredProperty: MeasuredProperty = Field(..., **an.measuredProperty.__dict__) diff --git a/hdr_schemata/models/HDRUK/v2_2_1/__init__.py b/hdr_schemata/models/HDRUK/v2_2_1/__init__.py index c0425bb..a5b4a58 100644 --- a/hdr_schemata/models/HDRUK/v2_2_1/__init__.py +++ b/hdr_schemata/models/HDRUK/v2_2_1/__init__.py @@ -6,6 +6,7 @@ from .EnrichmentAndLinkage import EnrichmentAndLinkage from .Accessibility import Accessibility from .Provenance import Provenance +from .Observations import Observation from .annotations import annotations as an @@ -28,6 +29,10 @@ class Hdruk221(Hdruk220): None, description=an.provenance.description, title=an.provenance.title ) + observations: List[Observation] = Field( + ..., description=an.observations.description, title=an.observations.title + ) + @classmethod def save_schema(cls, location="./2.2.1/schema.json"): with open(location, "w") as f: From 9d94e755f9653bf243d0a6cc8b020b9cc0b6029c Mon Sep 17 00:00:00 2001 From: Branwen Snelling Date: Thu, 16 May 2024 11:19:55 +0100 Subject: [PATCH 6/7] run mk docs for hdr221 --- docs/HDRUK/2.2.1.form.json | 4 +++- docs/HDRUK/2.2.1.md | 2 ++ docs/HDRUK/2.2.1.structure.json | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/HDRUK/2.2.1.form.json b/docs/HDRUK/2.2.1.form.json index f4b7093..4a385f6 100644 --- a/docs/HDRUK/2.2.1.form.json +++ b/docs/HDRUK/2.2.1.form.json @@ -944,7 +944,9 @@ "required": true, "title": "Conforms To", "description": "List standardised data models that the dataset has been stored in or transformed to, such as OMOP or FHIR. If the data is only available in a local format, please make that explicit. If you are using a standard that has not been included in the list, please use \u201cother\u201d and contact support desk to ask for an addition.", - "examples": null, + "examples": [ + "LOCAL,NHS DATA DICTIONARY" + ], "is_list": true, "is_optional": true, "types": { diff --git a/docs/HDRUK/2.2.1.md b/docs/HDRUK/2.2.1.md index 84972de..78a55a5 100644 --- a/docs/HDRUK/2.2.1.md +++ b/docs/HDRUK/2.2.1.md @@ -773,7 +773,9 @@ List standardised data models that the dataset has been stored in or transformed |:------------|:----------|:--------------|:-----------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | Conforms To | True | True | True | ["StandardisedDataModels[{'$defs': {'StandardisedDataModelsEnum': {'enum': ['HL7 FHIR', 'HL7 V2', 'HL7 CDA', 'HL7 CCOW', 'LOINC', 'DICOM', 'I2B2', 'IHE', 'OMOP', 'OPENEHR', 'SENTINEL', 'PCORNET', 'CDISC', 'NHS DATA DICTIONARY', 'NHS SCOTLAND DATA DICTIONARY', 'NHS WALES DATA DICTIONARY', 'LOCAL', 'OTHER'], 'title': 'StandardisedDataModelsEnum', 'type': 'string'}}, 'anyOf': [{'$ref': '#/$defs/StandardisedDataModelsEnum'}, {'type': 'null'}], 'default': null}]"] | +Examples: + * LOCAL,NHS DATA DICTIONARY #### language diff --git a/docs/HDRUK/2.2.1.structure.json b/docs/HDRUK/2.2.1.structure.json index e4377fe..1dae9b4 100644 --- a/docs/HDRUK/2.2.1.structure.json +++ b/docs/HDRUK/2.2.1.structure.json @@ -983,7 +983,9 @@ "required": true, "title": "Conforms To", "description": "List standardised data models that the dataset has been stored in or transformed to, such as OMOP or FHIR. If the data is only available in a local format, please make that explicit. If you are using a standard that has not been included in the list, please use \u201cother\u201d and contact support desk to ask for an addition.", - "examples": null, + "examples": [ + "LOCAL,NHS DATA DICTIONARY" + ], "type": [ "StandardisedDataModels[{'$defs': {'StandardisedDataModelsEnum': {'enum': ['HL7 FHIR', 'HL7 V2', 'HL7 CDA', 'HL7 CCOW', 'LOINC', 'DICOM', 'I2B2', 'IHE', 'OMOP', 'OPENEHR', 'SENTINEL', 'PCORNET', 'CDISC', 'NHS DATA DICTIONARY', 'NHS SCOTLAND DATA DICTIONARY', 'NHS WALES DATA DICTIONARY', 'LOCAL', 'OTHER'], 'title': 'StandardisedDataModelsEnum', 'type': 'string'}}, 'anyOf': [{'$ref': '#/$defs/StandardisedDataModelsEnum'}, {'type': 'null'}], 'default': null}]" ], From f9c1a5c322fa8a2d44293e2bbe88a29225a3784d Mon Sep 17 00:00:00 2001 From: Branwen Snelling Date: Thu, 16 May 2024 15:43:12 +0100 Subject: [PATCH 7/7] import measured property --- hdr_schemata/models/HDRUK/v2_2_1/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/hdr_schemata/models/HDRUK/v2_2_1/__init__.py b/hdr_schemata/models/HDRUK/v2_2_1/__init__.py index a5b4a58..0cd38c4 100644 --- a/hdr_schemata/models/HDRUK/v2_2_1/__init__.py +++ b/hdr_schemata/models/HDRUK/v2_2_1/__init__.py @@ -7,6 +7,7 @@ from .Accessibility import Accessibility from .Provenance import Provenance from .Observations import Observation +from .MeasuredProperty import MeasuredProperty from .annotations import annotations as an