Skip to content

Commit

Permalink
Merge pull request #5 from HDRUK/add/GWDM/1.0
Browse files Browse the repository at this point in the history
Add/gwdm/1.0
  • Loading branch information
calmacx authored Sep 27, 2023
2 parents f9e5dd4 + 8486033 commit c2f6d98
Show file tree
Hide file tree
Showing 34 changed files with 2,498 additions and 2 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Pytest

on: [push]

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install schema module
run: |
python -m pip install --upgrade pip
python -m pip install setuptools
python -m pip install -e .
- name: Run pytest
run: |
cd hdr_schemata/tests/
pytest
Empty file added hdr_schemata/__init__.py
Empty file.
9 changes: 9 additions & 0 deletions hdr_schemata/definitions/HDRUK/DatasetType.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from typing import Optional
from pydantic import RootModel,constr

#note: contructed as a string of max_length=100
# in the future we may want to limit this with Enums
class DatasetType(RootModel):
root: Optional[constr(min_length=2, max_length=100)]


7 changes: 7 additions & 0 deletions hdr_schemata/definitions/HDRUK/LongAbstractText.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from typing import Optional
from pydantic import RootModel,constr

class LongAbstractText(RootModel):
root: Optional[constr(min_length=5, max_length=5000)]


7 changes: 7 additions & 0 deletions hdr_schemata/definitions/HDRUK/ShortTitle.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from typing import Optional
from pydantic import RootModel,constr

class ShortTitle(RootModel):
root: Optional[constr(min_length=2, max_length=100)]


Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from pydantic import RootModel, constr

class TwoHundredFiftyFiveCharacters(RootModel):
root: constr(min_length=2, max_length=255)


4 changes: 4 additions & 0 deletions hdr_schemata/definitions/HDRUK/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from .ControlledVocabulary import ControlledVocabulary
from .ControlledVocabularyEnum import ControlledVocabularyEnum
from .DataUseLimitation import DataUseLimitation
from .DatasetType import DatasetType
from .DataUseRequirements import DataUseRequirements
from .DeliveryLeadTime import DeliveryLeadTime
from .Description import Description
Expand All @@ -16,6 +17,7 @@
from .Isocountrycode import Isocountrycode
from .Language import Language
from .LanguageEnum import LanguageEnum
from .LongAbstractText import LongAbstractText
from .LongDescription import LongDescription
from .MeasuredProperty import MeasuredProperty
from .MemberOf import MemberOf
Expand All @@ -27,10 +29,12 @@
from .Semver import Semver
from .Setting import Setting
from .ShortDescription import ShortDescription
from .ShortTitle import ShortTitle
from .Source import Source
from .StandardisedDataModels import StandardisedDataModels
from .StandardisedDataModelsEnum import StandardisedDataModelsEnum
from .StatisticalPopulationConstrained import StatisticalPopulationConstrained
from .TimeLag import TimeLag
from .TwoHundredFiftyFiveCharacters import TwoHundredFiftyFiveCharacters
from .Url import Url
from .Uuidv4 import Uuidv4
126 changes: 126 additions & 0 deletions hdr_schemata/examples/GWDM/1.0/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
{
"required": {
"gatewayId": "1234",
"gatewayPid": "5124f2",
"issued": "2020-08-05T14:35:59Z",
"modified": "2021-01-28T14:15:46Z",
"revisions": [
{
"version": "1.0.0",
"url": "https://d5faf9c6-6c34-46d7-93c4-7706a5436ed9"
},
{
"version": "2.0.0",
"url": "https://a7ddefbd-31d9-4703-a738-256e4689f76a"
},
{
"version": "0.0.1",
"url": "https://9e798632-442a-427b-8d0e-456f754d28dc"
},
{
"version": "2.1.1",
"url": "https://a7ddefbd-31d9-4703-a738-256e4689f76a"
}
]
},
"summary": {
"abstract": "Publications that mention HDR-UK (or any variant thereof) in Acknowledgements or Author Affiliations",
"contactPoint": "[email protected]",
"keywords": "Preprints,Papers,HDR UK",
"controlledKeywords": "Papers",
"datasetType": "list of papers",
"description": "Publications that mention HDR-UK (or any variant thereof) in Acknowledgements or Author Affiliations\n\nThis will include:\n- Papers\n- COVID-19 Papers\n- COVID-19 Preprint",
"doiName": "10.1093/ije/dyx196",
"shortTitle": "HDR UK Papers & Preprints",
"title": "Publications that mention HDR-UK (or any variant thereof) in Acknowledgements or Author Affiliations",
"publisher": {
"publisherName": "HEALTH DATA RESEARCH UK"
}
},
"coverage": {
"pathway": "NOT APPLICABLE",
"physicalSampleAvailability": "NOT AVAILABLE",
"spatial": "https://www.geonames.org/countries/GB/united-kingdom.html",
"followup": "UNKNOWN",
"typicalAgeRange": "0-0"
},
"provenance": {
"origin": {
"purpose": "OTHER",
"source": "MACHINE GENERATED",
"collectionSituation": "OTHER"
},
"temporal": {
"endDate": "2022-04-30",
"startDate": "2020-03-31",
"timeLag": "NOT APPLICABLE",
"accrualPeriodicity": "DAILY",
"distributionReleaseDate": "2020-11-27"
}
},
"accessibility": {
"access": {
"deliveryLeadTime": "OTHER",
"jurisdiction": "GB-ENG",
"dataController": "HDR UK",
"dataProcessor": "HDR UK",
"accessRights": "https://raw.githubusercontent.com/HDRUK/papers/master/LICENSE",
"accessService": "https://github.com/HDRUK/papers",
"accessRequestCost": "Free"
},
"usage": {
"dataUseLimitation": "GENERAL RESEARCH USE",
"dataUseRequirement": "RETURN TO DATABASE OR RESOURCE",
"resourceCreator": "HDR UK Science Team"
},
"formatAndStandards": {
"vocabularyEncodingSchemes": "OTHER",
"conformsTo": "OTHER",
"languages": "en",
"formats": "CSV,JSON"
}
},
"linkage": {
"isGeneratedUsing": "something",
"dataUses": "dunno",
"isReferenceIn": "10.5281/zenodo.326615",
"tools": "https://github.com/HDRUK/papers",
"datasetLinkage": {
"isDerivedFrom": "https://web.www.healthdatagateway.org/dataset/fd8d0743-344a-4758-bb97-f8ad84a37357",
"isPartOf": "NOT APPLICABLE",
"isMemberOf": "blah",
"linkedDatasets": "https://web.www.healthdatagateway.org/dataset/fd8d0743-344a-4758-bb97-f8ad84a37357"
},
"investigations": "https://github.com/HDRUK/papers"
},
"observations": [
{
"observedNode": "FINDINGS",
"measuredValue": 575,
"observationDate": "2020-11-27",
"measuredProperty": "Count",
"disambiguatingDescription": "Number of papers with affiliation and/or acknowledgement to HDR UK"
}
],
"structuralMetadata": [
{
"name": "table1",
"description": "this is table 1",
"columns": [
{
"name": "column1",
"description": "this is column1",
"dataType": "String",
"sensitive": false,
"values": [
{
"name": "value",
"description": "this is value1",
"frequency":50
}
]
}
]
}
]
}
Loading

0 comments on commit c2f6d98

Please sign in to comment.