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

Replace definitions with $defs in JSON Schema artifact #109

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
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
7 changes: 2 additions & 5 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,29 @@ name = "pypi"
# For LinkML, we use the `ccdh-dev` branch, which we manually keep in sync with LinkML's main branch
# as well as some additional changes required for CRDCH generation.
linkml = {editable = true, ref = "ccdh-dev", git = "https://github.com/cancerDHC/linkml.git"}

# Since we use the development version of LinkML, we also use the development version of linkml-runtime.
# This may sometimes cause issues between this and LinkML.
linkml-runtime = {editable = true, git = "https://github.com/linkml/linkml-runtime.git"}

pyparsing = "<=2.4.7"
rdflib-pyld-compat = "*" # resinstating after removal by migration to linkml model template

[dev-packages]
pyyaml = "*" # For reading and writing YAML files.

# Packages needed for testing.
pytest = "~=6.2.4"
tox = "*"
typing_extensions = "*" # This is a tox prereq for Python 3.7, but not installed by Pipenv.
twine = "*" # should this go in make-venv/Pipfile ?

# Packages needed by sheet2linkml.
black = "==v21.5b1" # Used for code linting.
requests = "*" # For making HTTP requests.
pygsheets = "*" # For accessing Google Sheets.
python-dotenv = "*" # For reading .env files.

# Packages needed for building and publishing documentation.
mike = "*"
mkdocs-material = "*"
assertpy = "*"
jsonschema = "*"

[pipenv]
allow_prereleases = true # added by migration to linkml model template
Expand Down
417 changes: 230 additions & 187 deletions Pipfile.lock

Large diffs are not rendered by default.

353 changes: 121 additions & 232 deletions crdch_model/crdch_model.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion crdch_model/csv/crdch_model.csv
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ SpecimenTransportActivity,,An activity through which a specimen is transported b
Subject,,Demographics and other administrative information about an individual or animal receiving care or other health-related services.
Substance,,"A type of material substance, or instance thereof, as used in a particular application. May include information about the role the substance played in a particular application."
TimePeriod,,A period of time between a start and end time point.
TimePoint,,"A structured representation of a single point in time that allows direct/explicit declaration as a dateTime, or specification in terms of offset from a defined index."
TimePoint,,"A structured representation of a single point in time that allows direct/explicit declaration as a dateTime, specification in terms of offset from a defined index, or description of an event type as a proxy for the time point when it occurred."
TobaccoExposureObservation,,"A structured object that describes a single data item about an individual's exposure to tobacco, as generated through a point-in-time observation, measurement, or interpretation."
Treatment,,Represent medication administration or other treatment types.

12 changes: 7 additions & 5 deletions crdch_model/graphql/crdch_model.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,12 @@ type CodeableConcept
type Coding
{
code: CrdchString!
label: CrdchString
system: CrdchString!
systemURL: CrdchString
systemVersion: CrdchString
label: CrdchString
valueSet: CrdchString
valueSetVersion: CrdchString
tag: [CrdchString]
}

type Diagnosis
Expand All @@ -94,7 +96,7 @@ type Diagnosis
identifier: [Identifier]
subject: Subject
ageAtDiagnosis: Quantity
yearAtDiagnosis: CrdchInteger
diagnosisDate: TimePoint
condition: EnumCRDCHDiagnosisCondition
primarySite: [BodySite]
metastaticSite: [BodySite]
Expand Down Expand Up @@ -325,8 +327,8 @@ type Specimen
qualityMeasure: [SpecimenQualityObservation]
cellularCompositionType: EnumCRDCHSpecimenCellularCompositionType
histologicalCompositionMeasures: [HistologicalCompositionObservationSet]
generalTissueMorphology: EnumCRDCHSpecimenGeneralTissueMorphology
specificTissueMorphology: EnumCRDCHSpecimenSpecificTissueMorphology
generalTissuePathology: EnumCRDCHSpecimenGeneralTissuePathology
specificTissuePathology: EnumCRDCHSpecimenSpecificTissuePathology
preinvasiveTissueMorphology: EnumCRDCHSpecimenPreinvasiveTissueMorphology
morphologyPathologicallyConfirmed: CrdchBoolean
morphologyAssessorRole: EnumCRDCHSpecimenMorphologyAssessorRole
Expand Down
646 changes: 299 additions & 347 deletions crdch_model/json_schema/crdch_model.schema.json

Large diffs are not rendered by default.

1,207 changes: 617 additions & 590 deletions crdch_model/owl/crdch_model.owl.ttl

Large diffs are not rendered by default.

14 changes: 8 additions & 6 deletions crdch_model/shex/crdch_model.shex
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,12 @@ linkml:Nodeidentifier NONLITERAL
( $<Coding_tes> ( &<Entity_tes> ;
rdf:type [ <Entity> ] ? ;
<code> @<CrdchString> ;
<label> @<CrdchString> ? ;
<system> @<CrdchString> ;
<systemURL> @<CrdchString> ? ;
<systemVersion> @<CrdchString> ? ;
<label> @<CrdchString> ?
<system_version> @<CrdchString> ? ;
<value_set> @<CrdchString> ? ;
<value_set_version> @<CrdchString> ? ;
<tag> @<CrdchString> *
) ;
rdf:type [ <Coding> ] ?
)
Expand All @@ -179,7 +181,7 @@ linkml:Nodeidentifier NONLITERAL
<identifier> @<Identifier> * ;
<subject> @<Subject> ? ;
<age_at_diagnosis> @<Quantity> ? ;
<year_at_diagnosis> @<CrdchInteger> ? ;
<diagnosis_date> @<TimePoint> ? ;
<condition> @<EnumCRDCHDiagnosisCondition> ? ;
<primary_site> @<BodySite> * ;
<metastatic_site> @<BodySite> * ;
Expand Down Expand Up @@ -490,8 +492,8 @@ linkml:Nodeidentifier NONLITERAL
<quality_measure> @<SpecimenQualityObservation> * ;
<cellular_composition_type> @<EnumCRDCHSpecimenCellularCompositionType> ? ;
<histological_composition_measures> @<HistologicalCompositionObservationSet> * ;
<general_tissue_morphology> @<EnumCRDCHSpecimenGeneralTissueMorphology> ? ;
<specific_tissue_morphology> @<EnumCRDCHSpecimenSpecificTissueMorphology> ? ;
<general_tissue_pathology> @<EnumCRDCHSpecimenGeneralTissuePathology> ? ;
<specific_tissue_pathology> @<EnumCRDCHSpecimenSpecificTissuePathology> ? ;
<preinvasive_tissue_morphology> @<EnumCRDCHSpecimenPreinvasiveTissueMorphology> ? ;
<morphology_pathologically_confirmed> @<CrdchBoolean> ? ;
<morphology_assessor_role> @<EnumCRDCHSpecimenMorphologyAssessorRole> ? ;
Expand Down
32 changes: 23 additions & 9 deletions crdch_model/shex/crdch_model.shexj
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,13 @@
"min": 1,
"max": 1
},
{
"type": "TripleConstraint",
"predicate": "https://example.org/crdch/label",
"valueExpr": "https://example.org/crdch/CrdchString",
"min": 0,
"max": 1
},
{
"type": "TripleConstraint",
"predicate": "https://example.org/crdch/system",
Expand All @@ -806,24 +813,31 @@
},
{
"type": "TripleConstraint",
"predicate": "https://example.org/crdch/systemURL",
"predicate": "https://example.org/crdch/system_version",
"valueExpr": "https://example.org/crdch/CrdchString",
"min": 0,
"max": 1
},
{
"type": "TripleConstraint",
"predicate": "https://example.org/crdch/systemVersion",
"predicate": "https://example.org/crdch/value_set",
"valueExpr": "https://example.org/crdch/CrdchString",
"min": 0,
"max": 1
},
{
"type": "TripleConstraint",
"predicate": "https://example.org/crdch/label",
"predicate": "https://example.org/crdch/value_set_version",
"valueExpr": "https://example.org/crdch/CrdchString",
"min": 0,
"max": 1
},
{
"type": "TripleConstraint",
"predicate": "https://example.org/crdch/tag",
"valueExpr": "https://example.org/crdch/CrdchString",
"min": 0,
"max": -1
}
]
},
Expand Down Expand Up @@ -894,8 +908,8 @@
},
{
"type": "TripleConstraint",
"predicate": "https://example.org/crdch/year_at_diagnosis",
"valueExpr": "https://example.org/crdch/CrdchInteger",
"predicate": "https://example.org/crdch/diagnosis_date",
"valueExpr": "https://example.org/crdch/TimePoint",
"min": 0,
"max": 1
},
Expand Down Expand Up @@ -2743,15 +2757,15 @@
},
{
"type": "TripleConstraint",
"predicate": "https://example.org/crdch/general_tissue_morphology",
"valueExpr": "https://example.org/crdch/EnumCRDCHSpecimenGeneralTissueMorphology",
"predicate": "https://example.org/crdch/general_tissue_pathology",
"valueExpr": "https://example.org/crdch/EnumCRDCHSpecimenGeneralTissuePathology",
"min": 0,
"max": 1
},
{
"type": "TripleConstraint",
"predicate": "https://example.org/crdch/specific_tissue_morphology",
"valueExpr": "https://example.org/crdch/EnumCRDCHSpecimenSpecificTissueMorphology",
"predicate": "https://example.org/crdch/specific_tissue_pathology",
"valueExpr": "https://example.org/crdch/EnumCRDCHSpecimenSpecificTissuePathology",
"min": 0,
"max": 1
},
Expand Down
Loading