From 1cbea57a0a573c02f884044397b96e6729226ad1 Mon Sep 17 00:00:00 2001 From: caufieldjh Date: Fri, 13 Sep 2024 10:13:22 -0400 Subject: [PATCH 01/13] Add comments --- src/ontogpt/templates/pathology.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ontogpt/templates/pathology.yaml b/src/ontogpt/templates/pathology.yaml index 018120ac8..faff88197 100644 --- a/src/ontogpt/templates/pathology.yaml +++ b/src/ontogpt/templates/pathology.yaml @@ -27,6 +27,14 @@ imports: # This may require instructions to reprocess the text to be more like SNOMED, e.g., # "hepatitis" doesn't have a specific term but maybe inflammation is appropriate +# TODO: Add slot to represent case of benign tissue, e.g., "benign colonic mucosa" + +# TODO: For SNOMED, exclude qualifiers + +# TODO: Add more annotators (NCIT, MeSH, MONDO, DO, ICD10) + +# TODO: Include final classification of the overall pathology + classes: PathologyReport: From bb990b53d6b4f5100178cdd79f4b27657aa5d869 Mon Sep 17 00:00:00 2001 From: caufieldjh Date: Wed, 18 Sep 2024 14:35:30 -0400 Subject: [PATCH 02/13] Restrict SNOMEDCT IDs to clinical finding children --- src/ontogpt/templates/pathology.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/ontogpt/templates/pathology.yaml b/src/ontogpt/templates/pathology.yaml index faff88197..120e1d397 100644 --- a/src/ontogpt/templates/pathology.yaml +++ b/src/ontogpt/templates/pathology.yaml @@ -35,6 +35,8 @@ imports: # TODO: Include final classification of the overall pathology +# TODO: SNOMEDCT:385432009 is properly grounded from "N/A" but it should be kept as N/A + classes: PathologyReport: @@ -116,6 +118,10 @@ classes: - SNOMEDCT annotations: annotators: bioportal:SNOMEDCT + slot_usage: + id: + values_from: + - SNOMEDClinicalFinding AnatomicalEntity: is_a: NamedEntity @@ -123,3 +129,11 @@ classes: - UBERON annotations: annotators: sqlite:obo:uberon + +enums: + + SNOMEDClinicalFinding: + reachable_from: + source_ontology: bioportal:SNOMEDCT + source_nodes: + - SNOMEDCT:404684003 ## Clinical finding From b0244b1776da224e4817a8a49969e5046deb1daa Mon Sep 17 00:00:00 2001 From: caufieldjh Date: Wed, 18 Sep 2024 14:50:38 -0400 Subject: [PATCH 03/13] Changes to SNOMED clinical finding enum to try value set expansion --- src/ontogpt/templates/pathology.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ontogpt/templates/pathology.yaml b/src/ontogpt/templates/pathology.yaml index 120e1d397..83a924912 100644 --- a/src/ontogpt/templates/pathology.yaml +++ b/src/ontogpt/templates/pathology.yaml @@ -134,6 +134,8 @@ enums: SNOMEDClinicalFinding: reachable_from: - source_ontology: bioportal:SNOMEDCT + source_ontology: "snomedct:clinical_findings" + relationship_types: + - rdfs:subClassOf source_nodes: - SNOMEDCT:404684003 ## Clinical finding From 9695ca8cdc0c6d40afae404059926f734ef8db66 Mon Sep 17 00:00:00 2001 From: caufieldjh Date: Wed, 18 Sep 2024 14:55:13 -0400 Subject: [PATCH 04/13] OK, dynamic enums not working for Bioportal yet --- src/ontogpt/templates/pathology.yaml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/ontogpt/templates/pathology.yaml b/src/ontogpt/templates/pathology.yaml index 83a924912..005a869bd 100644 --- a/src/ontogpt/templates/pathology.yaml +++ b/src/ontogpt/templates/pathology.yaml @@ -118,10 +118,6 @@ classes: - SNOMEDCT annotations: annotators: bioportal:SNOMEDCT - slot_usage: - id: - values_from: - - SNOMEDClinicalFinding AnatomicalEntity: is_a: NamedEntity @@ -129,13 +125,3 @@ classes: - UBERON annotations: annotators: sqlite:obo:uberon - -enums: - - SNOMEDClinicalFinding: - reachable_from: - source_ontology: "snomedct:clinical_findings" - relationship_types: - - rdfs:subClassOf - source_nodes: - - SNOMEDCT:404684003 ## Clinical finding From d5822e7a2f611d6d9b88482e41a37fadcb994096 Mon Sep 17 00:00:00 2001 From: caufieldjh Date: Wed, 18 Sep 2024 16:43:54 -0400 Subject: [PATCH 05/13] Add more annotators to Diagnosis --- src/ontogpt/templates/pathology.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ontogpt/templates/pathology.yaml b/src/ontogpt/templates/pathology.yaml index 005a869bd..d8dd566bb 100644 --- a/src/ontogpt/templates/pathology.yaml +++ b/src/ontogpt/templates/pathology.yaml @@ -71,7 +71,8 @@ classes: full diagnoses or observations, for example, "colitis", "inflammation", "dysplasia", "polyp". If not specified or cannot be identified (e.g., due to lack of tissue sample), this value must be - "N/A". + "N/A". Do not include qualifiers in this field, e.g., "active colitis" + should be "colitis". range: Diagnosis annotations: prompt.example: colitis, inflammation, dysplasia @@ -117,7 +118,7 @@ classes: id_prefixes: - SNOMEDCT annotations: - annotators: bioportal:SNOMEDCT + annotators: bioportal:SNOMEDCT, bioportal:ICD10CM, sqlite:obo:ncit, sqlite:obo:mesh, sqlite:obo:mondo AnatomicalEntity: is_a: NamedEntity From 0ec35c17bb7bac1e7c01533c25aa15e0ff0c4fd3 Mon Sep 17 00:00:00 2001 From: caufieldjh Date: Wed, 18 Sep 2024 16:57:04 -0400 Subject: [PATCH 06/13] Ground qualifiers and severity --- src/ontogpt/templates/pathology.yaml | 45 ++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 9 deletions(-) diff --git a/src/ontogpt/templates/pathology.yaml b/src/ontogpt/templates/pathology.yaml index d8dd566bb..51410ee53 100644 --- a/src/ontogpt/templates/pathology.yaml +++ b/src/ontogpt/templates/pathology.yaml @@ -31,8 +31,6 @@ imports: # TODO: For SNOMED, exclude qualifiers -# TODO: Add more annotators (NCIT, MeSH, MONDO, DO, ICD10) - # TODO: Include final classification of the overall pathology # TODO: SNOMEDCT:385432009 is properly grounded from "N/A" but it should be kept as N/A @@ -69,18 +67,19 @@ classes: description: >- The diagnosis or pathology being described. This may include full diagnoses or observations, for example, "colitis", - "inflammation", "dysplasia", "polyp". If not specified or cannot be - identified (e.g., due to lack of tissue sample), this value must be - "N/A". Do not include qualifiers in this field, e.g., "active colitis" - should be "colitis". + "inflammation", "dysplasia", "polyp". If not specified, this value + must be "Not Specified". If a diagnosis cannot be reached + (e.g., due to lack of tissue sample), this value must be + "No Diagnosis". Do not include qualifiers in this field, + e.g., "active colitis" should be "colitis". range: Diagnosis annotations: prompt.example: colitis, inflammation, dysplasia qualifiers: description: >- A semicolon-delimited list of descriptors other than those for - severity. If not specified, this value must be "N/A". - range: string + severity. If not specified, this value must be "Not Specified". + range: Qualifier annotations: prompt.example: active, chronic, focal multivalued: true @@ -88,7 +87,7 @@ classes: description: >- The severity of the pathology, for example, mild, moderate, or severe. If not specified, this value must be "N/A". - range: string + range: SeverityLevel annotations: prompt.example: mild, moderate, severe anatomical_entities: @@ -126,3 +125,31 @@ classes: - UBERON annotations: annotators: sqlite:obo:uberon + + Qualifier: + is_a: NamedEntity + id_prefixes: + - PATO + annotations: + annotators: sqlite:obo:pato + +enums: + SeverityLevel: + description: >- + The severity of a pathology. + permissible_values: + mild: + description: >- + A pathology that is mild in severity. + meaning: PATO:0000394 + moderate: + description: >- + A pathology that is moderate in severity. + meaning: PATO:0000395 + severe: + description: >- + A pathology that is severe in severity. + meaning: PATO:0000396 + Not Specified: + description: >- + The severity of the pathology is not specified. From a209baea9a2e73802d8fdd3fef24dac46c169d0f Mon Sep 17 00:00:00 2001 From: caufieldjh Date: Wed, 18 Sep 2024 17:01:32 -0400 Subject: [PATCH 07/13] Allow grounding Diagnosis to ICD10 --- src/ontogpt/templates/pathology.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/ontogpt/templates/pathology.yaml b/src/ontogpt/templates/pathology.yaml index 51410ee53..9a53ac8d0 100644 --- a/src/ontogpt/templates/pathology.yaml +++ b/src/ontogpt/templates/pathology.yaml @@ -29,12 +29,8 @@ imports: # TODO: Add slot to represent case of benign tissue, e.g., "benign colonic mucosa" -# TODO: For SNOMED, exclude qualifiers - # TODO: Include final classification of the overall pathology -# TODO: SNOMEDCT:385432009 is properly grounded from "N/A" but it should be kept as N/A - classes: PathologyReport: @@ -116,6 +112,7 @@ classes: is_a: NamedEntity id_prefixes: - SNOMEDCT + - ICD10CM annotations: annotators: bioportal:SNOMEDCT, bioportal:ICD10CM, sqlite:obo:ncit, sqlite:obo:mesh, sqlite:obo:mondo From 645867821808ae6e0570454f87801517b24a94bb Mon Sep 17 00:00:00 2001 From: caufieldjh Date: Wed, 18 Sep 2024 17:06:33 -0400 Subject: [PATCH 08/13] Add slot for benign classification --- src/ontogpt/templates/pathology.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ontogpt/templates/pathology.yaml b/src/ontogpt/templates/pathology.yaml index 9a53ac8d0..d476024da 100644 --- a/src/ontogpt/templates/pathology.yaml +++ b/src/ontogpt/templates/pathology.yaml @@ -52,6 +52,15 @@ classes: changes". range: PathologyStatement multivalued: true + is_benign: + description: >- + Whether the overall pathology appears to be benign and not malignant. + Other pathologies may be present, but if tissue is described as + benign and/or if a carcinoma is explicitly excluded, this value should + be true. It it otherwise false. + range: string + annotations: + prompt.example: true, false PathologyStatement: description: >- From 66c0dc67b0c64e5a90e686d757e38f798ee06c6d Mon Sep 17 00:00:00 2001 From: caufieldjh Date: Wed, 18 Sep 2024 17:21:11 -0400 Subject: [PATCH 09/13] Add more categorization and risk factor identification --- src/ontogpt/templates/pathology.yaml | 40 +++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/src/ontogpt/templates/pathology.yaml b/src/ontogpt/templates/pathology.yaml index d476024da..4e5fa6f34 100644 --- a/src/ontogpt/templates/pathology.yaml +++ b/src/ontogpt/templates/pathology.yaml @@ -27,8 +27,6 @@ imports: # This may require instructions to reprocess the text to be more like SNOMED, e.g., # "hepatitis" doesn't have a specific term but maybe inflammation is appropriate -# TODO: Add slot to represent case of benign tissue, e.g., "benign colonic mucosa" - # TODO: Include final classification of the overall pathology classes: @@ -57,10 +55,23 @@ classes: Whether the overall pathology appears to be benign and not malignant. Other pathologies may be present, but if tissue is described as benign and/or if a carcinoma is explicitly excluded, this value should - be true. It it otherwise false. + be true. A statement of "no significant pathologic abnormality" + or the short form "nspa" would also have a value of true. + It it otherwise false. range: string annotations: prompt.example: true, false + risks: + description: >- + A semicolon-delimited list of risks for development of + more severe pathologies. If not specified, this value must be + "Not Specified". Examples: gastric intestinal metaplasia, + ulceration, lymphangiectasia + overall_classification: + description: >- + The final classification of the overall pathology. This must be one of + the following: "Unclear", "Benign", "Malignant", or "Inflammation". + range: PathologyClassification PathologyStatement: description: >- @@ -110,9 +121,9 @@ classes: multivalued: true negative: description: >- - Whether the pathology is negative or not present. A statement of - "no significant pathologic abnormality" or the short form "nspa" - would have a value of true. + Whether the pathology is negative or not present. This must be + explicitly stated in the input, e.g., "no granulomas", in order + to be true. It is otherwise false. range: string annotations: prompt.example: true, false @@ -159,3 +170,20 @@ enums: Not Specified: description: >- The severity of the pathology is not specified. + PathologyClassification: + description: >- + The final classification of the overall pathology. + permissible_values: + Unclear: + description: >- + The final classification of the overall pathology is unclear. + Benign: + description: >- + The final classification of the overall pathology is benign. + Malignant: + description: >- + The final classification of the overall pathology is malignant. + Inflammation: + description: >- + The final classification of the overall pathology is inflammation. + From d4777ada44c2c98f6c38bc3a0baca60f7444ecc5 Mon Sep 17 00:00:00 2001 From: caufieldjh Date: Wed, 18 Sep 2024 17:21:48 -0400 Subject: [PATCH 10/13] Cleanup --- src/ontogpt/templates/pathology.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/ontogpt/templates/pathology.yaml b/src/ontogpt/templates/pathology.yaml index 4e5fa6f34..32cda4e24 100644 --- a/src/ontogpt/templates/pathology.yaml +++ b/src/ontogpt/templates/pathology.yaml @@ -27,8 +27,6 @@ imports: # This may require instructions to reprocess the text to be more like SNOMED, e.g., # "hepatitis" doesn't have a specific term but maybe inflammation is appropriate -# TODO: Include final classification of the overall pathology - classes: PathologyReport: From 3be6eae742592b8daf011be82565e0a459d23821 Mon Sep 17 00:00:00 2001 From: caufieldjh Date: Wed, 18 Sep 2024 17:26:59 -0400 Subject: [PATCH 11/13] Make risks slot multivalued --- src/ontogpt/templates/pathology.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ontogpt/templates/pathology.yaml b/src/ontogpt/templates/pathology.yaml index 32cda4e24..1f797eeda 100644 --- a/src/ontogpt/templates/pathology.yaml +++ b/src/ontogpt/templates/pathology.yaml @@ -65,6 +65,8 @@ classes: more severe pathologies. If not specified, this value must be "Not Specified". Examples: gastric intestinal metaplasia, ulceration, lymphangiectasia + range: string + multivalued: true overall_classification: description: >- The final classification of the overall pathology. This must be one of From 803b48d8a72555cb1157effa644215eb2cf9f0ee Mon Sep 17 00:00:00 2001 From: caufieldjh Date: Wed, 18 Sep 2024 17:36:05 -0400 Subject: [PATCH 12/13] Notes on the schema --- src/ontogpt/templates/pathology.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ontogpt/templates/pathology.yaml b/src/ontogpt/templates/pathology.yaml index 1f797eeda..73f036144 100644 --- a/src/ontogpt/templates/pathology.yaml +++ b/src/ontogpt/templates/pathology.yaml @@ -27,6 +27,10 @@ imports: # This may require instructions to reprocess the text to be more like SNOMED, e.g., # "hepatitis" doesn't have a specific term but maybe inflammation is appropriate +# TODO: tune the risk factor list, it seems to identify negative instances as present +# e.g. "gastric antral-type mucosa with reactive gastropathy; no helicobacter organisms, intestinal metaplasia or dysplasia; see comment." +# identifies "gastric intestinal metaplasia" as a risk factor + classes: PathologyReport: From f53238e140f2b0f4345c093b331f581e7a11335a Mon Sep 17 00:00:00 2001 From: caufieldjh Date: Wed, 18 Sep 2024 17:36:51 -0400 Subject: [PATCH 13/13] Update python classes --- src/ontogpt/templates/pathology.py | 67 +++++++++++++++++++++++++++--- 1 file changed, 61 insertions(+), 6 deletions(-) diff --git a/src/ontogpt/templates/pathology.py b/src/ontogpt/templates/pathology.py index db725e823..dad34e28d 100644 --- a/src/ontogpt/templates/pathology.py +++ b/src/ontogpt/templates/pathology.py @@ -87,6 +87,34 @@ class NullDataOptions(str, Enum): NOT_MENTIONED = "NOT_MENTIONED" +class SeverityLevel(str, Enum): + """ + The severity of a pathology. + """ + # A pathology that is mild in severity. + mild = "mild" + # A pathology that is moderate in severity. + moderate = "moderate" + # A pathology that is severe in severity. + severe = "severe" + # The severity of the pathology is not specified. + Not_Specified = "Not Specified" + + +class PathologyClassification(str, Enum): + """ + The final classification of the overall pathology. + """ + # The final classification of the overall pathology is unclear. + Unclear = "Unclear" + # The final classification of the overall pathology is benign. + Benign = "Benign" + # The final classification of the overall pathology is malignant. + Malignant = "Malignant" + # The final classification of the overall pathology is inflammation. + Inflammation = "Inflammation" + + class ExtractionResult(ConfiguredBaseModel): """ @@ -203,6 +231,12 @@ class PathologyReport(ConfiguredBaseModel): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'http://w3id.org/ontogpt/pathology', 'tree_root': True}) pathology_statements: Optional[List[PathologyStatement]] = Field(None, description="""A semicolon-delimited list of pathology statements, each describing a pathology, including any diagnoses, one or more specific qualities being measured and the anatomical location or tissue the pathology is measured in. If any of the pathology statements are negative, the negation should be included in each statment, e.g., \"no granulomas or viropathic changes\" should become \"no granulomas\" and \"no viropathic changes\".""", json_schema_extra = { "linkml_meta": {'alias': 'pathology_statements', 'domain_of': ['PathologyReport']} }) + is_benign: Optional[str] = Field(None, description="""Whether the overall pathology appears to be benign and not malignant. Other pathologies may be present, but if tissue is described as benign and/or if a carcinoma is explicitly excluded, this value should be true. A statement of \"no significant pathologic abnormality\" or the short form \"nspa\" would also have a value of true. It it otherwise false.""", json_schema_extra = { "linkml_meta": {'alias': 'is_benign', + 'annotations': {'prompt.example': {'tag': 'prompt.example', + 'value': 'true, false'}}, + 'domain_of': ['PathologyReport']} }) + risks: Optional[List[str]] = Field(None, description="""A semicolon-delimited list of risks for development of more severe pathologies. If not specified, this value must be \"Not Specified\". Examples: gastric intestinal metaplasia, ulceration, lymphangiectasia""", json_schema_extra = { "linkml_meta": {'alias': 'risks', 'domain_of': ['PathologyReport']} }) + overall_classification: Optional[PathologyClassification] = Field(None, description="""The final classification of the overall pathology. This must be one of the following: \"Unclear\", \"Benign\", \"Malignant\", or \"Inflammation\".""", json_schema_extra = { "linkml_meta": {'alias': 'overall_classification', 'domain_of': ['PathologyReport']} }) class PathologyStatement(ConfiguredBaseModel): @@ -211,16 +245,16 @@ class PathologyStatement(ConfiguredBaseModel): """ linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'http://w3id.org/ontogpt/pathology'}) - diagnosis: Optional[str] = Field(None, description="""The diagnosis or pathology being described. This may include full diagnoses or observations, for example, \"colitis\", \"inflammation\", \"dysplasia\", \"polyp\". If not specified or cannot be identified (e.g., due to lack of tissue sample), this value must be \"N/A\".""", json_schema_extra = { "linkml_meta": {'alias': 'diagnosis', + diagnosis: Optional[str] = Field(None, description="""The diagnosis or pathology being described. This may include full diagnoses or observations, for example, \"colitis\", \"inflammation\", \"dysplasia\", \"polyp\". If not specified, this value must be \"Not Specified\". If a diagnosis cannot be reached (e.g., due to lack of tissue sample), this value must be \"No Diagnosis\". Do not include qualifiers in this field, e.g., \"active colitis\" should be \"colitis\".""", json_schema_extra = { "linkml_meta": {'alias': 'diagnosis', 'annotations': {'prompt.example': {'tag': 'prompt.example', 'value': 'colitis, inflammation, ' 'dysplasia'}}, 'domain_of': ['PathologyStatement']} }) - qualifiers: Optional[List[str]] = Field(None, description="""A semicolon-delimited list of descriptors other than those for severity. If not specified, this value must be \"N/A\".""", json_schema_extra = { "linkml_meta": {'alias': 'qualifiers', + qualifiers: Optional[List[str]] = Field(None, description="""A semicolon-delimited list of descriptors other than those for severity. If not specified, this value must be \"Not Specified\".""", json_schema_extra = { "linkml_meta": {'alias': 'qualifiers', 'annotations': {'prompt.example': {'tag': 'prompt.example', 'value': 'active, chronic, focal'}}, 'domain_of': ['PathologyStatement']} }) - severity: Optional[str] = Field(None, description="""The severity of the pathology, for example, mild, moderate, or severe. If not specified, this value must be \"N/A\".""", json_schema_extra = { "linkml_meta": {'alias': 'severity', + severity: Optional[SeverityLevel] = Field(None, description="""The severity of the pathology, for example, mild, moderate, or severe. If not specified, this value must be \"N/A\".""", json_schema_extra = { "linkml_meta": {'alias': 'severity', 'annotations': {'prompt.example': {'tag': 'prompt.example', 'value': 'mild, moderate, severe'}}, 'domain_of': ['PathologyStatement']} }) @@ -229,7 +263,7 @@ class PathologyStatement(ConfiguredBaseModel): 'value': 'duodenum, colonic mucosa, ' 'liver'}}, 'domain_of': ['PathologyStatement']} }) - negative: Optional[str] = Field(None, description="""Whether the pathology is negative or not present. A statement of \"no significant pathologic abnormality\" or the short form \"nspa\" would have a value of true.""", json_schema_extra = { "linkml_meta": {'alias': 'negative', + negative: Optional[str] = Field(None, description="""Whether the pathology is negative or not present. This must be explicitly stated in the input, e.g., \"no granulomas\", in order to be true. It is otherwise false.""", json_schema_extra = { "linkml_meta": {'alias': 'negative', 'annotations': {'prompt.example': {'tag': 'prompt.example', 'value': 'true, false'}}, 'domain_of': ['PathologyStatement']} }) @@ -237,9 +271,11 @@ class PathologyStatement(ConfiguredBaseModel): class Diagnosis(NamedEntity): linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'annotations': {'annotators': {'tag': 'annotators', - 'value': 'bioportal:SNOMEDCT'}}, + 'value': 'bioportal:SNOMEDCT, ' + 'bioportal:ICD10CM, sqlite:obo:ncit, ' + 'sqlite:obo:mesh, sqlite:obo:mondo'}}, 'from_schema': 'http://w3id.org/ontogpt/pathology', - 'id_prefixes': ['SNOMEDCT']}) + 'id_prefixes': ['SNOMEDCT', 'ICD10CM']}) id: str = Field(..., description="""A unique identifier for the named entity""", json_schema_extra = { "linkml_meta": {'alias': 'id', 'annotations': {'prompt.skip': {'tag': 'prompt.skip', 'value': 'true'}}, @@ -271,6 +307,24 @@ class AnatomicalEntity(NamedEntity): 'slot_uri': 'rdfs:label'} }) +class Qualifier(NamedEntity): + linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'annotations': {'annotators': {'tag': 'annotators', + 'value': 'sqlite:obo:pato'}}, + 'from_schema': 'http://w3id.org/ontogpt/pathology', + 'id_prefixes': ['PATO']}) + + id: str = Field(..., description="""A unique identifier for the named entity""", json_schema_extra = { "linkml_meta": {'alias': 'id', + 'annotations': {'prompt.skip': {'tag': 'prompt.skip', 'value': 'true'}}, + 'comments': ['this is populated during the grounding and normalization step'], + 'domain_of': ['NamedEntity', 'Publication']} }) + label: Optional[str] = Field(None, description="""The label (name) of the named thing""", json_schema_extra = { "linkml_meta": {'alias': 'label', + 'aliases': ['name'], + 'annotations': {'owl': {'tag': 'owl', + 'value': 'AnnotationProperty, AnnotationAssertion'}}, + 'domain_of': ['NamedEntity'], + 'slot_uri': 'rdfs:label'} }) + + # Model rebuild # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model ExtractionResult.model_rebuild() @@ -286,4 +340,5 @@ class AnatomicalEntity(NamedEntity): PathologyStatement.model_rebuild() Diagnosis.model_rebuild() AnatomicalEntity.model_rebuild() +Qualifier.model_rebuild()