forked from biolink/biolink-model
-
Notifications
You must be signed in to change notification settings - Fork 1
/
model.py
4567 lines (3545 loc) · 207 KB
/
model.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Auto generated from biolink-model.yaml by pythongen.py version: 0.2.1
# Generation date: 2019-09-19 08:29
# Schema: biolink_model
#
# id: https://w3id.org/biolink/biolink-model
# description: Entity and association taxonomy and datamodel for life-sciences data
# license: https://creativecommons.org/publicdomain/zero/1.0/
from typing import Optional, List, Union, Dict, ClassVar
from dataclasses import dataclass
from biolinkml.utils.metamodelcore import empty_list, empty_dict, bnode
from biolinkml.utils.yamlutils import YAMLRoot
from biolinkml.utils.formatutils import camelcase, underscore, sfx
from rdflib import Namespace, URIRef
from biolinkml.utils.metamodelcore import Bool, ElementIdentifier, URIorCURIE, XSDDate, XSDTime
from includes.types import Boolean, Date, Double, Float, Integer, String, Time, Uriorcurie
metamodel_version = "1.4.1"
# Namespaces
BFO = Namespace('http://purl.obolibrary.org/obo/BFO_')
BIOGRID = Namespace('http://thebiogrid.org/')
BIOSAMPLE = Namespace('http://example.org/UNKNOWN/BioSample/')
CHEBI = Namespace('http://purl.obolibrary.org/obo/CHEBI_')
CHEMBL_COMPOUND = Namespace('http://identifiers.org/chembl.compound/')
CHEMBL_TARGET = Namespace('http://identifiers.org/chembl.target/')
CIO = Namespace('http://purl.obolibrary.org/obo/CIO_')
CIVIC = Namespace('http://example.org/UNKNOWN/CIViC/')
CL = Namespace('http://purl.obolibrary.org/obo/CL_')
CLO = Namespace('http://purl.obolibrary.org/obo/CLO_')
CLINVAR = Namespace('http://www.ncbi.nlm.nih.gov/clinvar/')
ECO = Namespace('http://purl.obolibrary.org/obo/ECO_')
ECTO = Namespace('http://example.org/UNKNOWN/ECTO/')
EFO = Namespace('http://purl.obolibrary.org/obo/EFO_')
ENSEMBL = Namespace('http://ensembl.org/id/')
FAO = Namespace('http://purl.obolibrary.org/obo/FAO_')
GENO = Namespace('http://purl.obolibrary.org/obo/GENO_')
GO = Namespace('http://purl.obolibrary.org/obo/GO_')
GOLD_META = Namespace('http://identifiers.org/gold.meta/')
HANCESTRO = Namespace('http://example.org/UNKNOWN/HANCESTRO/')
HGNC = Namespace('http://www.genenames.org/cgi-bin/gene_symbol_report?hgnc_id=')
HP = Namespace('http://purl.obolibrary.org/obo/HP_')
IAO = Namespace('http://purl.obolibrary.org/obo/IAO_')
INTACT = Namespace('http://example.org/UNKNOWN/IntAct/')
MGI = Namespace('http://www.informatics.jax.org/accession/MGI:')
MIR = Namespace('http://identifiers.org/mir/')
MONDO = Namespace('http://purl.obolibrary.org/obo/MONDO_')
NCBIGENE = Namespace('http://www.ncbi.nlm.nih.gov/gene/')
NCIT = Namespace('http://purl.obolibrary.org/obo/NCIT_')
OBAN = Namespace('http://purl.org/oban/')
OBI = Namespace('http://purl.obolibrary.org/obo/OBI_')
OGMS = Namespace('http://purl.obolibrary.org/obo/OGMS_')
OIO = Namespace('http://www.geneontology.org/formats/oboInOwl#')
PANTHER = Namespace('http://www.pantherdb.org/panther/family.do?clsAccession=')
PMID = Namespace('http://www.ncbi.nlm.nih.gov/pubmed/')
PO = Namespace('http://purl.obolibrary.org/obo/PO_')
PR = Namespace('http://purl.obolibrary.org/obo/PR_')
PW = Namespace('http://purl.obolibrary.org/obo/PW_')
POMBASE = Namespace('https://www.pombase.org/spombe/result/')
RHEA = Namespace('http://identifiers.org/rhea/')
RNACENTRAL = Namespace('http://example.org/UNKNOWN/RNAcentral/')
RO = Namespace('http://purl.obolibrary.org/obo/RO_')
REACTOME = Namespace('http://example.org/UNKNOWN/Reactome/')
SEMMEDDB = Namespace('http://example.org/UNKNOWN/SEMMEDDB/')
SGD = Namespace('https://www.yeastgenome.org/locus/')
SIO = Namespace('http://semanticscience.org/resource/SIO_')
SO = Namespace('http://purl.obolibrary.org/obo/SO_')
UBERON = Namespace('http://purl.obolibrary.org/obo/UBERON_')
UMLSSC = Namespace('https://uts-ws.nlm.nih.gov/rest/semantic-network/semantic-network/current/TUI/')
UMLSSG = Namespace('https://uts-ws.nlm.nih.gov/rest/semantic-network/semantic-network/current/GROUP/')
UMLSST = Namespace('https://uts-ws.nlm.nih.gov/rest/semantic-network/semantic-network/current/STY/')
UO = Namespace('http://purl.obolibrary.org/obo/UO_')
UPHENO = Namespace('http://purl.obolibrary.org/obo/UPHENO_')
UNIPROTKB = Namespace('http://identifiers.org/uniprot/')
VMC = Namespace('http://example.org/UNKNOWN/VMC/')
WB = Namespace('http://identifiers.org/wb/')
WD = Namespace('http://example.org/UNKNOWN/WD/')
ZFIN = Namespace('http://zfin.org/')
BIOLINK = Namespace('https://w3id.org/biolink/vocab/')
DCT = Namespace('http://example.org/UNKNOWN/dct/')
DCTERMS = Namespace('http://purl.org/dc/terms/')
DICTYBASE = Namespace('http://dictybase.org/gene/')
FALDO = Namespace('http://biohackathon.org/resource/faldo#')
OWL = Namespace('http://www.w3.org/2002/07/owl#')
PAV = Namespace('http://purl.org/pav/')
QUD = Namespace('http://qudt.org/1.1/schema/qudt#')
RDF = Namespace('http://www.w3.org/1999/02/22-rdf-syntax-ns#')
RDFS = Namespace('http://www.w3.org/2000/01/rdf-schema#')
SHEX = Namespace('http://www.w3.org/ns/shex#')
SKOS = Namespace('https://www.w3.org/TR/skos-reference/#')
VOID = Namespace('http://rdfs.org/ns/void#')
WGS = Namespace('http://www.w3.org/2003/01/geo/wgs84_pos')
XSD = Namespace('http://www.w3.org/2001/XMLSchema#')
DEFAULT_ = BIOLINK
# Types
class ChemicalFormulaValue(str):
""" A chemical formula """
type_class_uri = XSD.string
type_class_curie = "xsd:string"
type_name = "chemical formula value"
type_model_uri = BIOLINK.ChemicalFormulaValue
class IdentifierType(ElementIdentifier):
""" A string that is intended to uniquely identify a thing May be URI in full or compact (CURIE) form """
type_class_uri = XSD.anyURI
type_class_curie = "xsd:anyURI"
type_name = "identifier type"
type_model_uri = BIOLINK.IdentifierType
class IriType(Uriorcurie):
""" An IRI """
type_class_uri = XSD.anyURI
type_class_curie = "xsd:anyURI"
type_name = "iri type"
type_model_uri = BIOLINK.IriType
class LabelType(String):
""" A string that provides a human-readable name for a thing """
type_class_uri = XSD.string
type_class_curie = "xsd:string"
type_name = "label type"
type_model_uri = BIOLINK.LabelType
class NarrativeText(String):
""" A string that provides a human-readable description of something """
type_class_uri = XSD.string
type_class_curie = "xsd:string"
type_name = "narrative text"
type_model_uri = BIOLINK.NarrativeText
class SymbolType(String):
type_class_uri = XSD.string
type_class_curie = "xsd:string"
type_name = "symbol type"
type_model_uri = BIOLINK.SymbolType
class Frequency(String):
type_class_uri = UO["0000105"]
type_class_curie = "UO:0000105"
type_name = "frequency"
type_model_uri = BIOLINK.Frequency
class PercentageFrequencyValue(Double):
type_class_uri = UO["0000187"]
type_class_curie = "UO:0000187"
type_name = "percentage frequency value"
type_model_uri = BIOLINK.PercentageFrequencyValue
class Quotient(Double):
type_class_uri = UO["0010006"]
type_class_curie = "UO:0010006"
type_name = "quotient"
type_model_uri = BIOLINK.Quotient
class Unit(String):
type_class_uri = UO["0000000"]
type_class_curie = "UO:0000000"
type_name = "unit"
type_model_uri = BIOLINK.Unit
class TimeType(Time):
type_class_uri = XSD.dateTime
type_class_curie = "xsd:dateTime"
type_name = "time type"
type_model_uri = BIOLINK.TimeType
class BiologicalSequence(String):
type_class_uri = XSD.string
type_class_curie = "xsd:string"
type_name = "biological sequence"
type_model_uri = BIOLINK.BiologicalSequence
# Class references
class AttributeId(ElementIdentifier):
pass
class BiologicalSexId(AttributeId):
pass
class PhenotypicSexId(BiologicalSexId):
pass
class GenotypicSexId(BiologicalSexId):
pass
class SeverityValueId(AttributeId):
pass
class FrequencyValueId(AttributeId):
pass
class ClinicalModifierId(AttributeId):
pass
class OnsetId(AttributeId):
pass
class NamedThingId(ElementIdentifier):
pass
class DataFileId(NamedThingId):
pass
class SourceFileId(DataFileId):
pass
class DataSetId(NamedThingId):
pass
class DataSetVersionId(DataSetId):
pass
class DistributionLevelId(DataSetVersionId):
pass
class DataSetSummaryId(DataSetVersionId):
pass
class BiologicalEntityId(NamedThingId):
pass
class OntologyClassId(NamedThingId):
pass
class RelationshipTypeId(OntologyClassId):
pass
class GeneOntologyClassId(OntologyClassId):
pass
class OrganismTaxonId(OntologyClassId):
pass
class OrganismalEntityId(BiologicalEntityId):
pass
class IndividualOrganismId(OrganismalEntityId):
pass
class CaseId(IndividualOrganismId):
pass
class PopulationOfIndividualOrganismsId(OrganismalEntityId):
pass
class MaterialSampleId(NamedThingId):
pass
class DiseaseOrPhenotypicFeatureId(BiologicalEntityId):
pass
class DiseaseId(DiseaseOrPhenotypicFeatureId):
pass
class PhenotypicFeatureId(DiseaseOrPhenotypicFeatureId):
pass
class EnvironmentId(BiologicalEntityId):
pass
class InformationContentEntityId(NamedThingId):
pass
class ConfidenceLevelId(InformationContentEntityId):
pass
class EvidenceTypeId(InformationContentEntityId):
pass
class PublicationId(InformationContentEntityId):
pass
class AdministrativeEntityId(NamedThingId):
pass
class ProviderId(AdministrativeEntityId):
pass
class MolecularEntityId(BiologicalEntityId):
pass
class ChemicalSubstanceId(MolecularEntityId):
pass
class CarbohydrateId(ChemicalSubstanceId):
pass
class DrugId(ChemicalSubstanceId):
pass
class MetaboliteId(ChemicalSubstanceId):
pass
class AnatomicalEntityId(OrganismalEntityId):
pass
class LifeStageId(OrganismalEntityId):
pass
class PlanetaryEntityId(NamedThingId):
pass
class EnvironmentalProcessId(PlanetaryEntityId):
pass
class EnvironmentalFeatureId(PlanetaryEntityId):
pass
class ClinicalEntityId(NamedThingId):
pass
class ClinicalTrialId(ClinicalEntityId):
pass
class ClinicalInterventionId(ClinicalEntityId):
pass
class DeviceId(NamedThingId):
pass
class GenomicEntityId(MolecularEntityId):
pass
class GenomeId(GenomicEntityId):
pass
class TranscriptId(GenomicEntityId):
pass
class ExonId(GenomicEntityId):
pass
class CodingSequenceId(GenomicEntityId):
pass
class MacromolecularMachineId(GenomicEntityId):
pass
class GeneOrGeneProductId(MacromolecularMachineId):
pass
class GeneId(GeneOrGeneProductId):
pass
class GeneProductId(GeneOrGeneProductId):
pass
class ProteinId(GeneProductId):
pass
class GeneProductIsoformId(GeneProductId):
pass
class ProteinIsoformId(ProteinId):
pass
class RNAProductId(GeneProductId):
pass
class RNAProductIsoformId(RNAProductId):
pass
class NoncodingRNAProductId(RNAProductId):
pass
class MicroRNAId(NoncodingRNAProductId):
pass
class MacromolecularComplexId(MacromolecularMachineId):
pass
class GeneFamilyId(MolecularEntityId):
pass
class ZygosityId(AttributeId):
pass
class GenotypeId(GenomicEntityId):
pass
class HaplotypeId(GenomicEntityId):
pass
class SequenceVariantId(GenomicEntityId):
pass
class DrugExposureId(EnvironmentId):
pass
class TreatmentId(EnvironmentId):
pass
class GeographicLocationId(PlanetaryEntityId):
pass
class GeographicLocationAtTimeId(GeographicLocationId):
pass
class AssociationId(ElementIdentifier):
pass
class GenotypeToGenotypePartAssociationId(AssociationId):
pass
class GenotypeToGeneAssociationId(AssociationId):
pass
class GenotypeToVariantAssociationId(AssociationId):
pass
class GeneToGeneAssociationId(AssociationId):
pass
class GeneToGeneHomologyAssociationId(GeneToGeneAssociationId):
pass
class PairwiseInteractionAssociationId(AssociationId):
pass
class PairwiseGeneToGeneInteractionId(GeneToGeneAssociationId):
pass
class CellLineToThingAssociationId(AssociationId):
pass
class CellLineToDiseaseOrPhenotypicFeatureAssociationId(AssociationId):
pass
class ChemicalToThingAssociationId(AssociationId):
pass
class CaseToThingAssociationId(AssociationId):
pass
class ChemicalToChemicalAssociationId(AssociationId):
pass
class ChemicalToChemicalDerivationAssociationId(ChemicalToChemicalAssociationId):
pass
class ChemicalToDiseaseOrPhenotypicFeatureAssociationId(AssociationId):
pass
class ChemicalToPathwayAssociationId(AssociationId):
pass
class ChemicalToGeneAssociationId(AssociationId):
pass
class MaterialSampleToThingAssociationId(AssociationId):
pass
class MaterialSampleDerivationAssociationId(AssociationId):
pass
class MaterialSampleToDiseaseOrPhenotypicFeatureAssociationId(AssociationId):
pass
class EntityToPhenotypicFeatureAssociationId(AssociationId):
pass
class DiseaseOrPhenotypicFeatureAssociationToThingAssociationId(AssociationId):
pass
class DiseaseOrPhenotypicFeatureAssociationToLocationAssociationId(DiseaseOrPhenotypicFeatureAssociationToThingAssociationId):
pass
class ThingToDiseaseOrPhenotypicFeatureAssociationId(AssociationId):
pass
class DiseaseToThingAssociationId(AssociationId):
pass
class GenotypeToPhenotypicFeatureAssociationId(AssociationId):
pass
class EnvironmentToPhenotypicFeatureAssociationId(AssociationId):
pass
class DiseaseToPhenotypicFeatureAssociationId(AssociationId):
pass
class CaseToPhenotypicFeatureAssociationId(AssociationId):
pass
class GeneToThingAssociationId(AssociationId):
pass
class VariantToThingAssociationId(AssociationId):
pass
class GeneToPhenotypicFeatureAssociationId(AssociationId):
pass
class GeneToDiseaseAssociationId(AssociationId):
pass
class VariantToPopulationAssociationId(AssociationId):
pass
class PopulationToPopulationAssociationId(AssociationId):
pass
class VariantToPhenotypicFeatureAssociationId(AssociationId):
pass
class VariantToDiseaseAssociationId(AssociationId):
pass
class GeneAsAModelOfDiseaseAssociationId(GeneToDiseaseAssociationId):
pass
class GeneHasVariantThatContributesToDiseaseAssociationId(GeneToDiseaseAssociationId):
pass
class GenotypeToThingAssociationId(AssociationId):
pass
class GeneToExpressionSiteAssociationId(AssociationId):
pass
class SequenceVariantModulatesTreatmentAssociationId(AssociationId):
pass
class FunctionalAssociationId(AssociationId):
pass
class MacromolecularMachineToMolecularActivityAssociationId(FunctionalAssociationId):
pass
class MacromolecularMachineToBiologicalProcessAssociationId(FunctionalAssociationId):
pass
class MacromolecularMachineToCellularComponentAssociationId(FunctionalAssociationId):
pass
class GeneToGoTermAssociationId(FunctionalAssociationId):
pass
class GenomicSequenceLocalizationId(AssociationId):
pass
class SequenceFeatureRelationshipId(AssociationId):
pass
class TranscriptToGeneRelationshipId(SequenceFeatureRelationshipId):
pass
class GeneToGeneProductRelationshipId(SequenceFeatureRelationshipId):
pass
class ExonToTranscriptRelationshipId(SequenceFeatureRelationshipId):
pass
class GeneRegulatoryRelationshipId(AssociationId):
pass
class AnatomicalEntityToAnatomicalEntityAssociationId(AssociationId):
pass
class AnatomicalEntityToAnatomicalEntityPartOfAssociationId(AnatomicalEntityToAnatomicalEntityAssociationId):
pass
class AnatomicalEntityToAnatomicalEntityOntogenicAssociationId(AnatomicalEntityToAnatomicalEntityAssociationId):
pass
class OccurrentId(NamedThingId):
pass
class PhysicalEntityId(NamedThingId):
pass
class BiologicalProcessOrActivityId(BiologicalEntityId):
pass
class MolecularActivityId(BiologicalProcessOrActivityId):
pass
class ActivityAndBehaviorId(OccurrentId):
pass
class ProcedureId(OccurrentId):
pass
class PhenomenonId(OccurrentId):
pass
class BiologicalProcessId(BiologicalProcessOrActivityId):
pass
class PathwayId(BiologicalProcessId):
pass
class PhysiologicalProcessId(BiologicalProcessId):
pass
class CellularComponentId(AnatomicalEntityId):
pass
class CellId(AnatomicalEntityId):
pass
class CellLineId(OrganismalEntityId):
pass
class GrossAnatomicalStructureId(AnatomicalEntityId):
pass
class AbstractEntity(YAMLRoot):
"""
Any thing that is not a process or a physical mass-bearing entity
"""
_inherited_slots: ClassVar[List[str]] = []
class_class_uri: ClassVar[URIRef] = BIOLINK.AbstractEntity
class_class_curie: ClassVar[str] = "biolink:AbstractEntity"
class_name: ClassVar[str] = "abstract entity"
class_model_uri: ClassVar[URIRef] = BIOLINK.AbstractEntity
@dataclass
class Attribute(AbstractEntity):
"""
A property or characteristic of an entity. For example, an apple may have properties such as color, shape, age,
crispiness. An environmental sample may have attributes such as depth, lat, long, material.
"""
_inherited_slots: ClassVar[List[str]] = ["related_to", "interacts_with", "subclass_of"]
class_class_uri: ClassVar[URIRef] = BIOLINK.Attribute
class_class_curie: ClassVar[str] = "biolink:Attribute"
class_name: ClassVar[str] = "attribute"
class_model_uri: ClassVar[URIRef] = BIOLINK.Attribute
id: Union[ElementIdentifier, AttributeId] = None
name: Union[str, LabelType] = None
category: List[Union[str, IriType]] = empty_list()
has_attribute_type: Optional[Union[ElementIdentifier, OntologyClassId]] = None
has_quantitative_value: List[Union[dict, "QuantityValue"]] = empty_list()
has_qualitative_value: Optional[Union[ElementIdentifier, NamedThingId]] = None
def __post_init__(self):
if self.id is None:
raise ValueError(f"id must be supplied")
if not isinstance(self.id, AttributeId):
self.id = AttributeId(self.id)
if self.has_attribute_type is not None and not isinstance(self.has_attribute_type, OntologyClassId):
self.has_attribute_type = OntologyClassId(self.has_attribute_type)
self.has_quantitative_value = [v if isinstance(v, QuantityValue)
else QuantityValue(**v) for v in self.has_quantitative_value]
if self.has_qualitative_value is not None and not isinstance(self.has_qualitative_value, NamedThingId):
self.has_qualitative_value = NamedThingId(self.has_qualitative_value)
super().__post_init__()
@dataclass
class QuantityValue(AbstractEntity):
"""
A value of an attribute that is quantitative and measurable, expressed as a combination of a unit and a numeric
value
"""
_inherited_slots: ClassVar[List[str]] = []
class_class_uri: ClassVar[URIRef] = BIOLINK.QuantityValue
class_class_curie: ClassVar[str] = "biolink:QuantityValue"
class_name: ClassVar[str] = "quantity value"
class_model_uri: ClassVar[URIRef] = BIOLINK.QuantityValue
has_unit: Optional[Union[str, Unit]] = None
has_numeric_value: Optional[float] = None
def __post_init__(self):
if self.has_unit is not None and not isinstance(self.has_unit, Unit):
self.has_unit = Unit(self.has_unit)
super().__post_init__()
@dataclass
class BiologicalSex(Attribute):
_inherited_slots: ClassVar[List[str]] = ["related_to", "interacts_with", "subclass_of"]
class_class_uri: ClassVar[URIRef] = BIOLINK.BiologicalSex
class_class_curie: ClassVar[str] = "biolink:BiologicalSex"
class_name: ClassVar[str] = "biological sex"
class_model_uri: ClassVar[URIRef] = BIOLINK.BiologicalSex
id: Union[ElementIdentifier, BiologicalSexId] = None
name: Union[str, LabelType] = None
category: List[Union[str, IriType]] = empty_list()
def __post_init__(self):
if self.id is None:
raise ValueError(f"id must be supplied")
if not isinstance(self.id, BiologicalSexId):
self.id = BiologicalSexId(self.id)
super().__post_init__()
@dataclass
class PhenotypicSex(BiologicalSex):
"""
An attribute corresponding to the phenotypic sex of the individual, based upon the reproductive organs present.
"""
_inherited_slots: ClassVar[List[str]] = ["related_to", "interacts_with", "subclass_of"]
class_class_uri: ClassVar[URIRef] = BIOLINK.PhenotypicSex
class_class_curie: ClassVar[str] = "biolink:PhenotypicSex"
class_name: ClassVar[str] = "phenotypic sex"
class_model_uri: ClassVar[URIRef] = BIOLINK.PhenotypicSex
id: Union[ElementIdentifier, PhenotypicSexId] = None
name: Union[str, LabelType] = None
category: List[Union[str, IriType]] = empty_list()
def __post_init__(self):
if self.id is None:
raise ValueError(f"id must be supplied")
if not isinstance(self.id, PhenotypicSexId):
self.id = PhenotypicSexId(self.id)
super().__post_init__()
@dataclass
class GenotypicSex(BiologicalSex):
"""
An attribute corresponding to the genotypic sex of the individual, based upon genotypic composition of sex
chromosomes.
"""
_inherited_slots: ClassVar[List[str]] = ["related_to", "interacts_with", "subclass_of"]
class_class_uri: ClassVar[URIRef] = BIOLINK.GenotypicSex
class_class_curie: ClassVar[str] = "biolink:GenotypicSex"
class_name: ClassVar[str] = "genotypic sex"
class_model_uri: ClassVar[URIRef] = BIOLINK.GenotypicSex
id: Union[ElementIdentifier, GenotypicSexId] = None
name: Union[str, LabelType] = None
category: List[Union[str, IriType]] = empty_list()
def __post_init__(self):
if self.id is None:
raise ValueError(f"id must be supplied")
if not isinstance(self.id, GenotypicSexId):
self.id = GenotypicSexId(self.id)
super().__post_init__()
@dataclass
class SeverityValue(Attribute):
"""
describes the severity of a phenotypic feature or disease
"""
_inherited_slots: ClassVar[List[str]] = ["related_to", "interacts_with", "subclass_of"]
class_class_uri: ClassVar[URIRef] = BIOLINK.SeverityValue
class_class_curie: ClassVar[str] = "biolink:SeverityValue"
class_name: ClassVar[str] = "severity value"
class_model_uri: ClassVar[URIRef] = BIOLINK.SeverityValue
id: Union[ElementIdentifier, SeverityValueId] = None
name: Union[str, LabelType] = None
category: List[Union[str, IriType]] = empty_list()
def __post_init__(self):
if self.id is None:
raise ValueError(f"id must be supplied")
if not isinstance(self.id, SeverityValueId):
self.id = SeverityValueId(self.id)
super().__post_init__()
@dataclass
class FrequencyValue(Attribute):
"""
describes the frequency of occurrence of an event or condition
"""
_inherited_slots: ClassVar[List[str]] = ["related_to", "interacts_with", "subclass_of"]
class_class_uri: ClassVar[URIRef] = BIOLINK.FrequencyValue
class_class_curie: ClassVar[str] = "biolink:FrequencyValue"
class_name: ClassVar[str] = "frequency value"
class_model_uri: ClassVar[URIRef] = BIOLINK.FrequencyValue
id: Union[ElementIdentifier, FrequencyValueId] = None
name: Union[str, LabelType] = None
category: List[Union[str, IriType]] = empty_list()
def __post_init__(self):
if self.id is None:
raise ValueError(f"id must be supplied")
if not isinstance(self.id, FrequencyValueId):
self.id = FrequencyValueId(self.id)
super().__post_init__()
@dataclass
class ClinicalModifier(Attribute):
"""
Used to characterize and specify the phenotypic abnormalities defined in the Phenotypic abnormality subontology,
with respect to severity, laterality, age of onset, and other aspects
"""
_inherited_slots: ClassVar[List[str]] = ["related_to", "interacts_with", "subclass_of"]
class_class_uri: ClassVar[URIRef] = BIOLINK.ClinicalModifier
class_class_curie: ClassVar[str] = "biolink:ClinicalModifier"
class_name: ClassVar[str] = "clinical modifier"
class_model_uri: ClassVar[URIRef] = BIOLINK.ClinicalModifier
id: Union[ElementIdentifier, ClinicalModifierId] = None
name: Union[str, LabelType] = None
category: List[Union[str, IriType]] = empty_list()
def __post_init__(self):
if self.id is None:
raise ValueError(f"id must be supplied")
if not isinstance(self.id, ClinicalModifierId):
self.id = ClinicalModifierId(self.id)
super().__post_init__()
@dataclass
class Onset(Attribute):
"""
The age group in which manifestations appear
"""
_inherited_slots: ClassVar[List[str]] = ["related_to", "interacts_with", "subclass_of"]
class_class_uri: ClassVar[URIRef] = HP["0003674"]
class_class_curie: ClassVar[str] = "HP:0003674"
class_name: ClassVar[str] = "onset"
class_model_uri: ClassVar[URIRef] = BIOLINK.Onset
id: Union[ElementIdentifier, OnsetId] = None
name: Union[str, LabelType] = None
category: List[Union[str, IriType]] = empty_list()
def __post_init__(self):
if self.id is None:
raise ValueError(f"id must be supplied")
if not isinstance(self.id, OnsetId):
self.id = OnsetId(self.id)