From 546f53c8d68e1fdf5deafaddef901548983d58ed Mon Sep 17 00:00:00 2001 From: cmungall Date: Tue, 17 Jan 2023 17:47:27 -0800 Subject: [PATCH 1/2] Additional tests for percent encoding of IDs for rdflib_dumper --- linkml_runtime/dumpers/rdflib_dumper.py | 4 +- .../input/phenopackets/any.yaml | 37 + .../input/phenopackets/base.yaml | 227 + .../input/phenopackets/biosample.yaml | 178 + .../input/phenopackets/constants.yaml | 392 ++ .../input/phenopackets/cv_terms.yaml | 144 + .../input/phenopackets/dicts.yaml | 204 + .../input/phenopackets/disease.yaml | 85 + .../input/phenopackets/genome.yaml | 25 + .../input/phenopackets/individual.yaml | 157 + .../input/phenopackets/interpretation.yaml | 168 + .../input/phenopackets/measurement.yaml | 160 + .../input/phenopackets/medical_action.yaml | 264 ++ .../input/phenopackets/meta_data.yaml | 122 + .../input/phenopackets/pedigree.yaml | 76 + .../input/phenopackets/phenopackets.yaml | 181 + .../phenopackets/phenotypic_feature.yaml | 75 + .../input/phenopackets/timestamp.yaml | 37 + .../input/phenopackets/vrs.yaml | 695 +++ .../input/phenopackets/vrsatile.yaml | 236 + .../models/phenopackets.py | 3970 +++++++++++++++++ .../test_rdflib_dumper.py | 41 +- 22 files changed, 7471 insertions(+), 7 deletions(-) create mode 100644 tests/test_loaders_dumpers/input/phenopackets/any.yaml create mode 100644 tests/test_loaders_dumpers/input/phenopackets/base.yaml create mode 100644 tests/test_loaders_dumpers/input/phenopackets/biosample.yaml create mode 100644 tests/test_loaders_dumpers/input/phenopackets/constants.yaml create mode 100644 tests/test_loaders_dumpers/input/phenopackets/cv_terms.yaml create mode 100644 tests/test_loaders_dumpers/input/phenopackets/dicts.yaml create mode 100644 tests/test_loaders_dumpers/input/phenopackets/disease.yaml create mode 100644 tests/test_loaders_dumpers/input/phenopackets/genome.yaml create mode 100644 tests/test_loaders_dumpers/input/phenopackets/individual.yaml create mode 100644 tests/test_loaders_dumpers/input/phenopackets/interpretation.yaml create mode 100644 tests/test_loaders_dumpers/input/phenopackets/measurement.yaml create mode 100644 tests/test_loaders_dumpers/input/phenopackets/medical_action.yaml create mode 100644 tests/test_loaders_dumpers/input/phenopackets/meta_data.yaml create mode 100644 tests/test_loaders_dumpers/input/phenopackets/pedigree.yaml create mode 100644 tests/test_loaders_dumpers/input/phenopackets/phenopackets.yaml create mode 100644 tests/test_loaders_dumpers/input/phenopackets/phenotypic_feature.yaml create mode 100644 tests/test_loaders_dumpers/input/phenopackets/timestamp.yaml create mode 100644 tests/test_loaders_dumpers/input/phenopackets/vrs.yaml create mode 100644 tests/test_loaders_dumpers/input/phenopackets/vrsatile.yaml create mode 100644 tests/test_loaders_dumpers/models/phenopackets.py diff --git a/linkml_runtime/dumpers/rdflib_dumper.py b/linkml_runtime/dumpers/rdflib_dumper.py index 7efd6fee..6114a7d8 100644 --- a/linkml_runtime/dumpers/rdflib_dumper.py +++ b/linkml_runtime/dumpers/rdflib_dumper.py @@ -160,8 +160,8 @@ def dumps(self, element: YAMLRoot, schemaview: SchemaView = None, return self.as_rdf_graph(element, schemaview, prefix_map=prefix_map).\ serialize(format=fmt) - def _as_uri(self, element_id: str, id_slot: SlotDefinition, schemaview: SchemaView) -> URIRef: - if schemaview.is_slot_percent_encoded(id_slot): + def _as_uri(self, element_id: str, id_slot: Optional[SlotDefinition], schemaview: SchemaView) -> URIRef: + if id_slot and schemaview.is_slot_percent_encoded(id_slot): return URIRef(urllib.parse.quote(element_id)) else: return schemaview.namespaces().uri_for(element_id) diff --git a/tests/test_loaders_dumpers/input/phenopackets/any.yaml b/tests/test_loaders_dumpers/input/phenopackets/any.yaml new file mode 100644 index 00000000..b66cb4b8 --- /dev/null +++ b/tests/test_loaders_dumpers/input/phenopackets/any.yaml @@ -0,0 +1,37 @@ + +classes: + Any: + attributes: + typeUrl: + annotations: + rank: 1 + description: "A URL/resource name that uniquely identifies the type of the serialized protocol buffer message. This string must contain at least one \"/\" character. The last segment of the URL's path must represent the fully qualified name of the type (as in `path/google.protobuf.Duration`). The name should be in a canonical form (e.g., leading \".\" is not accepted). In practice, teams usually precompile into the binary all types that they expect it to use in the context of Any. However, for URLs which use the scheme `http`, `https`, or no scheme, one can optionally set up a type server that maps type URLs to message definitions as follows: * If no scheme is provided, `https` is assumed. * An HTTP GET on the URL must yield a [google.protobuf.Type][] value in binary format, or produce an error. * Applications are allowed to cache lookup results based on the URL, or have them precompiled into a binary to avoid any lookup. Therefore, binary compatibility needs to be preserved on changes to types. (Use versioned type names to manage breaking changes.) Note: this functionality is not currently available in the official protobuf release, and it is not used for type URLs beginning with type.googleapis.com. Schemes other than `http`, `https` (or the empty scheme) might be used with implementation specific semantics. " + range: string + value: + annotations: + rank: 2 + description: Must be a valid serialized protocol buffer of the above specified type. + range: string + description: "`Any` contains an arbitrary serialized protocol buffer message along with a URL that describes the type of the serialized message. Protobuf library provides support to pack/unpack Any values in the form of utility functions or additional generated methods of the Any type. Example 1: Pack and unpack a message in C++. Foo foo = ...; Any any; any.PackFrom(foo); ... if (any.UnpackTo(&foo)) { ... } Example 2: Pack and unpack a message in Java. Foo foo = ...; Any any = Any.pack(foo); ... if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() any.Pack(foo) ... if any.Is(Foo.DESCRIPTOR): any.Unpack(foo) ... Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) if err != nil { ... } ... foo := &pb.Foo{} if err := any.UnmarshalTo(foo); err != nil { ... } The pack methods provided by protobuf library will by default use 'type.googleapis.com/full.type.name' as the type URL and the unpack methods only use the fully qualified type name after the last '/' in the type URL, for example \"foo.bar.com/x/y.z\" will yield type name \"y.z\". JSON ==== The JSON representation of an `Any` value uses the regular representation of the deserialized, embedded message, with an additional field `@type` which contains the type URL. Example: package google.profile; message Person { string first_name = 1; string last_name = 2; } { \"@type\": \"type.googleapis.com/google.profile.Person\", \"firstName\": , \"lastName\": } If the embedded message type is well-known and has a custom JSON representation, that representation will be embedded adding a field `value` which holds the custom JSON in addition to the `@type` field. Example (for message [google.protobuf.Duration][]): { \"@type\": \"type.googleapis.com/google.protobuf.Duration\", \"value\": \"1.212s\" } " +default_prefix: any +description: "Automatic translation of phenopackets protobuf to LinkML. Status: EXPERIMENTAL." +enums: {} + +id: https://w3id.org/linkml/phenopackets/any +imports: + - linkml:types +name: any +prefixes: + GENO: http://purl.obolibrary.org/obo/GENO_ + HP: http://purl.obolibrary.org/obo/HP_ + LOINC: https://loinc.org/ + MONDO: http://purl.obolibrary.org/obo/MONDO_ + NCIT: http://purl.obolibrary.org/obo/NCIT_ + UBERON: http://purl.obolibrary.org/obo/UBERON_ + UCUM: http://unitsofmeasure.org/ + UO: http://purl.obolibrary.org/obo/UO_ + any: https://w3id.org/linkml/phenopackets/any/ + argo: https://docs.icgc-argo.org/dictionary/ + linkml: https://w3id.org/linkml/ +slots: {} + diff --git a/tests/test_loaders_dumpers/input/phenopackets/base.yaml b/tests/test_loaders_dumpers/input/phenopackets/base.yaml new file mode 100644 index 00000000..2416cf6a --- /dev/null +++ b/tests/test_loaders_dumpers/input/phenopackets/base.yaml @@ -0,0 +1,227 @@ + +classes: + Age: + attributes: + iso8601duration: + annotations: + rank: 1 + description: The :ref:`ISO 8601` age of this object as ISO8601 duration or time intervals. e.g. P40Y10M05D) + range: string + description: See http://build.fhir.org/datatypes and http://build.fhir.org/condition-definitions.html#Condition.onset_x_ In FHIR this is represented as a UCUM measurement - http://unitsofmeasure.org/trac/ + AgeRange: + attributes: + end: + annotations: + rank: 2 + description: '' + range: Age + start: + annotations: + rank: 1 + description: '' + range: Age + description: '' + Dictionary: + comments: + - TODO + Evidence: + attributes: + evidenceCode: + annotations: + rank: 1 + description: "The encoded evidence type using, for example the Evidence & Conclusion Ontology (ECO - http://purl.obolibrary.org/obo/eco.owl) FHIR mapping: Condition.evidence.code" + inlined: true + range: OntologyClass + reference: + annotations: + rank: 2 + description: "FHIR mapping: Condition.evidence.detail" + inlined: true + range: ExternalReference + description: "FHIR mapping: Condition.evidence (https://www.hl7.org/fhir/condition-definitions.html#Condition.evidence)" + ExternalReference: + attributes: + description: + annotations: + rank: 3 + description: "Human readable title or display string for the reference FHIR mapping: Reference.display" + range: string + id: + annotations: + rank: 1 + description: "e.g. ISBN, PMID:123456, DOI:..., FHIR mapping: Reference.identifier" + range: string + reference: + annotations: + rank: 2 + description: A full or partial URL pointing to the external reference if no commonly resolvable identifier can be used in the `id` field FHIR mapping Reference.reference + range: string + description: "FHIR mapping: Reference (https://www.hl7.org/fhir/references.html)" + File: + attributes: + fileAttributes: + annotations: + rank: 3 + description: Map of attributes describing the file. For example the File format or genome assembly would be defied here. For genomic data files there MUST be a 'genomeAssembly' key. + inlined: true + range: Dictionary + individualToFileIdentifiers: + annotations: + rank: 2 + description: A map of identifiers mapping an individual to a sample in the file. The key values must correspond to the Individual::id for the individuals in the message, the values must map to the samples in the file. + inlined: true + range: Dictionary + uri: + annotations: + rank: 1 + description: URI for the file e.g. file://data/genomes/file1.vcf.gz or https://opensnp.org/data/60.23andme-exome-vcf.231?1341012444 + range: string + description: '' + GestationalAge: + attributes: + days: + annotations: + rank: 2 + description: '' + range: integer + weeks: + annotations: + rank: 1 + description: '' + range: integer + description: '' + OntologyClass: + attributes: + id: + annotations: + rank: 1 + description: a CURIE-style identifier e.g. HP:0100024, MP:0001284, UBERON:0001690. This is the primary key for the ontology class REQUIRED! + identifier: true + range: string + required: true + label: + annotations: + rank: 2 + description: class label, aka name. E.g. "Abnormality of cardiovascular system" + range: string + description: "A class (aka term, concept) in an ontology. FHIR mapping: CodeableConcept (http://www.hl7.org/fhir/datatypes.html#CodeableConcept) see also Coding (http://www.hl7.org/fhir/datatypes.html#Coding)" + Procedure: + attributes: + bodySite: + annotations: + rank: 2 + description: "FHIR mapping: Procedure.bodySite" + inlined: true + range: OntologyClass + code: + annotations: + rank: 1 + description: "FHIR mapping: Procedure.code" + inlined: true + range: OntologyClass + performed: + annotations: + rank: 3 + description: When the procedure was performed. + inlined: true + range: TimeElement + description: "A clinical procedure performed on a subject. By preference a single concept to indicate both the procedure and the body site should be used. In cases where this is not possible, the body site should be indicated using a separate ontology class. e.g. {\"code\":{\"NCIT:C51585\": \"Biopsy of Soft Palate\"}} {\"code\":{\"NCIT:C28743\": \"Punch Biopsy\"}, \"body_site\":{\"UBERON:0003403\": \"skin of forearm\"}} - a punch biopsy of the skin from the forearm FHIR mapping: Procedure (https://www.hl7.org/fhir/procedure.html)" + TimeElement: + attributes: + age: + annotations: + rank: 1 + description: '' + range: Age + ageRange: + annotations: + rank: 2 + description: '' + range: AgeRange + gestationalAge: + annotations: + rank: 6 + description: '' + range: GestationalAge + interval: + annotations: + rank: 5 + description: '' + inlined: true + range: TimeInterval + ontologyClass: + annotations: + rank: 3 + description: '' + inlined: true + range: OntologyClass + timestamp: + annotations: + rank: 4 + description: '' + range: string + description: '' + rules: + - + postconditions: + exactly_one_of: + - + slot_conditions: + gestationalAge: + required: true + - + slot_conditions: + age: + required: true + - + slot_conditions: + ageRange: + required: true + - + slot_conditions: + ontologyClass: + required: true + - + slot_conditions: + timestamp: + required: true + - + slot_conditions: + interval: + required: true + TimeInterval: + attributes: + end: + annotations: + rank: 2 + description: '' + range: string + start: + annotations: + rank: 1 + description: '' + range: string + description: '' +default_prefix: base +description: "Automatic translation of phenopackets protobuf to LinkML. Status: EXPERIMENTAL." +enums: {} + +id: https://w3id.org/linkml/phenopackets/base +imports: + - linkml:types + - timestamp +name: base +prefixes: + GENO: http://purl.obolibrary.org/obo/GENO_ + HP: http://purl.obolibrary.org/obo/HP_ + LOINC: https://loinc.org/ + MONDO: http://purl.obolibrary.org/obo/MONDO_ + NCIT: http://purl.obolibrary.org/obo/NCIT_ + UBERON: http://purl.obolibrary.org/obo/UBERON_ + UCUM: http://unitsofmeasure.org/ + UO: http://purl.obolibrary.org/obo/UO_ + argo: https://docs.icgc-argo.org/dictionary/ + base: https://w3id.org/linkml/phenopackets/base/ + linkml: https://w3id.org/linkml/ +slots: {} + diff --git a/tests/test_loaders_dumpers/input/phenopackets/biosample.yaml b/tests/test_loaders_dumpers/input/phenopackets/biosample.yaml new file mode 100644 index 00000000..2eb4bfae --- /dev/null +++ b/tests/test_loaders_dumpers/input/phenopackets/biosample.yaml @@ -0,0 +1,178 @@ + +classes: + Biosample: + attributes: + derivedFromId: + annotations: + rank: 3 + description: The id of the parent biosample this biosample was derived from. + range: string + description: + annotations: + rank: 4 + description: The biosample's description. This attribute contains human readable text. The "description" attributes should not contain any structured data. + range: string + diagnosticMarkers: + annotations: + rank: 16 + description: Clinically relevant bio markers. Most of the assays such as IHC are covered by the NCIT under the sub-hierarchy NCIT:C25294 (Laboratory Procedure). e.g. NCIT:C68748 (HER2/Neu Positive), NCIT:C131711 (Human Papillomavirus-18 Positive) + inlined: true + multivalued: true + range: OntologyClass + files: + annotations: + rank: 18 + description: Pointer to the relevant file(s) for the biosample. Files relating to the entire individual e.g. a germline exome/genome should be associated with the Phenopacket rather than the Biosample it was derived from. + inlined: true + multivalued: true + range: File + histologicalDiagnosis: + annotations: + rank: 11 + description: This is the pathologist’s diagnosis and may often represent a refinement of the clinical diagnosis given in the Patient/Clinical module. Should use the same terminology as diagnosis, but represent the pathologist’s findings. Normal samples would be tagged with the term "NCIT:C38757", "Negative Finding" ARGO mapping specimen::tumour_histological_type + exact_mappings: + - ARGO:specimen.tumour_histological_type + inlined: true + range: OntologyClass + id: + annotations: + rank: 1 + description: biosamples SAMN08666232 Human Cell Atlas The Biosample id This is unique in the context of the server instance. ARGO mapping specimen::submitter_specimen_id + exact_mappings: + - ARGO:specimen.submitter_specimen_id + range: string + individualId: + annotations: + rank: 2 + description: The id of the individual this biosample was derived from. ARGO mapping specimen::submitter_donor_id + exact_mappings: + - ARGO:specimen.submitter_donor_id + range: string + materialSample: + annotations: + rank: 19 + description: "This element can be used to specify the status of the sample. For instance, a status may be used as a normal control, often in combination with another sample that is thought to contain a pathological finding. We recommend use of ontology terms such as: EFO:0009654 (reference sample) or EFO:0009655 (abnormal sample) ARGO mapping sample_registration::tumour_normal_designation" + exact_mappings: + - ARGO:sample_registration.tumour_normal_designation + inlined: true + range: OntologyClass + measurements: + annotations: + rank: 8 + description: '' + inlined: true + multivalued: true + range: Measurement + pathologicalStage: + annotations: + rank: 14 + description: ARGO mapping specimen::pathological_tumour_staging_system ARGO mapping specimen::pathological_stage_group + exact_mappings: + - ARGO:specimen.pathological_tumour_staging_system + inlined: true + range: OntologyClass + pathologicalTnmFinding: + annotations: + rank: 15 + description: ARGO mapping specimen::pathological_t_category ARGO mapping specimen::pathological_n_category ARGO mapping specimen::pathological_m_category + exact_mappings: + - ARGO:specimen.pathological_t_category + inlined: true + multivalued: true + range: OntologyClass + phenotypicFeatures: + annotations: + rank: 7 + description: Phenotypic characteristics of the BioSample, for example histological findings of a biopsy. + inlined: true + multivalued: true + range: PhenotypicFeature + procedure: + annotations: + rank: 17 + description: Clinical procedure performed on the subject in order to extract the biosample. ARGO mapping specimen::specimen_anatomic_location - Procedure::body_site ARGO mapping specimen::specimen_acquisition_interval - Procedure::time_performed + exact_mappings: + - ARGO:specimen.specimen_anatomic_location + range: Procedure + sampleProcessing: + annotations: + rank: 20 + description: Field to represent how the sample was processed. ARGO mapping specimen::specimen_processing + exact_mappings: + - ARGO:specimen.specimen_processing + inlined: true + range: OntologyClass + sampleStorage: + annotations: + rank: 21 + description: Field to represent how the sample was stored ARGO mapping specimen::specimen_storage + exact_mappings: + - ARGO:specimen.specimen_storage + inlined: true + range: OntologyClass + sampleType: + annotations: + rank: 6 + description: Recommended use of EFO term to describe the sample. e.g. Amplified DNA, ctDNA, Total RNA, Lung tissue, Cultured cells... ARGO mapping sample_registration::sample_type + exact_mappings: + - ARGO:sample_registration.sample_type + inlined: true + range: OntologyClass + sampledTissue: + annotations: + rank: 5 + description: "UBERON class describing the tissue from which the specimen was collected. PDX-MI mapping: 'Specimen tumor tissue' FHIR mapping: Specimen.type ARGO mapping sample_registration::specimen_tissue_source" + exact_mappings: + - ARGO:sample_registration.specimen_tissue_source + inlined: true + range: OntologyClass + taxonomy: + annotations: + rank: 9 + description: NCBI taxonomic identifier (NCBITaxon) of the sample e.g. NCBITaxon:9606 + inlined: true + range: OntologyClass + timeOfCollection: + annotations: + rank: 10 + description: An TimeElement describing either the age of the individual this biosample was derived from at the time of collection, or the time itself. See http://build.fhir.org/datatypes + inlined: true + range: TimeElement + tumorGrade: + annotations: + rank: 13 + description: Potentially a child term of NCIT:C28076 (Disease Grade Qualifier) or equivalent See https://www.cancer.gov/about-cancer/diagnosis-staging/prognosis/tumor-grade-fact-sheet + inlined: true + range: OntologyClass + tumorProgression: + annotations: + rank: 12 + description: Is the specimen tissue from the primary tumor, a metastasis or a recurrence? Most likely a child term of NCIT:C7062 (Neoplasm by Special Category) NCIT:C3677 (Benign Neoplasm) NCIT:C84509 (Primary Malignant Neoplasm) NCIT:C95606 (Second Primary Malignant Neoplasm) NCIT:C3261 (Metastatic Neoplasm) NCIT:C4813 (Recurrent Malignant Neoplasm) + inlined: true + range: OntologyClass + description: "A Biosample refers to a unit of biological material from which the substrate molecules (e.g. genomic DNA, RNA, proteins) for molecular analyses (e.g. sequencing, array hybridisation, mass-spectrometry) are extracted. Examples would be a tissue biopsy, a single cell from a culture for single cell genome sequencing or a protein fraction from a gradient centrifugation. Several instances (e.g. technical replicates) or types of experiments (e.g. genomic array as well as RNA-seq experiments) may refer to the same Biosample. FHIR mapping: Specimen (http://www.hl7.org/fhir/specimen.html)." +default_prefix: biosample +description: "Automatic translation of phenopackets protobuf to LinkML. Status: EXPERIMENTAL." +enums: {} + +id: https://w3id.org/linkml/phenopackets/biosample +imports: + - linkml:types + - base + - measurement + - phenotypic_feature +name: biosample +prefixes: + GENO: http://purl.obolibrary.org/obo/GENO_ + HP: http://purl.obolibrary.org/obo/HP_ + LOINC: https://loinc.org/ + MONDO: http://purl.obolibrary.org/obo/MONDO_ + NCIT: http://purl.obolibrary.org/obo/NCIT_ + UBERON: http://purl.obolibrary.org/obo/UBERON_ + UCUM: http://unitsofmeasure.org/ + UO: http://purl.obolibrary.org/obo/UO_ + argo: https://docs.icgc-argo.org/dictionary/ + biosample: https://w3id.org/linkml/phenopackets/biosample/ + linkml: https://w3id.org/linkml/ +slots: {} + diff --git a/tests/test_loaders_dumpers/input/phenopackets/constants.yaml b/tests/test_loaders_dumpers/input/phenopackets/constants.yaml new file mode 100644 index 00000000..b17077a3 --- /dev/null +++ b/tests/test_loaders_dumpers/input/phenopackets/constants.yaml @@ -0,0 +1,392 @@ +name: constants +id: https://w3id.org/linkml/phenopackets/constants +imports: +- linkml:types +prefixes: + linkml: https://w3id.org/linkml/ + constants: https://w3id.org/linkml/phenopackets/constants/ + UCUM: http://unitsofmeasure.org/ + OBI: http://purl.obolibrary.org/obo/OBI_ + HP: http://purl.obolibrary.org/obo/HP_ + MP: http://purl.obolibrary.org/obo/MP_ + GO: http://purl.obolibrary.org/obo/GO_ + CHEBI: http://purl.obolibrary.org/obo/CHEBI_ + NCIT: http://purl.obolibrary.org/obo/NCIT_ + UO: http://purl.obolibrary.org/obo/UO_ + PATO: http://purl.obolibrary.org/obo/PATO_ + EFO: http://purl.obolibrary.org/obo/EFO_ + GENO: http://purl.obolibrary.org/obo/GENO_ + LOINC: https://loinc.org/ + UBERON: http://purl.obolibrary.org/obo/UBERON_ +default_prefix: constants +default_range: string +enums: + AllelicStateTerms: + permissible_values: + HETEROZYGOUS: + description: heterozygous + meaning: GENO:0000135 + HOMOZYGOUS: + description: homozygous + meaning: GENO:0000136 + HEMIZYGOUS: + description: hemizygous + meaning: GENO:0000134 + AssaysTerms: + permissible_values: + CREATINE_KINASE: + description: Creatine kinase [Enzymatic activity/volume] in Serum or Plasma + meaning: LOINC:2157-6 + GenderTerms: + permissible_values: + IDENTIFIES_AS_MALE: + description: Identifies as male + meaning: LOINC:LA22878-5 + IDENTIFIES_AS_FEMALE: + description: Identifies as female + meaning: LOINC:LA22879-3 + FEMALE_TO_MALE_TRANSSEXUAL: + description: Female-to-male transsexual + meaning: LOINC:LA22880-1 + MALE_TO_FEMALE_TRANSSEXUAL: + description: Male-to-female transsexual + meaning: LOINC:LA22881-9 + IDENTIFIES_AS_NON_CONFORMING: + description: Identifies as non-conforming + meaning: LOINC:LA22882-7 + OTHER_GENDER: + description: other + meaning: LOINC:LA46-8 + ASKED_BUT_UNKNOWN: + description: Asked but unknown + meaning: LOINC:LA20384-6 + LateralityTerms: + permissible_values: + RIGHT: + description: Right + meaning: HP:0012834 + LEFT: + description: Left + meaning: HP:0012835 + UNILATERAL: + description: Unilateral + meaning: HP:0012833 + BILATERAL: + description: Bilateral + meaning: HP:0012832 + MedicalActionsTerms: + permissible_values: + ADVERSE_EVENT: + description: Adverse Event + meaning: NCIT:C41331 + FOUR_TIMES_DAILY: + description: Four Times Daily + meaning: NCIT:C64530 + INTRA_ARTERIAL: + description: Intraarterial Route of Administration + meaning: NCIT:C38222 + IV_ADMINISTRATION: + description: Intravenous Route of Administration + meaning: NCIT:C38276 + ORAL_ADMINISTRATION: + description: Oral Route of Administration + meaning: NCIT:C38288 + ONCE: + description: Once + meaning: NCIT:C64576 + ONCE_DAILY: + description: Once Daily + meaning: NCIT:C125004 + THREE_TIMES_DAILY: + description: Three Times Daily + meaning: NCIT:C64527 + TWICE_DAILY: + description: Twice Daily + meaning: NCIT:C64496 + OnsetTerms: + permissible_values: + ANTENATAL_ONSET: + description: Antenatal onset + meaning: HP:0030674 + EMBRYONAL_ONSET: + description: Embryonal onset + meaning: HP:0011460 + FETAL_ONSET: + description: Fetal onset + meaning: HP:0011461 + LATE_FIRST_TRIMESTER_ONSET: + description: Late first trimester onset + meaning: HP:0034199 + SECOND_TRIMESTER_ONSET: + description: Second trimester onset + meaning: HP:0034198 + THIRD_TRIMESTER_ONSET: + description: Third trimester onset + meaning: HP:0034197 + CONGENITAL_ONSET: + description: Congenital onset + meaning: HP:0003577 + NEONATAL_ONSET: + description: Neonatal onset + meaning: HP:0003623 + INFANTILE_ONSET: + description: Infantile onset + meaning: HP:0003593 + CHILDHOOD_ONSET: + description: Childhood onset + meaning: HP:0011463 + JUVENILE_ONSET: + description: Juvenile onset + meaning: HP:0003621 + ADULT_ONSET: + description: Adult onset + meaning: HP:0003581 + YOUNG_ADULT_ONSET: + description: Young adult onset + meaning: HP:0011462 + EARLY_YOUNG_ADULT_ONSET: + description: Early young adult onset + meaning: HP:0025708 + INTERMEDIATE_YOUNG_ADULT_ONSET: + description: Intermediate young adult onset + meaning: HP:0025709 + LATE_YOUNG_ADULT_ONSET: + description: Late young adult onset + meaning: HP:0025710 + MIDDLE_AGE_ONSET: + description: Middle age onset + meaning: HP:0003596 + LATE_ONSET: + description: Late onset + meaning: HP:0003584 + OrganTerms: + permissible_values: + BRAIN: + description: brain + meaning: UBERON:0000955 + CEREBELLUM: + description: cerebellum + meaning: UBERON:0002037 + EAR: + description: ear + meaning: UBERON:0001690 + EYE: + description: eye + meaning: UBERON:0000970 + HEART: + description: heart + meaning: UBERON:0002107 + KIDNEY: + description: kidney + meaning: UBERON:0002113 + LARGE_INTESTINE: + description: large intestine + meaning: UBERON:0000059 + LIVER: + description: liver + meaning: UBERON:0002107 + LUNG: + description: lung + meaning: UBERON:0002048 + NOSE: + description: nose + meaning: UBERON:0000004 + SMALL_INTESTINE: + description: small intestine + meaning: UBERON:0002108 + SPINAL_CORD: + description: spinal cord + meaning: UBERON:0002240 + SPLEEN: + description: spleen + meaning: UBERON:0002106 + TONGUE: + description: tongue + meaning: UBERON:0001723 + THYMUS: + description: thymus + meaning: UBERON:0002370 + ResponseTerms: + permissible_values: + FAVORABLE: + description: Favorable + meaning: NCIT:C102560 + UNFAVORABLE: + description: Unfavorable + meaning: NCIT:C102561 + SpatialPatternTerms: + permissible_values: + PREDOMINANT_SMALL_JOINT_LOCALIZATION: + description: Predominant small joint localization + meaning: HP:0032544 + POLYCYCLIC: + description: Polycyclic + meaning: HP:0031450 + AXIAL: + description: Axial + meaning: HP:0025287 + PERILOBULAR: + description: Perilobular + meaning: HP:0033813 + PARASEPTAL: + description: Paraseptal + meaning: HP:0033814 + BRONCHOCENTRIC: + description: Bronchocentric + meaning: HP:0033815 + CENTRILOBULAR: + description: Centrilobular + meaning: HP:0033816 + MILIARY: + description: Miliary + meaning: HP:0033817 + GENERALIZED: + description: Generalized + meaning: HP:0012837 + PERILYMPHATIC: + description: Perilymphatic + meaning: HP:0033819 + LOCALIZED: + description: Localized + meaning: HP:0012838 + RETICULAR: + description: Reticular + meaning: HP:0033818 + DISTAL: + description: Distal + meaning: HP:0012839 + CENTRAL: + description: Central + meaning: HP:0030645 + UPPER_BODY_PREDOMINANCE: + description: Upper-body predominance + meaning: HP:0025290 + JOINT_EXTENSOR_SURFACE_LOCALIZATION: + description: Joint extensor surface localization + meaning: HP:0032539 + HERPETIFORM: + description: Herpetiform + meaning: HP:0025295 + MORBILLIFORM: + description: Morbilliform + meaning: HP:0025296 + PERICENTRAL: + description: Pericentral + meaning: HP:0030649 + DERMATOMAL: + description: Dermatomal + meaning: HP:0025294 + MIDPERIPHERAL: + description: Midperipheral + meaning: HP:0030648 + DISTRIBUTED_ALONG_BLASCHKO_LINES: + description: Distributed along Blaschko lines + meaning: HP:0025293 + ACRAL: + description: Acral + meaning: HP:0025292 + PARACENTRAL: + description: Paracentral + meaning: HP:0030647 + LATERAL: + description: Lateral + meaning: HP:0025275 + PERIPHERAL: + description: Peripheral + meaning: HP:0030646 + LOWER_BODY_PREDOMINANCE: + description: Lower-body predominance + meaning: HP:0025291 + DIFFUSE: + description: Diffuse + meaning: HP:0020034 + PROXIMAL: + description: Proximal + meaning: HP:0012840 + APICAL: + description: Apical + meaning: HP:0033820 + FOCAL: + description: Focal + meaning: HP:0030650 + MULTIFOCAL: + description: Multifocal + meaning: HP:0030651 + JOINT_FLEXOR_SURFACE_LOCALIZATION: + description: Jointflexorsurfacelocalization + meaning: HP:0032540 + UnitTerms: + permissible_values: + DEGREE: + description: degree (plane angle) + meaning: UCUM:degree + DIOPTER: + description: diopter + meaning: UCUM:[diop] + GRAM: + description: gram + meaning: UCUM:g + GRAM_PER_KG: + description: gram per kilogram + meaning: UCUM:g/kg + KILIGRAM: + description: kiligram + meaning: UCUM:kg + LITER: + description: liter + meaning: UCUM:L + METER: + description: meter + meaning: UCUM:m + MICROGRAM: + description: microgram + meaning: UCUM:ug + MICROGRAM_PER_DECILITER: + description: microgram per deciliter + meaning: UCUM:ug/dL + MICROGRAM_PER_LITER: + description: microgram per liter + meaning: UCUM:ug/L + MICROLITER: + description: microliter + meaning: UCUM:uL + MICROMETER: + description: micrometer + meaning: UCUM:um + MILLIGRAM: + description: milligram + meaning: UCUM:mg + MILLIGRAM_PER_DAY: + description: milligram per day + meaning: UCUM:mg/dL + MILLIGRAM_PER_DL: + description: milligram per deciliter + meaning: UCUM:mg/dL + MILLIGRAM_PER_KG: + description: milligram per kilogram + meaning: UCUM:mg.kg-1 + MILLILITER: + description: milliliter + meaning: UCUM:mL + MILLIMETER: + description: millimeter + meaning: UCUM:mm + MILLIMETRES_OF_MERCURY: + description: millimetres of mercury + meaning: UCUM:mm[Hg] + MILLIMOLE: + description: millimole + meaning: UCUM:mmol + MOLE: + description: mole + meaning: UCUM:mol + MOLE_PER_LITER: + description: mole per liter + meaning: UCUM:mol/L + MOLE_PER_MILLILITER: + description: mole per milliliter + meaning: UCUM:mol/mL + ENZYME_UNIT_PER_LITER: + description: enzyme unit per liter + meaning: UCUM:U/L + diff --git a/tests/test_loaders_dumpers/input/phenopackets/cv_terms.yaml b/tests/test_loaders_dumpers/input/phenopackets/cv_terms.yaml new file mode 100644 index 00000000..28c8bc93 --- /dev/null +++ b/tests/test_loaders_dumpers/input/phenopackets/cv_terms.yaml @@ -0,0 +1,144 @@ +id: https://w3id.org/linkml/phenopackets/cv_terms +imports: + - linkml:types + - constants +name: cv_terms +title: Controlled Terms +source: https://phenopacket-schema.readthedocs.io/en/latest/recommended-ontologies.html +description: >- + Enumerations/Terms for encoding ontology terms in phenopackets. + + The phenopacket schema can be used with any ontologies. The phenopacket can be compared to a hierarchical structure with “slots” for ontology terms and other data. Different use cases may require different ontology terms to cover the subject matter or to fulfil requirements of a specific research project. The spectrum of requirements is so broad that we do not think it is appropriate to require a specific set of ontologies for use with phenopackets. Nonetheless, the value of phenopacket-encoded data will be greatly increased if the community of users converges towards a common set of ontologies (to the extent possible). Here, we provide general recommendations for ontologies that we have found to be useful. This list is incomplete and we would welcome feedback from the community about ontologies that should be added to this page. + +see_also: + - http://phenopackets.org/phenopacket-tools/constants.html + +prefixes: + linkml: https://w3id.org/linkml/ + bioregistry: https://bioregistry.io/registry/ + MONDO: http://purl.obolibrary.org/obo/MONDO_ + UBERON: http://purl.obolibrary.org/obo/UBERON_ + NCIT: http://purl.obolibrary.org/obo/NCIT_ + GENO: http://purl.obolibrary.org/obo/GENO_ + HP: http://purl.obolibrary.org/obo/HP_ + UO: http://purl.obolibrary.org/obo/UO_ + LOINC: https://loinc.org/ + UCUM: http://unitsofmeasure.org/ + EFO: http://www.ebi.ac.uk/efo/EFO_ + +enums: + MondoDiseaseTerms: + description: >- + Mondo Disease Ontology provides a comprehensive logically structured ontology of diseases that integrates multiple other disease ontologies. + examples: + - description: incontinentia pigmenti + value: MONDO:0010631 + - description: dilated cardiomyopathy 3B + value: MONDO:0010542 + reachable_from: + source_ontology: bioregistry:mondo + source_nodes: + - MONDO:0000001 ## disease or disorder + is_direct: false + include_self: false + relationship_types: + - rdfs:subClassOf + + NCITDiseaseTerms: + description: All disease terms from the NCI Thesaurus + reachable_from: + source_ontology: bioregistry:ncit + source_nodes: + - NCIT:C2991 ## Disease or Disorder + is_direct: false + include_self: false + relationship_types: + - rdfs:subClassOf + + NCITNeoplasmTerms: + description: All neoplasm terms from the NCI Thesaurus + reachable_from: + source_ontology: bioregistry:ncit + source_nodes: + - NCIT:C3262 ## Neoplasm + is_direct: false + include_self: false + relationship_types: + - rdfs:subClassOf + + HPOAbnormalityTerms: + description: >- + The Human Phenotype Ontology (HPO) provides a comprehensive logical standard to describe and computationally analyze phenotypic abnormalities found in human disease. + examples: + - description: Arachnodactyly + value: HP:0001166 + - description: Patent ductus arteriosus + value: HP:0001643 + reachable_from: + source_ontology: bioregistry:hp + source_nodes: + - HP:0000118 ## Phenotypic abnormality + is_direct: false + include_self: false + relationship_types: + - rdfs:subClassOf + + UberonAnatomicalEntityTerms: + description: >- + UBERON is an integrated cross-species ontology with classes representing a variety of anatomical entities. + reachable_from: + source_ontology: bioregistry:uberon + source_nodes: + - UBERON:0001062 ## anatomical entity + is_direct: false + include_self: false + relationship_types: + - rdfs:subClassOf + + HGNCGeneTerms: + description: >- + The HUGO Gene Nomenclature Committee (HGNC) provides standard names, symbols, and IDs for human genes. + reachable_from: + source_ontology: bioregistry:hgnc + + UOUnitTerms: + description: >- + The Units of measurement ontology (denoted UO) provides terms for units commonly encountered in medical data. The following table shows some typical examples. + examples: + - description: millimolar + value: UO:0000063 + reachable_from: + source_ontology: bioregistry:uo + source_nodes: + - UO:0000000 ! unit + is_direct: false + include_self: false + relationship_types: + - rdfs:subClassOf + + GENOZygosityTerms: + description: >- + GENO is an ontology of genotypes their more fundamental sequence components. This enum refers to the zygosity subset of GENO + examples: + - description: heteroyzgous + value: GENO:0000135 + - description: homozygous + value: GENO:0000136 + reachable_from: + source_ontology: bioregistry:geno + source_nodes: + - GENO:0000133 ## zygosity + is_direct: false + include_self: false + relationship_types: + - rdfs:subClassOf + + LOINCMeasurementTerms: + description: >- + Logical Observation Identifiers Names and Codes (LOINC) is a database and universal standard for identifying medical laboratory observations. It can be used to denote clinical assays in the Measurement element. examples: + examples: + - description: Platelets [#/volume] in Blood + value: LOINC:26515-7 + reachable_from: + source_ontology: bioregistry:loinc + diff --git a/tests/test_loaders_dumpers/input/phenopackets/dicts.yaml b/tests/test_loaders_dumpers/input/phenopackets/dicts.yaml new file mode 100644 index 00000000..1b287fca --- /dev/null +++ b/tests/test_loaders_dumpers/input/phenopackets/dicts.yaml @@ -0,0 +1,204 @@ + +classes: + Age: + attributes: + iso8601duration: + annotations: + rank: 1 + description: "The :ref:`ISO 8601` age of this object as ISO8601\nduration or time intervals. e.g. P40Y10M05D)" + range: string + description: "See http://build.fhir.org/datatypes and http://build.fhir.org/condition-definitions.html#Condition.onset_x_\nIn FHIR this is represented as a UCUM measurement - http://unitsofmeasure.org/trac/" + AgeRange: + attributes: + end: + annotations: + rank: 2 + description: '' + range: Age + start: + annotations: + rank: 1 + description: '' + range: Age + description: '' + Evidence: + attributes: + evidenceCode: + annotations: + rank: 1 + description: "The encoded evidence type using, for example the Evidence & Conclusion Ontology (ECO - http://purl.obolibrary.org/obo/eco.owl)\nFHIR mapping: Condition.evidence.code" + range: OntologyClass + reference: + annotations: + rank: 2 + description: "FHIR mapping: Condition.evidence.detail" + range: ExternalReference + description: "FHIR mapping: Condition.evidence (https://www.hl7.org/fhir/condition-definitions.html#Condition.evidence)" + ExternalReference: + attributes: + description: + annotations: + rank: 3 + description: "Human readable title or display string for the reference\nFHIR mapping: Reference.display" + range: string + id: + annotations: + rank: 1 + description: "e.g. ISBN, PMID:123456, DOI:...,\nFHIR mapping: Reference.identifier" + range: string + reference: + annotations: + rank: 2 + description: "A full or partial URL pointing to the external reference if no commonly resolvable identifier can be used in the\n`id` field\nFHIR mapping Reference.reference" + range: string + description: "FHIR mapping: Reference (https://www.hl7.org/fhir/references.html)" + File: + attributes: + fileAttributes: + annotations: + rank: 3 + description: "Map of attributes describing the file. For example the File format or genome assembly would be defied here. For\ngenomic data files there MUST be a 'genomeAssembly' key." + range: Dictionary + individualToFileIdentifiers: + annotations: + rank: 2 + description: "A map of identifiers mapping an individual to a sample in the file. The key values must correspond to the\nIndividual::id for the individuals in the message, the values must map to the samples in the file." + range: Dictionary + uri: + annotations: + rank: 1 + description: URI for the file e.g. file://data/genomes/file1.vcf.gz or https://opensnp.org/data/60.23andme-exome-vcf.231?1341012444 + range: string + description: '' + GestationalAge: + attributes: + days: + annotations: + rank: 2 + description: '' + range: integer + weeks: + annotations: + rank: 1 + description: '' + range: integer + description: '' + OntologyClass: + attributes: + id: + annotations: + rank: 1 + description: "a CURIE-style identifier e.g. HP:0100024, MP:0001284, UBERON:0001690.\nThis is the primary key for the ontology class\nREQUIRED!" + range: string + required: 'true' + label: + annotations: + rank: 2 + description: class label, aka name. E.g. "Abnormality of cardiovascular system" + range: string + description: "A class (aka term, concept) in an ontology.\nFHIR mapping: CodeableConcept (http://www.hl7.org/fhir/datatypes.html#CodeableConcept)\nsee also Coding (http://www.hl7.org/fhir/datatypes.html#Coding)" + Procedure: + attributes: + bodySite: + annotations: + rank: 2 + description: "FHIR mapping: Procedure.bodySite" + range: OntologyClass + code: + annotations: + rank: 1 + description: "FHIR mapping: Procedure.code" + range: OntologyClass + performed: + annotations: + rank: 3 + description: When the procedure was performed. + range: TimeElement + description: "A clinical procedure performed on a subject. By preference a single concept to indicate both the procedure and the\nbody site should be used. In cases where this is not possible, the body site should be indicated using a separate\nontology class.\ne.g.\n{\"code\":{\"NCIT:C51585\": \"Biopsy of Soft Palate\"}}\n{\"code\":{\"NCIT:C28743\": \"Punch Biopsy\"}, \"body_site\":{\"UBERON:0003403\": \"skin of forearm\"}} - a punch biopsy of the skin from the forearm\nFHIR mapping: Procedure (https://www.hl7.org/fhir/procedure.html)" + TimeElement: + attributes: + age: + annotations: + rank: 1 + description: '' + range: Age + ageRange: + annotations: + rank: 2 + description: '' + range: AgeRange + gestationalAge: + annotations: + rank: 6 + description: '' + range: GestationalAge + interval: + annotations: + rank: 5 + description: '' + range: TimeInterval + ontologyClass: + annotations: + rank: 3 + description: '' + range: OntologyClass + timestamp: + annotations: + rank: 4 + description: '' + range: Timestamp + description: '' + rules: + - + postconditions: + exactly_one_of: + - + slot_conditions: + gestationalAge: + required: 'true' + - + slot_conditions: + age: + required: 'true' + - + slot_conditions: + ageRange: + required: 'true' + - + slot_conditions: + ontologyClass: + required: 'true' + - + slot_conditions: + timestamp: + required: 'true' + - + slot_conditions: + interval: + required: 'true' + TimeInterval: + attributes: + end: + annotations: + rank: 2 + description: '' + range: Timestamp + start: + annotations: + rank: 1 + description: '' + range: Timestamp + description: '' +default_prefix: base +enums: {} + +id: https://w3id.org/linkml/phenopackets/base +imports: + - linkml:types + - timestamp +name: base +prefixes: + base: https://w3id.org/linkml/phenopackets/base/ + linkml: https://w3id.org/linkml/ +slots: {} + diff --git a/tests/test_loaders_dumpers/input/phenopackets/disease.yaml b/tests/test_loaders_dumpers/input/phenopackets/disease.yaml new file mode 100644 index 00000000..cb458c6e --- /dev/null +++ b/tests/test_loaders_dumpers/input/phenopackets/disease.yaml @@ -0,0 +1,85 @@ + +classes: + Disease: + attributes: + clinicalTnmFinding: + annotations: + rank: 6 + description: Cancer findings in the TNM system that is relevant to the diagnosis of cancer. See https://www.cancer.gov/about-cancer/diagnosis-staging/staging Valid values include child terms of NCIT:C48232 (Cancer TNM Finding) ARGO mapping primary_diagnosis::clinical_t_category ARGO mapping primary_diagnosis::clinical_n_category ARGO mapping primary_diagnosis::clinical_m_category + exact_mappings: + - ARGO:primary_diagnosis.clinical_t_category + inlined: true + multivalued: true + range: OntologyClass + diseaseStage: + annotations: + rank: 5 + description: Disease staging, the extent to which a disease has developed. For cancers, see https://www.cancer.gov/about-cancer/diagnosis-staging/staging Valid values include child terms of NCIT:C28108 (Disease Stage Qualifier) ARGO mapping primary_diagnosis::clinical_tumour_staging_system ARGO mapping primary_diagnosis::clinical_stage_group + exact_mappings: + - ARGO:primary_diagnosis.clinical_tumour_staging_system + inlined: true + multivalued: true + range: OntologyClass + excluded: + annotations: + rank: 2 + description: Flag to indicate whether the disease was observed or not. Default is 'false', in other words the disease was observed. Therefore it is only required in cases to indicate that the disease was looked for, but found to be absent. More formally, this modifier indicates the logical negation of the OntologyClass used in the 'term' field. *CAUTION* It is imperative to check this field for correct interpretation of the disease! + range: boolean + laterality: + annotations: + rank: 8 + description: "The term used to indicate laterality of diagnosis, if applicable. (Codelist reference: NCI CDE: 4122391)" + inlined: true + range: OntologyClass + onset: + annotations: + rank: 3 + description: "The onset of the disease. The values of this will come from the HPO onset hierarchy i.e. subclasses of HP:0003674 FHIR mapping: Condition.onset ARGO mapping primary_diagnosis::age_at_diagnosis" + exact_mappings: + - ARGO:primary_diagnosis.age_at_diagnosis + inlined: true + range: TimeElement + primarySite: + annotations: + rank: 7 + description: The text term used to describe the primary site of disease, as categorized by the World Health Organization's (WHO) International Classification of Diseases for Oncology (ICD-O). This categorization groups cases into general + inlined: true + range: OntologyClass + resolution: + annotations: + rank: 4 + description: '' + inlined: true + range: TimeElement + term: + annotations: + rank: 1 + description: The identifier of this disease e.g. MONDO:0007043, OMIM:101600, Orphanet:710, DOID:14705 (note these are all equivalent) ARGO mapping primary_diagnosis::submitter_primary_diagnosis_id + exact_mappings: + - ARGO:primary_diagnosis.submitter_primary_diagnosis_id + inlined: true + range: OntologyClass + description: Message to indicate a disease (diagnosis) and its recorded onset. +default_prefix: disease +description: "Automatic translation of phenopackets protobuf to LinkML. Status: EXPERIMENTAL." +enums: {} + +id: https://w3id.org/linkml/phenopackets/disease +imports: + - linkml:types + - base +name: disease +prefixes: + GENO: http://purl.obolibrary.org/obo/GENO_ + HP: http://purl.obolibrary.org/obo/HP_ + LOINC: https://loinc.org/ + MONDO: http://purl.obolibrary.org/obo/MONDO_ + NCIT: http://purl.obolibrary.org/obo/NCIT_ + UBERON: http://purl.obolibrary.org/obo/UBERON_ + UCUM: http://unitsofmeasure.org/ + UO: http://purl.obolibrary.org/obo/UO_ + argo: https://docs.icgc-argo.org/dictionary/ + disease: https://w3id.org/linkml/phenopackets/disease/ + linkml: https://w3id.org/linkml/ +slots: {} + diff --git a/tests/test_loaders_dumpers/input/phenopackets/genome.yaml b/tests/test_loaders_dumpers/input/phenopackets/genome.yaml new file mode 100644 index 00000000..841d4b74 --- /dev/null +++ b/tests/test_loaders_dumpers/input/phenopackets/genome.yaml @@ -0,0 +1,25 @@ + +classes: {} + +default_prefix: genome +description: "Automatic translation of phenopackets protobuf to LinkML. Status: EXPERIMENTAL." +enums: {} + +id: https://w3id.org/linkml/phenopackets/genome +imports: + - linkml:types +name: genome +prefixes: + GENO: http://purl.obolibrary.org/obo/GENO_ + HP: http://purl.obolibrary.org/obo/HP_ + LOINC: https://loinc.org/ + MONDO: http://purl.obolibrary.org/obo/MONDO_ + NCIT: http://purl.obolibrary.org/obo/NCIT_ + UBERON: http://purl.obolibrary.org/obo/UBERON_ + UCUM: http://unitsofmeasure.org/ + UO: http://purl.obolibrary.org/obo/UO_ + argo: https://docs.icgc-argo.org/dictionary/ + genome: https://w3id.org/linkml/phenopackets/genome/ + linkml: https://w3id.org/linkml/ +slots: {} + diff --git a/tests/test_loaders_dumpers/input/phenopackets/individual.yaml b/tests/test_loaders_dumpers/input/phenopackets/individual.yaml new file mode 100644 index 00000000..22bea573 --- /dev/null +++ b/tests/test_loaders_dumpers/input/phenopackets/individual.yaml @@ -0,0 +1,157 @@ + +classes: + Individual: + attributes: + alternateIds: + annotations: + rank: 2 + description: An optional list of alternative identifiers for this individual. This field is provided for the convenience of users who may have multiple mappings to an individual which they need to track. + multivalued: true + range: string + dateOfBirth: + annotations: + rank: 3 + description: The date of birth of the individual as an ISO8601 UTC timestamp - rounded down to the closest known year/month/day/hour/minute e.g. "2018-03-01T00:00:00Z" for someone born on an unknown day in March 2018 or "2018-01-01T00:00:00Z" for someone born on an unknown day in 2018 or empty if unknown/ not stated. + range: string + gender: + annotations: + rank: 8 + description: Self-identified gender + inlined: true + range: OntologyClass + id: + annotations: + rank: 1 + description: An identifier for the individual. This must be unique within the record. ARGO mapping donor::submitter_donor_id + exact_mappings: + - ARGO:donor.submitter_donor_id + range: string + karyotypicSex: + annotations: + rank: 7 + description: The karyotypic sex of the individual + range: KaryotypicSex + sex: + annotations: + rank: 6 + description: The phenotypic sex of the individual ARGO mapping sample_registration::gender (this is complicated as ARGO only have male/female/other which maps to the phenopacket Sex field) + exact_mappings: + - ARGO:sample_registration.gender + range: Sex + taxonomy: + annotations: + rank: 9 + description: NCBI taxonomic identifier NCBITaxon e.g. NCBITaxon:9606 or NCBITaxon:1337 For resources where there may be more than one organism being studied it is advisable to indicate the taxonomic identifier of that organism, to its most specific level + inlined: true + range: OntologyClass + timeAtLastEncounter: + annotations: + rank: 4 + description: An TimeElement object describing the age of the individual at the last time of collection. The Age object allows the encoding of the age either as ISO8601 duration or time interval (preferred), or as ontology term object. See http://build.fhir.org/datatypes + inlined: true + range: TimeElement + vitalStatus: + annotations: + rank: 5 + description: Vital status of the individual. If not present it is assumed that the individual is alive. If present it will default to 'false' i.e. the individual was alive when the data was collected. ARGO mapping donor::vital_status + exact_mappings: + - ARGO:donor.vital_status + range: VitalStatus + description: "An individual (or subject) typically corresponds to an individual human or another organism. FHIR mapping: Patient (https://www.hl7.org/fhir/patient.html)." + VitalStatus: + attributes: + causeOfDeath: + annotations: + rank: 3 + description: ARGO mapping donor::cause_of_death + exact_mappings: + - ARGO:donor.cause_of_death + inlined: true + range: OntologyClass + status: + annotations: + rank: 1 + description: '' + range: Status + survivalTimeInDays: + annotations: + rank: 4 + description: ARGO mapping donor::survival_time + exact_mappings: + - ARGO:donor.survival_time + range: integer + timeOfDeath: + annotations: + rank: 2 + description: '' + inlined: true + range: TimeElement + description: '' +default_prefix: individual +description: "Automatic translation of phenopackets protobuf to LinkML. Status: EXPERIMENTAL." +enums: + KaryotypicSex: + description: Karyotypic sex of the individual + permissible_values: + OTHER_KARYOTYPE: + description: '' + UNKNOWN_KARYOTYPE: + description: '' + XO: + description: '' + XX: + description: '' + XXX: + description: '' + XXXX: + description: '' + XXXY: + description: '' + XXY: + description: '' + XXYY: + description: '' + XY: + description: '' + XYY: + description: '' + Sex: + description: "Sex of an individual FHIR mapping: AdministrativeGender (https://www.hl7.org/fhir/codesystem-administrative-gender.html)" + permissible_values: + FEMALE: + description: Female + MALE: + description: Male + OTHER_SEX: + description: It is not possible, to accurately assess the applicability of MALE/FEMALE. + UNKNOWN_SEX: + description: Not assessed / available. + Status: + description: Default = false i.e. the individual is alive. MUST be true if + permissible_values: + ALIVE: + description: '' + DECEASED: + description: '' + UNKNOWN_STATUS: + description: '' +id: https://w3id.org/linkml/phenopackets/individual +imports: + - linkml:types + - timestamp + - base +name: individual +prefixes: + GENO: http://purl.obolibrary.org/obo/GENO_ + HP: http://purl.obolibrary.org/obo/HP_ + LOINC: https://loinc.org/ + MONDO: http://purl.obolibrary.org/obo/MONDO_ + NCIT: http://purl.obolibrary.org/obo/NCIT_ + UBERON: http://purl.obolibrary.org/obo/UBERON_ + UCUM: http://unitsofmeasure.org/ + UO: http://purl.obolibrary.org/obo/UO_ + argo: https://docs.icgc-argo.org/dictionary/ + individual: https://w3id.org/linkml/phenopackets/individual/ + linkml: https://w3id.org/linkml/ +slots: {} + diff --git a/tests/test_loaders_dumpers/input/phenopackets/interpretation.yaml b/tests/test_loaders_dumpers/input/phenopackets/interpretation.yaml new file mode 100644 index 00000000..98fac124 --- /dev/null +++ b/tests/test_loaders_dumpers/input/phenopackets/interpretation.yaml @@ -0,0 +1,168 @@ + +classes: + Diagnosis: + attributes: + disease: + annotations: + rank: 1 + description: The disease/condition assigned to the diagnosis.Details about this disease may be contained in the `diseases` field in the Phenopacket. + inlined: true + range: OntologyClass + genomicInterpretations: + annotations: + rank: 2 + description: genomic features containing the status of their contribution towards the diagnosis + inlined: true + multivalued: true + range: GenomicInterpretation + description: '' + GenomicInterpretation: + attributes: + gene: + annotations: + rank: 3 + description: '' + inlined: true + range: GeneDescriptor + interpretationStatus: + annotations: + rank: 2 + description: '' + range: InterpretationStatus + subjectOrBiosampleId: + annotations: + rank: 1 + description: identifier for the subject of the interpretation. This MUST be the individual id or a biosample id of the enclosing phenopacket. + range: string + variantInterpretation: + annotations: + rank: 4 + description: '' + range: VariantInterpretation + description: A statement about the contribution of a genomic element towards the observed phenotype. Note that this does not intend to encode any knowledge or results of specific computations. + rules: + - + postconditions: + exactly_one_of: + - + slot_conditions: + gene: + required: true + - + slot_conditions: + variantInterpretation: + required: true + Interpretation: + attributes: + diagnosis: + annotations: + rank: 3 + description: The diagnosis made in this interpretation + range: Diagnosis + id: + annotations: + rank: 1 + description: id of the interpretation + range: string + progressStatus: + annotations: + rank: 2 + description: '' + range: ProgressStatus + summary: + annotations: + rank: 4 + description: '' + range: string + description: '' + VariantInterpretation: + attributes: + acmgPathogenicityClassification: + annotations: + rank: 1 + description: '' + range: AcmgPathogenicityClassification + therapeuticActionability: + annotations: + rank: 2 + description: '' + range: TherapeuticActionability + variationDescriptor: + annotations: + rank: 3 + description: '' + range: VariationDescriptor + description: '' +default_prefix: interpretation +description: "Automatic translation of phenopackets protobuf to LinkML. Status: EXPERIMENTAL." +enums: + AcmgPathogenicityClassification: + description: '' + permissible_values: + BENIGN: + description: '' + LIKELY_BENIGN: + description: '' + LIKELY_PATHOGENIC: + description: '' + NOT_PROVIDED: + description: '' + PATHOGENIC: + description: '' + UNCERTAIN_SIGNIFICANCE: + description: '' + InterpretationStatus: + description: '' + permissible_values: + CANDIDATE: + description: '' + CAUSATIVE: + description: '' + CONTRIBUTORY: + description: '' + REJECTED: + description: '' + UNKNOWN_STATUS: + description: '' + ProgressStatus: + description: '' + permissible_values: + COMPLETED: + description: '' + IN_PROGRESS: + description: '' + SOLVED: + description: '' + UNKNOWN_PROGRESS: + description: '' + UNSOLVED: + description: '' + TherapeuticActionability: + description: '' + permissible_values: + ACTIONABLE: + description: '' + NOT_ACTIONABLE: + description: '' + UNKNOWN_ACTIONABILITY: + description: '' +id: https://w3id.org/linkml/phenopackets/interpretation +imports: + - linkml:types + - base + - vrsatile +name: interpretation +prefixes: + GENO: http://purl.obolibrary.org/obo/GENO_ + HP: http://purl.obolibrary.org/obo/HP_ + LOINC: https://loinc.org/ + MONDO: http://purl.obolibrary.org/obo/MONDO_ + NCIT: http://purl.obolibrary.org/obo/NCIT_ + UBERON: http://purl.obolibrary.org/obo/UBERON_ + UCUM: http://unitsofmeasure.org/ + UO: http://purl.obolibrary.org/obo/UO_ + argo: https://docs.icgc-argo.org/dictionary/ + interpretation: https://w3id.org/linkml/phenopackets/interpretation/ + linkml: https://w3id.org/linkml/ +slots: {} + diff --git a/tests/test_loaders_dumpers/input/phenopackets/measurement.yaml b/tests/test_loaders_dumpers/input/phenopackets/measurement.yaml new file mode 100644 index 00000000..a2a6bf75 --- /dev/null +++ b/tests/test_loaders_dumpers/input/phenopackets/measurement.yaml @@ -0,0 +1,160 @@ + +classes: + ComplexValue: + attributes: + typedQuantities: + annotations: + rank: 1 + description: The quantities required to fully describe the complex value. For example the systolic and diastolic blood pressure quantities + inlined: true + multivalued: true + range: TypedQuantity + description: '' + Measurement: + attributes: + assay: + annotations: + rank: 2 + description: "An ontology class which describes the assay used to produce the measurement. For example \"body temperature\" (CMO:0000015) or \"Platelets [#/volume] in Blood\" (LOINC:26515-7) FHIR mapping: Observation.code" + inlined: true + range: OntologyClass + complexValue: + annotations: + rank: 4 + description: '' + range: ComplexValue + description: + annotations: + rank: 1 + description: Free-text description of the feature. Note this is not a acceptable place to document/describe the phenotype - the type and onset etc... fields should be used for this purpose. + range: string + procedure: + annotations: + rank: 6 + description: Clinical procedure performed on the subject in order to produce the measurement. + range: Procedure + timeObserved: + annotations: + rank: 5 + description: The time at which the measurement was made + inlined: true + range: TimeElement + value: + annotations: + rank: 3 + description: '' + range: Value + description: "FHIR mapping: Observation (https://www.hl7.org/fhir/observation.html)" + rules: + - + postconditions: + exactly_one_of: + - + slot_conditions: + value: + required: true + - + slot_conditions: + complexValue: + required: true + Quantity: + attributes: + referenceRange: + annotations: + rank: 3 + description: Reference range for the quantity e.g. The normal range of platelets is 150,000 to 450,000 platelets/uL. + range: ReferenceRange + unit: + annotations: + rank: 1 + description: For instance, NCIT subhierarchy, Unit of Measure (Code C25709), https://www.ebi.ac.uk/ols/ontologies/uo + inlined: true + range: OntologyClass + value: + annotations: + rank: 2 + description: the value of the quantity in the units e.g. 2.0 mg + range: double + description: '' + ReferenceRange: + attributes: + high: + annotations: + rank: 3 + description: '' + range: double + low: + annotations: + rank: 2 + description: '' + range: double + unit: + annotations: + rank: 1 + description: '' + inlined: true + range: OntologyClass + description: '' + TypedQuantity: + attributes: + quantity: + annotations: + rank: 2 + description: e.g. mm Hg + range: Quantity + type: + annotations: + rank: 1 + description: e.g. diastolic, systolic + inlined: true + range: OntologyClass + description: For complex measurements, such as blood pressure where more than one component quantity is required to describe the measurement + Value: + attributes: + ontologyClass: + annotations: + rank: 2 + description: for use with things such as categories 'red', 'yellow' or 'absent'/'present' + inlined: true + range: OntologyClass + quantity: + annotations: + rank: 1 + description: '' + range: Quantity + description: '' + rules: + - + postconditions: + exactly_one_of: + - + slot_conditions: + quantity: + required: true + - + slot_conditions: + ontologyClass: + required: true +default_prefix: measurement +description: "Automatic translation of phenopackets protobuf to LinkML. Status: EXPERIMENTAL." +enums: {} + +id: https://w3id.org/linkml/phenopackets/measurement +imports: + - linkml:types + - base +name: measurement +prefixes: + GENO: http://purl.obolibrary.org/obo/GENO_ + HP: http://purl.obolibrary.org/obo/HP_ + LOINC: https://loinc.org/ + MONDO: http://purl.obolibrary.org/obo/MONDO_ + NCIT: http://purl.obolibrary.org/obo/NCIT_ + UBERON: http://purl.obolibrary.org/obo/UBERON_ + UCUM: http://unitsofmeasure.org/ + UO: http://purl.obolibrary.org/obo/UO_ + argo: https://docs.icgc-argo.org/dictionary/ + linkml: https://w3id.org/linkml/ + measurement: https://w3id.org/linkml/phenopackets/measurement/ +slots: {} + diff --git a/tests/test_loaders_dumpers/input/phenopackets/medical_action.yaml b/tests/test_loaders_dumpers/input/phenopackets/medical_action.yaml new file mode 100644 index 00000000..fe7e9524 --- /dev/null +++ b/tests/test_loaders_dumpers/input/phenopackets/medical_action.yaml @@ -0,0 +1,264 @@ + +classes: + DoseInterval: + attributes: + interval: + annotations: + rank: 3 + description: '' + inlined: true + range: TimeInterval + quantity: + annotations: + rank: 1 + description: '' + range: Quantity + scheduleFrequency: + annotations: + rank: 2 + description: '' + inlined: true + range: OntologyClass + description: e.g. 50mg/ml 3 times daily for two weeks + MedicalAction: + attributes: + adverseEvents: + annotations: + rank: 8 + description: ARGO mapping treatment::adverse_events + exact_mappings: + - ARGO:treatment.adverse_events + inlined: true + multivalued: true + range: OntologyClass + procedure: + annotations: + rank: 1 + description: '' + range: Procedure + radiationTherapy: + annotations: + rank: 3 + description: '' + range: RadiationTherapy + responseToTreatment: + annotations: + rank: 7 + description: ARGO mapping treatment::response_to_treatment + exact_mappings: + - ARGO:treatment.response_to_treatment + inlined: true + range: OntologyClass + therapeuticRegimen: + annotations: + rank: 4 + description: '' + range: TherapeuticRegimen + treatment: + annotations: + rank: 2 + description: '' + range: Treatment + treatmentIntent: + annotations: + rank: 6 + description: Whether the intention of the treatment was curative, palliative, ARGO mapping treatment::treatment_intent + exact_mappings: + - ARGO:treatment.treatment_intent + inlined: true + range: OntologyClass + treatmentTarget: + annotations: + rank: 5 + description: The condition or disease that this treatment was intended to address. FHIR mapping Procedure::reasonCode + inlined: true + range: OntologyClass + treatmentTerminationReason: + annotations: + rank: 9 + description: ARGO mapping treatment::treatment_outcome + exact_mappings: + - ARGO:treatment.treatment_outcome + inlined: true + range: OntologyClass + description: medication, procedure, other actions taken for clinical management + rules: + - + postconditions: + exactly_one_of: + - + slot_conditions: + procedure: + required: true + - + slot_conditions: + treatment: + required: true + - + slot_conditions: + radiationTherapy: + required: true + - + slot_conditions: + therapeuticRegimen: + required: true + RadiationTherapy: + attributes: + bodySite: + annotations: + rank: 2 + description: The anatomical site where radiation therapy was administered. REQUIRED. ARGO mapping radiation::anatomical_site_irradiated + exact_mappings: + - ARGO:radiation.anatomical_site_irradiated + inlined: true + range: OntologyClass + required: true + dosage: + annotations: + rank: 3 + description: The total dose given in units of Gray (Gy). REQUIRED. ARGO mapping radiation::radiation_therapy_dosage + exact_mappings: + - ARGO:radiation.radiation_therapy_dosage + range: integer + required: true + fractions: + annotations: + rank: 4 + description: The total number of fractions delivered as part of treatment. REQUIRED. ARGO mapping radiation::radiation_therapy_fractions + exact_mappings: + - ARGO:radiation.radiation_therapy_fractions + range: integer + required: true + modality: + annotations: + rank: 1 + description: The modality of radiation therapy (e.g., electron, photon,…). REQUIRED. ARGO mapping radiation::radiation_therapy_modality + exact_mappings: + - ARGO:radiation.radiation_therapy_modality + inlined: true + range: OntologyClass + required: true + description: RadiationTherapy + TherapeuticRegimen: + attributes: + endTime: + annotations: + rank: 4 + description: end time can be empty which would indicate ongoing + inlined: true + range: TimeElement + externalReference: + annotations: + rank: 1 + description: '' + inlined: true + range: ExternalReference + ontologyClass: + annotations: + rank: 2 + description: '' + inlined: true + range: OntologyClass + regimenStatus: + annotations: + rank: 5 + description: '' + range: RegimenStatus + startTime: + annotations: + rank: 3 + description: possibly undefined; + inlined: true + range: TimeElement + description: ARGO mapping radiation::radiation_therapy_type (missing) + rules: + - + postconditions: + exactly_one_of: + - + slot_conditions: + externalReference: + required: true + - + slot_conditions: + ontologyClass: + required: true + Treatment: + attributes: + agent: + annotations: + rank: 1 + description: '' + inlined: true + range: OntologyClass + cumulativeDose: + annotations: + rank: 5 + description: ARGO mapping chemotherapy::cumulative_drug_dosage + exact_mappings: + - ARGO:chemotherapy.cumulative_drug_dosage + range: Quantity + doseIntervals: + annotations: + rank: 3 + description: '' + inlined: true + multivalued: true + range: DoseInterval + drugType: + annotations: + rank: 4 + description: '' + range: DrugType + routeOfAdministration: + annotations: + rank: 2 + description: '' + inlined: true + range: OntologyClass + description: ARGO mapping treatment::is_primary_treatment (missing) treatment with an agent, such as a drug +default_prefix: medical_action +description: "Automatic translation of phenopackets protobuf to LinkML. Status: EXPERIMENTAL." +enums: + DrugType: + description: A simplified version of ODHSI-DRUG_EXPOSURE + permissible_values: + ADMINISTRATION_RELATED_TO_PROCEDURE: + description: '' + EHR_MEDICATION_LIST: + description: '' + PRESCRIPTION: + description: '' + UNKNOWN_DRUG_TYPE: + description: '' + RegimenStatus: + description: '' + permissible_values: + COMPLETED: + description: '' + DISCONTINUED: + description: '' + STARTED: + description: '' + UNKNOWN_STATUS: + description: '' +id: https://w3id.org/linkml/phenopackets/medical_action +imports: + - linkml:types + - base + - measurement +name: medical_action +prefixes: + GENO: http://purl.obolibrary.org/obo/GENO_ + HP: http://purl.obolibrary.org/obo/HP_ + LOINC: https://loinc.org/ + MONDO: http://purl.obolibrary.org/obo/MONDO_ + NCIT: http://purl.obolibrary.org/obo/NCIT_ + UBERON: http://purl.obolibrary.org/obo/UBERON_ + UCUM: http://unitsofmeasure.org/ + UO: http://purl.obolibrary.org/obo/UO_ + argo: https://docs.icgc-argo.org/dictionary/ + linkml: https://w3id.org/linkml/ + medical_action: https://w3id.org/linkml/phenopackets/medical_action/ +slots: {} + diff --git a/tests/test_loaders_dumpers/input/phenopackets/meta_data.yaml b/tests/test_loaders_dumpers/input/phenopackets/meta_data.yaml new file mode 100644 index 00000000..cd475359 --- /dev/null +++ b/tests/test_loaders_dumpers/input/phenopackets/meta_data.yaml @@ -0,0 +1,122 @@ + +classes: + MetaData: + attributes: + created: + annotations: + rank: 1 + description: ISO8601 UTC timestamp for when this phenopacket was created in ISO "2018-03-01T00:00:00Z" + range: string + createdBy: + annotations: + rank: 2 + description: some kind of identifier for the contributor/ program ARGO sample_registration::program_id + range: string + externalReferences: + annotations: + rank: 7 + description: External identifiers for this message. These are considered different representation of the same record, not records which are in some other relation with the record at hand. For example this might be a PubMed reference to a study in which the individuals are reported. + inlined: true + multivalued: true + range: ExternalReference + phenopacketSchemaVersion: + annotations: + rank: 6 + description: phenopacket-schema-version used to create this phenopacket + range: string + resources: + annotations: + rank: 4 + description: a listing of the ontologies and resources referenced in the phenopacket + inlined: true + multivalued: true + range: Resource + submittedBy: + annotations: + rank: 3 + description: information about the person/organisation/network that has submitted this phenopacket + range: string + updates: + annotations: + rank: 5 + description: An OPTIONAL list of Updates to the phenopacket. + inlined: true + multivalued: true + range: Update + description: '' + Resource: + attributes: + id: + annotations: + rank: 1 + description: "for OBO Ontologies, the value of this string MUST always be the official OBO ID, which is always equivalent to the ID prefix in lower case. Examples: hp, go, mp, mondo Consult http://obofoundry.org for a complete list For other ontologies (e.g. SNOMED), use the prefix in identifiers.org" + range: string + iriPrefix: + annotations: + rank: 6 + description: "Full IRI prefix which can be used with the namespace_prefix and the OntologyClass::id to resolve to an IRI for a term. Tools such as the curie-util (https://github.com/prefixcommons/curie-util) can utilise this to produce fully-resolvable IRIs for an OntologyClass. e.g. Using the HPO term encoding the concept of 'Severe' OntologyClass: id: 'HP:0012828' label: 'Severe' Resource: namespace_prefix: 'HP' iri_prefix: 'http://purl.obolibrary.org/obo/HP_' the term can be resolved to http://purl.obolibrary.org/obo/HP_0012828" + range: string + name: + annotations: + rank: 2 + description: e.g. The Human Phenotype Ontology for OBO Ontologies, the value of this string SHOULD be the same as the title field on http://obofoundry.org however, this field is purely for information purposes and software should not encode any assumptions + range: string + namespacePrefix: + annotations: + rank: 5 + description: The prefix used in the CURIE of an OntologyClass e.g. HP, MP, ECO For example an HPO term will have a CURIE like this - HP:0012828 which should be used in combination with the iri_prefix to form a fully-resolvable IRI + range: string + url: + annotations: + rank: 3 + description: For OBO ontologies, this should always be the PURL, e.g. http://purl.obolibrary.org/obo/hp.owl, http://purl.obolibrary.org/obo/hp.obo + range: string + version: + annotations: + rank: 4 + description: for OBO ontologies, this should be the versionIRI + range: string + description: "Description of an external resource used for referencing an object. For example the resource may be an ontology such as the HPO or SNOMED. FHIR mapping: CodeSystem (http://www.hl7.org/fhir/codesystem.html)" + Update: + attributes: + comment: + annotations: + rank: 3 + description: Textual comment about the changes made to the content and/or reason for the update. OPTIONAL + range: string + timestamp: + annotations: + rank: 1 + description: ISO8601 UTC timestamps at which this record was updated, in the format YYYY-MM-DDTHH:MM:SS.SSSZ e.g. 2007-12-03T10:15:30.00Z REQUIRED + range: string + required: true + updatedBy: + annotations: + rank: 2 + description: Information about the person/organisation/network that has updated the phenopacket. OPTIONAL + range: string + description: Information about when an update to a record occurred, who or what made the update and any pertinent information regarding the content and/or reason for the update +default_prefix: meta_data +description: "Automatic translation of phenopackets protobuf to LinkML. Status: EXPERIMENTAL." +enums: {} + +id: https://w3id.org/linkml/phenopackets/meta_data +imports: + - linkml:types + - timestamp + - base +name: meta_data +prefixes: + GENO: http://purl.obolibrary.org/obo/GENO_ + HP: http://purl.obolibrary.org/obo/HP_ + LOINC: https://loinc.org/ + MONDO: http://purl.obolibrary.org/obo/MONDO_ + NCIT: http://purl.obolibrary.org/obo/NCIT_ + UBERON: http://purl.obolibrary.org/obo/UBERON_ + UCUM: http://unitsofmeasure.org/ + UO: http://purl.obolibrary.org/obo/UO_ + argo: https://docs.icgc-argo.org/dictionary/ + linkml: https://w3id.org/linkml/ + meta_data: https://w3id.org/linkml/phenopackets/meta_data/ +slots: {} + diff --git a/tests/test_loaders_dumpers/input/phenopackets/pedigree.yaml b/tests/test_loaders_dumpers/input/phenopackets/pedigree.yaml new file mode 100644 index 00000000..351e8a42 --- /dev/null +++ b/tests/test_loaders_dumpers/input/phenopackets/pedigree.yaml @@ -0,0 +1,76 @@ + +classes: + Pedigree: + attributes: + persons: + annotations: + rank: 1 + description: '' + inlined: true + multivalued: true + range: Person + description: https://software.broadinstitute.org/gatk/documentation/article?id=11016 + Person: + attributes: + affectedStatus: + annotations: + rank: 6 + description: '' + range: AffectedStatus + familyId: + annotations: + rank: 1 + description: '' + range: string + individualId: + annotations: + rank: 2 + description: '' + range: string + maternalId: + annotations: + rank: 4 + description: '' + range: string + paternalId: + annotations: + rank: 3 + description: '' + range: string + sex: + annotations: + rank: 5 + description: '' + range: Sex + description: '' +default_prefix: pedigree +description: "Automatic translation of phenopackets protobuf to LinkML. Status: EXPERIMENTAL." +enums: + AffectedStatus: + description: '' + permissible_values: + AFFECTED: + description: '' + MISSING: + description: '' + UNAFFECTED: + description: '' +id: https://w3id.org/linkml/phenopackets/pedigree +imports: + - linkml:types + - individual +name: pedigree +prefixes: + GENO: http://purl.obolibrary.org/obo/GENO_ + HP: http://purl.obolibrary.org/obo/HP_ + LOINC: https://loinc.org/ + MONDO: http://purl.obolibrary.org/obo/MONDO_ + NCIT: http://purl.obolibrary.org/obo/NCIT_ + UBERON: http://purl.obolibrary.org/obo/UBERON_ + UCUM: http://unitsofmeasure.org/ + UO: http://purl.obolibrary.org/obo/UO_ + argo: https://docs.icgc-argo.org/dictionary/ + linkml: https://w3id.org/linkml/ + pedigree: https://w3id.org/linkml/phenopackets/pedigree/ +slots: {} + diff --git a/tests/test_loaders_dumpers/input/phenopackets/phenopackets.yaml b/tests/test_loaders_dumpers/input/phenopackets/phenopackets.yaml new file mode 100644 index 00000000..745f6dfa --- /dev/null +++ b/tests/test_loaders_dumpers/input/phenopackets/phenopackets.yaml @@ -0,0 +1,181 @@ + +classes: + Cohort: + attributes: + description: + annotations: + rank: 2 + description: '' + range: string + files: + annotations: + rank: 4 + description: Pointer to relevant file(s) for the cohort. Files relating exclusively to individual phenopackets should be contained in the Phenopacket. + inlined: true + multivalued: true + range: File + id: + annotations: + rank: 1 + description: '' + range: string + members: + annotations: + rank: 3 + description: '' + inlined: true + multivalued: true + range: Phenopacket + metaData: + annotations: + rank: 5 + description: Structured definitions of the resources and ontologies used within the phenopacket. REQUIRED + range: MetaData + required: true + description: A group of individuals related in some phenotypic or genotypic aspect. + Family: + attributes: + consanguinousParents: + annotations: + rank: 7 + description: flag to indicate that the parents of the proband are consanguinous + range: boolean + files: + annotations: + rank: 5 + description: Pointer to the relevant file(s) for the family. These should be files relating to one or more of the family members e.g a multi-sample VCF. Files relating exclusively to individual phenopackets should be contained in the Phenopacket. + inlined: true + multivalued: true + range: File + id: + annotations: + rank: 1 + description: An identifier specific for this family. + range: string + metaData: + annotations: + rank: 6 + description: Structured definitions of the resources and ontologies used within the phenopacket. REQUIRED + range: MetaData + required: true + pedigree: + annotations: + rank: 4 + description: The pedigree defining the relations between the proband and their relatives. Pedigree.individual_id should map to the PhenoPacket.Individual.id + range: Pedigree + proband: + annotations: + rank: 2 + description: The individual representing the focus of this packet - e.g. the proband in rare disease cases or cancer patient + inlined: true + range: Phenopacket + relatives: + annotations: + rank: 3 + description: Individuals related in some way to the patient. For instance, the individuals may be genetically related or may be members of a cohort. If this field is used, then it is expected that a pedigree will be included for genetically related individuals for use cases such as genomic diagnostics. If a phenopacket is being used to describe one member of a cohort, then in general one phenopacket will be created for each of the individuals in the cohort. + inlined: true + multivalued: true + range: Phenopacket + description: Phenotype, sample and pedigree data required for a genomic diagnosis. Equivalent to the Genomics England InterpretationRequestRD https://github.com/genomicsengland/GelReportModels/blob/master/schemas/IDLs/org.gel.models.report.avro/5.0.0/InterpretationRequestRD.avdl + Phenopacket: + attributes: + biosamples: + annotations: + rank: 5 + description: Biosample(s) derived from the patient or a collection of biosamples in isolation + inlined: true + multivalued: true + range: Biosample + diseases: + annotations: + rank: 7 + description: Field for disease identifiers - could be used for listing either diagnosed or suspected conditions. The resources using these fields should define what this represents in their context. + multivalued: true + range: Disease + files: + annotations: + rank: 10 + description: Pointer to the relevant file(s) for the individual + inlined: true + multivalued: true + range: File + id: + annotations: + rank: 1 + description: An identifier specific for this phenopacket. + range: string + interpretations: + annotations: + rank: 6 + description: '' + inlined: true + multivalued: true + range: Interpretation + measurements: + annotations: + rank: 4 + description: Quantifiable measurements related to the individual + inlined: true + multivalued: true + range: Measurement + medicalActions: + annotations: + rank: 9 + description: '' + inlined: true + multivalued: true + range: MedicalAction + metaData: + annotations: + rank: 11 + description: Structured definitions of the resources and ontologies used within the phenopacket. REQUIRED + range: MetaData + required: true + phenotypicFeatures: + annotations: + rank: 3 + description: Phenotypic features relating to the subject of the phenopacket + inlined: true + multivalued: true + range: PhenotypicFeature + subject: + annotations: + rank: 2 + description: The individual representing the focus of this packet - e.g. the proband in rare disease cases or cancer patient + inlined: true + range: Individual + description: An anonymous phenotypic description of an individual or biosample with potential genes of interest and/or diagnoses. This is a bundle of high-level concepts with no specifically defined relational concepts. It is expected that the resources sharing the phenopackets will define and enforce their own semantics and level of requirements for included fields. + tree_root: true +default_prefix: phenopackets +description: "Automatic translation of phenopackets protobuf to LinkML. Status: EXPERIMENTAL." +enums: {} + +id: https://w3id.org/linkml/phenopackets/phenopackets +imports: + - linkml:types + - cv_terms + - base + - biosample + - disease + - interpretation + - individual + - measurement + - medical_action + - meta_data + - pedigree + - phenotypic_feature +name: phenopackets +prefixes: + GENO: http://purl.obolibrary.org/obo/GENO_ + HP: http://purl.obolibrary.org/obo/HP_ + LOINC: https://loinc.org/ + MONDO: http://purl.obolibrary.org/obo/MONDO_ + NCIT: http://purl.obolibrary.org/obo/NCIT_ + UBERON: http://purl.obolibrary.org/obo/UBERON_ + UCUM: http://unitsofmeasure.org/ + UO: http://purl.obolibrary.org/obo/UO_ + argo: https://docs.icgc-argo.org/dictionary/ + linkml: https://w3id.org/linkml/ + phenopackets: https://w3id.org/linkml/phenopackets/phenopackets/ +slots: {} + diff --git a/tests/test_loaders_dumpers/input/phenopackets/phenotypic_feature.yaml b/tests/test_loaders_dumpers/input/phenopackets/phenotypic_feature.yaml new file mode 100644 index 00000000..d43db4b8 --- /dev/null +++ b/tests/test_loaders_dumpers/input/phenopackets/phenotypic_feature.yaml @@ -0,0 +1,75 @@ + +classes: + PhenotypicFeature: + attributes: + description: + annotations: + rank: 1 + description: Free-text description of the phenotype. Note this is not a acceptable place to document/describe the phenotype - the type and onset etc... fields should be used for this purpose. + range: string + evidence: + annotations: + rank: 8 + description: Evidences for how the phenotype was determined. + multivalued: true + range: Evidence + excluded: + annotations: + rank: 3 + description: Flag to indicate whether the phenotype was observed or not. Default is 'false', in other words the phenotype was observed. Therefore it is only required in cases to indicate that the phenotype was looked for, but found to be absent. More formally, this modifier indicates the logical negation of the OntologyClass used in the 'type' field. *CAUTION* It is imperative to check this field for correct interpretation of the phenotype! + range: boolean + modifiers: + annotations: + rank: 5 + description: subclasses of HP:0012823 ! Clinical modifier apart from Severity HP:0012824 - Severity + inlined: true + multivalued: true + range: OntologyClass + onset: + annotations: + rank: 6 + description: "the values of this will come from the HPO onset hierarchy i.e. subclasses of HP:0003674 FHIR mapping: Condition.onset" + inlined: true + range: TimeElement + resolution: + annotations: + rank: 7 + description: '' + inlined: true + range: TimeElement + severity: + annotations: + rank: 4 + description: "Severity of the condition e.g. subclasses of HP:0012824-Severity or SNOMED:272141005-Severities FHIR mapping: Condition.severity" + inlined: true + range: OntologyClass + type: + annotations: + rank: 2 + description: "The primary ontology class which describes the phenotype. For example \"HP:0001363\" \"Craniosynostosis\" FHIR mapping: Condition.identifier" + inlined: true + range: OntologyClass + description: "An individual phenotypic feature, observed as either present or absent (negated), with possible onset, modifiers and frequency FHIR mapping: Condition (https://www.hl7.org/fhir/condition.html) or Observation (https://www.hl7.org/fhir/observation.html)" +default_prefix: phenotypic_feature +description: "Automatic translation of phenopackets protobuf to LinkML. Status: EXPERIMENTAL." +enums: {} + +id: https://w3id.org/linkml/phenopackets/phenotypic_feature +imports: + - linkml:types + - base +name: phenotypic_feature +prefixes: + GENO: http://purl.obolibrary.org/obo/GENO_ + HP: http://purl.obolibrary.org/obo/HP_ + LOINC: https://loinc.org/ + MONDO: http://purl.obolibrary.org/obo/MONDO_ + NCIT: http://purl.obolibrary.org/obo/NCIT_ + UBERON: http://purl.obolibrary.org/obo/UBERON_ + UCUM: http://unitsofmeasure.org/ + UO: http://purl.obolibrary.org/obo/UO_ + argo: https://docs.icgc-argo.org/dictionary/ + linkml: https://w3id.org/linkml/ + phenotypic_feature: https://w3id.org/linkml/phenopackets/phenotypic_feature/ +slots: {} + diff --git a/tests/test_loaders_dumpers/input/phenopackets/timestamp.yaml b/tests/test_loaders_dumpers/input/phenopackets/timestamp.yaml new file mode 100644 index 00000000..2c2cc766 --- /dev/null +++ b/tests/test_loaders_dumpers/input/phenopackets/timestamp.yaml @@ -0,0 +1,37 @@ + +classes: + Timestamp: + attributes: + nanos: + annotations: + rank: 2 + description: Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive. + range: integer + seconds: + annotations: + rank: 1 + description: Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. + range: integer + description: "A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D ) to obtain a formatter capable of generating timestamps in this format. " +default_prefix: timestamp +description: "Automatic translation of phenopackets protobuf to LinkML. Status: EXPERIMENTAL." +enums: {} + +id: https://w3id.org/linkml/phenopackets/timestamp +imports: + - linkml:types +name: timestamp +prefixes: + GENO: http://purl.obolibrary.org/obo/GENO_ + HP: http://purl.obolibrary.org/obo/HP_ + LOINC: https://loinc.org/ + MONDO: http://purl.obolibrary.org/obo/MONDO_ + NCIT: http://purl.obolibrary.org/obo/NCIT_ + UBERON: http://purl.obolibrary.org/obo/UBERON_ + UCUM: http://unitsofmeasure.org/ + UO: http://purl.obolibrary.org/obo/UO_ + argo: https://docs.icgc-argo.org/dictionary/ + linkml: https://w3id.org/linkml/ + timestamp: https://w3id.org/linkml/phenopackets/timestamp/ +slots: {} + diff --git a/tests/test_loaders_dumpers/input/phenopackets/vrs.yaml b/tests/test_loaders_dumpers/input/phenopackets/vrs.yaml new file mode 100644 index 00000000..00a3c621 --- /dev/null +++ b/tests/test_loaders_dumpers/input/phenopackets/vrs.yaml @@ -0,0 +1,695 @@ + +classes: + Abundance: + attributes: + copyNumber: + annotations: + rank: 1 + description: '' + range: CopyNumber + description: '' + rules: + - + postconditions: + exactly_one_of: + - + slot_conditions: + copyNumber: + required: true + Allele: + attributes: + chromosomeLocation: + annotations: + rank: 3 + description: '' + range: ChromosomeLocation + curie: + annotations: + rank: 2 + description: '' + range: string + derivedSequenceExpression: + annotations: + rank: 6 + description: '' + range: DerivedSequenceExpression + id: + annotations: + rank: 1 + description: '' + range: string + literalSequenceExpression: + annotations: + rank: 5 + description: '' + range: LiteralSequenceExpression + repeatedSequenceExpression: + annotations: + rank: 7 + description: '' + range: RepeatedSequenceExpression + sequenceLocation: + annotations: + rank: 4 + description: '' + range: SequenceLocation + description: '' + rules: + - + postconditions: + exactly_one_of: + - + slot_conditions: + literalSequenceExpression: + required: true + - + slot_conditions: + derivedSequenceExpression: + required: true + - + slot_conditions: + repeatedSequenceExpression: + required: true + ChromosomeLocation: + attributes: + chr: + annotations: + rank: 3 + description: '' + range: string + id: + annotations: + rank: 1 + description: '' + range: string + interval: + annotations: + rank: 4 + description: '' + inlined: true + range: CytobandInterval + speciesId: + annotations: + rank: 2 + description: '' + range: string + description: '' + CopyNumber: + attributes: + allele: + annotations: + rank: 2 + description: '' + range: Allele + curie: + annotations: + rank: 8 + description: '' + range: string + definiteRange: + annotations: + rank: 11 + description: '' + range: DefiniteRange + derivedSequenceExpression: + annotations: + rank: 6 + description: '' + range: DerivedSequenceExpression + gene: + annotations: + rank: 4 + description: '' + range: Gene + haplotype: + annotations: + rank: 3 + description: '' + range: Haplotype + id: + annotations: + rank: 1 + description: '' + range: string + indefiniteRange: + annotations: + rank: 10 + description: '' + range: IndefiniteRange + literalSequenceExpression: + annotations: + rank: 5 + description: '' + range: LiteralSequenceExpression + number: + annotations: + rank: 9 + description: '' + range: Number + repeatedSequenceExpression: + annotations: + rank: 7 + description: '' + range: RepeatedSequenceExpression + description: '' + rules: + - + postconditions: + exactly_one_of: + - + slot_conditions: + number: + required: true + - + slot_conditions: + indefiniteRange: + required: true + - + slot_conditions: + definiteRange: + required: true + CytobandInterval: + attributes: + end: + annotations: + rank: 2 + description: '' + range: string + start: + annotations: + rank: 1 + description: '' + range: string + description: '' + DefiniteRange: + attributes: + max: + annotations: + rank: 2 + description: '' + range: integer + min: + annotations: + rank: 1 + description: '' + range: integer + description: '' + DerivedSequenceExpression: + attributes: + location: + annotations: + rank: 1 + description: '' + range: SequenceLocation + reverseComplement: + annotations: + rank: 2 + description: '' + range: boolean + description: '' + Feature: + attributes: + gene: + annotations: + rank: 1 + description: '' + range: Gene + description: '' + rules: + - + postconditions: + exactly_one_of: + - + slot_conditions: + gene: + required: true + Gene: + attributes: + geneId: + annotations: + rank: 1 + description: '' + range: string + description: '' + Haplotype: + attributes: {} + + description: '' + IndefiniteRange: + attributes: + comparator: + annotations: + rank: 2 + description: '' + range: string + value: + annotations: + rank: 1 + description: '' + range: integer + description: '' + LiteralSequenceExpression: + attributes: + sequence: + annotations: + rank: 1 + description: '' + range: string + description: '' + Location: + attributes: + chromosomeLocation: + annotations: + rank: 1 + description: '' + range: ChromosomeLocation + sequenceLocation: + annotations: + rank: 2 + description: '' + range: SequenceLocation + description: '' + rules: + - + postconditions: + exactly_one_of: + - + slot_conditions: + chromosomeLocation: + required: true + - + slot_conditions: + sequenceLocation: + required: true + Member: + attributes: + allele: + annotations: + rank: 2 + description: '' + range: Allele + copyNumber: + annotations: + rank: 4 + description: '' + range: CopyNumber + curie: + annotations: + rank: 1 + description: '' + range: string + haplotype: + annotations: + rank: 3 + description: '' + range: Haplotype + id: + annotations: + rank: 1 + description: '' + range: string + members: + annotations: + rank: 2 + description: '' + inlined: true + multivalued: true + range: Member + text: + annotations: + rank: 5 + description: '' + range: Text + variationSet: + annotations: + rank: 6 + description: '' + range: VariationSet + description: '' + rules: + - + postconditions: + exactly_one_of: + - + slot_conditions: + curie: + required: true + - + slot_conditions: + allele: + required: true + - + slot_conditions: + haplotype: + required: true + - + slot_conditions: + copyNumber: + required: true + - + slot_conditions: + text: + required: true + - + slot_conditions: + variationSet: + required: true + MolecularVariation: + attributes: + allele: + annotations: + rank: 1 + description: '' + range: Allele + haplotype: + annotations: + rank: 2 + description: '' + range: Haplotype + description: '' + rules: + - + postconditions: + exactly_one_of: + - + slot_conditions: + allele: + required: true + - + slot_conditions: + haplotype: + required: true + Number: + attributes: + value: + annotations: + rank: 1 + description: '' + range: integer + description: '' + RepeatedSequenceExpression: + attributes: + definiteRange: + annotations: + rank: 5 + description: '' + range: DefiniteRange + derivedSequenceExpression: + annotations: + rank: 2 + description: '' + range: DerivedSequenceExpression + indefiniteRange: + annotations: + rank: 4 + description: '' + range: IndefiniteRange + literalSequenceExpression: + annotations: + rank: 1 + description: '' + range: LiteralSequenceExpression + number: + annotations: + rank: 3 + description: '' + range: Number + description: '' + rules: + - + postconditions: + exactly_one_of: + - + slot_conditions: + number: + required: true + - + slot_conditions: + indefiniteRange: + required: true + - + slot_conditions: + definiteRange: + required: true + SequenceExpression: + attributes: + derivedSequenceExpression: + annotations: + rank: 2 + description: '' + range: DerivedSequenceExpression + literalSequenceExpression: + annotations: + rank: 1 + description: '' + range: LiteralSequenceExpression + repeatedSequenceExpression: + annotations: + rank: 3 + description: '' + range: RepeatedSequenceExpression + description: '' + rules: + - + postconditions: + exactly_one_of: + - + slot_conditions: + literalSequenceExpression: + required: true + - + slot_conditions: + derivedSequenceExpression: + required: true + - + slot_conditions: + repeatedSequenceExpression: + required: true + SequenceInterval: + attributes: + endDefiniteRange: + annotations: + rank: 6 + description: '' + range: DefiniteRange + endIndefiniteRange: + annotations: + rank: 5 + description: '' + range: IndefiniteRange + endNumber: + annotations: + rank: 4 + description: '' + range: Number + startDefiniteRange: + annotations: + rank: 3 + description: '' + range: DefiniteRange + startIndefiniteRange: + annotations: + rank: 2 + description: '' + range: IndefiniteRange + startNumber: + annotations: + rank: 1 + description: '' + range: Number + description: '' + rules: + - + postconditions: + exactly_one_of: + - + slot_conditions: + endNumber: + required: true + - + slot_conditions: + endIndefiniteRange: + required: true + - + slot_conditions: + endDefiniteRange: + required: true + SequenceLocation: + attributes: + id: + annotations: + rank: 1 + description: '' + range: string + sequenceId: + annotations: + rank: 2 + description: '' + range: string + sequenceInterval: + annotations: + rank: 3 + description: '' + range: SequenceInterval + description: '' + rules: + - + postconditions: + exactly_one_of: + - + slot_conditions: + sequenceInterval: + required: true + SequenceState: + attributes: + sequence: + annotations: + rank: 1 + description: '' + range: string + description: '' + SimpleInterval: + attributes: + end: + annotations: + rank: 2 + description: '' + range: integer + start: + annotations: + rank: 1 + description: '' + range: integer + description: '' + SystemicVariation: + attributes: + copyNumber: + annotations: + rank: 1 + description: '' + range: CopyNumber + description: '' + rules: + - + postconditions: + exactly_one_of: + - + slot_conditions: + copyNumber: + required: true + Text: + attributes: + definition: + annotations: + rank: 2 + description: '' + range: string + id: + annotations: + rank: 1 + description: '' + range: string + description: '' + UtilityVariation: + attributes: + text: + annotations: + rank: 1 + description: '' + range: Text + variationSet: + annotations: + rank: 2 + description: '' + range: VariationSet + description: '' + rules: + - + postconditions: + exactly_one_of: + - + slot_conditions: + text: + required: true + - + slot_conditions: + variationSet: + required: true + Variation: + attributes: + allele: + annotations: + rank: 1 + description: '' + range: Allele + copyNumber: + annotations: + rank: 3 + description: '' + range: CopyNumber + haplotype: + annotations: + rank: 2 + description: '' + range: Haplotype + text: + annotations: + rank: 4 + description: '' + range: Text + variationSet: + annotations: + rank: 5 + description: '' + range: VariationSet + description: '' + rules: + - + postconditions: + exactly_one_of: + - + slot_conditions: + allele: + required: true + - + slot_conditions: + haplotype: + required: true + - + slot_conditions: + copyNumber: + required: true + - + slot_conditions: + text: + required: true + - + slot_conditions: + variationSet: + required: true + VariationSet: + attributes: {} + + description: '' +default_prefix: vrs +description: "Automatic translation of phenopackets protobuf to LinkML. Status: EXPERIMENTAL." +enums: {} + +id: https://w3id.org/linkml/phenopackets/vrs +imports: + - linkml:types +name: vrs +prefixes: + GENO: http://purl.obolibrary.org/obo/GENO_ + HP: http://purl.obolibrary.org/obo/HP_ + LOINC: https://loinc.org/ + MONDO: http://purl.obolibrary.org/obo/MONDO_ + NCIT: http://purl.obolibrary.org/obo/NCIT_ + UBERON: http://purl.obolibrary.org/obo/UBERON_ + UCUM: http://unitsofmeasure.org/ + UO: http://purl.obolibrary.org/obo/UO_ + argo: https://docs.icgc-argo.org/dictionary/ + linkml: https://w3id.org/linkml/ + vrs: https://w3id.org/linkml/phenopackets/vrs/ +slots: {} + diff --git a/tests/test_loaders_dumpers/input/phenopackets/vrsatile.yaml b/tests/test_loaders_dumpers/input/phenopackets/vrsatile.yaml new file mode 100644 index 00000000..132d1d38 --- /dev/null +++ b/tests/test_loaders_dumpers/input/phenopackets/vrsatile.yaml @@ -0,0 +1,236 @@ + +classes: + Expression: + attributes: + syntax: + annotations: + rank: 1 + description: '' + range: string + value: + annotations: + rank: 2 + description: '' + range: string + version: + annotations: + rank: 3 + description: '' + range: string + description: https://vrsatile.readthedocs.io/en/latest/value_object_descriptor/vod_index.html#expression + Extension: + attributes: + name: + annotations: + rank: 1 + description: '' + range: string + value: + annotations: + rank: 2 + description: '' + inlined: true + multivalued: true + range: Any + description: https://vrsatile.readthedocs.io/en/latest/value_object_descriptor/vod_index.html#extension + GeneDescriptor: + attributes: + alternateIds: + annotations: + rank: 4 + description: Alternate IDs (should be CURIE) for the same concept may be placed in alternate_ids + multivalued: true + range: string + alternateSymbols: + annotations: + rank: 5 + description: Takes the place of alternate_labels field in a generic descriptor + multivalued: true + range: string + description: + annotations: + rank: 3 + description: A free-text description of the value object + range: string + symbol: + annotations: + rank: 2 + description: The primary gene symbol. Takes the place of the label field in a generic descriptor + range: string + valueId: + annotations: + rank: 1 + description: The official gene identifier as designated by the organism gene nomenclature committee e.g. HGNC:3477 or MGI:2385071 This should be a CURIE linking the reference to a namespace where it can be retrieved. Mirrors the value_id field of a generic value object descriptor + range: string + xrefs: + annotations: + rank: 6 + description: Related concept IDs (e.g. gene ortholog IDs) may be placed in xrefs + multivalued: true + range: string + description: https://vrsatile.readthedocs.io/en/latest/value_object_descriptor/vod_index.html#gene-descriptor + VariationDescriptor: + attributes: + allelicState: + annotations: + rank: 14 + description: We RECOMMEND that the allelic_state of variant be described by terms from the Genotype Ontology (GENO). These SHOULD descend from concept GENO:0000875. + inlined: true + range: OntologyClass + alternateLabels: + annotations: + rank: 9 + description: Common aliases for a variant, e.g. EGFR vIII, are alternate labels + multivalued: true + range: string + description: + annotations: + rank: 4 + description: '' + range: string + expressions: + annotations: + rank: 6 + description: HGVS, SPDI, and gnomAD-style strings should be represented as Expressions + inlined: true + multivalued: true + range: Expression + extensions: + annotations: + rank: 10 + description: '' + inlined: true + multivalued: true + range: Extension + geneContext: + annotations: + rank: 5 + description: A specific gene context that applies to this variant. + inlined: true + range: GeneDescriptor + id: + annotations: + rank: 1 + description: '' + range: string + label: + annotations: + rank: 3 + description: '' + range: string + moleculeContext: + annotations: + rank: 11 + description: The molecular context of the vrs variation. Must be one of “genomic”, “transcript”, or “protein”. Defaults to "unspecified_molecule_context" + range: MoleculeContext + structuralType: + annotations: + rank: 12 + description: The structural variant type associated with this variant, such as a substitution, deletion, or fusion. We RECOMMEND using a descendent term of SO:0001537. + inlined: true + range: OntologyClass + variation: + annotations: + rank: 2 + description: '' + range: Variation + vcfRecord: + annotations: + rank: 7 + description: A VCF Record of the variant. This SHOULD be a single allele, the VCF genotype (GT) field should be represented in the allelic_state + range: VcfRecord + vrsRefAlleleSeq: + annotations: + rank: 13 + description: A Sequence corresponding to a “ref allele”, describing the sequence expected at a SequenceLocation reference. + range: string + xrefs: + annotations: + rank: 8 + description: Allele registry, ClinVar, or other related IDs should be included as xrefs + multivalued: true + range: string + description: '' + VcfRecord: + attributes: + alt: + annotations: + rank: 6 + description: '' + range: string + chrom: + annotations: + rank: 2 + description: '' + range: string + filter: + annotations: + rank: 8 + description: '' + range: string + genomeAssembly: + annotations: + rank: 1 + description: '' + range: string + id: + annotations: + rank: 4 + description: '' + range: string + info: + annotations: + rank: 9 + description: '' + range: string + pos: + annotations: + rank: 3 + description: '' + range: integer + qual: + annotations: + rank: 7 + description: '' + range: string + ref: + annotations: + rank: 5 + description: '' + range: string + description: '' +default_prefix: vrsatile +description: "Automatic translation of phenopackets protobuf to LinkML. Status: EXPERIMENTAL." +enums: + MoleculeContext: + description: '' + permissible_values: + genomic: + description: '' + protein: + description: '' + transcript: + description: '' + unspecified_molecule_context: + description: '' +id: https://w3id.org/linkml/phenopackets/vrsatile +imports: + - linkml:types + - any + - vrs + - base +name: vrsatile +prefixes: + GENO: http://purl.obolibrary.org/obo/GENO_ + HP: http://purl.obolibrary.org/obo/HP_ + LOINC: https://loinc.org/ + MONDO: http://purl.obolibrary.org/obo/MONDO_ + NCIT: http://purl.obolibrary.org/obo/NCIT_ + UBERON: http://purl.obolibrary.org/obo/UBERON_ + UCUM: http://unitsofmeasure.org/ + UO: http://purl.obolibrary.org/obo/UO_ + argo: https://docs.icgc-argo.org/dictionary/ + linkml: https://w3id.org/linkml/ + vrsatile: https://w3id.org/linkml/phenopackets/vrsatile/ +slots: {} + diff --git a/tests/test_loaders_dumpers/models/phenopackets.py b/tests/test_loaders_dumpers/models/phenopackets.py new file mode 100644 index 00000000..5826c9d6 --- /dev/null +++ b/tests/test_loaders_dumpers/models/phenopackets.py @@ -0,0 +1,3970 @@ +# Auto generated from phenopackets.yaml by pythongen.py version: 0.9.0 +# Generation date: 2023-01-17T12:56:45 +# Schema: phenopackets +# +# id: https://w3id.org/linkml/phenopackets/phenopackets +# description: Automatic translation of phenopackets protobuf to LinkML. Status: EXPERIMENTAL. +# license: https://creativecommons.org/publicdomain/zero/1.0/ + +import dataclasses +import sys +import re +from jsonasobj2 import JsonObj, as_dict +from typing import Optional, List, Union, Dict, ClassVar, Any +from dataclasses import dataclass +from linkml_runtime.linkml_model.meta import EnumDefinition, PermissibleValue, PvFormulaOptions + +from linkml_runtime.utils.slot import Slot +from linkml_runtime.utils.metamodelcore import empty_list, empty_dict, bnode +from linkml_runtime.utils.yamlutils import YAMLRoot, extended_str, extended_float, extended_int +from linkml_runtime.utils.dataclass_extensions_376 import dataclasses_init_fn_with_kwargs +from linkml_runtime.utils.formatutils import camelcase, underscore, sfx +from linkml_runtime.utils.enumerations import EnumDefinitionImpl +from rdflib import Namespace, URIRef +from linkml_runtime.utils.curienamespace import CurieNamespace +from linkml_runtime.linkml_model.types import Boolean, Double, Integer, String +from linkml_runtime.utils.metamodelcore import Bool + +metamodel_version = "1.7.0" +version = None + +# Overwrite dataclasses _init_fn to add **kwargs in __init__ +dataclasses._init_fn = dataclasses_init_fn_with_kwargs + +# Namespaces +ARGO = CurieNamespace('ARGO', 'https://docs.icgc-argo.org/dictionary/') +GENO = CurieNamespace('GENO', 'http://purl.obolibrary.org/obo/GENO_') +HP = CurieNamespace('HP', 'http://purl.obolibrary.org/obo/HP_') +LOINC = CurieNamespace('LOINC', 'https://loinc.org/') +MONDO = CurieNamespace('MONDO', 'http://purl.obolibrary.org/obo/MONDO_') +NCIT = CurieNamespace('NCIT', 'http://purl.obolibrary.org/obo/NCIT_') +UBERON = CurieNamespace('UBERON', 'http://purl.obolibrary.org/obo/UBERON_') +UCUM = CurieNamespace('UCUM', 'http://unitsofmeasure.org/') +UO = CurieNamespace('UO', 'http://purl.obolibrary.org/obo/UO_') +ANY = CurieNamespace('any', 'https://w3id.org/linkml/phenopackets/any/') +ARGO = CurieNamespace('argo', 'https://docs.icgc-argo.org/dictionary/') +BASE = CurieNamespace('base', 'https://w3id.org/linkml/phenopackets/base/') +BIOSAMPLE = CurieNamespace('biosample', 'https://w3id.org/linkml/phenopackets/biosample/') +DISEASE = CurieNamespace('disease', 'https://w3id.org/linkml/phenopackets/disease/') +INDIVIDUAL = CurieNamespace('individual', 'https://w3id.org/linkml/phenopackets/individual/') +INTERPRETATION = CurieNamespace('interpretation', 'https://w3id.org/linkml/phenopackets/interpretation/') +LINKML = CurieNamespace('linkml', 'https://w3id.org/linkml/') +MEASUREMENT = CurieNamespace('measurement', 'https://w3id.org/linkml/phenopackets/measurement/') +MEDICAL_ACTION = CurieNamespace('medical_action', 'https://w3id.org/linkml/phenopackets/medical_action/') +META_DATA = CurieNamespace('meta_data', 'https://w3id.org/linkml/phenopackets/meta_data/') +PEDIGREE = CurieNamespace('pedigree', 'https://w3id.org/linkml/phenopackets/pedigree/') +PHENOPACKETS = CurieNamespace('phenopackets', 'https://w3id.org/linkml/phenopackets/phenopackets/') +PHENOTYPIC_FEATURE = CurieNamespace('phenotypic_feature', 'https://w3id.org/linkml/phenopackets/phenotypic_feature/') +TIMESTAMP = CurieNamespace('timestamp', 'https://w3id.org/linkml/phenopackets/timestamp/') +VRS = CurieNamespace('vrs', 'https://w3id.org/linkml/phenopackets/vrs/') +VRSATILE = CurieNamespace('vrsatile', 'https://w3id.org/linkml/phenopackets/vrsatile/') +DEFAULT_ = PHENOPACKETS + + +# Types + +# Class references +class OntologyClassId(extended_str): + pass + + +@dataclass +class Cohort(YAMLRoot): + """ + A group of individuals related in some phenotypic or genotypic aspect. + """ + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = PHENOPACKETS.Cohort + class_class_curie: ClassVar[str] = "phenopackets:Cohort" + class_name: ClassVar[str] = "Cohort" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.Cohort + + metaData: Union[dict, "MetaData"] = None + description: Optional[str] = None + files: Optional[Union[Union[dict, "File"], List[Union[dict, "File"]]]] = empty_list() + id: Optional[str] = None + members: Optional[Union[Union[dict, "Phenopacket"], List[Union[dict, "Phenopacket"]]]] = empty_list() + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self._is_empty(self.metaData): + self.MissingRequiredField("metaData") + if not isinstance(self.metaData, MetaData): + self.metaData = MetaData(**as_dict(self.metaData)) + + if self.description is not None and not isinstance(self.description, str): + self.description = str(self.description) + + if not isinstance(self.files, list): + self.files = [self.files] if self.files is not None else [] + self.files = [v if isinstance(v, File) else File(**as_dict(v)) for v in self.files] + + if self.id is not None and not isinstance(self.id, str): + self.id = str(self.id) + + self._normalize_inlined_as_dict(slot_name="members", slot_type=Phenopacket, key_name="metaData", keyed=False) + + super().__post_init__(**kwargs) + + +@dataclass +class Family(YAMLRoot): + """ + Phenotype, sample and pedigree data required for a genomic diagnosis. Equivalent to the Genomics England + InterpretationRequestRD + https://github.com/genomicsengland/GelReportModels/blob/master/schemas/IDLs/org.gel.models.report.avro/5.0.0/InterpretationRequestRD.avdl + """ + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = PHENOPACKETS.Family + class_class_curie: ClassVar[str] = "phenopackets:Family" + class_name: ClassVar[str] = "Family" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.Family + + metaData: Union[dict, "MetaData"] = None + consanguinousParents: Optional[Union[bool, Bool]] = None + files: Optional[Union[Union[dict, "File"], List[Union[dict, "File"]]]] = empty_list() + id: Optional[str] = None + pedigree: Optional[Union[dict, "Pedigree"]] = None + proband: Optional[Union[dict, "Phenopacket"]] = None + relatives: Optional[Union[Union[dict, "Phenopacket"], List[Union[dict, "Phenopacket"]]]] = empty_list() + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self._is_empty(self.metaData): + self.MissingRequiredField("metaData") + if not isinstance(self.metaData, MetaData): + self.metaData = MetaData(**as_dict(self.metaData)) + + if self.consanguinousParents is not None and not isinstance(self.consanguinousParents, Bool): + self.consanguinousParents = Bool(self.consanguinousParents) + + if not isinstance(self.files, list): + self.files = [self.files] if self.files is not None else [] + self.files = [v if isinstance(v, File) else File(**as_dict(v)) for v in self.files] + + if self.id is not None and not isinstance(self.id, str): + self.id = str(self.id) + + if self.pedigree is not None and not isinstance(self.pedigree, Pedigree): + self.pedigree = Pedigree(**as_dict(self.pedigree)) + + if self.proband is not None and not isinstance(self.proband, Phenopacket): + self.proband = Phenopacket(**as_dict(self.proband)) + + self._normalize_inlined_as_dict(slot_name="relatives", slot_type=Phenopacket, key_name="metaData", keyed=False) + + super().__post_init__(**kwargs) + + +@dataclass +class Phenopacket(YAMLRoot): + """ + An anonymous phenotypic description of an individual or biosample with potential genes of interest and/or + diagnoses. This is a bundle of high-level concepts with no specifically defined relational concepts. It is + expected that the resources sharing the phenopackets will define and enforce their own semantics and level of + requirements for included fields. + """ + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = PHENOPACKETS.Phenopacket + class_class_curie: ClassVar[str] = "phenopackets:Phenopacket" + class_name: ClassVar[str] = "Phenopacket" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.Phenopacket + + metaData: Union[dict, "MetaData"] = None + biosamples: Optional[Union[Union[dict, "Biosample"], List[Union[dict, "Biosample"]]]] = empty_list() + diseases: Optional[Union[Union[dict, "Disease"], List[Union[dict, "Disease"]]]] = empty_list() + files: Optional[Union[Union[dict, "File"], List[Union[dict, "File"]]]] = empty_list() + id: Optional[str] = None + interpretations: Optional[Union[Union[dict, "Interpretation"], List[Union[dict, "Interpretation"]]]] = empty_list() + measurements: Optional[Union[Union[dict, "Measurement"], List[Union[dict, "Measurement"]]]] = empty_list() + medicalActions: Optional[Union[Union[dict, "MedicalAction"], List[Union[dict, "MedicalAction"]]]] = empty_list() + phenotypicFeatures: Optional[Union[Union[dict, "PhenotypicFeature"], List[Union[dict, "PhenotypicFeature"]]]] = empty_list() + subject: Optional[Union[dict, "Individual"]] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self._is_empty(self.metaData): + self.MissingRequiredField("metaData") + if not isinstance(self.metaData, MetaData): + self.metaData = MetaData(**as_dict(self.metaData)) + + if not isinstance(self.biosamples, list): + self.biosamples = [self.biosamples] if self.biosamples is not None else [] + self.biosamples = [v if isinstance(v, Biosample) else Biosample(**as_dict(v)) for v in self.biosamples] + + if not isinstance(self.diseases, list): + self.diseases = [self.diseases] if self.diseases is not None else [] + self.diseases = [v if isinstance(v, Disease) else Disease(**as_dict(v)) for v in self.diseases] + + if not isinstance(self.files, list): + self.files = [self.files] if self.files is not None else [] + self.files = [v if isinstance(v, File) else File(**as_dict(v)) for v in self.files] + + if self.id is not None and not isinstance(self.id, str): + self.id = str(self.id) + + if not isinstance(self.interpretations, list): + self.interpretations = [self.interpretations] if self.interpretations is not None else [] + self.interpretations = [v if isinstance(v, Interpretation) else Interpretation(**as_dict(v)) for v in self.interpretations] + + if not isinstance(self.measurements, list): + self.measurements = [self.measurements] if self.measurements is not None else [] + self.measurements = [v if isinstance(v, Measurement) else Measurement(**as_dict(v)) for v in self.measurements] + + if not isinstance(self.medicalActions, list): + self.medicalActions = [self.medicalActions] if self.medicalActions is not None else [] + self.medicalActions = [v if isinstance(v, MedicalAction) else MedicalAction(**as_dict(v)) for v in self.medicalActions] + + if not isinstance(self.phenotypicFeatures, list): + self.phenotypicFeatures = [self.phenotypicFeatures] if self.phenotypicFeatures is not None else [] + self.phenotypicFeatures = [v if isinstance(v, PhenotypicFeature) else PhenotypicFeature(**as_dict(v)) for v in self.phenotypicFeatures] + + if self.subject is not None and not isinstance(self.subject, Individual): + self.subject = Individual(**as_dict(self.subject)) + + super().__post_init__(**kwargs) + + +@dataclass +class Age(YAMLRoot): + """ + See http://build.fhir.org/datatypes and http://build.fhir.org/condition-definitions.html#Condition.onset_x_ In + FHIR this is represented as a UCUM measurement - http://unitsofmeasure.org/trac/ + """ + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = BASE.Age + class_class_curie: ClassVar[str] = "base:Age" + class_name: ClassVar[str] = "Age" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.Age + + iso8601duration: Optional[str] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.iso8601duration is not None and not isinstance(self.iso8601duration, str): + self.iso8601duration = str(self.iso8601duration) + + super().__post_init__(**kwargs) + + +@dataclass +class AgeRange(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = BASE.AgeRange + class_class_curie: ClassVar[str] = "base:AgeRange" + class_name: ClassVar[str] = "AgeRange" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.AgeRange + + end: Optional[Union[dict, Age]] = None + start: Optional[Union[dict, Age]] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.end is not None and not isinstance(self.end, Age): + self.end = Age(**as_dict(self.end)) + + if self.start is not None and not isinstance(self.start, Age): + self.start = Age(**as_dict(self.start)) + + super().__post_init__(**kwargs) + + +class Dictionary(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = BASE.Dictionary + class_class_curie: ClassVar[str] = "base:Dictionary" + class_name: ClassVar[str] = "Dictionary" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.Dictionary + + +@dataclass +class Evidence(YAMLRoot): + """ + FHIR mapping: Condition.evidence (https://www.hl7.org/fhir/condition-definitions.html#Condition.evidence) + """ + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = BASE.Evidence + class_class_curie: ClassVar[str] = "base:Evidence" + class_name: ClassVar[str] = "Evidence" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.Evidence + + evidenceCode: Optional[Union[dict, "OntologyClass"]] = None + reference: Optional[Union[dict, "ExternalReference"]] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.evidenceCode is not None and not isinstance(self.evidenceCode, OntologyClass): + self.evidenceCode = OntologyClass(**as_dict(self.evidenceCode)) + + if self.reference is not None and not isinstance(self.reference, ExternalReference): + self.reference = ExternalReference(**as_dict(self.reference)) + + super().__post_init__(**kwargs) + + +@dataclass +class ExternalReference(YAMLRoot): + """ + FHIR mapping: Reference (https://www.hl7.org/fhir/references.html) + """ + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = BASE.ExternalReference + class_class_curie: ClassVar[str] = "base:ExternalReference" + class_name: ClassVar[str] = "ExternalReference" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.ExternalReference + + description: Optional[str] = None + id: Optional[str] = None + reference: Optional[str] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.description is not None and not isinstance(self.description, str): + self.description = str(self.description) + + if self.id is not None and not isinstance(self.id, str): + self.id = str(self.id) + + if self.reference is not None and not isinstance(self.reference, str): + self.reference = str(self.reference) + + super().__post_init__(**kwargs) + + +@dataclass +class File(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = BASE.File + class_class_curie: ClassVar[str] = "base:File" + class_name: ClassVar[str] = "File" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.File + + fileAttributes: Optional[Union[dict, Dictionary]] = None + individualToFileIdentifiers: Optional[Union[dict, Dictionary]] = None + uri: Optional[str] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.fileAttributes is not None and not isinstance(self.fileAttributes, Dictionary): + self.fileAttributes = Dictionary() + + if self.individualToFileIdentifiers is not None and not isinstance(self.individualToFileIdentifiers, Dictionary): + self.individualToFileIdentifiers = Dictionary() + + if self.uri is not None and not isinstance(self.uri, str): + self.uri = str(self.uri) + + super().__post_init__(**kwargs) + + +@dataclass +class GestationalAge(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = BASE.GestationalAge + class_class_curie: ClassVar[str] = "base:GestationalAge" + class_name: ClassVar[str] = "GestationalAge" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.GestationalAge + + days: Optional[int] = None + weeks: Optional[int] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.days is not None and not isinstance(self.days, int): + self.days = int(self.days) + + if self.weeks is not None and not isinstance(self.weeks, int): + self.weeks = int(self.weeks) + + super().__post_init__(**kwargs) + + +@dataclass +class OntologyClass(YAMLRoot): + """ + A class (aka term, concept) in an ontology. FHIR mapping: CodeableConcept + (http://www.hl7.org/fhir/datatypes.html#CodeableConcept) see also Coding + (http://www.hl7.org/fhir/datatypes.html#Coding) + """ + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = BASE.OntologyClass + class_class_curie: ClassVar[str] = "base:OntologyClass" + class_name: ClassVar[str] = "OntologyClass" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.OntologyClass + + id: Union[str, OntologyClassId] = None + label: Optional[str] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self._is_empty(self.id): + self.MissingRequiredField("id") + if not isinstance(self.id, OntologyClassId): + self.id = OntologyClassId(self.id) + + if self.label is not None and not isinstance(self.label, str): + self.label = str(self.label) + + super().__post_init__(**kwargs) + + +@dataclass +class Procedure(YAMLRoot): + """ + A clinical procedure performed on a subject. By preference a single concept to indicate both the procedure and the + body site should be used. In cases where this is not possible, the body site should be indicated using a separate + ontology class. e.g. {"code":{"NCIT:C51585": "Biopsy of Soft Palate"}} {"code":{"NCIT:C28743": "Punch Biopsy"}, + "body_site":{"UBERON:0003403": "skin of forearm"}} - a punch biopsy of the skin from the forearm FHIR mapping: + Procedure (https://www.hl7.org/fhir/procedure.html) + """ + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = BASE.Procedure + class_class_curie: ClassVar[str] = "base:Procedure" + class_name: ClassVar[str] = "Procedure" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.Procedure + + bodySite: Optional[Union[dict, OntologyClass]] = None + code: Optional[Union[dict, OntologyClass]] = None + performed: Optional[Union[dict, "TimeElement"]] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.bodySite is not None and not isinstance(self.bodySite, OntologyClass): + self.bodySite = OntologyClass(**as_dict(self.bodySite)) + + if self.code is not None and not isinstance(self.code, OntologyClass): + self.code = OntologyClass(**as_dict(self.code)) + + if self.performed is not None and not isinstance(self.performed, TimeElement): + self.performed = TimeElement(**as_dict(self.performed)) + + super().__post_init__(**kwargs) + + +@dataclass +class TimeElement(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = BASE.TimeElement + class_class_curie: ClassVar[str] = "base:TimeElement" + class_name: ClassVar[str] = "TimeElement" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.TimeElement + + age: Optional[Union[dict, Age]] = None + ageRange: Optional[Union[dict, AgeRange]] = None + gestationalAge: Optional[Union[dict, GestationalAge]] = None + interval: Optional[Union[dict, "TimeInterval"]] = None + ontologyClass: Optional[Union[dict, OntologyClass]] = None + timestamp: Optional[str] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.age is not None and not isinstance(self.age, Age): + self.age = Age(**as_dict(self.age)) + + if self.ageRange is not None and not isinstance(self.ageRange, AgeRange): + self.ageRange = AgeRange(**as_dict(self.ageRange)) + + if self.gestationalAge is not None and not isinstance(self.gestationalAge, GestationalAge): + self.gestationalAge = GestationalAge(**as_dict(self.gestationalAge)) + + if self.interval is not None and not isinstance(self.interval, TimeInterval): + self.interval = TimeInterval(**as_dict(self.interval)) + + if self.ontologyClass is not None and not isinstance(self.ontologyClass, OntologyClass): + self.ontologyClass = OntologyClass(**as_dict(self.ontologyClass)) + + if self.timestamp is not None and not isinstance(self.timestamp, str): + self.timestamp = str(self.timestamp) + + super().__post_init__(**kwargs) + + +@dataclass +class TimeInterval(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = BASE.TimeInterval + class_class_curie: ClassVar[str] = "base:TimeInterval" + class_name: ClassVar[str] = "TimeInterval" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.TimeInterval + + end: Optional[str] = None + start: Optional[str] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.end is not None and not isinstance(self.end, str): + self.end = str(self.end) + + if self.start is not None and not isinstance(self.start, str): + self.start = str(self.start) + + super().__post_init__(**kwargs) + + +@dataclass +class Biosample(YAMLRoot): + """ + A Biosample refers to a unit of biological material from which the substrate molecules (e.g. genomic DNA, RNA, + proteins) for molecular analyses (e.g. sequencing, array hybridisation, mass-spectrometry) are extracted. Examples + would be a tissue biopsy, a single cell from a culture for single cell genome sequencing or a protein fraction + from a gradient centrifugation. Several instances (e.g. technical replicates) or types of experiments (e.g. + genomic array as well as RNA-seq experiments) may refer to the same Biosample. FHIR mapping: Specimen + (http://www.hl7.org/fhir/specimen.html). + """ + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = BIOSAMPLE.Biosample + class_class_curie: ClassVar[str] = "biosample:Biosample" + class_name: ClassVar[str] = "Biosample" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.Biosample + + derivedFromId: Optional[str] = None + description: Optional[str] = None + diagnosticMarkers: Optional[Union[Dict[Union[str, OntologyClassId], Union[dict, OntologyClass]], List[Union[dict, OntologyClass]]]] = empty_dict() + files: Optional[Union[Union[dict, File], List[Union[dict, File]]]] = empty_list() + histologicalDiagnosis: Optional[Union[dict, OntologyClass]] = None + id: Optional[str] = None + individualId: Optional[str] = None + materialSample: Optional[Union[dict, OntologyClass]] = None + measurements: Optional[Union[Union[dict, "Measurement"], List[Union[dict, "Measurement"]]]] = empty_list() + pathologicalStage: Optional[Union[dict, OntologyClass]] = None + pathologicalTnmFinding: Optional[Union[Dict[Union[str, OntologyClassId], Union[dict, OntologyClass]], List[Union[dict, OntologyClass]]]] = empty_dict() + phenotypicFeatures: Optional[Union[Union[dict, "PhenotypicFeature"], List[Union[dict, "PhenotypicFeature"]]]] = empty_list() + procedure: Optional[Union[dict, Procedure]] = None + sampleProcessing: Optional[Union[dict, OntologyClass]] = None + sampleStorage: Optional[Union[dict, OntologyClass]] = None + sampleType: Optional[Union[dict, OntologyClass]] = None + sampledTissue: Optional[Union[dict, OntologyClass]] = None + taxonomy: Optional[Union[dict, OntologyClass]] = None + timeOfCollection: Optional[Union[dict, TimeElement]] = None + tumorGrade: Optional[Union[dict, OntologyClass]] = None + tumorProgression: Optional[Union[dict, OntologyClass]] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.derivedFromId is not None and not isinstance(self.derivedFromId, str): + self.derivedFromId = str(self.derivedFromId) + + if self.description is not None and not isinstance(self.description, str): + self.description = str(self.description) + + self._normalize_inlined_as_dict(slot_name="diagnosticMarkers", slot_type=OntologyClass, key_name="id", keyed=True) + + if not isinstance(self.files, list): + self.files = [self.files] if self.files is not None else [] + self.files = [v if isinstance(v, File) else File(**as_dict(v)) for v in self.files] + + if self.histologicalDiagnosis is not None and not isinstance(self.histologicalDiagnosis, OntologyClass): + self.histologicalDiagnosis = OntologyClass(**as_dict(self.histologicalDiagnosis)) + + if self.id is not None and not isinstance(self.id, str): + self.id = str(self.id) + + if self.individualId is not None and not isinstance(self.individualId, str): + self.individualId = str(self.individualId) + + if self.materialSample is not None and not isinstance(self.materialSample, OntologyClass): + self.materialSample = OntologyClass(**as_dict(self.materialSample)) + + if not isinstance(self.measurements, list): + self.measurements = [self.measurements] if self.measurements is not None else [] + self.measurements = [v if isinstance(v, Measurement) else Measurement(**as_dict(v)) for v in self.measurements] + + if self.pathologicalStage is not None and not isinstance(self.pathologicalStage, OntologyClass): + self.pathologicalStage = OntologyClass(**as_dict(self.pathologicalStage)) + + self._normalize_inlined_as_dict(slot_name="pathologicalTnmFinding", slot_type=OntologyClass, key_name="id", keyed=True) + + if not isinstance(self.phenotypicFeatures, list): + self.phenotypicFeatures = [self.phenotypicFeatures] if self.phenotypicFeatures is not None else [] + self.phenotypicFeatures = [v if isinstance(v, PhenotypicFeature) else PhenotypicFeature(**as_dict(v)) for v in self.phenotypicFeatures] + + if self.procedure is not None and not isinstance(self.procedure, Procedure): + self.procedure = Procedure(**as_dict(self.procedure)) + + if self.sampleProcessing is not None and not isinstance(self.sampleProcessing, OntologyClass): + self.sampleProcessing = OntologyClass(**as_dict(self.sampleProcessing)) + + if self.sampleStorage is not None and not isinstance(self.sampleStorage, OntologyClass): + self.sampleStorage = OntologyClass(**as_dict(self.sampleStorage)) + + if self.sampleType is not None and not isinstance(self.sampleType, OntologyClass): + self.sampleType = OntologyClass(**as_dict(self.sampleType)) + + if self.sampledTissue is not None and not isinstance(self.sampledTissue, OntologyClass): + self.sampledTissue = OntologyClass(**as_dict(self.sampledTissue)) + + if self.taxonomy is not None and not isinstance(self.taxonomy, OntologyClass): + self.taxonomy = OntologyClass(**as_dict(self.taxonomy)) + + if self.timeOfCollection is not None and not isinstance(self.timeOfCollection, TimeElement): + self.timeOfCollection = TimeElement(**as_dict(self.timeOfCollection)) + + if self.tumorGrade is not None and not isinstance(self.tumorGrade, OntologyClass): + self.tumorGrade = OntologyClass(**as_dict(self.tumorGrade)) + + if self.tumorProgression is not None and not isinstance(self.tumorProgression, OntologyClass): + self.tumorProgression = OntologyClass(**as_dict(self.tumorProgression)) + + super().__post_init__(**kwargs) + + +@dataclass +class Disease(YAMLRoot): + """ + Message to indicate a disease (diagnosis) and its recorded onset. + """ + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = DISEASE.Disease + class_class_curie: ClassVar[str] = "disease:Disease" + class_name: ClassVar[str] = "Disease" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.Disease + + clinicalTnmFinding: Optional[Union[Dict[Union[str, OntologyClassId], Union[dict, OntologyClass]], List[Union[dict, OntologyClass]]]] = empty_dict() + diseaseStage: Optional[Union[Dict[Union[str, OntologyClassId], Union[dict, OntologyClass]], List[Union[dict, OntologyClass]]]] = empty_dict() + excluded: Optional[Union[bool, Bool]] = None + laterality: Optional[Union[dict, OntologyClass]] = None + onset: Optional[Union[dict, TimeElement]] = None + primarySite: Optional[Union[dict, OntologyClass]] = None + resolution: Optional[Union[dict, TimeElement]] = None + term: Optional[Union[dict, OntologyClass]] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + self._normalize_inlined_as_dict(slot_name="clinicalTnmFinding", slot_type=OntologyClass, key_name="id", keyed=True) + + self._normalize_inlined_as_dict(slot_name="diseaseStage", slot_type=OntologyClass, key_name="id", keyed=True) + + if self.excluded is not None and not isinstance(self.excluded, Bool): + self.excluded = Bool(self.excluded) + + if self.laterality is not None and not isinstance(self.laterality, OntologyClass): + self.laterality = OntologyClass(**as_dict(self.laterality)) + + if self.onset is not None and not isinstance(self.onset, TimeElement): + self.onset = TimeElement(**as_dict(self.onset)) + + if self.primarySite is not None and not isinstance(self.primarySite, OntologyClass): + self.primarySite = OntologyClass(**as_dict(self.primarySite)) + + if self.resolution is not None and not isinstance(self.resolution, TimeElement): + self.resolution = TimeElement(**as_dict(self.resolution)) + + if self.term is not None and not isinstance(self.term, OntologyClass): + self.term = OntologyClass(**as_dict(self.term)) + + super().__post_init__(**kwargs) + + +@dataclass +class Diagnosis(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = INTERPRETATION.Diagnosis + class_class_curie: ClassVar[str] = "interpretation:Diagnosis" + class_name: ClassVar[str] = "Diagnosis" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.Diagnosis + + disease: Optional[Union[dict, OntologyClass]] = None + genomicInterpretations: Optional[Union[Union[dict, "GenomicInterpretation"], List[Union[dict, "GenomicInterpretation"]]]] = empty_list() + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.disease is not None and not isinstance(self.disease, OntologyClass): + self.disease = OntologyClass(**as_dict(self.disease)) + + if not isinstance(self.genomicInterpretations, list): + self.genomicInterpretations = [self.genomicInterpretations] if self.genomicInterpretations is not None else [] + self.genomicInterpretations = [v if isinstance(v, GenomicInterpretation) else GenomicInterpretation(**as_dict(v)) for v in self.genomicInterpretations] + + super().__post_init__(**kwargs) + + +@dataclass +class GenomicInterpretation(YAMLRoot): + """ + A statement about the contribution of a genomic element towards the observed phenotype. Note that this does not + intend to encode any knowledge or results of specific computations. + """ + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = INTERPRETATION.GenomicInterpretation + class_class_curie: ClassVar[str] = "interpretation:GenomicInterpretation" + class_name: ClassVar[str] = "GenomicInterpretation" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.GenomicInterpretation + + gene: Optional[Union[dict, "GeneDescriptor"]] = None + interpretationStatus: Optional[Union[str, "InterpretationStatus"]] = None + subjectOrBiosampleId: Optional[str] = None + variantInterpretation: Optional[Union[dict, "VariantInterpretation"]] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.gene is not None and not isinstance(self.gene, GeneDescriptor): + self.gene = GeneDescriptor(**as_dict(self.gene)) + + if self.interpretationStatus is not None and not isinstance(self.interpretationStatus, InterpretationStatus): + self.interpretationStatus = InterpretationStatus(self.interpretationStatus) + + if self.subjectOrBiosampleId is not None and not isinstance(self.subjectOrBiosampleId, str): + self.subjectOrBiosampleId = str(self.subjectOrBiosampleId) + + if self.variantInterpretation is not None and not isinstance(self.variantInterpretation, VariantInterpretation): + self.variantInterpretation = VariantInterpretation(**as_dict(self.variantInterpretation)) + + super().__post_init__(**kwargs) + + +@dataclass +class Interpretation(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = INTERPRETATION.Interpretation + class_class_curie: ClassVar[str] = "interpretation:Interpretation" + class_name: ClassVar[str] = "Interpretation" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.Interpretation + + diagnosis: Optional[Union[dict, Diagnosis]] = None + id: Optional[str] = None + progressStatus: Optional[Union[str, "ProgressStatus"]] = None + summary: Optional[str] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.diagnosis is not None and not isinstance(self.diagnosis, Diagnosis): + self.diagnosis = Diagnosis(**as_dict(self.diagnosis)) + + if self.id is not None and not isinstance(self.id, str): + self.id = str(self.id) + + if self.progressStatus is not None and not isinstance(self.progressStatus, ProgressStatus): + self.progressStatus = ProgressStatus(self.progressStatus) + + if self.summary is not None and not isinstance(self.summary, str): + self.summary = str(self.summary) + + super().__post_init__(**kwargs) + + +@dataclass +class VariantInterpretation(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = INTERPRETATION.VariantInterpretation + class_class_curie: ClassVar[str] = "interpretation:VariantInterpretation" + class_name: ClassVar[str] = "VariantInterpretation" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.VariantInterpretation + + acmgPathogenicityClassification: Optional[Union[str, "AcmgPathogenicityClassification"]] = None + therapeuticActionability: Optional[Union[str, "TherapeuticActionability"]] = None + variationDescriptor: Optional[Union[dict, "VariationDescriptor"]] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.acmgPathogenicityClassification is not None and not isinstance(self.acmgPathogenicityClassification, AcmgPathogenicityClassification): + self.acmgPathogenicityClassification = AcmgPathogenicityClassification(self.acmgPathogenicityClassification) + + if self.therapeuticActionability is not None and not isinstance(self.therapeuticActionability, TherapeuticActionability): + self.therapeuticActionability = TherapeuticActionability(self.therapeuticActionability) + + if self.variationDescriptor is not None and not isinstance(self.variationDescriptor, VariationDescriptor): + self.variationDescriptor = VariationDescriptor(**as_dict(self.variationDescriptor)) + + super().__post_init__(**kwargs) + + +@dataclass +class Individual(YAMLRoot): + """ + An individual (or subject) typically corresponds to an individual human or another organism. FHIR mapping: Patient + (https://www.hl7.org/fhir/patient.html). + """ + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = INDIVIDUAL.Individual + class_class_curie: ClassVar[str] = "individual:Individual" + class_name: ClassVar[str] = "Individual" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.Individual + + alternateIds: Optional[Union[str, List[str]]] = empty_list() + dateOfBirth: Optional[str] = None + gender: Optional[Union[dict, OntologyClass]] = None + id: Optional[str] = None + karyotypicSex: Optional[Union[str, "KaryotypicSex"]] = None + sex: Optional[Union[str, "Sex"]] = None + taxonomy: Optional[Union[dict, OntologyClass]] = None + timeAtLastEncounter: Optional[Union[dict, TimeElement]] = None + vitalStatus: Optional[Union[dict, "VitalStatus"]] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if not isinstance(self.alternateIds, list): + self.alternateIds = [self.alternateIds] if self.alternateIds is not None else [] + self.alternateIds = [v if isinstance(v, str) else str(v) for v in self.alternateIds] + + if self.dateOfBirth is not None and not isinstance(self.dateOfBirth, str): + self.dateOfBirth = str(self.dateOfBirth) + + if self.gender is not None and not isinstance(self.gender, OntologyClass): + self.gender = OntologyClass(**as_dict(self.gender)) + + if self.id is not None and not isinstance(self.id, str): + self.id = str(self.id) + + if self.karyotypicSex is not None and not isinstance(self.karyotypicSex, KaryotypicSex): + self.karyotypicSex = KaryotypicSex(self.karyotypicSex) + + if self.sex is not None and not isinstance(self.sex, Sex): + self.sex = Sex(self.sex) + + if self.taxonomy is not None and not isinstance(self.taxonomy, OntologyClass): + self.taxonomy = OntologyClass(**as_dict(self.taxonomy)) + + if self.timeAtLastEncounter is not None and not isinstance(self.timeAtLastEncounter, TimeElement): + self.timeAtLastEncounter = TimeElement(**as_dict(self.timeAtLastEncounter)) + + if self.vitalStatus is not None and not isinstance(self.vitalStatus, VitalStatus): + self.vitalStatus = VitalStatus(**as_dict(self.vitalStatus)) + + super().__post_init__(**kwargs) + + +@dataclass +class VitalStatus(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = INDIVIDUAL.VitalStatus + class_class_curie: ClassVar[str] = "individual:VitalStatus" + class_name: ClassVar[str] = "VitalStatus" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.VitalStatus + + causeOfDeath: Optional[Union[dict, OntologyClass]] = None + status: Optional[Union[str, "Status"]] = None + survivalTimeInDays: Optional[int] = None + timeOfDeath: Optional[Union[dict, TimeElement]] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.causeOfDeath is not None and not isinstance(self.causeOfDeath, OntologyClass): + self.causeOfDeath = OntologyClass(**as_dict(self.causeOfDeath)) + + if self.status is not None and not isinstance(self.status, Status): + self.status = Status(self.status) + + if self.survivalTimeInDays is not None and not isinstance(self.survivalTimeInDays, int): + self.survivalTimeInDays = int(self.survivalTimeInDays) + + if self.timeOfDeath is not None and not isinstance(self.timeOfDeath, TimeElement): + self.timeOfDeath = TimeElement(**as_dict(self.timeOfDeath)) + + super().__post_init__(**kwargs) + + +@dataclass +class ComplexValue(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = MEASUREMENT.ComplexValue + class_class_curie: ClassVar[str] = "measurement:ComplexValue" + class_name: ClassVar[str] = "ComplexValue" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.ComplexValue + + typedQuantities: Optional[Union[Union[dict, "TypedQuantity"], List[Union[dict, "TypedQuantity"]]]] = empty_list() + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if not isinstance(self.typedQuantities, list): + self.typedQuantities = [self.typedQuantities] if self.typedQuantities is not None else [] + self.typedQuantities = [v if isinstance(v, TypedQuantity) else TypedQuantity(**as_dict(v)) for v in self.typedQuantities] + + super().__post_init__(**kwargs) + + +@dataclass +class Measurement(YAMLRoot): + """ + FHIR mapping: Observation (https://www.hl7.org/fhir/observation.html) + """ + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = MEASUREMENT.Measurement + class_class_curie: ClassVar[str] = "measurement:Measurement" + class_name: ClassVar[str] = "Measurement" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.Measurement + + assay: Optional[Union[dict, OntologyClass]] = None + complexValue: Optional[Union[dict, ComplexValue]] = None + description: Optional[str] = None + procedure: Optional[Union[dict, Procedure]] = None + timeObserved: Optional[Union[dict, TimeElement]] = None + value: Optional[Union[dict, "Value"]] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.assay is not None and not isinstance(self.assay, OntologyClass): + self.assay = OntologyClass(**as_dict(self.assay)) + + if self.complexValue is not None and not isinstance(self.complexValue, ComplexValue): + self.complexValue = ComplexValue(**as_dict(self.complexValue)) + + if self.description is not None and not isinstance(self.description, str): + self.description = str(self.description) + + if self.procedure is not None and not isinstance(self.procedure, Procedure): + self.procedure = Procedure(**as_dict(self.procedure)) + + if self.timeObserved is not None and not isinstance(self.timeObserved, TimeElement): + self.timeObserved = TimeElement(**as_dict(self.timeObserved)) + + if self.value is not None and not isinstance(self.value, Value): + self.value = Value(**as_dict(self.value)) + + super().__post_init__(**kwargs) + + +@dataclass +class Quantity(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = MEASUREMENT.Quantity + class_class_curie: ClassVar[str] = "measurement:Quantity" + class_name: ClassVar[str] = "Quantity" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.Quantity + + referenceRange: Optional[Union[dict, "ReferenceRange"]] = None + unit: Optional[Union[dict, OntologyClass]] = None + value: Optional[float] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.referenceRange is not None and not isinstance(self.referenceRange, ReferenceRange): + self.referenceRange = ReferenceRange(**as_dict(self.referenceRange)) + + if self.unit is not None and not isinstance(self.unit, OntologyClass): + self.unit = OntologyClass(**as_dict(self.unit)) + + if self.value is not None and not isinstance(self.value, float): + self.value = float(self.value) + + super().__post_init__(**kwargs) + + +@dataclass +class ReferenceRange(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = MEASUREMENT.ReferenceRange + class_class_curie: ClassVar[str] = "measurement:ReferenceRange" + class_name: ClassVar[str] = "ReferenceRange" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.ReferenceRange + + high: Optional[float] = None + low: Optional[float] = None + unit: Optional[Union[dict, OntologyClass]] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.high is not None and not isinstance(self.high, float): + self.high = float(self.high) + + if self.low is not None and not isinstance(self.low, float): + self.low = float(self.low) + + if self.unit is not None and not isinstance(self.unit, OntologyClass): + self.unit = OntologyClass(**as_dict(self.unit)) + + super().__post_init__(**kwargs) + + +@dataclass +class TypedQuantity(YAMLRoot): + """ + For complex measurements, such as blood pressure where more than one component quantity is required to describe + the measurement + """ + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = MEASUREMENT.TypedQuantity + class_class_curie: ClassVar[str] = "measurement:TypedQuantity" + class_name: ClassVar[str] = "TypedQuantity" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.TypedQuantity + + quantity: Optional[Union[dict, Quantity]] = None + type: Optional[Union[dict, OntologyClass]] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.quantity is not None and not isinstance(self.quantity, Quantity): + self.quantity = Quantity(**as_dict(self.quantity)) + + if self.type is not None and not isinstance(self.type, OntologyClass): + self.type = OntologyClass(**as_dict(self.type)) + + super().__post_init__(**kwargs) + + +@dataclass +class Value(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = MEASUREMENT.Value + class_class_curie: ClassVar[str] = "measurement:Value" + class_name: ClassVar[str] = "Value" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.Value + + ontologyClass: Optional[Union[dict, OntologyClass]] = None + quantity: Optional[Union[dict, Quantity]] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.ontologyClass is not None and not isinstance(self.ontologyClass, OntologyClass): + self.ontologyClass = OntologyClass(**as_dict(self.ontologyClass)) + + if self.quantity is not None and not isinstance(self.quantity, Quantity): + self.quantity = Quantity(**as_dict(self.quantity)) + + super().__post_init__(**kwargs) + + +@dataclass +class DoseInterval(YAMLRoot): + """ + e.g. 50mg/ml 3 times daily for two weeks + """ + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = MEDICAL_ACTION.DoseInterval + class_class_curie: ClassVar[str] = "medical_action:DoseInterval" + class_name: ClassVar[str] = "DoseInterval" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.DoseInterval + + interval: Optional[Union[dict, TimeInterval]] = None + quantity: Optional[Union[dict, Quantity]] = None + scheduleFrequency: Optional[Union[dict, OntologyClass]] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.interval is not None and not isinstance(self.interval, TimeInterval): + self.interval = TimeInterval(**as_dict(self.interval)) + + if self.quantity is not None and not isinstance(self.quantity, Quantity): + self.quantity = Quantity(**as_dict(self.quantity)) + + if self.scheduleFrequency is not None and not isinstance(self.scheduleFrequency, OntologyClass): + self.scheduleFrequency = OntologyClass(**as_dict(self.scheduleFrequency)) + + super().__post_init__(**kwargs) + + +@dataclass +class MedicalAction(YAMLRoot): + """ + medication, procedure, other actions taken for clinical management + """ + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = MEDICAL_ACTION.MedicalAction + class_class_curie: ClassVar[str] = "medical_action:MedicalAction" + class_name: ClassVar[str] = "MedicalAction" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.MedicalAction + + adverseEvents: Optional[Union[Dict[Union[str, OntologyClassId], Union[dict, OntologyClass]], List[Union[dict, OntologyClass]]]] = empty_dict() + procedure: Optional[Union[dict, Procedure]] = None + radiationTherapy: Optional[Union[dict, "RadiationTherapy"]] = None + responseToTreatment: Optional[Union[dict, OntologyClass]] = None + therapeuticRegimen: Optional[Union[dict, "TherapeuticRegimen"]] = None + treatment: Optional[Union[dict, "Treatment"]] = None + treatmentIntent: Optional[Union[dict, OntologyClass]] = None + treatmentTarget: Optional[Union[dict, OntologyClass]] = None + treatmentTerminationReason: Optional[Union[dict, OntologyClass]] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + self._normalize_inlined_as_dict(slot_name="adverseEvents", slot_type=OntologyClass, key_name="id", keyed=True) + + if self.procedure is not None and not isinstance(self.procedure, Procedure): + self.procedure = Procedure(**as_dict(self.procedure)) + + if self.radiationTherapy is not None and not isinstance(self.radiationTherapy, RadiationTherapy): + self.radiationTherapy = RadiationTherapy(**as_dict(self.radiationTherapy)) + + if self.responseToTreatment is not None and not isinstance(self.responseToTreatment, OntologyClass): + self.responseToTreatment = OntologyClass(**as_dict(self.responseToTreatment)) + + if self.therapeuticRegimen is not None and not isinstance(self.therapeuticRegimen, TherapeuticRegimen): + self.therapeuticRegimen = TherapeuticRegimen(**as_dict(self.therapeuticRegimen)) + + if self.treatment is not None and not isinstance(self.treatment, Treatment): + self.treatment = Treatment(**as_dict(self.treatment)) + + if self.treatmentIntent is not None and not isinstance(self.treatmentIntent, OntologyClass): + self.treatmentIntent = OntologyClass(**as_dict(self.treatmentIntent)) + + if self.treatmentTarget is not None and not isinstance(self.treatmentTarget, OntologyClass): + self.treatmentTarget = OntologyClass(**as_dict(self.treatmentTarget)) + + if self.treatmentTerminationReason is not None and not isinstance(self.treatmentTerminationReason, OntologyClass): + self.treatmentTerminationReason = OntologyClass(**as_dict(self.treatmentTerminationReason)) + + super().__post_init__(**kwargs) + + +@dataclass +class RadiationTherapy(YAMLRoot): + """ + RadiationTherapy + """ + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = MEDICAL_ACTION.RadiationTherapy + class_class_curie: ClassVar[str] = "medical_action:RadiationTherapy" + class_name: ClassVar[str] = "RadiationTherapy" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.RadiationTherapy + + bodySite: Union[dict, OntologyClass] = None + dosage: int = None + fractions: int = None + modality: Union[dict, OntologyClass] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self._is_empty(self.bodySite): + self.MissingRequiredField("bodySite") + if not isinstance(self.bodySite, OntologyClass): + self.bodySite = OntologyClass(**as_dict(self.bodySite)) + + if self._is_empty(self.dosage): + self.MissingRequiredField("dosage") + if not isinstance(self.dosage, int): + self.dosage = int(self.dosage) + + if self._is_empty(self.fractions): + self.MissingRequiredField("fractions") + if not isinstance(self.fractions, int): + self.fractions = int(self.fractions) + + if self._is_empty(self.modality): + self.MissingRequiredField("modality") + if not isinstance(self.modality, OntologyClass): + self.modality = OntologyClass(**as_dict(self.modality)) + + super().__post_init__(**kwargs) + + +@dataclass +class TherapeuticRegimen(YAMLRoot): + """ + ARGO mapping radiation::radiation_therapy_type (missing) + """ + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = MEDICAL_ACTION.TherapeuticRegimen + class_class_curie: ClassVar[str] = "medical_action:TherapeuticRegimen" + class_name: ClassVar[str] = "TherapeuticRegimen" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.TherapeuticRegimen + + endTime: Optional[Union[dict, TimeElement]] = None + externalReference: Optional[Union[dict, ExternalReference]] = None + ontologyClass: Optional[Union[dict, OntologyClass]] = None + regimenStatus: Optional[Union[str, "RegimenStatus"]] = None + startTime: Optional[Union[dict, TimeElement]] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.endTime is not None and not isinstance(self.endTime, TimeElement): + self.endTime = TimeElement(**as_dict(self.endTime)) + + if self.externalReference is not None and not isinstance(self.externalReference, ExternalReference): + self.externalReference = ExternalReference(**as_dict(self.externalReference)) + + if self.ontologyClass is not None and not isinstance(self.ontologyClass, OntologyClass): + self.ontologyClass = OntologyClass(**as_dict(self.ontologyClass)) + + if self.regimenStatus is not None and not isinstance(self.regimenStatus, RegimenStatus): + self.regimenStatus = RegimenStatus(self.regimenStatus) + + if self.startTime is not None and not isinstance(self.startTime, TimeElement): + self.startTime = TimeElement(**as_dict(self.startTime)) + + super().__post_init__(**kwargs) + + +@dataclass +class Treatment(YAMLRoot): + """ + ARGO mapping treatment::is_primary_treatment (missing) treatment with an agent, such as a drug + """ + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = MEDICAL_ACTION.Treatment + class_class_curie: ClassVar[str] = "medical_action:Treatment" + class_name: ClassVar[str] = "Treatment" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.Treatment + + agent: Optional[Union[dict, OntologyClass]] = None + cumulativeDose: Optional[Union[dict, Quantity]] = None + doseIntervals: Optional[Union[Union[dict, DoseInterval], List[Union[dict, DoseInterval]]]] = empty_list() + drugType: Optional[Union[str, "DrugType"]] = None + routeOfAdministration: Optional[Union[dict, OntologyClass]] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.agent is not None and not isinstance(self.agent, OntologyClass): + self.agent = OntologyClass(**as_dict(self.agent)) + + if self.cumulativeDose is not None and not isinstance(self.cumulativeDose, Quantity): + self.cumulativeDose = Quantity(**as_dict(self.cumulativeDose)) + + if not isinstance(self.doseIntervals, list): + self.doseIntervals = [self.doseIntervals] if self.doseIntervals is not None else [] + self.doseIntervals = [v if isinstance(v, DoseInterval) else DoseInterval(**as_dict(v)) for v in self.doseIntervals] + + if self.drugType is not None and not isinstance(self.drugType, DrugType): + self.drugType = DrugType(self.drugType) + + if self.routeOfAdministration is not None and not isinstance(self.routeOfAdministration, OntologyClass): + self.routeOfAdministration = OntologyClass(**as_dict(self.routeOfAdministration)) + + super().__post_init__(**kwargs) + + +@dataclass +class MetaData(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = META_DATA.MetaData + class_class_curie: ClassVar[str] = "meta_data:MetaData" + class_name: ClassVar[str] = "MetaData" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.MetaData + + created: Optional[str] = None + createdBy: Optional[str] = None + externalReferences: Optional[Union[Union[dict, ExternalReference], List[Union[dict, ExternalReference]]]] = empty_list() + phenopacketSchemaVersion: Optional[str] = None + resources: Optional[Union[Union[dict, "Resource"], List[Union[dict, "Resource"]]]] = empty_list() + submittedBy: Optional[str] = None + updates: Optional[Union[Union[dict, "Update"], List[Union[dict, "Update"]]]] = empty_list() + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.created is not None and not isinstance(self.created, str): + self.created = str(self.created) + + if self.createdBy is not None and not isinstance(self.createdBy, str): + self.createdBy = str(self.createdBy) + + if not isinstance(self.externalReferences, list): + self.externalReferences = [self.externalReferences] if self.externalReferences is not None else [] + self.externalReferences = [v if isinstance(v, ExternalReference) else ExternalReference(**as_dict(v)) for v in self.externalReferences] + + if self.phenopacketSchemaVersion is not None and not isinstance(self.phenopacketSchemaVersion, str): + self.phenopacketSchemaVersion = str(self.phenopacketSchemaVersion) + + if not isinstance(self.resources, list): + self.resources = [self.resources] if self.resources is not None else [] + self.resources = [v if isinstance(v, Resource) else Resource(**as_dict(v)) for v in self.resources] + + if self.submittedBy is not None and not isinstance(self.submittedBy, str): + self.submittedBy = str(self.submittedBy) + + self._normalize_inlined_as_dict(slot_name="updates", slot_type=Update, key_name="timestamp", keyed=False) + + super().__post_init__(**kwargs) + + +@dataclass +class Resource(YAMLRoot): + """ + Description of an external resource used for referencing an object. For example the resource may be an ontology + such as the HPO or SNOMED. FHIR mapping: CodeSystem (http://www.hl7.org/fhir/codesystem.html) + """ + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = META_DATA.Resource + class_class_curie: ClassVar[str] = "meta_data:Resource" + class_name: ClassVar[str] = "Resource" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.Resource + + id: Optional[str] = None + iriPrefix: Optional[str] = None + name: Optional[str] = None + namespacePrefix: Optional[str] = None + url: Optional[str] = None + version: Optional[str] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.id is not None and not isinstance(self.id, str): + self.id = str(self.id) + + if self.iriPrefix is not None and not isinstance(self.iriPrefix, str): + self.iriPrefix = str(self.iriPrefix) + + if self.name is not None and not isinstance(self.name, str): + self.name = str(self.name) + + if self.namespacePrefix is not None and not isinstance(self.namespacePrefix, str): + self.namespacePrefix = str(self.namespacePrefix) + + if self.url is not None and not isinstance(self.url, str): + self.url = str(self.url) + + if self.version is not None and not isinstance(self.version, str): + self.version = str(self.version) + + super().__post_init__(**kwargs) + + +@dataclass +class Update(YAMLRoot): + """ + Information about when an update to a record occurred, who or what made the update and any pertinent information + regarding the content and/or reason for the update + """ + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = META_DATA.Update + class_class_curie: ClassVar[str] = "meta_data:Update" + class_name: ClassVar[str] = "Update" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.Update + + timestamp: str = None + comment: Optional[str] = None + updatedBy: Optional[str] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self._is_empty(self.timestamp): + self.MissingRequiredField("timestamp") + if not isinstance(self.timestamp, str): + self.timestamp = str(self.timestamp) + + if self.comment is not None and not isinstance(self.comment, str): + self.comment = str(self.comment) + + if self.updatedBy is not None and not isinstance(self.updatedBy, str): + self.updatedBy = str(self.updatedBy) + + super().__post_init__(**kwargs) + + +@dataclass +class Pedigree(YAMLRoot): + """ + https://software.broadinstitute.org/gatk/documentation/article?id=11016 + """ + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = PEDIGREE.Pedigree + class_class_curie: ClassVar[str] = "pedigree:Pedigree" + class_name: ClassVar[str] = "Pedigree" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.Pedigree + + persons: Optional[Union[Union[dict, "Person"], List[Union[dict, "Person"]]]] = empty_list() + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if not isinstance(self.persons, list): + self.persons = [self.persons] if self.persons is not None else [] + self.persons = [v if isinstance(v, Person) else Person(**as_dict(v)) for v in self.persons] + + super().__post_init__(**kwargs) + + +@dataclass +class Person(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = PEDIGREE.Person + class_class_curie: ClassVar[str] = "pedigree:Person" + class_name: ClassVar[str] = "Person" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.Person + + affectedStatus: Optional[Union[str, "AffectedStatus"]] = None + familyId: Optional[str] = None + individualId: Optional[str] = None + maternalId: Optional[str] = None + paternalId: Optional[str] = None + sex: Optional[Union[str, "Sex"]] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.affectedStatus is not None and not isinstance(self.affectedStatus, AffectedStatus): + self.affectedStatus = AffectedStatus(self.affectedStatus) + + if self.familyId is not None and not isinstance(self.familyId, str): + self.familyId = str(self.familyId) + + if self.individualId is not None and not isinstance(self.individualId, str): + self.individualId = str(self.individualId) + + if self.maternalId is not None and not isinstance(self.maternalId, str): + self.maternalId = str(self.maternalId) + + if self.paternalId is not None and not isinstance(self.paternalId, str): + self.paternalId = str(self.paternalId) + + if self.sex is not None and not isinstance(self.sex, Sex): + self.sex = Sex(self.sex) + + super().__post_init__(**kwargs) + + +@dataclass +class PhenotypicFeature(YAMLRoot): + """ + An individual phenotypic feature, observed as either present or absent (negated), with possible onset, modifiers + and frequency FHIR mapping: Condition (https://www.hl7.org/fhir/condition.html) or Observation + (https://www.hl7.org/fhir/observation.html) + """ + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = PHENOTYPIC_FEATURE.PhenotypicFeature + class_class_curie: ClassVar[str] = "phenotypic_feature:PhenotypicFeature" + class_name: ClassVar[str] = "PhenotypicFeature" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.PhenotypicFeature + + description: Optional[str] = None + evidence: Optional[Union[Union[dict, Evidence], List[Union[dict, Evidence]]]] = empty_list() + excluded: Optional[Union[bool, Bool]] = None + modifiers: Optional[Union[Dict[Union[str, OntologyClassId], Union[dict, OntologyClass]], List[Union[dict, OntologyClass]]]] = empty_dict() + onset: Optional[Union[dict, TimeElement]] = None + resolution: Optional[Union[dict, TimeElement]] = None + severity: Optional[Union[dict, OntologyClass]] = None + type: Optional[Union[dict, OntologyClass]] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.description is not None and not isinstance(self.description, str): + self.description = str(self.description) + + if not isinstance(self.evidence, list): + self.evidence = [self.evidence] if self.evidence is not None else [] + self.evidence = [v if isinstance(v, Evidence) else Evidence(**as_dict(v)) for v in self.evidence] + + if self.excluded is not None and not isinstance(self.excluded, Bool): + self.excluded = Bool(self.excluded) + + self._normalize_inlined_as_dict(slot_name="modifiers", slot_type=OntologyClass, key_name="id", keyed=True) + + if self.onset is not None and not isinstance(self.onset, TimeElement): + self.onset = TimeElement(**as_dict(self.onset)) + + if self.resolution is not None and not isinstance(self.resolution, TimeElement): + self.resolution = TimeElement(**as_dict(self.resolution)) + + if self.severity is not None and not isinstance(self.severity, OntologyClass): + self.severity = OntologyClass(**as_dict(self.severity)) + + if self.type is not None and not isinstance(self.type, OntologyClass): + self.type = OntologyClass(**as_dict(self.type)) + + super().__post_init__(**kwargs) + + +@dataclass +class Timestamp(YAMLRoot): + """ + A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of + seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on + January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for + interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from + 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can + convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute + Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); + Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp + timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp + from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = + (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch + 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % + 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = + System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) + ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = + Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = + Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in + the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is + "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while + {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go + up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); + the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the + Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an + offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In + JavaScript, one can convert a Date object to this format using the standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted to this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec + '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( + http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D ) to obtain a + formatter capable of generating timestamps in this format. + """ + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = TIMESTAMP.Timestamp + class_class_curie: ClassVar[str] = "timestamp:Timestamp" + class_name: ClassVar[str] = "Timestamp" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.Timestamp + + nanos: Optional[int] = None + seconds: Optional[int] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.nanos is not None and not isinstance(self.nanos, int): + self.nanos = int(self.nanos) + + if self.seconds is not None and not isinstance(self.seconds, int): + self.seconds = int(self.seconds) + + super().__post_init__(**kwargs) + + +@dataclass +class Expression(YAMLRoot): + """ + https://vrsatile.readthedocs.io/en/latest/value_object_descriptor/vod_index.html#expression + """ + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = VRSATILE.Expression + class_class_curie: ClassVar[str] = "vrsatile:Expression" + class_name: ClassVar[str] = "Expression" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.Expression + + syntax: Optional[str] = None + value: Optional[str] = None + version: Optional[str] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.syntax is not None and not isinstance(self.syntax, str): + self.syntax = str(self.syntax) + + if self.value is not None and not isinstance(self.value, str): + self.value = str(self.value) + + if self.version is not None and not isinstance(self.version, str): + self.version = str(self.version) + + super().__post_init__(**kwargs) + + +@dataclass +class Extension(YAMLRoot): + """ + https://vrsatile.readthedocs.io/en/latest/value_object_descriptor/vod_index.html#extension + """ + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = VRSATILE.Extension + class_class_curie: ClassVar[str] = "vrsatile:Extension" + class_name: ClassVar[str] = "Extension" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.Extension + + name: Optional[str] = None + value: Optional[Union[Union[dict, "Any"], List[Union[dict, "Any"]]]] = empty_list() + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.name is not None and not isinstance(self.name, str): + self.name = str(self.name) + + if not isinstance(self.value, list): + self.value = [self.value] if self.value is not None else [] + self.value = [v if isinstance(v, Any) else Any(**as_dict(v)) for v in self.value] + + super().__post_init__(**kwargs) + + +@dataclass +class GeneDescriptor(YAMLRoot): + """ + https://vrsatile.readthedocs.io/en/latest/value_object_descriptor/vod_index.html#gene-descriptor + """ + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = VRSATILE.GeneDescriptor + class_class_curie: ClassVar[str] = "vrsatile:GeneDescriptor" + class_name: ClassVar[str] = "GeneDescriptor" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.GeneDescriptor + + alternateIds: Optional[Union[str, List[str]]] = empty_list() + alternateSymbols: Optional[Union[str, List[str]]] = empty_list() + description: Optional[str] = None + symbol: Optional[str] = None + valueId: Optional[str] = None + xrefs: Optional[Union[str, List[str]]] = empty_list() + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if not isinstance(self.alternateIds, list): + self.alternateIds = [self.alternateIds] if self.alternateIds is not None else [] + self.alternateIds = [v if isinstance(v, str) else str(v) for v in self.alternateIds] + + if not isinstance(self.alternateSymbols, list): + self.alternateSymbols = [self.alternateSymbols] if self.alternateSymbols is not None else [] + self.alternateSymbols = [v if isinstance(v, str) else str(v) for v in self.alternateSymbols] + + if self.description is not None and not isinstance(self.description, str): + self.description = str(self.description) + + if self.symbol is not None and not isinstance(self.symbol, str): + self.symbol = str(self.symbol) + + if self.valueId is not None and not isinstance(self.valueId, str): + self.valueId = str(self.valueId) + + if not isinstance(self.xrefs, list): + self.xrefs = [self.xrefs] if self.xrefs is not None else [] + self.xrefs = [v if isinstance(v, str) else str(v) for v in self.xrefs] + + super().__post_init__(**kwargs) + + +@dataclass +class VariationDescriptor(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = VRSATILE.VariationDescriptor + class_class_curie: ClassVar[str] = "vrsatile:VariationDescriptor" + class_name: ClassVar[str] = "VariationDescriptor" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.VariationDescriptor + + allelicState: Optional[Union[dict, OntologyClass]] = None + alternateLabels: Optional[Union[str, List[str]]] = empty_list() + description: Optional[str] = None + expressions: Optional[Union[Union[dict, Expression], List[Union[dict, Expression]]]] = empty_list() + extensions: Optional[Union[Union[dict, Extension], List[Union[dict, Extension]]]] = empty_list() + geneContext: Optional[Union[dict, GeneDescriptor]] = None + id: Optional[str] = None + label: Optional[str] = None + moleculeContext: Optional[Union[str, "MoleculeContext"]] = None + structuralType: Optional[Union[dict, OntologyClass]] = None + variation: Optional[Union[dict, "Variation"]] = None + vcfRecord: Optional[Union[dict, "VcfRecord"]] = None + vrsRefAlleleSeq: Optional[str] = None + xrefs: Optional[Union[str, List[str]]] = empty_list() + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.allelicState is not None and not isinstance(self.allelicState, OntologyClass): + self.allelicState = OntologyClass(**as_dict(self.allelicState)) + + if not isinstance(self.alternateLabels, list): + self.alternateLabels = [self.alternateLabels] if self.alternateLabels is not None else [] + self.alternateLabels = [v if isinstance(v, str) else str(v) for v in self.alternateLabels] + + if self.description is not None and not isinstance(self.description, str): + self.description = str(self.description) + + if not isinstance(self.expressions, list): + self.expressions = [self.expressions] if self.expressions is not None else [] + self.expressions = [v if isinstance(v, Expression) else Expression(**as_dict(v)) for v in self.expressions] + + if not isinstance(self.extensions, list): + self.extensions = [self.extensions] if self.extensions is not None else [] + self.extensions = [v if isinstance(v, Extension) else Extension(**as_dict(v)) for v in self.extensions] + + if self.geneContext is not None and not isinstance(self.geneContext, GeneDescriptor): + self.geneContext = GeneDescriptor(**as_dict(self.geneContext)) + + if self.id is not None and not isinstance(self.id, str): + self.id = str(self.id) + + if self.label is not None and not isinstance(self.label, str): + self.label = str(self.label) + + if self.moleculeContext is not None and not isinstance(self.moleculeContext, MoleculeContext): + self.moleculeContext = MoleculeContext(self.moleculeContext) + + if self.structuralType is not None and not isinstance(self.structuralType, OntologyClass): + self.structuralType = OntologyClass(**as_dict(self.structuralType)) + + if self.variation is not None and not isinstance(self.variation, Variation): + self.variation = Variation(**as_dict(self.variation)) + + if self.vcfRecord is not None and not isinstance(self.vcfRecord, VcfRecord): + self.vcfRecord = VcfRecord(**as_dict(self.vcfRecord)) + + if self.vrsRefAlleleSeq is not None and not isinstance(self.vrsRefAlleleSeq, str): + self.vrsRefAlleleSeq = str(self.vrsRefAlleleSeq) + + if not isinstance(self.xrefs, list): + self.xrefs = [self.xrefs] if self.xrefs is not None else [] + self.xrefs = [v if isinstance(v, str) else str(v) for v in self.xrefs] + + super().__post_init__(**kwargs) + + +@dataclass +class VcfRecord(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = VRSATILE.VcfRecord + class_class_curie: ClassVar[str] = "vrsatile:VcfRecord" + class_name: ClassVar[str] = "VcfRecord" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.VcfRecord + + alt: Optional[str] = None + chrom: Optional[str] = None + filter: Optional[str] = None + genomeAssembly: Optional[str] = None + id: Optional[str] = None + info: Optional[str] = None + pos: Optional[int] = None + qual: Optional[str] = None + ref: Optional[str] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.alt is not None and not isinstance(self.alt, str): + self.alt = str(self.alt) + + if self.chrom is not None and not isinstance(self.chrom, str): + self.chrom = str(self.chrom) + + if self.filter is not None and not isinstance(self.filter, str): + self.filter = str(self.filter) + + if self.genomeAssembly is not None and not isinstance(self.genomeAssembly, str): + self.genomeAssembly = str(self.genomeAssembly) + + if self.id is not None and not isinstance(self.id, str): + self.id = str(self.id) + + if self.info is not None and not isinstance(self.info, str): + self.info = str(self.info) + + if self.pos is not None and not isinstance(self.pos, int): + self.pos = int(self.pos) + + if self.qual is not None and not isinstance(self.qual, str): + self.qual = str(self.qual) + + if self.ref is not None and not isinstance(self.ref, str): + self.ref = str(self.ref) + + super().__post_init__(**kwargs) + + +@dataclass +class Any(YAMLRoot): + """ + `Any` contains an arbitrary serialized protocol buffer message along with a URL that describes the type of the + serialized message. Protobuf library provides support to pack/unpack Any values in the form of utility functions + or additional generated methods of the Any type. Example 1: Pack and unpack a message in C++. Foo foo = ...; Any + any; any.PackFrom(foo); ... if (any.UnpackTo(&foo)) { ... } Example 2: Pack and unpack a message in Java. Foo foo + = ...; Any any = Any.pack(foo); ... if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } Example 3: Pack and + unpack a message in Python. foo = Foo(...) any = Any() any.Pack(foo) ... if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) ... Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) if + err != nil { ... } ... foo := &pb.Foo{} if err := any.UnmarshalTo(foo); err != nil { ... } The pack methods + provided by protobuf library will by default use 'type.googleapis.com/full.type.name' as the type URL and the + unpack methods only use the fully qualified type name after the last '/' in the type URL, for example + "foo.bar.com/x/y.z" will yield type name "y.z". JSON ==== The JSON representation of an `Any` value uses the + regular representation of the deserialized, embedded message, with an additional field `@type` which contains the + type URL. Example: package google.profile; message Person { string first_name = 1; string last_name = 2; } { + "@type": "type.googleapis.com/google.profile.Person", "firstName": , "lastName": } If the + embedded message type is well-known and has a custom JSON representation, that representation will be embedded + adding a field `value` which holds the custom JSON in addition to the `@type` field. Example (for message + [google.protobuf.Duration][]): { "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } + """ + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = ANY.Any + class_class_curie: ClassVar[str] = "any:Any" + class_name: ClassVar[str] = "Any" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.Any + + typeUrl: Optional[str] = None + value: Optional[str] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.typeUrl is not None and not isinstance(self.typeUrl, str): + self.typeUrl = str(self.typeUrl) + + if self.value is not None and not isinstance(self.value, str): + self.value = str(self.value) + + super().__post_init__(**kwargs) + + +@dataclass +class Abundance(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = VRS.Abundance + class_class_curie: ClassVar[str] = "vrs:Abundance" + class_name: ClassVar[str] = "Abundance" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.Abundance + + copyNumber: Optional[Union[dict, "CopyNumber"]] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.copyNumber is not None and not isinstance(self.copyNumber, CopyNumber): + self.copyNumber = CopyNumber(**as_dict(self.copyNumber)) + + super().__post_init__(**kwargs) + + +@dataclass +class Allele(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = VRS.Allele + class_class_curie: ClassVar[str] = "vrs:Allele" + class_name: ClassVar[str] = "Allele" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.Allele + + chromosomeLocation: Optional[Union[dict, "ChromosomeLocation"]] = None + curie: Optional[str] = None + derivedSequenceExpression: Optional[Union[dict, "DerivedSequenceExpression"]] = None + id: Optional[str] = None + literalSequenceExpression: Optional[Union[dict, "LiteralSequenceExpression"]] = None + repeatedSequenceExpression: Optional[Union[dict, "RepeatedSequenceExpression"]] = None + sequenceLocation: Optional[Union[dict, "SequenceLocation"]] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.chromosomeLocation is not None and not isinstance(self.chromosomeLocation, ChromosomeLocation): + self.chromosomeLocation = ChromosomeLocation(**as_dict(self.chromosomeLocation)) + + if self.curie is not None and not isinstance(self.curie, str): + self.curie = str(self.curie) + + if self.derivedSequenceExpression is not None and not isinstance(self.derivedSequenceExpression, DerivedSequenceExpression): + self.derivedSequenceExpression = DerivedSequenceExpression(**as_dict(self.derivedSequenceExpression)) + + if self.id is not None and not isinstance(self.id, str): + self.id = str(self.id) + + if self.literalSequenceExpression is not None and not isinstance(self.literalSequenceExpression, LiteralSequenceExpression): + self.literalSequenceExpression = LiteralSequenceExpression(**as_dict(self.literalSequenceExpression)) + + if self.repeatedSequenceExpression is not None and not isinstance(self.repeatedSequenceExpression, RepeatedSequenceExpression): + self.repeatedSequenceExpression = RepeatedSequenceExpression(**as_dict(self.repeatedSequenceExpression)) + + if self.sequenceLocation is not None and not isinstance(self.sequenceLocation, SequenceLocation): + self.sequenceLocation = SequenceLocation(**as_dict(self.sequenceLocation)) + + super().__post_init__(**kwargs) + + +@dataclass +class ChromosomeLocation(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = VRS.ChromosomeLocation + class_class_curie: ClassVar[str] = "vrs:ChromosomeLocation" + class_name: ClassVar[str] = "ChromosomeLocation" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.ChromosomeLocation + + chr: Optional[str] = None + id: Optional[str] = None + interval: Optional[Union[dict, "CytobandInterval"]] = None + speciesId: Optional[str] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.chr is not None and not isinstance(self.chr, str): + self.chr = str(self.chr) + + if self.id is not None and not isinstance(self.id, str): + self.id = str(self.id) + + if self.interval is not None and not isinstance(self.interval, CytobandInterval): + self.interval = CytobandInterval(**as_dict(self.interval)) + + if self.speciesId is not None and not isinstance(self.speciesId, str): + self.speciesId = str(self.speciesId) + + super().__post_init__(**kwargs) + + +@dataclass +class CopyNumber(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = VRS.CopyNumber + class_class_curie: ClassVar[str] = "vrs:CopyNumber" + class_name: ClassVar[str] = "CopyNumber" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.CopyNumber + + allele: Optional[Union[dict, Allele]] = None + curie: Optional[str] = None + definiteRange: Optional[Union[dict, "DefiniteRange"]] = None + derivedSequenceExpression: Optional[Union[dict, "DerivedSequenceExpression"]] = None + gene: Optional[Union[dict, "Gene"]] = None + haplotype: Optional[Union[dict, "Haplotype"]] = None + id: Optional[str] = None + indefiniteRange: Optional[Union[dict, "IndefiniteRange"]] = None + literalSequenceExpression: Optional[Union[dict, "LiteralSequenceExpression"]] = None + number: Optional[Union[dict, "Number"]] = None + repeatedSequenceExpression: Optional[Union[dict, "RepeatedSequenceExpression"]] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.allele is not None and not isinstance(self.allele, Allele): + self.allele = Allele(**as_dict(self.allele)) + + if self.curie is not None and not isinstance(self.curie, str): + self.curie = str(self.curie) + + if self.definiteRange is not None and not isinstance(self.definiteRange, DefiniteRange): + self.definiteRange = DefiniteRange(**as_dict(self.definiteRange)) + + if self.derivedSequenceExpression is not None and not isinstance(self.derivedSequenceExpression, DerivedSequenceExpression): + self.derivedSequenceExpression = DerivedSequenceExpression(**as_dict(self.derivedSequenceExpression)) + + if self.gene is not None and not isinstance(self.gene, Gene): + self.gene = Gene(**as_dict(self.gene)) + + if self.haplotype is not None and not isinstance(self.haplotype, Haplotype): + self.haplotype = Haplotype() + + if self.id is not None and not isinstance(self.id, str): + self.id = str(self.id) + + if self.indefiniteRange is not None and not isinstance(self.indefiniteRange, IndefiniteRange): + self.indefiniteRange = IndefiniteRange(**as_dict(self.indefiniteRange)) + + if self.literalSequenceExpression is not None and not isinstance(self.literalSequenceExpression, LiteralSequenceExpression): + self.literalSequenceExpression = LiteralSequenceExpression(**as_dict(self.literalSequenceExpression)) + + if self.number is not None and not isinstance(self.number, Number): + self.number = Number(**as_dict(self.number)) + + if self.repeatedSequenceExpression is not None and not isinstance(self.repeatedSequenceExpression, RepeatedSequenceExpression): + self.repeatedSequenceExpression = RepeatedSequenceExpression(**as_dict(self.repeatedSequenceExpression)) + + super().__post_init__(**kwargs) + + +@dataclass +class CytobandInterval(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = VRS.CytobandInterval + class_class_curie: ClassVar[str] = "vrs:CytobandInterval" + class_name: ClassVar[str] = "CytobandInterval" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.CytobandInterval + + end: Optional[str] = None + start: Optional[str] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.end is not None and not isinstance(self.end, str): + self.end = str(self.end) + + if self.start is not None and not isinstance(self.start, str): + self.start = str(self.start) + + super().__post_init__(**kwargs) + + +@dataclass +class DefiniteRange(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = VRS.DefiniteRange + class_class_curie: ClassVar[str] = "vrs:DefiniteRange" + class_name: ClassVar[str] = "DefiniteRange" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.DefiniteRange + + max: Optional[int] = None + min: Optional[int] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.max is not None and not isinstance(self.max, int): + self.max = int(self.max) + + if self.min is not None and not isinstance(self.min, int): + self.min = int(self.min) + + super().__post_init__(**kwargs) + + +@dataclass +class DerivedSequenceExpression(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = VRS.DerivedSequenceExpression + class_class_curie: ClassVar[str] = "vrs:DerivedSequenceExpression" + class_name: ClassVar[str] = "DerivedSequenceExpression" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.DerivedSequenceExpression + + location: Optional[Union[dict, "SequenceLocation"]] = None + reverseComplement: Optional[Union[bool, Bool]] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.location is not None and not isinstance(self.location, SequenceLocation): + self.location = SequenceLocation(**as_dict(self.location)) + + if self.reverseComplement is not None and not isinstance(self.reverseComplement, Bool): + self.reverseComplement = Bool(self.reverseComplement) + + super().__post_init__(**kwargs) + + +@dataclass +class Feature(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = VRS.Feature + class_class_curie: ClassVar[str] = "vrs:Feature" + class_name: ClassVar[str] = "Feature" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.Feature + + gene: Optional[Union[dict, "Gene"]] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.gene is not None and not isinstance(self.gene, Gene): + self.gene = Gene(**as_dict(self.gene)) + + super().__post_init__(**kwargs) + + +@dataclass +class Gene(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = VRS.Gene + class_class_curie: ClassVar[str] = "vrs:Gene" + class_name: ClassVar[str] = "Gene" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.Gene + + geneId: Optional[str] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.geneId is not None and not isinstance(self.geneId, str): + self.geneId = str(self.geneId) + + super().__post_init__(**kwargs) + + +class Haplotype(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = VRS.Haplotype + class_class_curie: ClassVar[str] = "vrs:Haplotype" + class_name: ClassVar[str] = "Haplotype" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.Haplotype + + +@dataclass +class IndefiniteRange(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = VRS.IndefiniteRange + class_class_curie: ClassVar[str] = "vrs:IndefiniteRange" + class_name: ClassVar[str] = "IndefiniteRange" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.IndefiniteRange + + comparator: Optional[str] = None + value: Optional[int] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.comparator is not None and not isinstance(self.comparator, str): + self.comparator = str(self.comparator) + + if self.value is not None and not isinstance(self.value, int): + self.value = int(self.value) + + super().__post_init__(**kwargs) + + +@dataclass +class LiteralSequenceExpression(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = VRS.LiteralSequenceExpression + class_class_curie: ClassVar[str] = "vrs:LiteralSequenceExpression" + class_name: ClassVar[str] = "LiteralSequenceExpression" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.LiteralSequenceExpression + + sequence: Optional[str] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.sequence is not None and not isinstance(self.sequence, str): + self.sequence = str(self.sequence) + + super().__post_init__(**kwargs) + + +@dataclass +class Location(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = VRS.Location + class_class_curie: ClassVar[str] = "vrs:Location" + class_name: ClassVar[str] = "Location" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.Location + + chromosomeLocation: Optional[Union[dict, ChromosomeLocation]] = None + sequenceLocation: Optional[Union[dict, "SequenceLocation"]] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.chromosomeLocation is not None and not isinstance(self.chromosomeLocation, ChromosomeLocation): + self.chromosomeLocation = ChromosomeLocation(**as_dict(self.chromosomeLocation)) + + if self.sequenceLocation is not None and not isinstance(self.sequenceLocation, SequenceLocation): + self.sequenceLocation = SequenceLocation(**as_dict(self.sequenceLocation)) + + super().__post_init__(**kwargs) + + +@dataclass +class Member(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = VRS.Member + class_class_curie: ClassVar[str] = "vrs:Member" + class_name: ClassVar[str] = "Member" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.Member + + allele: Optional[Union[dict, Allele]] = None + copyNumber: Optional[Union[dict, CopyNumber]] = None + curie: Optional[str] = None + haplotype: Optional[Union[dict, Haplotype]] = None + id: Optional[str] = None + members: Optional[Union[Union[dict, "Member"], List[Union[dict, "Member"]]]] = empty_list() + text: Optional[Union[dict, "Text"]] = None + variationSet: Optional[Union[dict, "VariationSet"]] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.allele is not None and not isinstance(self.allele, Allele): + self.allele = Allele(**as_dict(self.allele)) + + if self.copyNumber is not None and not isinstance(self.copyNumber, CopyNumber): + self.copyNumber = CopyNumber(**as_dict(self.copyNumber)) + + if self.curie is not None and not isinstance(self.curie, str): + self.curie = str(self.curie) + + if self.haplotype is not None and not isinstance(self.haplotype, Haplotype): + self.haplotype = Haplotype() + + if self.id is not None and not isinstance(self.id, str): + self.id = str(self.id) + + if not isinstance(self.members, list): + self.members = [self.members] if self.members is not None else [] + self.members = [v if isinstance(v, Member) else Member(**as_dict(v)) for v in self.members] + + if self.text is not None and not isinstance(self.text, Text): + self.text = Text(**as_dict(self.text)) + + if self.variationSet is not None and not isinstance(self.variationSet, VariationSet): + self.variationSet = VariationSet() + + super().__post_init__(**kwargs) + + +@dataclass +class MolecularVariation(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = VRS.MolecularVariation + class_class_curie: ClassVar[str] = "vrs:MolecularVariation" + class_name: ClassVar[str] = "MolecularVariation" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.MolecularVariation + + allele: Optional[Union[dict, Allele]] = None + haplotype: Optional[Union[dict, Haplotype]] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.allele is not None and not isinstance(self.allele, Allele): + self.allele = Allele(**as_dict(self.allele)) + + if self.haplotype is not None and not isinstance(self.haplotype, Haplotype): + self.haplotype = Haplotype() + + super().__post_init__(**kwargs) + + +@dataclass +class Number(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = VRS.Number + class_class_curie: ClassVar[str] = "vrs:Number" + class_name: ClassVar[str] = "Number" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.Number + + value: Optional[int] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.value is not None and not isinstance(self.value, int): + self.value = int(self.value) + + super().__post_init__(**kwargs) + + +@dataclass +class RepeatedSequenceExpression(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = VRS.RepeatedSequenceExpression + class_class_curie: ClassVar[str] = "vrs:RepeatedSequenceExpression" + class_name: ClassVar[str] = "RepeatedSequenceExpression" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.RepeatedSequenceExpression + + definiteRange: Optional[Union[dict, DefiniteRange]] = None + derivedSequenceExpression: Optional[Union[dict, DerivedSequenceExpression]] = None + indefiniteRange: Optional[Union[dict, IndefiniteRange]] = None + literalSequenceExpression: Optional[Union[dict, LiteralSequenceExpression]] = None + number: Optional[Union[dict, Number]] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.definiteRange is not None and not isinstance(self.definiteRange, DefiniteRange): + self.definiteRange = DefiniteRange(**as_dict(self.definiteRange)) + + if self.derivedSequenceExpression is not None and not isinstance(self.derivedSequenceExpression, DerivedSequenceExpression): + self.derivedSequenceExpression = DerivedSequenceExpression(**as_dict(self.derivedSequenceExpression)) + + if self.indefiniteRange is not None and not isinstance(self.indefiniteRange, IndefiniteRange): + self.indefiniteRange = IndefiniteRange(**as_dict(self.indefiniteRange)) + + if self.literalSequenceExpression is not None and not isinstance(self.literalSequenceExpression, LiteralSequenceExpression): + self.literalSequenceExpression = LiteralSequenceExpression(**as_dict(self.literalSequenceExpression)) + + if self.number is not None and not isinstance(self.number, Number): + self.number = Number(**as_dict(self.number)) + + super().__post_init__(**kwargs) + + +@dataclass +class SequenceExpression(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = VRS.SequenceExpression + class_class_curie: ClassVar[str] = "vrs:SequenceExpression" + class_name: ClassVar[str] = "SequenceExpression" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.SequenceExpression + + derivedSequenceExpression: Optional[Union[dict, DerivedSequenceExpression]] = None + literalSequenceExpression: Optional[Union[dict, LiteralSequenceExpression]] = None + repeatedSequenceExpression: Optional[Union[dict, RepeatedSequenceExpression]] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.derivedSequenceExpression is not None and not isinstance(self.derivedSequenceExpression, DerivedSequenceExpression): + self.derivedSequenceExpression = DerivedSequenceExpression(**as_dict(self.derivedSequenceExpression)) + + if self.literalSequenceExpression is not None and not isinstance(self.literalSequenceExpression, LiteralSequenceExpression): + self.literalSequenceExpression = LiteralSequenceExpression(**as_dict(self.literalSequenceExpression)) + + if self.repeatedSequenceExpression is not None and not isinstance(self.repeatedSequenceExpression, RepeatedSequenceExpression): + self.repeatedSequenceExpression = RepeatedSequenceExpression(**as_dict(self.repeatedSequenceExpression)) + + super().__post_init__(**kwargs) + + +@dataclass +class SequenceInterval(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = VRS.SequenceInterval + class_class_curie: ClassVar[str] = "vrs:SequenceInterval" + class_name: ClassVar[str] = "SequenceInterval" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.SequenceInterval + + endDefiniteRange: Optional[Union[dict, DefiniteRange]] = None + endIndefiniteRange: Optional[Union[dict, IndefiniteRange]] = None + endNumber: Optional[Union[dict, Number]] = None + startDefiniteRange: Optional[Union[dict, DefiniteRange]] = None + startIndefiniteRange: Optional[Union[dict, IndefiniteRange]] = None + startNumber: Optional[Union[dict, Number]] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.endDefiniteRange is not None and not isinstance(self.endDefiniteRange, DefiniteRange): + self.endDefiniteRange = DefiniteRange(**as_dict(self.endDefiniteRange)) + + if self.endIndefiniteRange is not None and not isinstance(self.endIndefiniteRange, IndefiniteRange): + self.endIndefiniteRange = IndefiniteRange(**as_dict(self.endIndefiniteRange)) + + if self.endNumber is not None and not isinstance(self.endNumber, Number): + self.endNumber = Number(**as_dict(self.endNumber)) + + if self.startDefiniteRange is not None and not isinstance(self.startDefiniteRange, DefiniteRange): + self.startDefiniteRange = DefiniteRange(**as_dict(self.startDefiniteRange)) + + if self.startIndefiniteRange is not None and not isinstance(self.startIndefiniteRange, IndefiniteRange): + self.startIndefiniteRange = IndefiniteRange(**as_dict(self.startIndefiniteRange)) + + if self.startNumber is not None and not isinstance(self.startNumber, Number): + self.startNumber = Number(**as_dict(self.startNumber)) + + super().__post_init__(**kwargs) + + +@dataclass +class SequenceLocation(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = VRS.SequenceLocation + class_class_curie: ClassVar[str] = "vrs:SequenceLocation" + class_name: ClassVar[str] = "SequenceLocation" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.SequenceLocation + + id: Optional[str] = None + sequenceId: Optional[str] = None + sequenceInterval: Optional[Union[dict, SequenceInterval]] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.id is not None and not isinstance(self.id, str): + self.id = str(self.id) + + if self.sequenceId is not None and not isinstance(self.sequenceId, str): + self.sequenceId = str(self.sequenceId) + + if self.sequenceInterval is not None and not isinstance(self.sequenceInterval, SequenceInterval): + self.sequenceInterval = SequenceInterval(**as_dict(self.sequenceInterval)) + + super().__post_init__(**kwargs) + + +@dataclass +class SequenceState(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = VRS.SequenceState + class_class_curie: ClassVar[str] = "vrs:SequenceState" + class_name: ClassVar[str] = "SequenceState" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.SequenceState + + sequence: Optional[str] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.sequence is not None and not isinstance(self.sequence, str): + self.sequence = str(self.sequence) + + super().__post_init__(**kwargs) + + +@dataclass +class SimpleInterval(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = VRS.SimpleInterval + class_class_curie: ClassVar[str] = "vrs:SimpleInterval" + class_name: ClassVar[str] = "SimpleInterval" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.SimpleInterval + + end: Optional[int] = None + start: Optional[int] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.end is not None and not isinstance(self.end, int): + self.end = int(self.end) + + if self.start is not None and not isinstance(self.start, int): + self.start = int(self.start) + + super().__post_init__(**kwargs) + + +@dataclass +class SystemicVariation(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = VRS.SystemicVariation + class_class_curie: ClassVar[str] = "vrs:SystemicVariation" + class_name: ClassVar[str] = "SystemicVariation" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.SystemicVariation + + copyNumber: Optional[Union[dict, CopyNumber]] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.copyNumber is not None and not isinstance(self.copyNumber, CopyNumber): + self.copyNumber = CopyNumber(**as_dict(self.copyNumber)) + + super().__post_init__(**kwargs) + + +@dataclass +class Text(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = VRS.Text + class_class_curie: ClassVar[str] = "vrs:Text" + class_name: ClassVar[str] = "Text" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.Text + + definition: Optional[str] = None + id: Optional[str] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.definition is not None and not isinstance(self.definition, str): + self.definition = str(self.definition) + + if self.id is not None and not isinstance(self.id, str): + self.id = str(self.id) + + super().__post_init__(**kwargs) + + +@dataclass +class UtilityVariation(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = VRS.UtilityVariation + class_class_curie: ClassVar[str] = "vrs:UtilityVariation" + class_name: ClassVar[str] = "UtilityVariation" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.UtilityVariation + + text: Optional[Union[dict, Text]] = None + variationSet: Optional[Union[dict, "VariationSet"]] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.text is not None and not isinstance(self.text, Text): + self.text = Text(**as_dict(self.text)) + + if self.variationSet is not None and not isinstance(self.variationSet, VariationSet): + self.variationSet = VariationSet() + + super().__post_init__(**kwargs) + + +@dataclass +class Variation(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = VRS.Variation + class_class_curie: ClassVar[str] = "vrs:Variation" + class_name: ClassVar[str] = "Variation" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.Variation + + allele: Optional[Union[dict, Allele]] = None + copyNumber: Optional[Union[dict, CopyNumber]] = None + haplotype: Optional[Union[dict, Haplotype]] = None + text: Optional[Union[dict, Text]] = None + variationSet: Optional[Union[dict, "VariationSet"]] = None + + def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): + if self.allele is not None and not isinstance(self.allele, Allele): + self.allele = Allele(**as_dict(self.allele)) + + if self.copyNumber is not None and not isinstance(self.copyNumber, CopyNumber): + self.copyNumber = CopyNumber(**as_dict(self.copyNumber)) + + if self.haplotype is not None and not isinstance(self.haplotype, Haplotype): + self.haplotype = Haplotype() + + if self.text is not None and not isinstance(self.text, Text): + self.text = Text(**as_dict(self.text)) + + if self.variationSet is not None and not isinstance(self.variationSet, VariationSet): + self.variationSet = VariationSet() + + super().__post_init__(**kwargs) + + +class VariationSet(YAMLRoot): + _inherited_slots: ClassVar[List[str]] = [] + + class_class_uri: ClassVar[URIRef] = VRS.VariationSet + class_class_curie: ClassVar[str] = "vrs:VariationSet" + class_name: ClassVar[str] = "VariationSet" + class_model_uri: ClassVar[URIRef] = PHENOPACKETS.VariationSet + + +# Enumerations +class MondoDiseaseTerms(EnumDefinitionImpl): + """ + Mondo Disease Ontology provides a comprehensive logically structured ontology of diseases that integrates multiple + other disease ontologies. + """ + _defn = EnumDefinition( + name="MondoDiseaseTerms", + description="Mondo Disease Ontology provides a comprehensive logically structured ontology of diseases that integrates multiple other disease ontologies.", + ) + +class NCITDiseaseTerms(EnumDefinitionImpl): + """ + All disease terms from the NCI Thesaurus + """ + _defn = EnumDefinition( + name="NCITDiseaseTerms", + description="All disease terms from the NCI Thesaurus", + ) + +class NCITNeoplasmTerms(EnumDefinitionImpl): + """ + All neoplasm terms from the NCI Thesaurus + """ + _defn = EnumDefinition( + name="NCITNeoplasmTerms", + description="All neoplasm terms from the NCI Thesaurus", + ) + +class HPOAbnormalityTerms(EnumDefinitionImpl): + """ + The Human Phenotype Ontology (HPO) provides a comprehensive logical standard to describe and computationally + analyze phenotypic abnormalities found in human disease. + """ + _defn = EnumDefinition( + name="HPOAbnormalityTerms", + description="The Human Phenotype Ontology (HPO) provides a comprehensive logical standard to describe and computationally analyze phenotypic abnormalities found in human disease.", + ) + +class UberonAnatomicalEntityTerms(EnumDefinitionImpl): + """ + UBERON is an integrated cross-species ontology with classes representing a variety of anatomical entities. + """ + _defn = EnumDefinition( + name="UberonAnatomicalEntityTerms", + description="UBERON is an integrated cross-species ontology with classes representing a variety of anatomical entities.", + ) + +class HGNCGeneTerms(EnumDefinitionImpl): + """ + The HUGO Gene Nomenclature Committee (HGNC) provides standard names, symbols, and IDs for human genes. + """ + _defn = EnumDefinition( + name="HGNCGeneTerms", + description="The HUGO Gene Nomenclature Committee (HGNC) provides standard names, symbols, and IDs for human genes.", + ) + +class UOUnitTerms(EnumDefinitionImpl): + """ + The Units of measurement ontology (denoted UO) provides terms for units commonly encountered in medical data. The + following table shows some typical examples. + """ + _defn = EnumDefinition( + name="UOUnitTerms", + description="The Units of measurement ontology (denoted UO) provides terms for units commonly encountered in medical data. The following table shows some typical examples.", + ) + +class GENOZygosityTerms(EnumDefinitionImpl): + """ + GENO is an ontology of genotypes their more fundamental sequence components. This enum refers to the zygosity + subset of GENO + """ + _defn = EnumDefinition( + name="GENOZygosityTerms", + description="GENO is an ontology of genotypes their more fundamental sequence components. This enum refers to the zygosity subset of GENO", + ) + +class LOINCMeasurementTerms(EnumDefinitionImpl): + """ + Logical Observation Identifiers Names and Codes (LOINC) is a database and universal standard for identifying + medical laboratory observations. It can be used to denote clinical assays in the Measurement element. examples: + """ + _defn = EnumDefinition( + name="LOINCMeasurementTerms", + description="Logical Observation Identifiers Names and Codes (LOINC) is a database and universal standard for identifying medical laboratory observations. It can be used to denote clinical assays in the Measurement element. examples:", + ) + +class AcmgPathogenicityClassification(EnumDefinitionImpl): + + BENIGN = PermissibleValue(text="BENIGN") + LIKELY_BENIGN = PermissibleValue(text="LIKELY_BENIGN") + LIKELY_PATHOGENIC = PermissibleValue(text="LIKELY_PATHOGENIC") + NOT_PROVIDED = PermissibleValue(text="NOT_PROVIDED") + PATHOGENIC = PermissibleValue(text="PATHOGENIC") + UNCERTAIN_SIGNIFICANCE = PermissibleValue(text="UNCERTAIN_SIGNIFICANCE") + + _defn = EnumDefinition( + name="AcmgPathogenicityClassification", + ) + +class InterpretationStatus(EnumDefinitionImpl): + + CANDIDATE = PermissibleValue(text="CANDIDATE") + CAUSATIVE = PermissibleValue(text="CAUSATIVE") + CONTRIBUTORY = PermissibleValue(text="CONTRIBUTORY") + REJECTED = PermissibleValue(text="REJECTED") + UNKNOWN_STATUS = PermissibleValue(text="UNKNOWN_STATUS") + + _defn = EnumDefinition( + name="InterpretationStatus", + ) + +class ProgressStatus(EnumDefinitionImpl): + + COMPLETED = PermissibleValue(text="COMPLETED") + IN_PROGRESS = PermissibleValue(text="IN_PROGRESS") + SOLVED = PermissibleValue(text="SOLVED") + UNKNOWN_PROGRESS = PermissibleValue(text="UNKNOWN_PROGRESS") + UNSOLVED = PermissibleValue(text="UNSOLVED") + + _defn = EnumDefinition( + name="ProgressStatus", + ) + +class TherapeuticActionability(EnumDefinitionImpl): + + ACTIONABLE = PermissibleValue(text="ACTIONABLE") + NOT_ACTIONABLE = PermissibleValue(text="NOT_ACTIONABLE") + UNKNOWN_ACTIONABILITY = PermissibleValue(text="UNKNOWN_ACTIONABILITY") + + _defn = EnumDefinition( + name="TherapeuticActionability", + ) + +class KaryotypicSex(EnumDefinitionImpl): + """ + Karyotypic sex of the individual + """ + OTHER_KARYOTYPE = PermissibleValue(text="OTHER_KARYOTYPE") + UNKNOWN_KARYOTYPE = PermissibleValue(text="UNKNOWN_KARYOTYPE") + XO = PermissibleValue(text="XO") + XX = PermissibleValue(text="XX") + XXX = PermissibleValue(text="XXX") + XXXX = PermissibleValue(text="XXXX") + XXXY = PermissibleValue(text="XXXY") + XXY = PermissibleValue(text="XXY") + XXYY = PermissibleValue(text="XXYY") + XY = PermissibleValue(text="XY") + XYY = PermissibleValue(text="XYY") + + _defn = EnumDefinition( + name="KaryotypicSex", + description="Karyotypic sex of the individual", + ) + +class Sex(EnumDefinitionImpl): + """ + Sex of an individual FHIR mapping: AdministrativeGender + (https://www.hl7.org/fhir/codesystem-administrative-gender.html) + """ + FEMALE = PermissibleValue(text="FEMALE", + description="Female") + MALE = PermissibleValue(text="MALE", + description="Male") + OTHER_SEX = PermissibleValue(text="OTHER_SEX", + description="It is not possible, to accurately assess the applicability of MALE/FEMALE.") + UNKNOWN_SEX = PermissibleValue(text="UNKNOWN_SEX", + description="Not assessed / available.") + + _defn = EnumDefinition( + name="Sex", + description="Sex of an individual FHIR mapping: AdministrativeGender (https://www.hl7.org/fhir/codesystem-administrative-gender.html)", + ) + +class Status(EnumDefinitionImpl): + """ + Default = false i.e. the individual is alive. MUST be true if + """ + ALIVE = PermissibleValue(text="ALIVE") + DECEASED = PermissibleValue(text="DECEASED") + UNKNOWN_STATUS = PermissibleValue(text="UNKNOWN_STATUS") + + _defn = EnumDefinition( + name="Status", + description="Default = false i.e. the individual is alive. MUST be true if", + ) + +class DrugType(EnumDefinitionImpl): + """ + A simplified version of ODHSI-DRUG_EXPOSURE + """ + ADMINISTRATION_RELATED_TO_PROCEDURE = PermissibleValue(text="ADMINISTRATION_RELATED_TO_PROCEDURE") + EHR_MEDICATION_LIST = PermissibleValue(text="EHR_MEDICATION_LIST") + PRESCRIPTION = PermissibleValue(text="PRESCRIPTION") + UNKNOWN_DRUG_TYPE = PermissibleValue(text="UNKNOWN_DRUG_TYPE") + + _defn = EnumDefinition( + name="DrugType", + description="A simplified version of ODHSI-DRUG_EXPOSURE", + ) + +class RegimenStatus(EnumDefinitionImpl): + + COMPLETED = PermissibleValue(text="COMPLETED") + DISCONTINUED = PermissibleValue(text="DISCONTINUED") + STARTED = PermissibleValue(text="STARTED") + UNKNOWN_STATUS = PermissibleValue(text="UNKNOWN_STATUS") + + _defn = EnumDefinition( + name="RegimenStatus", + ) + +class AffectedStatus(EnumDefinitionImpl): + + AFFECTED = PermissibleValue(text="AFFECTED") + MISSING = PermissibleValue(text="MISSING") + UNAFFECTED = PermissibleValue(text="UNAFFECTED") + + _defn = EnumDefinition( + name="AffectedStatus", + ) + +class AllelicStateTerms(EnumDefinitionImpl): + + HETEROZYGOUS = PermissibleValue(text="HETEROZYGOUS", + description="heterozygous", + meaning=GENO["0000135"]) + HOMOZYGOUS = PermissibleValue(text="HOMOZYGOUS", + description="homozygous", + meaning=GENO["0000136"]) + HEMIZYGOUS = PermissibleValue(text="HEMIZYGOUS", + description="hemizygous", + meaning=GENO["0000134"]) + + _defn = EnumDefinition( + name="AllelicStateTerms", + ) + +class AssaysTerms(EnumDefinitionImpl): + + CREATINE_KINASE = PermissibleValue(text="CREATINE_KINASE", + description="Creatine kinase [Enzymatic activity/volume] in Serum or Plasma", + meaning=LOINC["2157-6"]) + + _defn = EnumDefinition( + name="AssaysTerms", + ) + +class GenderTerms(EnumDefinitionImpl): + + IDENTIFIES_AS_MALE = PermissibleValue(text="IDENTIFIES_AS_MALE", + description="Identifies as male", + meaning=LOINC["LA22878-5"]) + IDENTIFIES_AS_FEMALE = PermissibleValue(text="IDENTIFIES_AS_FEMALE", + description="Identifies as female", + meaning=LOINC["LA22879-3"]) + FEMALE_TO_MALE_TRANSSEXUAL = PermissibleValue(text="FEMALE_TO_MALE_TRANSSEXUAL", + description="Female-to-male transsexual", + meaning=LOINC["LA22880-1"]) + MALE_TO_FEMALE_TRANSSEXUAL = PermissibleValue(text="MALE_TO_FEMALE_TRANSSEXUAL", + description="Male-to-female transsexual", + meaning=LOINC["LA22881-9"]) + IDENTIFIES_AS_NON_CONFORMING = PermissibleValue(text="IDENTIFIES_AS_NON_CONFORMING", + description="Identifies as non-conforming", + meaning=LOINC["LA22882-7"]) + OTHER_GENDER = PermissibleValue(text="OTHER_GENDER", + description="other", + meaning=LOINC["LA46-8"]) + ASKED_BUT_UNKNOWN = PermissibleValue(text="ASKED_BUT_UNKNOWN", + description="Asked but unknown", + meaning=LOINC["LA20384-6"]) + + _defn = EnumDefinition( + name="GenderTerms", + ) + +class LateralityTerms(EnumDefinitionImpl): + + RIGHT = PermissibleValue(text="RIGHT", + description="Right", + meaning=HP["0012834"]) + LEFT = PermissibleValue(text="LEFT", + description="Left", + meaning=HP["0012835"]) + UNILATERAL = PermissibleValue(text="UNILATERAL", + description="Unilateral", + meaning=HP["0012833"]) + BILATERAL = PermissibleValue(text="BILATERAL", + description="Bilateral", + meaning=HP["0012832"]) + + _defn = EnumDefinition( + name="LateralityTerms", + ) + +class MedicalActionsTerms(EnumDefinitionImpl): + + ADVERSE_EVENT = PermissibleValue(text="ADVERSE_EVENT", + description="Adverse Event", + meaning=NCIT.C41331) + FOUR_TIMES_DAILY = PermissibleValue(text="FOUR_TIMES_DAILY", + description="Four Times Daily", + meaning=NCIT.C64530) + INTRA_ARTERIAL = PermissibleValue(text="INTRA_ARTERIAL", + description="Intraarterial Route of Administration", + meaning=NCIT.C38222) + IV_ADMINISTRATION = PermissibleValue(text="IV_ADMINISTRATION", + description="Intravenous Route of Administration", + meaning=NCIT.C38276) + ORAL_ADMINISTRATION = PermissibleValue(text="ORAL_ADMINISTRATION", + description="Oral Route of Administration", + meaning=NCIT.C38288) + ONCE = PermissibleValue(text="ONCE", + description="Once", + meaning=NCIT.C64576) + ONCE_DAILY = PermissibleValue(text="ONCE_DAILY", + description="Once Daily", + meaning=NCIT.C125004) + THREE_TIMES_DAILY = PermissibleValue(text="THREE_TIMES_DAILY", + description="Three Times Daily", + meaning=NCIT.C64527) + TWICE_DAILY = PermissibleValue(text="TWICE_DAILY", + description="Twice Daily", + meaning=NCIT.C64496) + + _defn = EnumDefinition( + name="MedicalActionsTerms", + ) + +class OnsetTerms(EnumDefinitionImpl): + + ANTENATAL_ONSET = PermissibleValue(text="ANTENATAL_ONSET", + description="Antenatal onset", + meaning=HP["0030674"]) + EMBRYONAL_ONSET = PermissibleValue(text="EMBRYONAL_ONSET", + description="Embryonal onset", + meaning=HP["0011460"]) + FETAL_ONSET = PermissibleValue(text="FETAL_ONSET", + description="Fetal onset", + meaning=HP["0011461"]) + LATE_FIRST_TRIMESTER_ONSET = PermissibleValue(text="LATE_FIRST_TRIMESTER_ONSET", + description="Late first trimester onset", + meaning=HP["0034199"]) + SECOND_TRIMESTER_ONSET = PermissibleValue(text="SECOND_TRIMESTER_ONSET", + description="Second trimester onset", + meaning=HP["0034198"]) + THIRD_TRIMESTER_ONSET = PermissibleValue(text="THIRD_TRIMESTER_ONSET", + description="Third trimester onset", + meaning=HP["0034197"]) + CONGENITAL_ONSET = PermissibleValue(text="CONGENITAL_ONSET", + description="Congenital onset", + meaning=HP["0003577"]) + NEONATAL_ONSET = PermissibleValue(text="NEONATAL_ONSET", + description="Neonatal onset", + meaning=HP["0003623"]) + INFANTILE_ONSET = PermissibleValue(text="INFANTILE_ONSET", + description="Infantile onset", + meaning=HP["0003593"]) + CHILDHOOD_ONSET = PermissibleValue(text="CHILDHOOD_ONSET", + description="Childhood onset", + meaning=HP["0011463"]) + JUVENILE_ONSET = PermissibleValue(text="JUVENILE_ONSET", + description="Juvenile onset", + meaning=HP["0003621"]) + ADULT_ONSET = PermissibleValue(text="ADULT_ONSET", + description="Adult onset", + meaning=HP["0003581"]) + YOUNG_ADULT_ONSET = PermissibleValue(text="YOUNG_ADULT_ONSET", + description="Young adult onset", + meaning=HP["0011462"]) + EARLY_YOUNG_ADULT_ONSET = PermissibleValue(text="EARLY_YOUNG_ADULT_ONSET", + description="Early young adult onset", + meaning=HP["0025708"]) + INTERMEDIATE_YOUNG_ADULT_ONSET = PermissibleValue(text="INTERMEDIATE_YOUNG_ADULT_ONSET", + description="Intermediate young adult onset", + meaning=HP["0025709"]) + LATE_YOUNG_ADULT_ONSET = PermissibleValue(text="LATE_YOUNG_ADULT_ONSET", + description="Late young adult onset", + meaning=HP["0025710"]) + MIDDLE_AGE_ONSET = PermissibleValue(text="MIDDLE_AGE_ONSET", + description="Middle age onset", + meaning=HP["0003596"]) + LATE_ONSET = PermissibleValue(text="LATE_ONSET", + description="Late onset", + meaning=HP["0003584"]) + + _defn = EnumDefinition( + name="OnsetTerms", + ) + +class OrganTerms(EnumDefinitionImpl): + + BRAIN = PermissibleValue(text="BRAIN", + description="brain", + meaning=UBERON["0000955"]) + CEREBELLUM = PermissibleValue(text="CEREBELLUM", + description="cerebellum", + meaning=UBERON["0002037"]) + EAR = PermissibleValue(text="EAR", + description="ear", + meaning=UBERON["0001690"]) + EYE = PermissibleValue(text="EYE", + description="eye", + meaning=UBERON["0000970"]) + HEART = PermissibleValue(text="HEART", + description="heart", + meaning=UBERON["0002107"]) + KIDNEY = PermissibleValue(text="KIDNEY", + description="kidney", + meaning=UBERON["0002113"]) + LARGE_INTESTINE = PermissibleValue(text="LARGE_INTESTINE", + description="large intestine", + meaning=UBERON["0000059"]) + LIVER = PermissibleValue(text="LIVER", + description="liver", + meaning=UBERON["0002107"]) + LUNG = PermissibleValue(text="LUNG", + description="lung", + meaning=UBERON["0002048"]) + NOSE = PermissibleValue(text="NOSE", + description="nose", + meaning=UBERON["0000004"]) + SMALL_INTESTINE = PermissibleValue(text="SMALL_INTESTINE", + description="small intestine", + meaning=UBERON["0002108"]) + SPINAL_CORD = PermissibleValue(text="SPINAL_CORD", + description="spinal cord", + meaning=UBERON["0002240"]) + SPLEEN = PermissibleValue(text="SPLEEN", + description="spleen", + meaning=UBERON["0002106"]) + TONGUE = PermissibleValue(text="TONGUE", + description="tongue", + meaning=UBERON["0001723"]) + THYMUS = PermissibleValue(text="THYMUS", + description="thymus", + meaning=UBERON["0002370"]) + + _defn = EnumDefinition( + name="OrganTerms", + ) + +class ResponseTerms(EnumDefinitionImpl): + + FAVORABLE = PermissibleValue(text="FAVORABLE", + description="Favorable", + meaning=NCIT.C102560) + UNFAVORABLE = PermissibleValue(text="UNFAVORABLE", + description="Unfavorable", + meaning=NCIT.C102561) + + _defn = EnumDefinition( + name="ResponseTerms", + ) + +class SpatialPatternTerms(EnumDefinitionImpl): + + PREDOMINANT_SMALL_JOINT_LOCALIZATION = PermissibleValue(text="PREDOMINANT_SMALL_JOINT_LOCALIZATION", + description="Predominant small joint localization", + meaning=HP["0032544"]) + POLYCYCLIC = PermissibleValue(text="POLYCYCLIC", + description="Polycyclic", + meaning=HP["0031450"]) + AXIAL = PermissibleValue(text="AXIAL", + description="Axial", + meaning=HP["0025287"]) + PERILOBULAR = PermissibleValue(text="PERILOBULAR", + description="Perilobular", + meaning=HP["0033813"]) + PARASEPTAL = PermissibleValue(text="PARASEPTAL", + description="Paraseptal", + meaning=HP["0033814"]) + BRONCHOCENTRIC = PermissibleValue(text="BRONCHOCENTRIC", + description="Bronchocentric", + meaning=HP["0033815"]) + CENTRILOBULAR = PermissibleValue(text="CENTRILOBULAR", + description="Centrilobular", + meaning=HP["0033816"]) + MILIARY = PermissibleValue(text="MILIARY", + description="Miliary", + meaning=HP["0033817"]) + GENERALIZED = PermissibleValue(text="GENERALIZED", + description="Generalized", + meaning=HP["0012837"]) + PERILYMPHATIC = PermissibleValue(text="PERILYMPHATIC", + description="Perilymphatic", + meaning=HP["0033819"]) + LOCALIZED = PermissibleValue(text="LOCALIZED", + description="Localized", + meaning=HP["0012838"]) + RETICULAR = PermissibleValue(text="RETICULAR", + description="Reticular", + meaning=HP["0033818"]) + DISTAL = PermissibleValue(text="DISTAL", + description="Distal", + meaning=HP["0012839"]) + CENTRAL = PermissibleValue(text="CENTRAL", + description="Central", + meaning=HP["0030645"]) + UPPER_BODY_PREDOMINANCE = PermissibleValue(text="UPPER_BODY_PREDOMINANCE", + description="Upper-body predominance", + meaning=HP["0025290"]) + JOINT_EXTENSOR_SURFACE_LOCALIZATION = PermissibleValue(text="JOINT_EXTENSOR_SURFACE_LOCALIZATION", + description="Joint extensor surface localization", + meaning=HP["0032539"]) + HERPETIFORM = PermissibleValue(text="HERPETIFORM", + description="Herpetiform", + meaning=HP["0025295"]) + MORBILLIFORM = PermissibleValue(text="MORBILLIFORM", + description="Morbilliform", + meaning=HP["0025296"]) + PERICENTRAL = PermissibleValue(text="PERICENTRAL", + description="Pericentral", + meaning=HP["0030649"]) + DERMATOMAL = PermissibleValue(text="DERMATOMAL", + description="Dermatomal", + meaning=HP["0025294"]) + MIDPERIPHERAL = PermissibleValue(text="MIDPERIPHERAL", + description="Midperipheral", + meaning=HP["0030648"]) + DISTRIBUTED_ALONG_BLASCHKO_LINES = PermissibleValue(text="DISTRIBUTED_ALONG_BLASCHKO_LINES", + description="Distributed along Blaschko lines", + meaning=HP["0025293"]) + ACRAL = PermissibleValue(text="ACRAL", + description="Acral", + meaning=HP["0025292"]) + PARACENTRAL = PermissibleValue(text="PARACENTRAL", + description="Paracentral", + meaning=HP["0030647"]) + LATERAL = PermissibleValue(text="LATERAL", + description="Lateral", + meaning=HP["0025275"]) + PERIPHERAL = PermissibleValue(text="PERIPHERAL", + description="Peripheral", + meaning=HP["0030646"]) + LOWER_BODY_PREDOMINANCE = PermissibleValue(text="LOWER_BODY_PREDOMINANCE", + description="Lower-body predominance", + meaning=HP["0025291"]) + DIFFUSE = PermissibleValue(text="DIFFUSE", + description="Diffuse", + meaning=HP["0020034"]) + PROXIMAL = PermissibleValue(text="PROXIMAL", + description="Proximal", + meaning=HP["0012840"]) + APICAL = PermissibleValue(text="APICAL", + description="Apical", + meaning=HP["0033820"]) + FOCAL = PermissibleValue(text="FOCAL", + description="Focal", + meaning=HP["0030650"]) + MULTIFOCAL = PermissibleValue(text="MULTIFOCAL", + description="Multifocal", + meaning=HP["0030651"]) + JOINT_FLEXOR_SURFACE_LOCALIZATION = PermissibleValue(text="JOINT_FLEXOR_SURFACE_LOCALIZATION", + description="Jointflexorsurfacelocalization", + meaning=HP["0032540"]) + + _defn = EnumDefinition( + name="SpatialPatternTerms", + ) + +class UnitTerms(EnumDefinitionImpl): + + DEGREE = PermissibleValue(text="DEGREE", + description="degree (plane angle)", + meaning=UCUM.degree) + DIOPTER = PermissibleValue(text="DIOPTER", + description="diopter", + meaning=UCUM["[diop]"]) + GRAM = PermissibleValue(text="GRAM", + description="gram", + meaning=UCUM.g) + GRAM_PER_KG = PermissibleValue(text="GRAM_PER_KG", + description="gram per kilogram", + meaning=UCUM["g/kg"]) + KILIGRAM = PermissibleValue(text="KILIGRAM", + description="kiligram", + meaning=UCUM.kg) + LITER = PermissibleValue(text="LITER", + description="liter", + meaning=UCUM.L) + METER = PermissibleValue(text="METER", + description="meter", + meaning=UCUM.m) + MICROGRAM = PermissibleValue(text="MICROGRAM", + description="microgram", + meaning=UCUM.ug) + MICROGRAM_PER_DECILITER = PermissibleValue(text="MICROGRAM_PER_DECILITER", + description="microgram per deciliter", + meaning=UCUM["ug/dL"]) + MICROGRAM_PER_LITER = PermissibleValue(text="MICROGRAM_PER_LITER", + description="microgram per liter", + meaning=UCUM["ug/L"]) + MICROLITER = PermissibleValue(text="MICROLITER", + description="microliter", + meaning=UCUM.uL) + MICROMETER = PermissibleValue(text="MICROMETER", + description="micrometer", + meaning=UCUM.um) + MILLIGRAM = PermissibleValue(text="MILLIGRAM", + description="milligram", + meaning=UCUM.mg) + MILLIGRAM_PER_DAY = PermissibleValue(text="MILLIGRAM_PER_DAY", + description="milligram per day", + meaning=UCUM["mg/dL"]) + MILLIGRAM_PER_DL = PermissibleValue(text="MILLIGRAM_PER_DL", + description="milligram per deciliter", + meaning=UCUM["mg/dL"]) + MILLIGRAM_PER_KG = PermissibleValue(text="MILLIGRAM_PER_KG", + description="milligram per kilogram", + meaning=UCUM["mg.kg-1"]) + MILLILITER = PermissibleValue(text="MILLILITER", + description="milliliter", + meaning=UCUM.mL) + MILLIMETER = PermissibleValue(text="MILLIMETER", + description="millimeter", + meaning=UCUM.mm) + MILLIMETRES_OF_MERCURY = PermissibleValue(text="MILLIMETRES_OF_MERCURY", + description="millimetres of mercury", + meaning=UCUM["mm[Hg]"]) + MILLIMOLE = PermissibleValue(text="MILLIMOLE", + description="millimole", + meaning=UCUM.mmol) + MOLE = PermissibleValue(text="MOLE", + description="mole", + meaning=UCUM.mol) + MOLE_PER_LITER = PermissibleValue(text="MOLE_PER_LITER", + description="mole per liter", + meaning=UCUM["mol/L"]) + MOLE_PER_MILLILITER = PermissibleValue(text="MOLE_PER_MILLILITER", + description="mole per milliliter", + meaning=UCUM["mol/mL"]) + ENZYME_UNIT_PER_LITER = PermissibleValue(text="ENZYME_UNIT_PER_LITER", + description="enzyme unit per liter", + meaning=UCUM["U/L"]) + + _defn = EnumDefinition( + name="UnitTerms", + ) + +class MoleculeContext(EnumDefinitionImpl): + + genomic = PermissibleValue(text="genomic") + protein = PermissibleValue(text="protein") + transcript = PermissibleValue(text="transcript") + unspecified_molecule_context = PermissibleValue(text="unspecified_molecule_context") + + _defn = EnumDefinition( + name="MoleculeContext", + ) + +# Slots +class slots: + pass + +slots.cohort__description = Slot(uri=PHENOPACKETS.description, name="cohort__description", curie=PHENOPACKETS.curie('description'), + model_uri=PHENOPACKETS.cohort__description, domain=None, range=Optional[str]) + +slots.cohort__files = Slot(uri=PHENOPACKETS.files, name="cohort__files", curie=PHENOPACKETS.curie('files'), + model_uri=PHENOPACKETS.cohort__files, domain=None, range=Optional[Union[Union[dict, File], List[Union[dict, File]]]]) + +slots.cohort__id = Slot(uri=PHENOPACKETS.id, name="cohort__id", curie=PHENOPACKETS.curie('id'), + model_uri=PHENOPACKETS.cohort__id, domain=None, range=Optional[str]) + +slots.cohort__members = Slot(uri=PHENOPACKETS.members, name="cohort__members", curie=PHENOPACKETS.curie('members'), + model_uri=PHENOPACKETS.cohort__members, domain=None, range=Optional[Union[Union[dict, Phenopacket], List[Union[dict, Phenopacket]]]]) + +slots.cohort__metaData = Slot(uri=PHENOPACKETS.metaData, name="cohort__metaData", curie=PHENOPACKETS.curie('metaData'), + model_uri=PHENOPACKETS.cohort__metaData, domain=None, range=Union[dict, MetaData]) + +slots.family__consanguinousParents = Slot(uri=PHENOPACKETS.consanguinousParents, name="family__consanguinousParents", curie=PHENOPACKETS.curie('consanguinousParents'), + model_uri=PHENOPACKETS.family__consanguinousParents, domain=None, range=Optional[Union[bool, Bool]]) + +slots.family__files = Slot(uri=PHENOPACKETS.files, name="family__files", curie=PHENOPACKETS.curie('files'), + model_uri=PHENOPACKETS.family__files, domain=None, range=Optional[Union[Union[dict, File], List[Union[dict, File]]]]) + +slots.family__id = Slot(uri=PHENOPACKETS.id, name="family__id", curie=PHENOPACKETS.curie('id'), + model_uri=PHENOPACKETS.family__id, domain=None, range=Optional[str]) + +slots.family__metaData = Slot(uri=PHENOPACKETS.metaData, name="family__metaData", curie=PHENOPACKETS.curie('metaData'), + model_uri=PHENOPACKETS.family__metaData, domain=None, range=Union[dict, MetaData]) + +slots.family__pedigree = Slot(uri=PHENOPACKETS.pedigree, name="family__pedigree", curie=PHENOPACKETS.curie('pedigree'), + model_uri=PHENOPACKETS.family__pedigree, domain=None, range=Optional[Union[dict, Pedigree]]) + +slots.family__proband = Slot(uri=PHENOPACKETS.proband, name="family__proband", curie=PHENOPACKETS.curie('proband'), + model_uri=PHENOPACKETS.family__proband, domain=None, range=Optional[Union[dict, Phenopacket]]) + +slots.family__relatives = Slot(uri=PHENOPACKETS.relatives, name="family__relatives", curie=PHENOPACKETS.curie('relatives'), + model_uri=PHENOPACKETS.family__relatives, domain=None, range=Optional[Union[Union[dict, Phenopacket], List[Union[dict, Phenopacket]]]]) + +slots.phenopacket__biosamples = Slot(uri=PHENOPACKETS.biosamples, name="phenopacket__biosamples", curie=PHENOPACKETS.curie('biosamples'), + model_uri=PHENOPACKETS.phenopacket__biosamples, domain=None, range=Optional[Union[Union[dict, Biosample], List[Union[dict, Biosample]]]]) + +slots.phenopacket__diseases = Slot(uri=PHENOPACKETS.diseases, name="phenopacket__diseases", curie=PHENOPACKETS.curie('diseases'), + model_uri=PHENOPACKETS.phenopacket__diseases, domain=None, range=Optional[Union[Union[dict, Disease], List[Union[dict, Disease]]]]) + +slots.phenopacket__files = Slot(uri=PHENOPACKETS.files, name="phenopacket__files", curie=PHENOPACKETS.curie('files'), + model_uri=PHENOPACKETS.phenopacket__files, domain=None, range=Optional[Union[Union[dict, File], List[Union[dict, File]]]]) + +slots.phenopacket__id = Slot(uri=PHENOPACKETS.id, name="phenopacket__id", curie=PHENOPACKETS.curie('id'), + model_uri=PHENOPACKETS.phenopacket__id, domain=None, range=Optional[str]) + +slots.phenopacket__interpretations = Slot(uri=PHENOPACKETS.interpretations, name="phenopacket__interpretations", curie=PHENOPACKETS.curie('interpretations'), + model_uri=PHENOPACKETS.phenopacket__interpretations, domain=None, range=Optional[Union[Union[dict, Interpretation], List[Union[dict, Interpretation]]]]) + +slots.phenopacket__measurements = Slot(uri=PHENOPACKETS.measurements, name="phenopacket__measurements", curie=PHENOPACKETS.curie('measurements'), + model_uri=PHENOPACKETS.phenopacket__measurements, domain=None, range=Optional[Union[Union[dict, Measurement], List[Union[dict, Measurement]]]]) + +slots.phenopacket__medicalActions = Slot(uri=PHENOPACKETS.medicalActions, name="phenopacket__medicalActions", curie=PHENOPACKETS.curie('medicalActions'), + model_uri=PHENOPACKETS.phenopacket__medicalActions, domain=None, range=Optional[Union[Union[dict, MedicalAction], List[Union[dict, MedicalAction]]]]) + +slots.phenopacket__metaData = Slot(uri=PHENOPACKETS.metaData, name="phenopacket__metaData", curie=PHENOPACKETS.curie('metaData'), + model_uri=PHENOPACKETS.phenopacket__metaData, domain=None, range=Union[dict, MetaData]) + +slots.phenopacket__phenotypicFeatures = Slot(uri=PHENOPACKETS.phenotypicFeatures, name="phenopacket__phenotypicFeatures", curie=PHENOPACKETS.curie('phenotypicFeatures'), + model_uri=PHENOPACKETS.phenopacket__phenotypicFeatures, domain=None, range=Optional[Union[Union[dict, PhenotypicFeature], List[Union[dict, PhenotypicFeature]]]]) + +slots.phenopacket__subject = Slot(uri=PHENOPACKETS.subject, name="phenopacket__subject", curie=PHENOPACKETS.curie('subject'), + model_uri=PHENOPACKETS.phenopacket__subject, domain=None, range=Optional[Union[dict, Individual]]) + +slots.age__iso8601duration = Slot(uri=PHENOPACKETS.iso8601duration, name="age__iso8601duration", curie=PHENOPACKETS.curie('iso8601duration'), + model_uri=PHENOPACKETS.age__iso8601duration, domain=None, range=Optional[str]) + +slots.ageRange__end = Slot(uri=PHENOPACKETS.end, name="ageRange__end", curie=PHENOPACKETS.curie('end'), + model_uri=PHENOPACKETS.ageRange__end, domain=None, range=Optional[Union[dict, Age]]) + +slots.ageRange__start = Slot(uri=PHENOPACKETS.start, name="ageRange__start", curie=PHENOPACKETS.curie('start'), + model_uri=PHENOPACKETS.ageRange__start, domain=None, range=Optional[Union[dict, Age]]) + +slots.evidence__evidenceCode = Slot(uri=PHENOPACKETS.evidenceCode, name="evidence__evidenceCode", curie=PHENOPACKETS.curie('evidenceCode'), + model_uri=PHENOPACKETS.evidence__evidenceCode, domain=None, range=Optional[Union[dict, OntologyClass]]) + +slots.evidence__reference = Slot(uri=PHENOPACKETS.reference, name="evidence__reference", curie=PHENOPACKETS.curie('reference'), + model_uri=PHENOPACKETS.evidence__reference, domain=None, range=Optional[Union[dict, ExternalReference]]) + +slots.externalReference__description = Slot(uri=PHENOPACKETS.description, name="externalReference__description", curie=PHENOPACKETS.curie('description'), + model_uri=PHENOPACKETS.externalReference__description, domain=None, range=Optional[str]) + +slots.externalReference__id = Slot(uri=PHENOPACKETS.id, name="externalReference__id", curie=PHENOPACKETS.curie('id'), + model_uri=PHENOPACKETS.externalReference__id, domain=None, range=Optional[str]) + +slots.externalReference__reference = Slot(uri=PHENOPACKETS.reference, name="externalReference__reference", curie=PHENOPACKETS.curie('reference'), + model_uri=PHENOPACKETS.externalReference__reference, domain=None, range=Optional[str]) + +slots.file__fileAttributes = Slot(uri=PHENOPACKETS.fileAttributes, name="file__fileAttributes", curie=PHENOPACKETS.curie('fileAttributes'), + model_uri=PHENOPACKETS.file__fileAttributes, domain=None, range=Optional[Union[dict, Dictionary]]) + +slots.file__individualToFileIdentifiers = Slot(uri=PHENOPACKETS.individualToFileIdentifiers, name="file__individualToFileIdentifiers", curie=PHENOPACKETS.curie('individualToFileIdentifiers'), + model_uri=PHENOPACKETS.file__individualToFileIdentifiers, domain=None, range=Optional[Union[dict, Dictionary]]) + +slots.file__uri = Slot(uri=PHENOPACKETS.uri, name="file__uri", curie=PHENOPACKETS.curie('uri'), + model_uri=PHENOPACKETS.file__uri, domain=None, range=Optional[str]) + +slots.gestationalAge__days = Slot(uri=PHENOPACKETS.days, name="gestationalAge__days", curie=PHENOPACKETS.curie('days'), + model_uri=PHENOPACKETS.gestationalAge__days, domain=None, range=Optional[int]) + +slots.gestationalAge__weeks = Slot(uri=PHENOPACKETS.weeks, name="gestationalAge__weeks", curie=PHENOPACKETS.curie('weeks'), + model_uri=PHENOPACKETS.gestationalAge__weeks, domain=None, range=Optional[int]) + +slots.ontologyClass__id = Slot(uri=PHENOPACKETS.id, name="ontologyClass__id", curie=PHENOPACKETS.curie('id'), + model_uri=PHENOPACKETS.ontologyClass__id, domain=None, range=URIRef) + +slots.ontologyClass__label = Slot(uri=PHENOPACKETS.label, name="ontologyClass__label", curie=PHENOPACKETS.curie('label'), + model_uri=PHENOPACKETS.ontologyClass__label, domain=None, range=Optional[str]) + +slots.procedure__bodySite = Slot(uri=PHENOPACKETS.bodySite, name="procedure__bodySite", curie=PHENOPACKETS.curie('bodySite'), + model_uri=PHENOPACKETS.procedure__bodySite, domain=None, range=Optional[Union[dict, OntologyClass]]) + +slots.procedure__code = Slot(uri=PHENOPACKETS.code, name="procedure__code", curie=PHENOPACKETS.curie('code'), + model_uri=PHENOPACKETS.procedure__code, domain=None, range=Optional[Union[dict, OntologyClass]]) + +slots.procedure__performed = Slot(uri=PHENOPACKETS.performed, name="procedure__performed", curie=PHENOPACKETS.curie('performed'), + model_uri=PHENOPACKETS.procedure__performed, domain=None, range=Optional[Union[dict, TimeElement]]) + +slots.timeElement__age = Slot(uri=PHENOPACKETS.age, name="timeElement__age", curie=PHENOPACKETS.curie('age'), + model_uri=PHENOPACKETS.timeElement__age, domain=None, range=Optional[Union[dict, Age]]) + +slots.timeElement__ageRange = Slot(uri=PHENOPACKETS.ageRange, name="timeElement__ageRange", curie=PHENOPACKETS.curie('ageRange'), + model_uri=PHENOPACKETS.timeElement__ageRange, domain=None, range=Optional[Union[dict, AgeRange]]) + +slots.timeElement__gestationalAge = Slot(uri=PHENOPACKETS.gestationalAge, name="timeElement__gestationalAge", curie=PHENOPACKETS.curie('gestationalAge'), + model_uri=PHENOPACKETS.timeElement__gestationalAge, domain=None, range=Optional[Union[dict, GestationalAge]]) + +slots.timeElement__interval = Slot(uri=PHENOPACKETS.interval, name="timeElement__interval", curie=PHENOPACKETS.curie('interval'), + model_uri=PHENOPACKETS.timeElement__interval, domain=None, range=Optional[Union[dict, TimeInterval]]) + +slots.timeElement__ontologyClass = Slot(uri=PHENOPACKETS.ontologyClass, name="timeElement__ontologyClass", curie=PHENOPACKETS.curie('ontologyClass'), + model_uri=PHENOPACKETS.timeElement__ontologyClass, domain=None, range=Optional[Union[dict, OntologyClass]]) + +slots.timeElement__timestamp = Slot(uri=PHENOPACKETS.timestamp, name="timeElement__timestamp", curie=PHENOPACKETS.curie('timestamp'), + model_uri=PHENOPACKETS.timeElement__timestamp, domain=None, range=Optional[str]) + +slots.timeInterval__end = Slot(uri=PHENOPACKETS.end, name="timeInterval__end", curie=PHENOPACKETS.curie('end'), + model_uri=PHENOPACKETS.timeInterval__end, domain=None, range=Optional[str]) + +slots.timeInterval__start = Slot(uri=PHENOPACKETS.start, name="timeInterval__start", curie=PHENOPACKETS.curie('start'), + model_uri=PHENOPACKETS.timeInterval__start, domain=None, range=Optional[str]) + +slots.biosample__derivedFromId = Slot(uri=PHENOPACKETS.derivedFromId, name="biosample__derivedFromId", curie=PHENOPACKETS.curie('derivedFromId'), + model_uri=PHENOPACKETS.biosample__derivedFromId, domain=None, range=Optional[str]) + +slots.biosample__description = Slot(uri=PHENOPACKETS.description, name="biosample__description", curie=PHENOPACKETS.curie('description'), + model_uri=PHENOPACKETS.biosample__description, domain=None, range=Optional[str]) + +slots.biosample__diagnosticMarkers = Slot(uri=PHENOPACKETS.diagnosticMarkers, name="biosample__diagnosticMarkers", curie=PHENOPACKETS.curie('diagnosticMarkers'), + model_uri=PHENOPACKETS.biosample__diagnosticMarkers, domain=None, range=Optional[Union[Dict[Union[str, OntologyClassId], Union[dict, OntologyClass]], List[Union[dict, OntologyClass]]]]) + +slots.biosample__files = Slot(uri=PHENOPACKETS.files, name="biosample__files", curie=PHENOPACKETS.curie('files'), + model_uri=PHENOPACKETS.biosample__files, domain=None, range=Optional[Union[Union[dict, File], List[Union[dict, File]]]]) + +slots.biosample__histologicalDiagnosis = Slot(uri=PHENOPACKETS.histologicalDiagnosis, name="biosample__histologicalDiagnosis", curie=PHENOPACKETS.curie('histologicalDiagnosis'), + model_uri=PHENOPACKETS.biosample__histologicalDiagnosis, domain=None, range=Optional[Union[dict, OntologyClass]]) + +slots.biosample__id = Slot(uri=PHENOPACKETS.id, name="biosample__id", curie=PHENOPACKETS.curie('id'), + model_uri=PHENOPACKETS.biosample__id, domain=None, range=Optional[str]) + +slots.biosample__individualId = Slot(uri=PHENOPACKETS.individualId, name="biosample__individualId", curie=PHENOPACKETS.curie('individualId'), + model_uri=PHENOPACKETS.biosample__individualId, domain=None, range=Optional[str]) + +slots.biosample__materialSample = Slot(uri=PHENOPACKETS.materialSample, name="biosample__materialSample", curie=PHENOPACKETS.curie('materialSample'), + model_uri=PHENOPACKETS.biosample__materialSample, domain=None, range=Optional[Union[dict, OntologyClass]]) + +slots.biosample__measurements = Slot(uri=PHENOPACKETS.measurements, name="biosample__measurements", curie=PHENOPACKETS.curie('measurements'), + model_uri=PHENOPACKETS.biosample__measurements, domain=None, range=Optional[Union[Union[dict, Measurement], List[Union[dict, Measurement]]]]) + +slots.biosample__pathologicalStage = Slot(uri=PHENOPACKETS.pathologicalStage, name="biosample__pathologicalStage", curie=PHENOPACKETS.curie('pathologicalStage'), + model_uri=PHENOPACKETS.biosample__pathologicalStage, domain=None, range=Optional[Union[dict, OntologyClass]]) + +slots.biosample__pathologicalTnmFinding = Slot(uri=PHENOPACKETS.pathologicalTnmFinding, name="biosample__pathologicalTnmFinding", curie=PHENOPACKETS.curie('pathologicalTnmFinding'), + model_uri=PHENOPACKETS.biosample__pathologicalTnmFinding, domain=None, range=Optional[Union[Dict[Union[str, OntologyClassId], Union[dict, OntologyClass]], List[Union[dict, OntologyClass]]]]) + +slots.biosample__phenotypicFeatures = Slot(uri=PHENOPACKETS.phenotypicFeatures, name="biosample__phenotypicFeatures", curie=PHENOPACKETS.curie('phenotypicFeatures'), + model_uri=PHENOPACKETS.biosample__phenotypicFeatures, domain=None, range=Optional[Union[Union[dict, PhenotypicFeature], List[Union[dict, PhenotypicFeature]]]]) + +slots.biosample__procedure = Slot(uri=PHENOPACKETS.procedure, name="biosample__procedure", curie=PHENOPACKETS.curie('procedure'), + model_uri=PHENOPACKETS.biosample__procedure, domain=None, range=Optional[Union[dict, Procedure]]) + +slots.biosample__sampleProcessing = Slot(uri=PHENOPACKETS.sampleProcessing, name="biosample__sampleProcessing", curie=PHENOPACKETS.curie('sampleProcessing'), + model_uri=PHENOPACKETS.biosample__sampleProcessing, domain=None, range=Optional[Union[dict, OntologyClass]]) + +slots.biosample__sampleStorage = Slot(uri=PHENOPACKETS.sampleStorage, name="biosample__sampleStorage", curie=PHENOPACKETS.curie('sampleStorage'), + model_uri=PHENOPACKETS.biosample__sampleStorage, domain=None, range=Optional[Union[dict, OntologyClass]]) + +slots.biosample__sampleType = Slot(uri=PHENOPACKETS.sampleType, name="biosample__sampleType", curie=PHENOPACKETS.curie('sampleType'), + model_uri=PHENOPACKETS.biosample__sampleType, domain=None, range=Optional[Union[dict, OntologyClass]]) + +slots.biosample__sampledTissue = Slot(uri=PHENOPACKETS.sampledTissue, name="biosample__sampledTissue", curie=PHENOPACKETS.curie('sampledTissue'), + model_uri=PHENOPACKETS.biosample__sampledTissue, domain=None, range=Optional[Union[dict, OntologyClass]]) + +slots.biosample__taxonomy = Slot(uri=PHENOPACKETS.taxonomy, name="biosample__taxonomy", curie=PHENOPACKETS.curie('taxonomy'), + model_uri=PHENOPACKETS.biosample__taxonomy, domain=None, range=Optional[Union[dict, OntologyClass]]) + +slots.biosample__timeOfCollection = Slot(uri=PHENOPACKETS.timeOfCollection, name="biosample__timeOfCollection", curie=PHENOPACKETS.curie('timeOfCollection'), + model_uri=PHENOPACKETS.biosample__timeOfCollection, domain=None, range=Optional[Union[dict, TimeElement]]) + +slots.biosample__tumorGrade = Slot(uri=PHENOPACKETS.tumorGrade, name="biosample__tumorGrade", curie=PHENOPACKETS.curie('tumorGrade'), + model_uri=PHENOPACKETS.biosample__tumorGrade, domain=None, range=Optional[Union[dict, OntologyClass]]) + +slots.biosample__tumorProgression = Slot(uri=PHENOPACKETS.tumorProgression, name="biosample__tumorProgression", curie=PHENOPACKETS.curie('tumorProgression'), + model_uri=PHENOPACKETS.biosample__tumorProgression, domain=None, range=Optional[Union[dict, OntologyClass]]) + +slots.disease__clinicalTnmFinding = Slot(uri=PHENOPACKETS.clinicalTnmFinding, name="disease__clinicalTnmFinding", curie=PHENOPACKETS.curie('clinicalTnmFinding'), + model_uri=PHENOPACKETS.disease__clinicalTnmFinding, domain=None, range=Optional[Union[Dict[Union[str, OntologyClassId], Union[dict, OntologyClass]], List[Union[dict, OntologyClass]]]]) + +slots.disease__diseaseStage = Slot(uri=PHENOPACKETS.diseaseStage, name="disease__diseaseStage", curie=PHENOPACKETS.curie('diseaseStage'), + model_uri=PHENOPACKETS.disease__diseaseStage, domain=None, range=Optional[Union[Dict[Union[str, OntologyClassId], Union[dict, OntologyClass]], List[Union[dict, OntologyClass]]]]) + +slots.disease__excluded = Slot(uri=PHENOPACKETS.excluded, name="disease__excluded", curie=PHENOPACKETS.curie('excluded'), + model_uri=PHENOPACKETS.disease__excluded, domain=None, range=Optional[Union[bool, Bool]]) + +slots.disease__laterality = Slot(uri=PHENOPACKETS.laterality, name="disease__laterality", curie=PHENOPACKETS.curie('laterality'), + model_uri=PHENOPACKETS.disease__laterality, domain=None, range=Optional[Union[dict, OntologyClass]]) + +slots.disease__onset = Slot(uri=PHENOPACKETS.onset, name="disease__onset", curie=PHENOPACKETS.curie('onset'), + model_uri=PHENOPACKETS.disease__onset, domain=None, range=Optional[Union[dict, TimeElement]]) + +slots.disease__primarySite = Slot(uri=PHENOPACKETS.primarySite, name="disease__primarySite", curie=PHENOPACKETS.curie('primarySite'), + model_uri=PHENOPACKETS.disease__primarySite, domain=None, range=Optional[Union[dict, OntologyClass]]) + +slots.disease__resolution = Slot(uri=PHENOPACKETS.resolution, name="disease__resolution", curie=PHENOPACKETS.curie('resolution'), + model_uri=PHENOPACKETS.disease__resolution, domain=None, range=Optional[Union[dict, TimeElement]]) + +slots.disease__term = Slot(uri=PHENOPACKETS.term, name="disease__term", curie=PHENOPACKETS.curie('term'), + model_uri=PHENOPACKETS.disease__term, domain=None, range=Optional[Union[dict, OntologyClass]]) + +slots.diagnosis__disease = Slot(uri=PHENOPACKETS.disease, name="diagnosis__disease", curie=PHENOPACKETS.curie('disease'), + model_uri=PHENOPACKETS.diagnosis__disease, domain=None, range=Optional[Union[dict, OntologyClass]]) + +slots.diagnosis__genomicInterpretations = Slot(uri=PHENOPACKETS.genomicInterpretations, name="diagnosis__genomicInterpretations", curie=PHENOPACKETS.curie('genomicInterpretations'), + model_uri=PHENOPACKETS.diagnosis__genomicInterpretations, domain=None, range=Optional[Union[Union[dict, GenomicInterpretation], List[Union[dict, GenomicInterpretation]]]]) + +slots.genomicInterpretation__gene = Slot(uri=PHENOPACKETS.gene, name="genomicInterpretation__gene", curie=PHENOPACKETS.curie('gene'), + model_uri=PHENOPACKETS.genomicInterpretation__gene, domain=None, range=Optional[Union[dict, GeneDescriptor]]) + +slots.genomicInterpretation__interpretationStatus = Slot(uri=PHENOPACKETS.interpretationStatus, name="genomicInterpretation__interpretationStatus", curie=PHENOPACKETS.curie('interpretationStatus'), + model_uri=PHENOPACKETS.genomicInterpretation__interpretationStatus, domain=None, range=Optional[Union[str, "InterpretationStatus"]]) + +slots.genomicInterpretation__subjectOrBiosampleId = Slot(uri=PHENOPACKETS.subjectOrBiosampleId, name="genomicInterpretation__subjectOrBiosampleId", curie=PHENOPACKETS.curie('subjectOrBiosampleId'), + model_uri=PHENOPACKETS.genomicInterpretation__subjectOrBiosampleId, domain=None, range=Optional[str]) + +slots.genomicInterpretation__variantInterpretation = Slot(uri=PHENOPACKETS.variantInterpretation, name="genomicInterpretation__variantInterpretation", curie=PHENOPACKETS.curie('variantInterpretation'), + model_uri=PHENOPACKETS.genomicInterpretation__variantInterpretation, domain=None, range=Optional[Union[dict, VariantInterpretation]]) + +slots.interpretation__diagnosis = Slot(uri=PHENOPACKETS.diagnosis, name="interpretation__diagnosis", curie=PHENOPACKETS.curie('diagnosis'), + model_uri=PHENOPACKETS.interpretation__diagnosis, domain=None, range=Optional[Union[dict, Diagnosis]]) + +slots.interpretation__id = Slot(uri=PHENOPACKETS.id, name="interpretation__id", curie=PHENOPACKETS.curie('id'), + model_uri=PHENOPACKETS.interpretation__id, domain=None, range=Optional[str]) + +slots.interpretation__progressStatus = Slot(uri=PHENOPACKETS.progressStatus, name="interpretation__progressStatus", curie=PHENOPACKETS.curie('progressStatus'), + model_uri=PHENOPACKETS.interpretation__progressStatus, domain=None, range=Optional[Union[str, "ProgressStatus"]]) + +slots.interpretation__summary = Slot(uri=PHENOPACKETS.summary, name="interpretation__summary", curie=PHENOPACKETS.curie('summary'), + model_uri=PHENOPACKETS.interpretation__summary, domain=None, range=Optional[str]) + +slots.variantInterpretation__acmgPathogenicityClassification = Slot(uri=PHENOPACKETS.acmgPathogenicityClassification, name="variantInterpretation__acmgPathogenicityClassification", curie=PHENOPACKETS.curie('acmgPathogenicityClassification'), + model_uri=PHENOPACKETS.variantInterpretation__acmgPathogenicityClassification, domain=None, range=Optional[Union[str, "AcmgPathogenicityClassification"]]) + +slots.variantInterpretation__therapeuticActionability = Slot(uri=PHENOPACKETS.therapeuticActionability, name="variantInterpretation__therapeuticActionability", curie=PHENOPACKETS.curie('therapeuticActionability'), + model_uri=PHENOPACKETS.variantInterpretation__therapeuticActionability, domain=None, range=Optional[Union[str, "TherapeuticActionability"]]) + +slots.variantInterpretation__variationDescriptor = Slot(uri=PHENOPACKETS.variationDescriptor, name="variantInterpretation__variationDescriptor", curie=PHENOPACKETS.curie('variationDescriptor'), + model_uri=PHENOPACKETS.variantInterpretation__variationDescriptor, domain=None, range=Optional[Union[dict, VariationDescriptor]]) + +slots.individual__alternateIds = Slot(uri=PHENOPACKETS.alternateIds, name="individual__alternateIds", curie=PHENOPACKETS.curie('alternateIds'), + model_uri=PHENOPACKETS.individual__alternateIds, domain=None, range=Optional[Union[str, List[str]]]) + +slots.individual__dateOfBirth = Slot(uri=PHENOPACKETS.dateOfBirth, name="individual__dateOfBirth", curie=PHENOPACKETS.curie('dateOfBirth'), + model_uri=PHENOPACKETS.individual__dateOfBirth, domain=None, range=Optional[str]) + +slots.individual__gender = Slot(uri=PHENOPACKETS.gender, name="individual__gender", curie=PHENOPACKETS.curie('gender'), + model_uri=PHENOPACKETS.individual__gender, domain=None, range=Optional[Union[dict, OntologyClass]]) + +slots.individual__id = Slot(uri=PHENOPACKETS.id, name="individual__id", curie=PHENOPACKETS.curie('id'), + model_uri=PHENOPACKETS.individual__id, domain=None, range=Optional[str]) + +slots.individual__karyotypicSex = Slot(uri=PHENOPACKETS.karyotypicSex, name="individual__karyotypicSex", curie=PHENOPACKETS.curie('karyotypicSex'), + model_uri=PHENOPACKETS.individual__karyotypicSex, domain=None, range=Optional[Union[str, "KaryotypicSex"]]) + +slots.individual__sex = Slot(uri=PHENOPACKETS.sex, name="individual__sex", curie=PHENOPACKETS.curie('sex'), + model_uri=PHENOPACKETS.individual__sex, domain=None, range=Optional[Union[str, "Sex"]]) + +slots.individual__taxonomy = Slot(uri=PHENOPACKETS.taxonomy, name="individual__taxonomy", curie=PHENOPACKETS.curie('taxonomy'), + model_uri=PHENOPACKETS.individual__taxonomy, domain=None, range=Optional[Union[dict, OntologyClass]]) + +slots.individual__timeAtLastEncounter = Slot(uri=PHENOPACKETS.timeAtLastEncounter, name="individual__timeAtLastEncounter", curie=PHENOPACKETS.curie('timeAtLastEncounter'), + model_uri=PHENOPACKETS.individual__timeAtLastEncounter, domain=None, range=Optional[Union[dict, TimeElement]]) + +slots.individual__vitalStatus = Slot(uri=PHENOPACKETS.vitalStatus, name="individual__vitalStatus", curie=PHENOPACKETS.curie('vitalStatus'), + model_uri=PHENOPACKETS.individual__vitalStatus, domain=None, range=Optional[Union[dict, VitalStatus]]) + +slots.vitalStatus__causeOfDeath = Slot(uri=PHENOPACKETS.causeOfDeath, name="vitalStatus__causeOfDeath", curie=PHENOPACKETS.curie('causeOfDeath'), + model_uri=PHENOPACKETS.vitalStatus__causeOfDeath, domain=None, range=Optional[Union[dict, OntologyClass]]) + +slots.vitalStatus__status = Slot(uri=PHENOPACKETS.status, name="vitalStatus__status", curie=PHENOPACKETS.curie('status'), + model_uri=PHENOPACKETS.vitalStatus__status, domain=None, range=Optional[Union[str, "Status"]]) + +slots.vitalStatus__survivalTimeInDays = Slot(uri=PHENOPACKETS.survivalTimeInDays, name="vitalStatus__survivalTimeInDays", curie=PHENOPACKETS.curie('survivalTimeInDays'), + model_uri=PHENOPACKETS.vitalStatus__survivalTimeInDays, domain=None, range=Optional[int]) + +slots.vitalStatus__timeOfDeath = Slot(uri=PHENOPACKETS.timeOfDeath, name="vitalStatus__timeOfDeath", curie=PHENOPACKETS.curie('timeOfDeath'), + model_uri=PHENOPACKETS.vitalStatus__timeOfDeath, domain=None, range=Optional[Union[dict, TimeElement]]) + +slots.complexValue__typedQuantities = Slot(uri=PHENOPACKETS.typedQuantities, name="complexValue__typedQuantities", curie=PHENOPACKETS.curie('typedQuantities'), + model_uri=PHENOPACKETS.complexValue__typedQuantities, domain=None, range=Optional[Union[Union[dict, TypedQuantity], List[Union[dict, TypedQuantity]]]]) + +slots.measurement__assay = Slot(uri=PHENOPACKETS.assay, name="measurement__assay", curie=PHENOPACKETS.curie('assay'), + model_uri=PHENOPACKETS.measurement__assay, domain=None, range=Optional[Union[dict, OntologyClass]]) + +slots.measurement__complexValue = Slot(uri=PHENOPACKETS.complexValue, name="measurement__complexValue", curie=PHENOPACKETS.curie('complexValue'), + model_uri=PHENOPACKETS.measurement__complexValue, domain=None, range=Optional[Union[dict, ComplexValue]]) + +slots.measurement__description = Slot(uri=PHENOPACKETS.description, name="measurement__description", curie=PHENOPACKETS.curie('description'), + model_uri=PHENOPACKETS.measurement__description, domain=None, range=Optional[str]) + +slots.measurement__procedure = Slot(uri=PHENOPACKETS.procedure, name="measurement__procedure", curie=PHENOPACKETS.curie('procedure'), + model_uri=PHENOPACKETS.measurement__procedure, domain=None, range=Optional[Union[dict, Procedure]]) + +slots.measurement__timeObserved = Slot(uri=PHENOPACKETS.timeObserved, name="measurement__timeObserved", curie=PHENOPACKETS.curie('timeObserved'), + model_uri=PHENOPACKETS.measurement__timeObserved, domain=None, range=Optional[Union[dict, TimeElement]]) + +slots.measurement__value = Slot(uri=PHENOPACKETS.value, name="measurement__value", curie=PHENOPACKETS.curie('value'), + model_uri=PHENOPACKETS.measurement__value, domain=None, range=Optional[Union[dict, Value]]) + +slots.quantity__referenceRange = Slot(uri=PHENOPACKETS.referenceRange, name="quantity__referenceRange", curie=PHENOPACKETS.curie('referenceRange'), + model_uri=PHENOPACKETS.quantity__referenceRange, domain=None, range=Optional[Union[dict, ReferenceRange]]) + +slots.quantity__unit = Slot(uri=PHENOPACKETS.unit, name="quantity__unit", curie=PHENOPACKETS.curie('unit'), + model_uri=PHENOPACKETS.quantity__unit, domain=None, range=Optional[Union[dict, OntologyClass]]) + +slots.quantity__value = Slot(uri=PHENOPACKETS.value, name="quantity__value", curie=PHENOPACKETS.curie('value'), + model_uri=PHENOPACKETS.quantity__value, domain=None, range=Optional[float]) + +slots.referenceRange__high = Slot(uri=PHENOPACKETS.high, name="referenceRange__high", curie=PHENOPACKETS.curie('high'), + model_uri=PHENOPACKETS.referenceRange__high, domain=None, range=Optional[float]) + +slots.referenceRange__low = Slot(uri=PHENOPACKETS.low, name="referenceRange__low", curie=PHENOPACKETS.curie('low'), + model_uri=PHENOPACKETS.referenceRange__low, domain=None, range=Optional[float]) + +slots.referenceRange__unit = Slot(uri=PHENOPACKETS.unit, name="referenceRange__unit", curie=PHENOPACKETS.curie('unit'), + model_uri=PHENOPACKETS.referenceRange__unit, domain=None, range=Optional[Union[dict, OntologyClass]]) + +slots.typedQuantity__quantity = Slot(uri=PHENOPACKETS.quantity, name="typedQuantity__quantity", curie=PHENOPACKETS.curie('quantity'), + model_uri=PHENOPACKETS.typedQuantity__quantity, domain=None, range=Optional[Union[dict, Quantity]]) + +slots.typedQuantity__type = Slot(uri=PHENOPACKETS.type, name="typedQuantity__type", curie=PHENOPACKETS.curie('type'), + model_uri=PHENOPACKETS.typedQuantity__type, domain=None, range=Optional[Union[dict, OntologyClass]]) + +slots.value__ontologyClass = Slot(uri=PHENOPACKETS.ontologyClass, name="value__ontologyClass", curie=PHENOPACKETS.curie('ontologyClass'), + model_uri=PHENOPACKETS.value__ontologyClass, domain=None, range=Optional[Union[dict, OntologyClass]]) + +slots.value__quantity = Slot(uri=PHENOPACKETS.quantity, name="value__quantity", curie=PHENOPACKETS.curie('quantity'), + model_uri=PHENOPACKETS.value__quantity, domain=None, range=Optional[Union[dict, Quantity]]) + +slots.doseInterval__interval = Slot(uri=PHENOPACKETS.interval, name="doseInterval__interval", curie=PHENOPACKETS.curie('interval'), + model_uri=PHENOPACKETS.doseInterval__interval, domain=None, range=Optional[Union[dict, TimeInterval]]) + +slots.doseInterval__quantity = Slot(uri=PHENOPACKETS.quantity, name="doseInterval__quantity", curie=PHENOPACKETS.curie('quantity'), + model_uri=PHENOPACKETS.doseInterval__quantity, domain=None, range=Optional[Union[dict, Quantity]]) + +slots.doseInterval__scheduleFrequency = Slot(uri=PHENOPACKETS.scheduleFrequency, name="doseInterval__scheduleFrequency", curie=PHENOPACKETS.curie('scheduleFrequency'), + model_uri=PHENOPACKETS.doseInterval__scheduleFrequency, domain=None, range=Optional[Union[dict, OntologyClass]]) + +slots.medicalAction__adverseEvents = Slot(uri=PHENOPACKETS.adverseEvents, name="medicalAction__adverseEvents", curie=PHENOPACKETS.curie('adverseEvents'), + model_uri=PHENOPACKETS.medicalAction__adverseEvents, domain=None, range=Optional[Union[Dict[Union[str, OntologyClassId], Union[dict, OntologyClass]], List[Union[dict, OntologyClass]]]]) + +slots.medicalAction__procedure = Slot(uri=PHENOPACKETS.procedure, name="medicalAction__procedure", curie=PHENOPACKETS.curie('procedure'), + model_uri=PHENOPACKETS.medicalAction__procedure, domain=None, range=Optional[Union[dict, Procedure]]) + +slots.medicalAction__radiationTherapy = Slot(uri=PHENOPACKETS.radiationTherapy, name="medicalAction__radiationTherapy", curie=PHENOPACKETS.curie('radiationTherapy'), + model_uri=PHENOPACKETS.medicalAction__radiationTherapy, domain=None, range=Optional[Union[dict, RadiationTherapy]]) + +slots.medicalAction__responseToTreatment = Slot(uri=PHENOPACKETS.responseToTreatment, name="medicalAction__responseToTreatment", curie=PHENOPACKETS.curie('responseToTreatment'), + model_uri=PHENOPACKETS.medicalAction__responseToTreatment, domain=None, range=Optional[Union[dict, OntologyClass]]) + +slots.medicalAction__therapeuticRegimen = Slot(uri=PHENOPACKETS.therapeuticRegimen, name="medicalAction__therapeuticRegimen", curie=PHENOPACKETS.curie('therapeuticRegimen'), + model_uri=PHENOPACKETS.medicalAction__therapeuticRegimen, domain=None, range=Optional[Union[dict, TherapeuticRegimen]]) + +slots.medicalAction__treatment = Slot(uri=PHENOPACKETS.treatment, name="medicalAction__treatment", curie=PHENOPACKETS.curie('treatment'), + model_uri=PHENOPACKETS.medicalAction__treatment, domain=None, range=Optional[Union[dict, Treatment]]) + +slots.medicalAction__treatmentIntent = Slot(uri=PHENOPACKETS.treatmentIntent, name="medicalAction__treatmentIntent", curie=PHENOPACKETS.curie('treatmentIntent'), + model_uri=PHENOPACKETS.medicalAction__treatmentIntent, domain=None, range=Optional[Union[dict, OntologyClass]]) + +slots.medicalAction__treatmentTarget = Slot(uri=PHENOPACKETS.treatmentTarget, name="medicalAction__treatmentTarget", curie=PHENOPACKETS.curie('treatmentTarget'), + model_uri=PHENOPACKETS.medicalAction__treatmentTarget, domain=None, range=Optional[Union[dict, OntologyClass]]) + +slots.medicalAction__treatmentTerminationReason = Slot(uri=PHENOPACKETS.treatmentTerminationReason, name="medicalAction__treatmentTerminationReason", curie=PHENOPACKETS.curie('treatmentTerminationReason'), + model_uri=PHENOPACKETS.medicalAction__treatmentTerminationReason, domain=None, range=Optional[Union[dict, OntologyClass]]) + +slots.radiationTherapy__bodySite = Slot(uri=PHENOPACKETS.bodySite, name="radiationTherapy__bodySite", curie=PHENOPACKETS.curie('bodySite'), + model_uri=PHENOPACKETS.radiationTherapy__bodySite, domain=None, range=Union[dict, OntologyClass]) + +slots.radiationTherapy__dosage = Slot(uri=PHENOPACKETS.dosage, name="radiationTherapy__dosage", curie=PHENOPACKETS.curie('dosage'), + model_uri=PHENOPACKETS.radiationTherapy__dosage, domain=None, range=int) + +slots.radiationTherapy__fractions = Slot(uri=PHENOPACKETS.fractions, name="radiationTherapy__fractions", curie=PHENOPACKETS.curie('fractions'), + model_uri=PHENOPACKETS.radiationTherapy__fractions, domain=None, range=int) + +slots.radiationTherapy__modality = Slot(uri=PHENOPACKETS.modality, name="radiationTherapy__modality", curie=PHENOPACKETS.curie('modality'), + model_uri=PHENOPACKETS.radiationTherapy__modality, domain=None, range=Union[dict, OntologyClass]) + +slots.therapeuticRegimen__endTime = Slot(uri=PHENOPACKETS.endTime, name="therapeuticRegimen__endTime", curie=PHENOPACKETS.curie('endTime'), + model_uri=PHENOPACKETS.therapeuticRegimen__endTime, domain=None, range=Optional[Union[dict, TimeElement]]) + +slots.therapeuticRegimen__externalReference = Slot(uri=PHENOPACKETS.externalReference, name="therapeuticRegimen__externalReference", curie=PHENOPACKETS.curie('externalReference'), + model_uri=PHENOPACKETS.therapeuticRegimen__externalReference, domain=None, range=Optional[Union[dict, ExternalReference]]) + +slots.therapeuticRegimen__ontologyClass = Slot(uri=PHENOPACKETS.ontologyClass, name="therapeuticRegimen__ontologyClass", curie=PHENOPACKETS.curie('ontologyClass'), + model_uri=PHENOPACKETS.therapeuticRegimen__ontologyClass, domain=None, range=Optional[Union[dict, OntologyClass]]) + +slots.therapeuticRegimen__regimenStatus = Slot(uri=PHENOPACKETS.regimenStatus, name="therapeuticRegimen__regimenStatus", curie=PHENOPACKETS.curie('regimenStatus'), + model_uri=PHENOPACKETS.therapeuticRegimen__regimenStatus, domain=None, range=Optional[Union[str, "RegimenStatus"]]) + +slots.therapeuticRegimen__startTime = Slot(uri=PHENOPACKETS.startTime, name="therapeuticRegimen__startTime", curie=PHENOPACKETS.curie('startTime'), + model_uri=PHENOPACKETS.therapeuticRegimen__startTime, domain=None, range=Optional[Union[dict, TimeElement]]) + +slots.treatment__agent = Slot(uri=PHENOPACKETS.agent, name="treatment__agent", curie=PHENOPACKETS.curie('agent'), + model_uri=PHENOPACKETS.treatment__agent, domain=None, range=Optional[Union[dict, OntologyClass]]) + +slots.treatment__cumulativeDose = Slot(uri=PHENOPACKETS.cumulativeDose, name="treatment__cumulativeDose", curie=PHENOPACKETS.curie('cumulativeDose'), + model_uri=PHENOPACKETS.treatment__cumulativeDose, domain=None, range=Optional[Union[dict, Quantity]]) + +slots.treatment__doseIntervals = Slot(uri=PHENOPACKETS.doseIntervals, name="treatment__doseIntervals", curie=PHENOPACKETS.curie('doseIntervals'), + model_uri=PHENOPACKETS.treatment__doseIntervals, domain=None, range=Optional[Union[Union[dict, DoseInterval], List[Union[dict, DoseInterval]]]]) + +slots.treatment__drugType = Slot(uri=PHENOPACKETS.drugType, name="treatment__drugType", curie=PHENOPACKETS.curie('drugType'), + model_uri=PHENOPACKETS.treatment__drugType, domain=None, range=Optional[Union[str, "DrugType"]]) + +slots.treatment__routeOfAdministration = Slot(uri=PHENOPACKETS.routeOfAdministration, name="treatment__routeOfAdministration", curie=PHENOPACKETS.curie('routeOfAdministration'), + model_uri=PHENOPACKETS.treatment__routeOfAdministration, domain=None, range=Optional[Union[dict, OntologyClass]]) + +slots.metaData__created = Slot(uri=PHENOPACKETS.created, name="metaData__created", curie=PHENOPACKETS.curie('created'), + model_uri=PHENOPACKETS.metaData__created, domain=None, range=Optional[str]) + +slots.metaData__createdBy = Slot(uri=PHENOPACKETS.createdBy, name="metaData__createdBy", curie=PHENOPACKETS.curie('createdBy'), + model_uri=PHENOPACKETS.metaData__createdBy, domain=None, range=Optional[str]) + +slots.metaData__externalReferences = Slot(uri=PHENOPACKETS.externalReferences, name="metaData__externalReferences", curie=PHENOPACKETS.curie('externalReferences'), + model_uri=PHENOPACKETS.metaData__externalReferences, domain=None, range=Optional[Union[Union[dict, ExternalReference], List[Union[dict, ExternalReference]]]]) + +slots.metaData__phenopacketSchemaVersion = Slot(uri=PHENOPACKETS.phenopacketSchemaVersion, name="metaData__phenopacketSchemaVersion", curie=PHENOPACKETS.curie('phenopacketSchemaVersion'), + model_uri=PHENOPACKETS.metaData__phenopacketSchemaVersion, domain=None, range=Optional[str]) + +slots.metaData__resources = Slot(uri=PHENOPACKETS.resources, name="metaData__resources", curie=PHENOPACKETS.curie('resources'), + model_uri=PHENOPACKETS.metaData__resources, domain=None, range=Optional[Union[Union[dict, Resource], List[Union[dict, Resource]]]]) + +slots.metaData__submittedBy = Slot(uri=PHENOPACKETS.submittedBy, name="metaData__submittedBy", curie=PHENOPACKETS.curie('submittedBy'), + model_uri=PHENOPACKETS.metaData__submittedBy, domain=None, range=Optional[str]) + +slots.metaData__updates = Slot(uri=PHENOPACKETS.updates, name="metaData__updates", curie=PHENOPACKETS.curie('updates'), + model_uri=PHENOPACKETS.metaData__updates, domain=None, range=Optional[Union[Union[dict, Update], List[Union[dict, Update]]]]) + +slots.resource__id = Slot(uri=PHENOPACKETS.id, name="resource__id", curie=PHENOPACKETS.curie('id'), + model_uri=PHENOPACKETS.resource__id, domain=None, range=Optional[str]) + +slots.resource__iriPrefix = Slot(uri=PHENOPACKETS.iriPrefix, name="resource__iriPrefix", curie=PHENOPACKETS.curie('iriPrefix'), + model_uri=PHENOPACKETS.resource__iriPrefix, domain=None, range=Optional[str]) + +slots.resource__name = Slot(uri=PHENOPACKETS.name, name="resource__name", curie=PHENOPACKETS.curie('name'), + model_uri=PHENOPACKETS.resource__name, domain=None, range=Optional[str]) + +slots.resource__namespacePrefix = Slot(uri=PHENOPACKETS.namespacePrefix, name="resource__namespacePrefix", curie=PHENOPACKETS.curie('namespacePrefix'), + model_uri=PHENOPACKETS.resource__namespacePrefix, domain=None, range=Optional[str]) + +slots.resource__url = Slot(uri=PHENOPACKETS.url, name="resource__url", curie=PHENOPACKETS.curie('url'), + model_uri=PHENOPACKETS.resource__url, domain=None, range=Optional[str]) + +slots.resource__version = Slot(uri=PHENOPACKETS.version, name="resource__version", curie=PHENOPACKETS.curie('version'), + model_uri=PHENOPACKETS.resource__version, domain=None, range=Optional[str]) + +slots.update__comment = Slot(uri=PHENOPACKETS.comment, name="update__comment", curie=PHENOPACKETS.curie('comment'), + model_uri=PHENOPACKETS.update__comment, domain=None, range=Optional[str]) + +slots.update__timestamp = Slot(uri=PHENOPACKETS.timestamp, name="update__timestamp", curie=PHENOPACKETS.curie('timestamp'), + model_uri=PHENOPACKETS.update__timestamp, domain=None, range=str) + +slots.update__updatedBy = Slot(uri=PHENOPACKETS.updatedBy, name="update__updatedBy", curie=PHENOPACKETS.curie('updatedBy'), + model_uri=PHENOPACKETS.update__updatedBy, domain=None, range=Optional[str]) + +slots.pedigree__persons = Slot(uri=PHENOPACKETS.persons, name="pedigree__persons", curie=PHENOPACKETS.curie('persons'), + model_uri=PHENOPACKETS.pedigree__persons, domain=None, range=Optional[Union[Union[dict, Person], List[Union[dict, Person]]]]) + +slots.person__affectedStatus = Slot(uri=PHENOPACKETS.affectedStatus, name="person__affectedStatus", curie=PHENOPACKETS.curie('affectedStatus'), + model_uri=PHENOPACKETS.person__affectedStatus, domain=None, range=Optional[Union[str, "AffectedStatus"]]) + +slots.person__familyId = Slot(uri=PHENOPACKETS.familyId, name="person__familyId", curie=PHENOPACKETS.curie('familyId'), + model_uri=PHENOPACKETS.person__familyId, domain=None, range=Optional[str]) + +slots.person__individualId = Slot(uri=PHENOPACKETS.individualId, name="person__individualId", curie=PHENOPACKETS.curie('individualId'), + model_uri=PHENOPACKETS.person__individualId, domain=None, range=Optional[str]) + +slots.person__maternalId = Slot(uri=PHENOPACKETS.maternalId, name="person__maternalId", curie=PHENOPACKETS.curie('maternalId'), + model_uri=PHENOPACKETS.person__maternalId, domain=None, range=Optional[str]) + +slots.person__paternalId = Slot(uri=PHENOPACKETS.paternalId, name="person__paternalId", curie=PHENOPACKETS.curie('paternalId'), + model_uri=PHENOPACKETS.person__paternalId, domain=None, range=Optional[str]) + +slots.person__sex = Slot(uri=PHENOPACKETS.sex, name="person__sex", curie=PHENOPACKETS.curie('sex'), + model_uri=PHENOPACKETS.person__sex, domain=None, range=Optional[Union[str, "Sex"]]) + +slots.phenotypicFeature__description = Slot(uri=PHENOPACKETS.description, name="phenotypicFeature__description", curie=PHENOPACKETS.curie('description'), + model_uri=PHENOPACKETS.phenotypicFeature__description, domain=None, range=Optional[str]) + +slots.phenotypicFeature__evidence = Slot(uri=PHENOPACKETS.evidence, name="phenotypicFeature__evidence", curie=PHENOPACKETS.curie('evidence'), + model_uri=PHENOPACKETS.phenotypicFeature__evidence, domain=None, range=Optional[Union[Union[dict, Evidence], List[Union[dict, Evidence]]]]) + +slots.phenotypicFeature__excluded = Slot(uri=PHENOPACKETS.excluded, name="phenotypicFeature__excluded", curie=PHENOPACKETS.curie('excluded'), + model_uri=PHENOPACKETS.phenotypicFeature__excluded, domain=None, range=Optional[Union[bool, Bool]]) + +slots.phenotypicFeature__modifiers = Slot(uri=PHENOPACKETS.modifiers, name="phenotypicFeature__modifiers", curie=PHENOPACKETS.curie('modifiers'), + model_uri=PHENOPACKETS.phenotypicFeature__modifiers, domain=None, range=Optional[Union[Dict[Union[str, OntologyClassId], Union[dict, OntologyClass]], List[Union[dict, OntologyClass]]]]) + +slots.phenotypicFeature__onset = Slot(uri=PHENOPACKETS.onset, name="phenotypicFeature__onset", curie=PHENOPACKETS.curie('onset'), + model_uri=PHENOPACKETS.phenotypicFeature__onset, domain=None, range=Optional[Union[dict, TimeElement]]) + +slots.phenotypicFeature__resolution = Slot(uri=PHENOPACKETS.resolution, name="phenotypicFeature__resolution", curie=PHENOPACKETS.curie('resolution'), + model_uri=PHENOPACKETS.phenotypicFeature__resolution, domain=None, range=Optional[Union[dict, TimeElement]]) + +slots.phenotypicFeature__severity = Slot(uri=PHENOPACKETS.severity, name="phenotypicFeature__severity", curie=PHENOPACKETS.curie('severity'), + model_uri=PHENOPACKETS.phenotypicFeature__severity, domain=None, range=Optional[Union[dict, OntologyClass]]) + +slots.phenotypicFeature__type = Slot(uri=PHENOPACKETS.type, name="phenotypicFeature__type", curie=PHENOPACKETS.curie('type'), + model_uri=PHENOPACKETS.phenotypicFeature__type, domain=None, range=Optional[Union[dict, OntologyClass]]) + +slots.timestamp__nanos = Slot(uri=PHENOPACKETS.nanos, name="timestamp__nanos", curie=PHENOPACKETS.curie('nanos'), + model_uri=PHENOPACKETS.timestamp__nanos, domain=None, range=Optional[int]) + +slots.timestamp__seconds = Slot(uri=PHENOPACKETS.seconds, name="timestamp__seconds", curie=PHENOPACKETS.curie('seconds'), + model_uri=PHENOPACKETS.timestamp__seconds, domain=None, range=Optional[int]) + +slots.expression__syntax = Slot(uri=PHENOPACKETS.syntax, name="expression__syntax", curie=PHENOPACKETS.curie('syntax'), + model_uri=PHENOPACKETS.expression__syntax, domain=None, range=Optional[str]) + +slots.expression__value = Slot(uri=PHENOPACKETS.value, name="expression__value", curie=PHENOPACKETS.curie('value'), + model_uri=PHENOPACKETS.expression__value, domain=None, range=Optional[str]) + +slots.expression__version = Slot(uri=PHENOPACKETS.version, name="expression__version", curie=PHENOPACKETS.curie('version'), + model_uri=PHENOPACKETS.expression__version, domain=None, range=Optional[str]) + +slots.extension__name = Slot(uri=PHENOPACKETS.name, name="extension__name", curie=PHENOPACKETS.curie('name'), + model_uri=PHENOPACKETS.extension__name, domain=None, range=Optional[str]) + +slots.extension__value = Slot(uri=PHENOPACKETS.value, name="extension__value", curie=PHENOPACKETS.curie('value'), + model_uri=PHENOPACKETS.extension__value, domain=None, range=Optional[Union[Union[dict, Any], List[Union[dict, Any]]]]) + +slots.geneDescriptor__alternateIds = Slot(uri=PHENOPACKETS.alternateIds, name="geneDescriptor__alternateIds", curie=PHENOPACKETS.curie('alternateIds'), + model_uri=PHENOPACKETS.geneDescriptor__alternateIds, domain=None, range=Optional[Union[str, List[str]]]) + +slots.geneDescriptor__alternateSymbols = Slot(uri=PHENOPACKETS.alternateSymbols, name="geneDescriptor__alternateSymbols", curie=PHENOPACKETS.curie('alternateSymbols'), + model_uri=PHENOPACKETS.geneDescriptor__alternateSymbols, domain=None, range=Optional[Union[str, List[str]]]) + +slots.geneDescriptor__description = Slot(uri=PHENOPACKETS.description, name="geneDescriptor__description", curie=PHENOPACKETS.curie('description'), + model_uri=PHENOPACKETS.geneDescriptor__description, domain=None, range=Optional[str]) + +slots.geneDescriptor__symbol = Slot(uri=PHENOPACKETS.symbol, name="geneDescriptor__symbol", curie=PHENOPACKETS.curie('symbol'), + model_uri=PHENOPACKETS.geneDescriptor__symbol, domain=None, range=Optional[str]) + +slots.geneDescriptor__valueId = Slot(uri=PHENOPACKETS.valueId, name="geneDescriptor__valueId", curie=PHENOPACKETS.curie('valueId'), + model_uri=PHENOPACKETS.geneDescriptor__valueId, domain=None, range=Optional[str]) + +slots.geneDescriptor__xrefs = Slot(uri=PHENOPACKETS.xrefs, name="geneDescriptor__xrefs", curie=PHENOPACKETS.curie('xrefs'), + model_uri=PHENOPACKETS.geneDescriptor__xrefs, domain=None, range=Optional[Union[str, List[str]]]) + +slots.variationDescriptor__allelicState = Slot(uri=PHENOPACKETS.allelicState, name="variationDescriptor__allelicState", curie=PHENOPACKETS.curie('allelicState'), + model_uri=PHENOPACKETS.variationDescriptor__allelicState, domain=None, range=Optional[Union[dict, OntologyClass]]) + +slots.variationDescriptor__alternateLabels = Slot(uri=PHENOPACKETS.alternateLabels, name="variationDescriptor__alternateLabels", curie=PHENOPACKETS.curie('alternateLabels'), + model_uri=PHENOPACKETS.variationDescriptor__alternateLabels, domain=None, range=Optional[Union[str, List[str]]]) + +slots.variationDescriptor__description = Slot(uri=PHENOPACKETS.description, name="variationDescriptor__description", curie=PHENOPACKETS.curie('description'), + model_uri=PHENOPACKETS.variationDescriptor__description, domain=None, range=Optional[str]) + +slots.variationDescriptor__expressions = Slot(uri=PHENOPACKETS.expressions, name="variationDescriptor__expressions", curie=PHENOPACKETS.curie('expressions'), + model_uri=PHENOPACKETS.variationDescriptor__expressions, domain=None, range=Optional[Union[Union[dict, Expression], List[Union[dict, Expression]]]]) + +slots.variationDescriptor__extensions = Slot(uri=PHENOPACKETS.extensions, name="variationDescriptor__extensions", curie=PHENOPACKETS.curie('extensions'), + model_uri=PHENOPACKETS.variationDescriptor__extensions, domain=None, range=Optional[Union[Union[dict, Extension], List[Union[dict, Extension]]]]) + +slots.variationDescriptor__geneContext = Slot(uri=PHENOPACKETS.geneContext, name="variationDescriptor__geneContext", curie=PHENOPACKETS.curie('geneContext'), + model_uri=PHENOPACKETS.variationDescriptor__geneContext, domain=None, range=Optional[Union[dict, GeneDescriptor]]) + +slots.variationDescriptor__id = Slot(uri=PHENOPACKETS.id, name="variationDescriptor__id", curie=PHENOPACKETS.curie('id'), + model_uri=PHENOPACKETS.variationDescriptor__id, domain=None, range=Optional[str]) + +slots.variationDescriptor__label = Slot(uri=PHENOPACKETS.label, name="variationDescriptor__label", curie=PHENOPACKETS.curie('label'), + model_uri=PHENOPACKETS.variationDescriptor__label, domain=None, range=Optional[str]) + +slots.variationDescriptor__moleculeContext = Slot(uri=PHENOPACKETS.moleculeContext, name="variationDescriptor__moleculeContext", curie=PHENOPACKETS.curie('moleculeContext'), + model_uri=PHENOPACKETS.variationDescriptor__moleculeContext, domain=None, range=Optional[Union[str, "MoleculeContext"]]) + +slots.variationDescriptor__structuralType = Slot(uri=PHENOPACKETS.structuralType, name="variationDescriptor__structuralType", curie=PHENOPACKETS.curie('structuralType'), + model_uri=PHENOPACKETS.variationDescriptor__structuralType, domain=None, range=Optional[Union[dict, OntologyClass]]) + +slots.variationDescriptor__variation = Slot(uri=PHENOPACKETS.variation, name="variationDescriptor__variation", curie=PHENOPACKETS.curie('variation'), + model_uri=PHENOPACKETS.variationDescriptor__variation, domain=None, range=Optional[Union[dict, Variation]]) + +slots.variationDescriptor__vcfRecord = Slot(uri=PHENOPACKETS.vcfRecord, name="variationDescriptor__vcfRecord", curie=PHENOPACKETS.curie('vcfRecord'), + model_uri=PHENOPACKETS.variationDescriptor__vcfRecord, domain=None, range=Optional[Union[dict, VcfRecord]]) + +slots.variationDescriptor__vrsRefAlleleSeq = Slot(uri=PHENOPACKETS.vrsRefAlleleSeq, name="variationDescriptor__vrsRefAlleleSeq", curie=PHENOPACKETS.curie('vrsRefAlleleSeq'), + model_uri=PHENOPACKETS.variationDescriptor__vrsRefAlleleSeq, domain=None, range=Optional[str]) + +slots.variationDescriptor__xrefs = Slot(uri=PHENOPACKETS.xrefs, name="variationDescriptor__xrefs", curie=PHENOPACKETS.curie('xrefs'), + model_uri=PHENOPACKETS.variationDescriptor__xrefs, domain=None, range=Optional[Union[str, List[str]]]) + +slots.vcfRecord__alt = Slot(uri=PHENOPACKETS.alt, name="vcfRecord__alt", curie=PHENOPACKETS.curie('alt'), + model_uri=PHENOPACKETS.vcfRecord__alt, domain=None, range=Optional[str]) + +slots.vcfRecord__chrom = Slot(uri=PHENOPACKETS.chrom, name="vcfRecord__chrom", curie=PHENOPACKETS.curie('chrom'), + model_uri=PHENOPACKETS.vcfRecord__chrom, domain=None, range=Optional[str]) + +slots.vcfRecord__filter = Slot(uri=PHENOPACKETS.filter, name="vcfRecord__filter", curie=PHENOPACKETS.curie('filter'), + model_uri=PHENOPACKETS.vcfRecord__filter, domain=None, range=Optional[str]) + +slots.vcfRecord__genomeAssembly = Slot(uri=PHENOPACKETS.genomeAssembly, name="vcfRecord__genomeAssembly", curie=PHENOPACKETS.curie('genomeAssembly'), + model_uri=PHENOPACKETS.vcfRecord__genomeAssembly, domain=None, range=Optional[str]) + +slots.vcfRecord__id = Slot(uri=PHENOPACKETS.id, name="vcfRecord__id", curie=PHENOPACKETS.curie('id'), + model_uri=PHENOPACKETS.vcfRecord__id, domain=None, range=Optional[str]) + +slots.vcfRecord__info = Slot(uri=PHENOPACKETS.info, name="vcfRecord__info", curie=PHENOPACKETS.curie('info'), + model_uri=PHENOPACKETS.vcfRecord__info, domain=None, range=Optional[str]) + +slots.vcfRecord__pos = Slot(uri=PHENOPACKETS.pos, name="vcfRecord__pos", curie=PHENOPACKETS.curie('pos'), + model_uri=PHENOPACKETS.vcfRecord__pos, domain=None, range=Optional[int]) + +slots.vcfRecord__qual = Slot(uri=PHENOPACKETS.qual, name="vcfRecord__qual", curie=PHENOPACKETS.curie('qual'), + model_uri=PHENOPACKETS.vcfRecord__qual, domain=None, range=Optional[str]) + +slots.vcfRecord__ref = Slot(uri=PHENOPACKETS.ref, name="vcfRecord__ref", curie=PHENOPACKETS.curie('ref'), + model_uri=PHENOPACKETS.vcfRecord__ref, domain=None, range=Optional[str]) + +slots.any__typeUrl = Slot(uri=PHENOPACKETS.typeUrl, name="any__typeUrl", curie=PHENOPACKETS.curie('typeUrl'), + model_uri=PHENOPACKETS.any__typeUrl, domain=None, range=Optional[str]) + +slots.any__value = Slot(uri=PHENOPACKETS.value, name="any__value", curie=PHENOPACKETS.curie('value'), + model_uri=PHENOPACKETS.any__value, domain=None, range=Optional[str]) + +slots.abundance__copyNumber = Slot(uri=PHENOPACKETS.copyNumber, name="abundance__copyNumber", curie=PHENOPACKETS.curie('copyNumber'), + model_uri=PHENOPACKETS.abundance__copyNumber, domain=None, range=Optional[Union[dict, CopyNumber]]) + +slots.allele__chromosomeLocation = Slot(uri=PHENOPACKETS.chromosomeLocation, name="allele__chromosomeLocation", curie=PHENOPACKETS.curie('chromosomeLocation'), + model_uri=PHENOPACKETS.allele__chromosomeLocation, domain=None, range=Optional[Union[dict, ChromosomeLocation]]) + +slots.allele__curie = Slot(uri=PHENOPACKETS.curie, name="allele__curie", curie=PHENOPACKETS.curie('curie'), + model_uri=PHENOPACKETS.allele__curie, domain=None, range=Optional[str]) + +slots.allele__derivedSequenceExpression = Slot(uri=PHENOPACKETS.derivedSequenceExpression, name="allele__derivedSequenceExpression", curie=PHENOPACKETS.curie('derivedSequenceExpression'), + model_uri=PHENOPACKETS.allele__derivedSequenceExpression, domain=None, range=Optional[Union[dict, DerivedSequenceExpression]]) + +slots.allele__id = Slot(uri=PHENOPACKETS.id, name="allele__id", curie=PHENOPACKETS.curie('id'), + model_uri=PHENOPACKETS.allele__id, domain=None, range=Optional[str]) + +slots.allele__literalSequenceExpression = Slot(uri=PHENOPACKETS.literalSequenceExpression, name="allele__literalSequenceExpression", curie=PHENOPACKETS.curie('literalSequenceExpression'), + model_uri=PHENOPACKETS.allele__literalSequenceExpression, domain=None, range=Optional[Union[dict, LiteralSequenceExpression]]) + +slots.allele__repeatedSequenceExpression = Slot(uri=PHENOPACKETS.repeatedSequenceExpression, name="allele__repeatedSequenceExpression", curie=PHENOPACKETS.curie('repeatedSequenceExpression'), + model_uri=PHENOPACKETS.allele__repeatedSequenceExpression, domain=None, range=Optional[Union[dict, RepeatedSequenceExpression]]) + +slots.allele__sequenceLocation = Slot(uri=PHENOPACKETS.sequenceLocation, name="allele__sequenceLocation", curie=PHENOPACKETS.curie('sequenceLocation'), + model_uri=PHENOPACKETS.allele__sequenceLocation, domain=None, range=Optional[Union[dict, SequenceLocation]]) + +slots.chromosomeLocation__chr = Slot(uri=PHENOPACKETS.chr, name="chromosomeLocation__chr", curie=PHENOPACKETS.curie('chr'), + model_uri=PHENOPACKETS.chromosomeLocation__chr, domain=None, range=Optional[str]) + +slots.chromosomeLocation__id = Slot(uri=PHENOPACKETS.id, name="chromosomeLocation__id", curie=PHENOPACKETS.curie('id'), + model_uri=PHENOPACKETS.chromosomeLocation__id, domain=None, range=Optional[str]) + +slots.chromosomeLocation__interval = Slot(uri=PHENOPACKETS.interval, name="chromosomeLocation__interval", curie=PHENOPACKETS.curie('interval'), + model_uri=PHENOPACKETS.chromosomeLocation__interval, domain=None, range=Optional[Union[dict, CytobandInterval]]) + +slots.chromosomeLocation__speciesId = Slot(uri=PHENOPACKETS.speciesId, name="chromosomeLocation__speciesId", curie=PHENOPACKETS.curie('speciesId'), + model_uri=PHENOPACKETS.chromosomeLocation__speciesId, domain=None, range=Optional[str]) + +slots.copyNumber__allele = Slot(uri=PHENOPACKETS.allele, name="copyNumber__allele", curie=PHENOPACKETS.curie('allele'), + model_uri=PHENOPACKETS.copyNumber__allele, domain=None, range=Optional[Union[dict, Allele]]) + +slots.copyNumber__curie = Slot(uri=PHENOPACKETS.curie, name="copyNumber__curie", curie=PHENOPACKETS.curie('curie'), + model_uri=PHENOPACKETS.copyNumber__curie, domain=None, range=Optional[str]) + +slots.copyNumber__definiteRange = Slot(uri=PHENOPACKETS.definiteRange, name="copyNumber__definiteRange", curie=PHENOPACKETS.curie('definiteRange'), + model_uri=PHENOPACKETS.copyNumber__definiteRange, domain=None, range=Optional[Union[dict, DefiniteRange]]) + +slots.copyNumber__derivedSequenceExpression = Slot(uri=PHENOPACKETS.derivedSequenceExpression, name="copyNumber__derivedSequenceExpression", curie=PHENOPACKETS.curie('derivedSequenceExpression'), + model_uri=PHENOPACKETS.copyNumber__derivedSequenceExpression, domain=None, range=Optional[Union[dict, DerivedSequenceExpression]]) + +slots.copyNumber__gene = Slot(uri=PHENOPACKETS.gene, name="copyNumber__gene", curie=PHENOPACKETS.curie('gene'), + model_uri=PHENOPACKETS.copyNumber__gene, domain=None, range=Optional[Union[dict, Gene]]) + +slots.copyNumber__haplotype = Slot(uri=PHENOPACKETS.haplotype, name="copyNumber__haplotype", curie=PHENOPACKETS.curie('haplotype'), + model_uri=PHENOPACKETS.copyNumber__haplotype, domain=None, range=Optional[Union[dict, Haplotype]]) + +slots.copyNumber__id = Slot(uri=PHENOPACKETS.id, name="copyNumber__id", curie=PHENOPACKETS.curie('id'), + model_uri=PHENOPACKETS.copyNumber__id, domain=None, range=Optional[str]) + +slots.copyNumber__indefiniteRange = Slot(uri=PHENOPACKETS.indefiniteRange, name="copyNumber__indefiniteRange", curie=PHENOPACKETS.curie('indefiniteRange'), + model_uri=PHENOPACKETS.copyNumber__indefiniteRange, domain=None, range=Optional[Union[dict, IndefiniteRange]]) + +slots.copyNumber__literalSequenceExpression = Slot(uri=PHENOPACKETS.literalSequenceExpression, name="copyNumber__literalSequenceExpression", curie=PHENOPACKETS.curie('literalSequenceExpression'), + model_uri=PHENOPACKETS.copyNumber__literalSequenceExpression, domain=None, range=Optional[Union[dict, LiteralSequenceExpression]]) + +slots.copyNumber__number = Slot(uri=PHENOPACKETS.number, name="copyNumber__number", curie=PHENOPACKETS.curie('number'), + model_uri=PHENOPACKETS.copyNumber__number, domain=None, range=Optional[Union[dict, Number]]) + +slots.copyNumber__repeatedSequenceExpression = Slot(uri=PHENOPACKETS.repeatedSequenceExpression, name="copyNumber__repeatedSequenceExpression", curie=PHENOPACKETS.curie('repeatedSequenceExpression'), + model_uri=PHENOPACKETS.copyNumber__repeatedSequenceExpression, domain=None, range=Optional[Union[dict, RepeatedSequenceExpression]]) + +slots.cytobandInterval__end = Slot(uri=PHENOPACKETS.end, name="cytobandInterval__end", curie=PHENOPACKETS.curie('end'), + model_uri=PHENOPACKETS.cytobandInterval__end, domain=None, range=Optional[str]) + +slots.cytobandInterval__start = Slot(uri=PHENOPACKETS.start, name="cytobandInterval__start", curie=PHENOPACKETS.curie('start'), + model_uri=PHENOPACKETS.cytobandInterval__start, domain=None, range=Optional[str]) + +slots.definiteRange__max = Slot(uri=PHENOPACKETS.max, name="definiteRange__max", curie=PHENOPACKETS.curie('max'), + model_uri=PHENOPACKETS.definiteRange__max, domain=None, range=Optional[int]) + +slots.definiteRange__min = Slot(uri=PHENOPACKETS.min, name="definiteRange__min", curie=PHENOPACKETS.curie('min'), + model_uri=PHENOPACKETS.definiteRange__min, domain=None, range=Optional[int]) + +slots.derivedSequenceExpression__location = Slot(uri=PHENOPACKETS.location, name="derivedSequenceExpression__location", curie=PHENOPACKETS.curie('location'), + model_uri=PHENOPACKETS.derivedSequenceExpression__location, domain=None, range=Optional[Union[dict, SequenceLocation]]) + +slots.derivedSequenceExpression__reverseComplement = Slot(uri=PHENOPACKETS.reverseComplement, name="derivedSequenceExpression__reverseComplement", curie=PHENOPACKETS.curie('reverseComplement'), + model_uri=PHENOPACKETS.derivedSequenceExpression__reverseComplement, domain=None, range=Optional[Union[bool, Bool]]) + +slots.feature__gene = Slot(uri=PHENOPACKETS.gene, name="feature__gene", curie=PHENOPACKETS.curie('gene'), + model_uri=PHENOPACKETS.feature__gene, domain=None, range=Optional[Union[dict, Gene]]) + +slots.gene__geneId = Slot(uri=PHENOPACKETS.geneId, name="gene__geneId", curie=PHENOPACKETS.curie('geneId'), + model_uri=PHENOPACKETS.gene__geneId, domain=None, range=Optional[str]) + +slots.indefiniteRange__comparator = Slot(uri=PHENOPACKETS.comparator, name="indefiniteRange__comparator", curie=PHENOPACKETS.curie('comparator'), + model_uri=PHENOPACKETS.indefiniteRange__comparator, domain=None, range=Optional[str]) + +slots.indefiniteRange__value = Slot(uri=PHENOPACKETS.value, name="indefiniteRange__value", curie=PHENOPACKETS.curie('value'), + model_uri=PHENOPACKETS.indefiniteRange__value, domain=None, range=Optional[int]) + +slots.literalSequenceExpression__sequence = Slot(uri=PHENOPACKETS.sequence, name="literalSequenceExpression__sequence", curie=PHENOPACKETS.curie('sequence'), + model_uri=PHENOPACKETS.literalSequenceExpression__sequence, domain=None, range=Optional[str]) + +slots.location__chromosomeLocation = Slot(uri=PHENOPACKETS.chromosomeLocation, name="location__chromosomeLocation", curie=PHENOPACKETS.curie('chromosomeLocation'), + model_uri=PHENOPACKETS.location__chromosomeLocation, domain=None, range=Optional[Union[dict, ChromosomeLocation]]) + +slots.location__sequenceLocation = Slot(uri=PHENOPACKETS.sequenceLocation, name="location__sequenceLocation", curie=PHENOPACKETS.curie('sequenceLocation'), + model_uri=PHENOPACKETS.location__sequenceLocation, domain=None, range=Optional[Union[dict, SequenceLocation]]) + +slots.member__allele = Slot(uri=PHENOPACKETS.allele, name="member__allele", curie=PHENOPACKETS.curie('allele'), + model_uri=PHENOPACKETS.member__allele, domain=None, range=Optional[Union[dict, Allele]]) + +slots.member__copyNumber = Slot(uri=PHENOPACKETS.copyNumber, name="member__copyNumber", curie=PHENOPACKETS.curie('copyNumber'), + model_uri=PHENOPACKETS.member__copyNumber, domain=None, range=Optional[Union[dict, CopyNumber]]) + +slots.member__curie = Slot(uri=PHENOPACKETS.curie, name="member__curie", curie=PHENOPACKETS.curie('curie'), + model_uri=PHENOPACKETS.member__curie, domain=None, range=Optional[str]) + +slots.member__haplotype = Slot(uri=PHENOPACKETS.haplotype, name="member__haplotype", curie=PHENOPACKETS.curie('haplotype'), + model_uri=PHENOPACKETS.member__haplotype, domain=None, range=Optional[Union[dict, Haplotype]]) + +slots.member__id = Slot(uri=PHENOPACKETS.id, name="member__id", curie=PHENOPACKETS.curie('id'), + model_uri=PHENOPACKETS.member__id, domain=None, range=Optional[str]) + +slots.member__members = Slot(uri=PHENOPACKETS.members, name="member__members", curie=PHENOPACKETS.curie('members'), + model_uri=PHENOPACKETS.member__members, domain=None, range=Optional[Union[Union[dict, Member], List[Union[dict, Member]]]]) + +slots.member__text = Slot(uri=PHENOPACKETS.text, name="member__text", curie=PHENOPACKETS.curie('text'), + model_uri=PHENOPACKETS.member__text, domain=None, range=Optional[Union[dict, Text]]) + +slots.member__variationSet = Slot(uri=PHENOPACKETS.variationSet, name="member__variationSet", curie=PHENOPACKETS.curie('variationSet'), + model_uri=PHENOPACKETS.member__variationSet, domain=None, range=Optional[Union[dict, VariationSet]]) + +slots.molecularVariation__allele = Slot(uri=PHENOPACKETS.allele, name="molecularVariation__allele", curie=PHENOPACKETS.curie('allele'), + model_uri=PHENOPACKETS.molecularVariation__allele, domain=None, range=Optional[Union[dict, Allele]]) + +slots.molecularVariation__haplotype = Slot(uri=PHENOPACKETS.haplotype, name="molecularVariation__haplotype", curie=PHENOPACKETS.curie('haplotype'), + model_uri=PHENOPACKETS.molecularVariation__haplotype, domain=None, range=Optional[Union[dict, Haplotype]]) + +slots.number__value = Slot(uri=PHENOPACKETS.value, name="number__value", curie=PHENOPACKETS.curie('value'), + model_uri=PHENOPACKETS.number__value, domain=None, range=Optional[int]) + +slots.repeatedSequenceExpression__definiteRange = Slot(uri=PHENOPACKETS.definiteRange, name="repeatedSequenceExpression__definiteRange", curie=PHENOPACKETS.curie('definiteRange'), + model_uri=PHENOPACKETS.repeatedSequenceExpression__definiteRange, domain=None, range=Optional[Union[dict, DefiniteRange]]) + +slots.repeatedSequenceExpression__derivedSequenceExpression = Slot(uri=PHENOPACKETS.derivedSequenceExpression, name="repeatedSequenceExpression__derivedSequenceExpression", curie=PHENOPACKETS.curie('derivedSequenceExpression'), + model_uri=PHENOPACKETS.repeatedSequenceExpression__derivedSequenceExpression, domain=None, range=Optional[Union[dict, DerivedSequenceExpression]]) + +slots.repeatedSequenceExpression__indefiniteRange = Slot(uri=PHENOPACKETS.indefiniteRange, name="repeatedSequenceExpression__indefiniteRange", curie=PHENOPACKETS.curie('indefiniteRange'), + model_uri=PHENOPACKETS.repeatedSequenceExpression__indefiniteRange, domain=None, range=Optional[Union[dict, IndefiniteRange]]) + +slots.repeatedSequenceExpression__literalSequenceExpression = Slot(uri=PHENOPACKETS.literalSequenceExpression, name="repeatedSequenceExpression__literalSequenceExpression", curie=PHENOPACKETS.curie('literalSequenceExpression'), + model_uri=PHENOPACKETS.repeatedSequenceExpression__literalSequenceExpression, domain=None, range=Optional[Union[dict, LiteralSequenceExpression]]) + +slots.repeatedSequenceExpression__number = Slot(uri=PHENOPACKETS.number, name="repeatedSequenceExpression__number", curie=PHENOPACKETS.curie('number'), + model_uri=PHENOPACKETS.repeatedSequenceExpression__number, domain=None, range=Optional[Union[dict, Number]]) + +slots.sequenceExpression__derivedSequenceExpression = Slot(uri=PHENOPACKETS.derivedSequenceExpression, name="sequenceExpression__derivedSequenceExpression", curie=PHENOPACKETS.curie('derivedSequenceExpression'), + model_uri=PHENOPACKETS.sequenceExpression__derivedSequenceExpression, domain=None, range=Optional[Union[dict, DerivedSequenceExpression]]) + +slots.sequenceExpression__literalSequenceExpression = Slot(uri=PHENOPACKETS.literalSequenceExpression, name="sequenceExpression__literalSequenceExpression", curie=PHENOPACKETS.curie('literalSequenceExpression'), + model_uri=PHENOPACKETS.sequenceExpression__literalSequenceExpression, domain=None, range=Optional[Union[dict, LiteralSequenceExpression]]) + +slots.sequenceExpression__repeatedSequenceExpression = Slot(uri=PHENOPACKETS.repeatedSequenceExpression, name="sequenceExpression__repeatedSequenceExpression", curie=PHENOPACKETS.curie('repeatedSequenceExpression'), + model_uri=PHENOPACKETS.sequenceExpression__repeatedSequenceExpression, domain=None, range=Optional[Union[dict, RepeatedSequenceExpression]]) + +slots.sequenceInterval__endDefiniteRange = Slot(uri=PHENOPACKETS.endDefiniteRange, name="sequenceInterval__endDefiniteRange", curie=PHENOPACKETS.curie('endDefiniteRange'), + model_uri=PHENOPACKETS.sequenceInterval__endDefiniteRange, domain=None, range=Optional[Union[dict, DefiniteRange]]) + +slots.sequenceInterval__endIndefiniteRange = Slot(uri=PHENOPACKETS.endIndefiniteRange, name="sequenceInterval__endIndefiniteRange", curie=PHENOPACKETS.curie('endIndefiniteRange'), + model_uri=PHENOPACKETS.sequenceInterval__endIndefiniteRange, domain=None, range=Optional[Union[dict, IndefiniteRange]]) + +slots.sequenceInterval__endNumber = Slot(uri=PHENOPACKETS.endNumber, name="sequenceInterval__endNumber", curie=PHENOPACKETS.curie('endNumber'), + model_uri=PHENOPACKETS.sequenceInterval__endNumber, domain=None, range=Optional[Union[dict, Number]]) + +slots.sequenceInterval__startDefiniteRange = Slot(uri=PHENOPACKETS.startDefiniteRange, name="sequenceInterval__startDefiniteRange", curie=PHENOPACKETS.curie('startDefiniteRange'), + model_uri=PHENOPACKETS.sequenceInterval__startDefiniteRange, domain=None, range=Optional[Union[dict, DefiniteRange]]) + +slots.sequenceInterval__startIndefiniteRange = Slot(uri=PHENOPACKETS.startIndefiniteRange, name="sequenceInterval__startIndefiniteRange", curie=PHENOPACKETS.curie('startIndefiniteRange'), + model_uri=PHENOPACKETS.sequenceInterval__startIndefiniteRange, domain=None, range=Optional[Union[dict, IndefiniteRange]]) + +slots.sequenceInterval__startNumber = Slot(uri=PHENOPACKETS.startNumber, name="sequenceInterval__startNumber", curie=PHENOPACKETS.curie('startNumber'), + model_uri=PHENOPACKETS.sequenceInterval__startNumber, domain=None, range=Optional[Union[dict, Number]]) + +slots.sequenceLocation__id = Slot(uri=PHENOPACKETS.id, name="sequenceLocation__id", curie=PHENOPACKETS.curie('id'), + model_uri=PHENOPACKETS.sequenceLocation__id, domain=None, range=Optional[str]) + +slots.sequenceLocation__sequenceId = Slot(uri=PHENOPACKETS.sequenceId, name="sequenceLocation__sequenceId", curie=PHENOPACKETS.curie('sequenceId'), + model_uri=PHENOPACKETS.sequenceLocation__sequenceId, domain=None, range=Optional[str]) + +slots.sequenceLocation__sequenceInterval = Slot(uri=PHENOPACKETS.sequenceInterval, name="sequenceLocation__sequenceInterval", curie=PHENOPACKETS.curie('sequenceInterval'), + model_uri=PHENOPACKETS.sequenceLocation__sequenceInterval, domain=None, range=Optional[Union[dict, SequenceInterval]]) + +slots.sequenceState__sequence = Slot(uri=PHENOPACKETS.sequence, name="sequenceState__sequence", curie=PHENOPACKETS.curie('sequence'), + model_uri=PHENOPACKETS.sequenceState__sequence, domain=None, range=Optional[str]) + +slots.simpleInterval__end = Slot(uri=PHENOPACKETS.end, name="simpleInterval__end", curie=PHENOPACKETS.curie('end'), + model_uri=PHENOPACKETS.simpleInterval__end, domain=None, range=Optional[int]) + +slots.simpleInterval__start = Slot(uri=PHENOPACKETS.start, name="simpleInterval__start", curie=PHENOPACKETS.curie('start'), + model_uri=PHENOPACKETS.simpleInterval__start, domain=None, range=Optional[int]) + +slots.systemicVariation__copyNumber = Slot(uri=PHENOPACKETS.copyNumber, name="systemicVariation__copyNumber", curie=PHENOPACKETS.curie('copyNumber'), + model_uri=PHENOPACKETS.systemicVariation__copyNumber, domain=None, range=Optional[Union[dict, CopyNumber]]) + +slots.text__definition = Slot(uri=PHENOPACKETS.definition, name="text__definition", curie=PHENOPACKETS.curie('definition'), + model_uri=PHENOPACKETS.text__definition, domain=None, range=Optional[str]) + +slots.text__id = Slot(uri=PHENOPACKETS.id, name="text__id", curie=PHENOPACKETS.curie('id'), + model_uri=PHENOPACKETS.text__id, domain=None, range=Optional[str]) + +slots.utilityVariation__text = Slot(uri=PHENOPACKETS.text, name="utilityVariation__text", curie=PHENOPACKETS.curie('text'), + model_uri=PHENOPACKETS.utilityVariation__text, domain=None, range=Optional[Union[dict, Text]]) + +slots.utilityVariation__variationSet = Slot(uri=PHENOPACKETS.variationSet, name="utilityVariation__variationSet", curie=PHENOPACKETS.curie('variationSet'), + model_uri=PHENOPACKETS.utilityVariation__variationSet, domain=None, range=Optional[Union[dict, VariationSet]]) + +slots.variation__allele = Slot(uri=PHENOPACKETS.allele, name="variation__allele", curie=PHENOPACKETS.curie('allele'), + model_uri=PHENOPACKETS.variation__allele, domain=None, range=Optional[Union[dict, Allele]]) + +slots.variation__copyNumber = Slot(uri=PHENOPACKETS.copyNumber, name="variation__copyNumber", curie=PHENOPACKETS.curie('copyNumber'), + model_uri=PHENOPACKETS.variation__copyNumber, domain=None, range=Optional[Union[dict, CopyNumber]]) + +slots.variation__haplotype = Slot(uri=PHENOPACKETS.haplotype, name="variation__haplotype", curie=PHENOPACKETS.curie('haplotype'), + model_uri=PHENOPACKETS.variation__haplotype, domain=None, range=Optional[Union[dict, Haplotype]]) + +slots.variation__text = Slot(uri=PHENOPACKETS.text, name="variation__text", curie=PHENOPACKETS.curie('text'), + model_uri=PHENOPACKETS.variation__text, domain=None, range=Optional[Union[dict, Text]]) + +slots.variation__variationSet = Slot(uri=PHENOPACKETS.variationSet, name="variation__variationSet", curie=PHENOPACKETS.curie('variationSet'), + model_uri=PHENOPACKETS.variation__variationSet, domain=None, range=Optional[Union[dict, VariationSet]]) diff --git a/tests/test_loaders_dumpers/test_rdflib_dumper.py b/tests/test_loaders_dumpers/test_rdflib_dumper.py index 3c5a0efe..6d0b3747 100644 --- a/tests/test_loaders_dumpers/test_rdflib_dumper.py +++ b/tests/test_loaders_dumpers/test_rdflib_dumper.py @@ -2,6 +2,7 @@ import os import unittest import logging +from pathlib import Path from rdflib import Graph, Literal, URIRef from rdflib.namespace import RDF, SKOS, XSD @@ -15,6 +16,7 @@ from tests.test_loaders_dumpers import INPUT_DIR, OUTPUT_DIR from tests.test_loaders_dumpers.models.personinfo import Container, Person, Address, Organization, OrganizationType from tests.test_loaders_dumpers.models.node_object import NodeObject, Triple +from tests.test_loaders_dumpers.models.phenopackets import PhenotypicFeature, OntologyClass, Phenopacket, MetaData SCHEMA = os.path.join(INPUT_DIR, 'personinfo.yaml') DATA = os.path.join(INPUT_DIR, 'example_personinfo_data.yaml') @@ -165,8 +167,6 @@ def test_undeclared_prefix(self): org1 = Organization('http://example.org/foo/o1') rdflib_dumper.as_rdf_graph(org1, schemaview=view) - - def test_rdflib_loader(self): """ tests loading from an RDF graph @@ -251,8 +251,6 @@ def test_blank_node(self): self.assertIn((bn, INFO.city, Literal("foo city")), g) self.assertIn((bn, INFO.street, Literal("1 foo street")), g) - - def _check_objs(self, view: SchemaView, container: Container): persons = container.persons orgs = container.organizations.values() @@ -284,7 +282,6 @@ def _check_objs(self, view: SchemaView, container: Container): self.assertEqual(med.diagnosis.name, 'headache') self.assertEqual(med.diagnosis.code_system, 'CODE:D') - def test_edge_cases(self): """ Tests various edge cases: @@ -346,6 +343,40 @@ def test_edge_cases(self): prefix_map=taxon_prefix_map) logging.error(f'Passed unexpectedly: rdf:object is known to have a mix of literals and nodes') + def test_phenopackets(self): + view = SchemaView(str(Path(INPUT_DIR) / "phenopackets"/ "phenopackets.yaml")) + test_label = 'test label' + with self.assertRaises(ValueError) as e: + c = OntologyClass(id='NO_SUCH_PREFIX:1', label=test_label) + rdflib_dumper.dumps(c, view) + cases = [ + ("HP:1", "http://purl.obolibrary.org/obo/HP_1", None), + ("FOO:1", "http://example.org/FOO_1", {'FOO': 'http://example.org/FOO_'}), + ] + for id, expected_uri, prefix_map in cases: + + c = OntologyClass(id=id, label=test_label) + ttl = rdflib_dumper.dumps(c, view, prefix_map=prefix_map) + g = Graph() + g.parse(data=ttl, format='ttl') + self.assertEqual(len(g), 2) + self.assertIn(Literal(test_label), list(g.objects(URIRef(expected_uri))), + f'Expected label {test_label} for {expected_uri} in {ttl}') + pf = PhenotypicFeature(type=c) + pkt = Phenopacket(id='id with spaces', + metaData=MetaData(), + phenotypicFeatures=[pf]) + ttl = rdflib_dumper.dumps(pkt, view, prefix_map=prefix_map) + print(ttl) + g = Graph() + g.parse(data=ttl, format='ttl') + self.assertIn(Literal(test_label), list(g.objects(URIRef(expected_uri))), + f'Expected label {test_label} for {expected_uri} in {ttl}') + + + + + if __name__ == '__main__': unittest.main() From fcbd2cb406639d9afee5f3e07e5e8878498020f6 Mon Sep 17 00:00:00 2001 From: cmungall Date: Tue, 17 Jan 2023 17:59:18 -0800 Subject: [PATCH 2/2] additional test for % encoding --- .../input/phenopackets/base.yaml | 1 + .../input/phenopackets/biosample.yaml | 1 + .../input/phenopackets/individual.yaml | 1 + .../input/phenopackets/interpretation.yaml | 1 + .../input/phenopackets/meta_data.yaml | 4 +++- .../input/phenopackets/phenopackets.yaml | 3 +++ .../input/phenopackets/vrs.yaml | 6 ++++++ .../input/phenopackets/vrsatile.yaml | 2 ++ tests/test_loaders_dumpers/test_rdflib_dumper.py | 13 +++++++++---- 9 files changed, 27 insertions(+), 5 deletions(-) diff --git a/tests/test_loaders_dumpers/input/phenopackets/base.yaml b/tests/test_loaders_dumpers/input/phenopackets/base.yaml index 2416cf6a..fdbf465c 100644 --- a/tests/test_loaders_dumpers/input/phenopackets/base.yaml +++ b/tests/test_loaders_dumpers/input/phenopackets/base.yaml @@ -48,6 +48,7 @@ classes: range: string id: annotations: + percent_encoded: true rank: 1 description: "e.g. ISBN, PMID:123456, DOI:..., FHIR mapping: Reference.identifier" range: string diff --git a/tests/test_loaders_dumpers/input/phenopackets/biosample.yaml b/tests/test_loaders_dumpers/input/phenopackets/biosample.yaml index 2eb4bfae..88d386ea 100644 --- a/tests/test_loaders_dumpers/input/phenopackets/biosample.yaml +++ b/tests/test_loaders_dumpers/input/phenopackets/biosample.yaml @@ -36,6 +36,7 @@ classes: range: OntologyClass id: annotations: + percent_encoded: true rank: 1 description: biosamples SAMN08666232 Human Cell Atlas The Biosample id This is unique in the context of the server instance. ARGO mapping specimen::submitter_specimen_id exact_mappings: diff --git a/tests/test_loaders_dumpers/input/phenopackets/individual.yaml b/tests/test_loaders_dumpers/input/phenopackets/individual.yaml index 22bea573..53a7de53 100644 --- a/tests/test_loaders_dumpers/input/phenopackets/individual.yaml +++ b/tests/test_loaders_dumpers/input/phenopackets/individual.yaml @@ -21,6 +21,7 @@ classes: range: OntologyClass id: annotations: + percent_encoded: true rank: 1 description: An identifier for the individual. This must be unique within the record. ARGO mapping donor::submitter_donor_id exact_mappings: diff --git a/tests/test_loaders_dumpers/input/phenopackets/interpretation.yaml b/tests/test_loaders_dumpers/input/phenopackets/interpretation.yaml index 98fac124..2ceee7f6 100644 --- a/tests/test_loaders_dumpers/input/phenopackets/interpretation.yaml +++ b/tests/test_loaders_dumpers/input/phenopackets/interpretation.yaml @@ -61,6 +61,7 @@ classes: range: Diagnosis id: annotations: + percent_encoded: true rank: 1 description: id of the interpretation range: string diff --git a/tests/test_loaders_dumpers/input/phenopackets/meta_data.yaml b/tests/test_loaders_dumpers/input/phenopackets/meta_data.yaml index cd475359..4862b31b 100644 --- a/tests/test_loaders_dumpers/input/phenopackets/meta_data.yaml +++ b/tests/test_loaders_dumpers/input/phenopackets/meta_data.yaml @@ -46,8 +46,10 @@ classes: description: '' Resource: attributes: - id: + id: + identifier: true annotations: + percent_encoded: true rank: 1 description: "for OBO Ontologies, the value of this string MUST always be the official OBO ID, which is always equivalent to the ID prefix in lower case. Examples: hp, go, mp, mondo Consult http://obofoundry.org for a complete list For other ontologies (e.g. SNOMED), use the prefix in identifiers.org" range: string diff --git a/tests/test_loaders_dumpers/input/phenopackets/phenopackets.yaml b/tests/test_loaders_dumpers/input/phenopackets/phenopackets.yaml index 745f6dfa..0e60ddd7 100644 --- a/tests/test_loaders_dumpers/input/phenopackets/phenopackets.yaml +++ b/tests/test_loaders_dumpers/input/phenopackets/phenopackets.yaml @@ -16,6 +16,7 @@ classes: range: File id: annotations: + percent_encoded: true rank: 1 description: '' range: string @@ -49,6 +50,7 @@ classes: range: File id: annotations: + percent_encoded: true rank: 1 description: An identifier specific for this family. range: string @@ -101,6 +103,7 @@ classes: range: File id: annotations: + percent_encoded: true rank: 1 description: An identifier specific for this phenopacket. range: string diff --git a/tests/test_loaders_dumpers/input/phenopackets/vrs.yaml b/tests/test_loaders_dumpers/input/phenopackets/vrs.yaml index 00a3c621..60102e83 100644 --- a/tests/test_loaders_dumpers/input/phenopackets/vrs.yaml +++ b/tests/test_loaders_dumpers/input/phenopackets/vrs.yaml @@ -35,6 +35,7 @@ classes: range: DerivedSequenceExpression id: annotations: + percent_encoded: true rank: 1 description: '' range: string @@ -79,6 +80,7 @@ classes: range: string id: annotations: + percent_encoded: true rank: 1 description: '' range: string @@ -128,6 +130,7 @@ classes: range: Haplotype id: annotations: + percent_encoded: true rank: 1 description: '' range: string @@ -305,6 +308,7 @@ classes: range: Haplotype id: annotations: + percent_encoded: true rank: 1 description: '' range: string @@ -518,6 +522,7 @@ classes: attributes: id: annotations: + percent_encoded: true rank: 1 description: '' range: string @@ -586,6 +591,7 @@ classes: range: string id: annotations: + percent_encoded: true rank: 1 description: '' range: string diff --git a/tests/test_loaders_dumpers/input/phenopackets/vrsatile.yaml b/tests/test_loaders_dumpers/input/phenopackets/vrsatile.yaml index 132d1d38..18be00f0 100644 --- a/tests/test_loaders_dumpers/input/phenopackets/vrsatile.yaml +++ b/tests/test_loaders_dumpers/input/phenopackets/vrsatile.yaml @@ -110,6 +110,7 @@ classes: range: GeneDescriptor id: annotations: + percent_encoded: true rank: 1 description: '' range: string @@ -175,6 +176,7 @@ classes: range: string id: annotations: + percent_encoded: true rank: 4 description: '' range: string diff --git a/tests/test_loaders_dumpers/test_rdflib_dumper.py b/tests/test_loaders_dumpers/test_rdflib_dumper.py index 6d0b3747..efbbc506 100644 --- a/tests/test_loaders_dumpers/test_rdflib_dumper.py +++ b/tests/test_loaders_dumpers/test_rdflib_dumper.py @@ -16,7 +16,8 @@ from tests.test_loaders_dumpers import INPUT_DIR, OUTPUT_DIR from tests.test_loaders_dumpers.models.personinfo import Container, Person, Address, Organization, OrganizationType from tests.test_loaders_dumpers.models.node_object import NodeObject, Triple -from tests.test_loaders_dumpers.models.phenopackets import PhenotypicFeature, OntologyClass, Phenopacket, MetaData +from tests.test_loaders_dumpers.models.phenopackets import PhenotypicFeature, OntologyClass, Phenopacket, MetaData, \ + Resource SCHEMA = os.path.join(INPUT_DIR, 'personinfo.yaml') DATA = os.path.join(INPUT_DIR, 'example_personinfo_data.yaml') @@ -351,7 +352,8 @@ def test_phenopackets(self): rdflib_dumper.dumps(c, view) cases = [ ("HP:1", "http://purl.obolibrary.org/obo/HP_1", None), - ("FOO:1", "http://example.org/FOO_1", {'FOO': 'http://example.org/FOO_'}), + ("FOO:1", "http://example.org/FOO_1", {'FOO': 'http://example.org/FOO_', + "@base": "http://example.org/base/"}), ] for id, expected_uri, prefix_map in cases: @@ -364,14 +366,17 @@ def test_phenopackets(self): f'Expected label {test_label} for {expected_uri} in {ttl}') pf = PhenotypicFeature(type=c) pkt = Phenopacket(id='id with spaces', - metaData=MetaData(), + metaData=MetaData(resources=[Resource(id='id with spaces')]), phenotypicFeatures=[pf]) ttl = rdflib_dumper.dumps(pkt, view, prefix_map=prefix_map) - print(ttl) g = Graph() g.parse(data=ttl, format='ttl') self.assertIn(Literal(test_label), list(g.objects(URIRef(expected_uri))), f'Expected label {test_label} for {expected_uri} in {ttl}') + if prefix_map and "@base" in prefix_map: + resource_uri = URIRef(prefix_map["@base"] + "id%20with%20spaces") + self.assertEqual(1, len(list(g.objects(resource_uri)))) +