From fc41591d2c1ec473646972f34cf9ee61f3021577 Mon Sep 17 00:00:00 2001 From: uhbrar Date: Thu, 12 Feb 2026 14:35:17 -0500 Subject: [PATCH 1/3] consolodate classes --- TranslatorReasonerAPI.yaml | 146 ++++++++++++++----------------------- 1 file changed, 53 insertions(+), 93 deletions(-) diff --git a/TranslatorReasonerAPI.yaml b/TranslatorReasonerAPI.yaml index 7dc93b8..3b023a9 100644 --- a/TranslatorReasonerAPI.yaml +++ b/TranslatorReasonerAPI.yaml @@ -528,9 +528,7 @@ components: description: >- QueryGraph object that contains a serialization of a query in the form of a graph - oneOf: - - $ref: '#/components/schemas/QueryGraph' - - $ref: '#/components/schemas/PathfinderQueryGraph' + $ref: '#/components/schemas/QueryGraph' knowledge_graph: $ref: '#/components/schemas/KnowledgeGraph' description: >- @@ -621,9 +619,7 @@ components: The list of all Analysis components that contribute to the result. See below for Analysis components. items: - oneOf: - - $ref: '#/components/schemas/Analysis' - - $ref: '#/components/schemas/PathfinderAnalysis' + $ref: '#/components/schemas/Analysis' minItems: 1 additionalProperties: true required: @@ -658,7 +654,7 @@ components: additionalProperties: true required: - id - BaseAnalysis: + Analysis: type: object description: >- An analysis is a dictionary that contains information about @@ -672,6 +668,30 @@ components: resource_id: $ref: '#/components/schemas/CURIE' description: The id of the resource generating this Analysis + edge_bindings: + type: object + minProperties: 1 + description: >- + The dictionary of input Query Graph to Knowledge Graph edge + bindings where the dictionary keys are the key identifiers of + the Query Graph edges and the associated values of those keys + are instances of EdgeBinding schema type (see below). This + value is an array of EdgeBindings since a given query edge may + resolve to multiple Knowledge Graph Edges. + additionalProperties: + type: array + items: + $ref: '#/components/schemas/EdgeBinding' + path_bindings: + type: object + minProperties: 1 + description: >- + The dictionary of input Query Graph paths to Analysis paths, + specifically only for pathfinder queries. + additionalProperties: + type: array + items: + $ref: '#/components/schemas/PathBinding' score: type: number format: float @@ -705,50 +725,10 @@ components: additionalProperties: true required: - resource_id - Analysis: - allOf: - - $ref: '#/components/schemas/BaseAnalysis' - - type: object - description: >- - An analysis for results from a non-Pathfinder query SHOULD have - edge_bindings and SHOULD NOT have path_bindings - required: - - edge_bindings - properties: - edge_bindings: - type: object - minProperties: 1 - description: >- - The dictionary of input Query Graph to Knowledge Graph edge - bindings where the dictionary keys are the key identifiers of - the Query Graph edges and the associated values of those keys - are instances of EdgeBinding schema type (see below). This - value is an array of EdgeBindings since a given query edge may - resolve to multiple Knowledge Graph Edges. - additionalProperties: - type: array - items: - $ref: '#/components/schemas/EdgeBinding' - PathfinderAnalysis: - allOf: - - $ref: '#/components/schemas/BaseAnalysis' - - type: object - description: >- - An analysis for results from a Pathfinder query SHOULD have - path_bindings and SHOULD NOT have edge_bindings - required: - - path_bindings - properties: - path_bindings: - type: object - minProperties: 1 - description: >- - The dictionary of input Query Graph paths to Analysis paths, - specifically only for pathfinder queries. - additionalProperties: - type: array - items: - $ref: '#/components/schemas/PathBinding' + oneOf: + - required: [edge_bindings] + - required: [path_bindings] + - required: [edge_bindings, path_bindings] EdgeBinding: type: object description: >- @@ -834,7 +814,7 @@ components: required: - nodes - edges - BaseQueryGraph: + QueryGraph: type: object description: >- A graph representing a biomedical question. It serves as a template for @@ -849,50 +829,30 @@ components: on bound nodes. additionalProperties: $ref: '#/components/schemas/QNode' + edges: + type: object + description: >- + The edge specifications. The keys of this map are unique edge + identifiers and the corresponding values include the constraints + on bound edges, in addition to specifying the subject and object + QNodes. + additionalProperties: + $ref: '#/components/schemas/QEdge' + paths: + type: object + description: >- + The QueryGraph path specification, used only for pathfinder type + queries. The keys of this map are unique path identifiers and + the corresponding values include the constraints on bound paths, + in addition to specifying the subject, object, and intermediate + QNodes. + additionalProperties: + $ref: '#/components/schemas/QPath' + minProperties: 1 + maxProperties: 1 additionalProperties: true required: - nodes - QueryGraph: - allOf: - - $ref: '#/components/schemas/BaseQueryGraph' - - type: object - description: >- - A non-Pathfinder query SHOULD have edges following the QEdge schema - and SHOULD NOT have paths - required: - - edges - properties: - edges: - type: object - description: >- - The edge specifications. The keys of this map are unique edge - identifiers and the corresponding values include the constraints - on bound edges, in addition to specifying the subject and object - QNodes. - additionalProperties: - $ref: '#/components/schemas/QEdge' - PathfinderQueryGraph: - allOf: - - $ref: '#/components/schemas/BaseQueryGraph' - - type: object - description: >- - A Pathfinder query SHOULD have paths following the QPath schema - and SHOULD NOT have edges - required: - - paths - properties: - paths: - type: object - description: >- - The QueryGraph path specification, used only for pathfinder type - queries. The keys of this map are unique path identifiers and - the corresponding values include the constraints on bound paths, - in addition to specifying the subject, object, and intermediate - QNodes. - additionalProperties: - $ref: '#/components/schemas/QPath' - minProperties: 1 - maxProperties: 1 QNode: type: object description: A node in the QueryGraph used to represent an entity in a From 848550aa07054ccb4fbeff18f68758cdd93661b0 Mon Sep 17 00:00:00 2001 From: uhbrar Date: Thu, 12 Feb 2026 14:35:42 -0500 Subject: [PATCH 2/3] make analyses not required --- TranslatorReasonerAPI.yaml | 1 - single_node_example.json | 211 +++++++++++++++++++++++++++++++++++++ 2 files changed, 211 insertions(+), 1 deletion(-) create mode 100644 single_node_example.json diff --git a/TranslatorReasonerAPI.yaml b/TranslatorReasonerAPI.yaml index 3b023a9..0831d4e 100644 --- a/TranslatorReasonerAPI.yaml +++ b/TranslatorReasonerAPI.yaml @@ -624,7 +624,6 @@ components: additionalProperties: true required: - node_bindings - - analyses NodeBinding: type: object description: >- diff --git a/single_node_example.json b/single_node_example.json new file mode 100644 index 0000000..c77c7b6 --- /dev/null +++ b/single_node_example.json @@ -0,0 +1,211 @@ +{ + "message": { + "query_graph": { + "nodes": { + "n0": { + "categories": [ + "biolink:Disease" + ], + "constraints": [], + "ids": [ + "MONDO:0004979" + ] + } + } + }, + "knowledge_graph": { + "nodes": { + "MONDO:0004979": { + "categories": [ + "biolink:BiologicalEntity", + "biolink:Disease", + "biolink:ThingWithTaxon", + "biolink:NamedThing", + "biolink:DiseaseOrPhenotypicFeature" + ], + "name": "asthma", + "attributes": [ + { + "attribute_type_id": "biolink:log_odds_ratio_95_ci", + "value": 100.0, + "value_type_id": "EDAM:data_0006", + "original_attribute_name": "information_content" + }, + { + "attribute_type_id": "biolink:Attribute", + "value": 77.1, + "original_attribute_name": "information_content" + }, + { + "attribute_type_id": "biolink:description", + "value": "Asthma is characterized by increased responsiveness of the tracheobronchial tree to multiple stimuli, leading to narrowing of the air passages with resultant dyspnea, cough, and wheezing. [HPO:probinson]; UMLS Semantic Type: STY:T047; Asthma is characterized by increased responsiveness of the tracheobronchial tree to multiple stimuli, leading to narrowing of the air passages with resultant dyspnea, cough, and wheezing.; Asthma is characterized by increased responsiveness of the tracheobronchial tree to multiple stimuli, leading to narrowing of the air passages with resultant dyspnea, cough, and wheezing.; ; Asthma is characterized by increased responsiveness of the tracheobronchial tree to multiple stimuli, leading to narrowing of the air passages with resultant dyspnea, cough, and wheezing.", + "value_type_id": "metatype:String", + "attribute_source": "infores:rtx-kg2" + }, + { + "attribute_type_id": "biolink:Attribute", + "value": true, + "original_attribute_name": "MONDO_SUPERCLASS_disease" + }, + { + "attribute_type_id": "dct:description", + "value": "A bronchial disease that is characterized by chronic inflammation and narrowing of the airways, which is caused by a combination of environmental and genetic factors resulting in recurring periods of wheezing (a whistling sound while breathing), chest tightness, shortness of breath, mucus production and coughing. The symptoms appear due to a variety of triggers such as allergens, irritants, respiratory infections, weather changes, exercise, stress, reflux disease, medications, foods and emotional anxiety.", + "value_type_id": "EDAM:data_0006", + "original_attribute_name": "description" + }, + { + "attribute_type_id": "biolink:Attribute", + "value": 77.4, + "original_attribute_name": "information_content" + }, + { + "attribute_type_id": "biolink:Attribute", + "value": true, + "original_attribute_name": "MONDO_SUPERCLASS_lower_respiratory_tract_disorder" + }, + { + "attribute_type_id": "biolink:Attribute", + "value": [ + "MEDDRA:10003553", + "MEDDRA:10037993", + "MONDO:0004979", + "MEDDRA:10003560", + "ICD10:J45", + "UMLS:C3714497", + "KEGG.DISEASE:05310", + "UMLS:C0004096", + "MEDDRA:10003565", + "MEDDRA:10066863", + "MESH:D001249", + "MEDDRA:10066091", + "MEDDRA:10003555", + "ICD9:493", + "NCIT:C28397", + "MESH:D016535", + "SNOMEDCT:195967001", + "MEDDRA:10003561", + "UMLS:C0085129", + "MEDDRA:10056285", + "HP:0002099", + "MEDDRA:10006450", + "MEDDRA:10082852", + "UMLS:C0340062", + "DOID:2841", + "SNOMEDCT:991000119106", + "icd11.foundation:1656445230", + "medgen:2109" + ], + "original_attribute_name": "equivalent_identifiers" + }, + { + "attribute_type_id": "biolink:description", + "value": "A bronchial disease that is characterized by chronic inflammation and narrowing of the airways, which is caused by a combination of environmental and genetic factors resulting in recurring periods of wheezing (a whistling sound while breathing), chest tightness, shortness of breath, mucus production and coughing. The symptoms appear due to a variety of triggers such as allergens, irritants, respiratory infections, weather changes, exercise, stress, reflux disease, medications, foods and emotional anxiety.", + "value_type_id": "dct:description", + "original_attribute_name": "description" + }, + { + "attribute_type_id": "biolink:Attribute", + "value": [ + "MONDO:0004979", + "DOID:2841", + "UMLS:C0004096", + "UMLS:C0085129", + "UMLS:C0340062", + "UMLS:C3714497", + "MESH:D001249", + "MESH:D016535", + "MEDDRA:10003553", + "MEDDRA:10003555", + "MEDDRA:10003560", + "MEDDRA:10003561", + "MEDDRA:10003565", + "MEDDRA:10006450", + "MEDDRA:10037993", + "MEDDRA:10056285", + "MEDDRA:10066091", + "MEDDRA:10066863", + "MEDDRA:10082852", + "NCIT:C28397", + "SNOMEDCT:195967001", + "SNOMEDCT:991000119106", + "ICD10:J45", + "ICD9:493", + "KEGG.DISEASE:05310", + "HP:0002099" + ], + "original_attribute_name": "equivalent_identifiers" + }, + { + "attribute_type_id": "biolink:Attribute", + "value": true, + "original_attribute_name": "MONDO_SUPERCLASS_human_disease" + }, + { + "attribute_type_id": "biolink:synonym", + "value": [ + "Asthma", + "Reactive airway disease", + "bronchial hyperreactivity", + "asthma", + "Bronchial Hyperreactivity" + ], + "value_type_id": "metatype:String", + "attribute_source": "infores:rtx-kg2", + "description": "Names of all nodes in this synonym set in RTX-KG2." + }, + { + "attribute_type_id": "biolink:IriType", + "value": "http://purl.obolibrary.org/obo/MONDO_0004979", + "value_type_id": "metatype:Uri", + "attribute_source": "infores:rtx-kg2" + }, + { + "attribute_type_id": "biolink:log_odds_ratio_95_ci", + "value": [ + "MONDO:0004979", + "DOID:2841", + "UMLS:C0004099", + "MESH:D001249", + "MESH:D001250", + "MEDDRA:10003557", + "MEDDRA:10015649", + "MEDDRA:10079895", + "NCIT:C28397", + "SNOMEDCT:31387002", + "medgen:2109", + "ICD10:J45", + "ICD9:493", + "KEGG.DISEASE:05310", + "HP:0012652" + ], + "value_type_id": "EDAM:data_0006", + "original_attribute_name": "equivalent_identifiers" + }, + { + "attribute_type_id": "biolink:Attribute", + "value": true, + "original_attribute_name": "MONDO_SUPERCLASS_respiratory_system_disorder" + }, + { + "attribute_type_id": "biolink:Attribute", + "value": 78.2, + "original_attribute_name": "information_content" + } + ] + } + } + }, + "results": [ + { + "node_bindings": { + "n0": [ + { + "id": "MONDO:0004979", + "attributes": [] + } + ] + } + } + ] + } +} \ No newline at end of file From f595a95511046eb1e9950bb015ef7076e94ce26f Mon Sep 17 00:00:00 2001 From: uhbrar Date: Thu, 12 Feb 2026 15:55:37 -0500 Subject: [PATCH 3/3] changes from trapi meeting --- .../DataExamples/single_node_example.json | 0 TranslatorReasonerAPI.yaml | 1 + 2 files changed, 1 insertion(+) rename single_node_example.json => ImplementationGuidance/DataExamples/single_node_example.json (100%) diff --git a/single_node_example.json b/ImplementationGuidance/DataExamples/single_node_example.json similarity index 100% rename from single_node_example.json rename to ImplementationGuidance/DataExamples/single_node_example.json diff --git a/TranslatorReasonerAPI.yaml b/TranslatorReasonerAPI.yaml index 0831d4e..bb2b6ea 100644 --- a/TranslatorReasonerAPI.yaml +++ b/TranslatorReasonerAPI.yaml @@ -837,6 +837,7 @@ components: QNodes. additionalProperties: $ref: '#/components/schemas/QEdge' + minProperties: 1 paths: type: object description: >-