diff --git a/src/graph/graph.ts b/src/graph/graph.ts index 018a096b..6657ce16 100644 --- a/src/graph/graph.ts +++ b/src/graph/graph.ts @@ -104,6 +104,12 @@ export default class BTEGraph { .map((item) => { this.edges[recordHash].addAdditionalAttributes(item, record.mappedResponse[item]); }); + if (record.knowledge_level) { + this.edges[recordHash].addAdditionalAttributes('knowledge_level', record.knowledge_level); + } + if (record.agent_type) { + this.edges[recordHash].addAdditionalAttributes('agent_type', record.agent_type); + } this.edges[recordHash].addSource(record.provenanceChain); Object.entries(record.qualifiers).forEach(([qualifierType, qualifier]) => { this.edges[recordHash].addQualifier(qualifierType, qualifier); diff --git a/src/index.ts b/src/index.ts index cc4c6e01..75fee861 100644 --- a/src/index.ts +++ b/src/index.ts @@ -173,6 +173,8 @@ export default class TRAPIQueryHandler { const source = Object.entries(ontologyKnowledgeSourceMapping).find(([prefix]) => { return expanded.includes(prefix); })[1]; + subclassEdge.addAdditionalAttributes('biolink:knowledge_level', 'knowledge_assertion') + subclassEdge.addAdditionalAttributes('biolink:agent_type', 'manual_agent') subclassEdge.addSource([ { resource_id: source, resource_role: 'primary_knowledge_source' }, { @@ -221,6 +223,8 @@ export default class TRAPIQueryHandler { object: object, }); boundEdge.addAdditionalAttributes('biolink:support_graphs', [supportGraphID]); + boundEdge.addAdditionalAttributes('biolink:knowledge_level', 'logical_entailment') + boundEdge.addAdditionalAttributes('biolink:agent_type', 'automated_agent') boundEdge.addSource([ { resource_id: this.options.provenanceUsesServiceProvider diff --git a/src/inferred_mode/inferred_mode.ts b/src/inferred_mode/inferred_mode.ts index cd360243..e8acc251 100644 --- a/src/inferred_mode/inferred_mode.ts +++ b/src/inferred_mode/inferred_mode.ts @@ -332,7 +332,11 @@ export default class InferredQueryHandler { resource_role: 'primary_knowledge_source', }, ], - attributes: [{ attribute_type_id: 'biolink:support_graphs', value: [] }], + attributes: [ + { attribute_type_id: 'biolink:support_graphs', value: [] }, + { attribute_type_id: 'biolink:knowledge_level', value: "prediction" }, + { attribute_type_id: 'biolink:agent_type', value: "computational_model" }, + ], }; } let auxGraphSuffix = 0;