Skip to content

TranslatorSRI/reasoner-converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reasoner Converter

github actions codecov

Reasoner Converter provides conversion between TRAPI versions 0.9.2 and 1.0.0.

Jump to:


Python API

from reasoner_converter.upgrading import upgrade_Node
from reasoner_converter.downgrading import downgrade_Node

knode0 = {
    "id": "MONDO:0005737",
    "type": ["disease"],
}
knode1 = upgrade_Node(knode0)
knode0 == downgrade_Node(knode1)

Backwards compatibility

The following are required to downgrade 1.0.0 → 0.9.2:

  • QNode.category is a string or a list of length 1
  • QEdge.predicate is a string or a list of length 1

0.9.2 → 1.0.0 changes

  • /query returns: MessageResponse
    • Response has required property message

Message

  • additional properties are: allowed → not allowed

KnowledgeGraph

  • .nodes is: an array of objects with required prop id → a map with keys equivalent to id
  • .edges is: an array of objects with required prop id → a map with keys equivalent to id

Node

  • .type.category
  • .category is: an array of strings → a string or an array of strings
  • additional properties are: allowed → not allowed

Edge

  • .type.predicate
  • .source_id.subject
  • .target_id.object
  • additional properties are: allowed → not allowed

QueryGraph

  • .nodes is: an array of objects with required prop id → a map with keys equivalent to id
  • .edges is: an array of objects with required prop id → a map with keys equivalent to id

QNode

  • .type.category
  • .category is: a string → a string or an array of strings
  • .curie.id

QEdge

  • .type.predicate
  • .predicate is: a BiolinkRelation → a BiolinkPredicate or an array of BiolinkPredicates
  • .source_id.subject
  • .target_id.object

Result

  • .node_bindings is: an array of objects with required prop qg_id → a map with keys equivalent to qg_id and array values
  • .edge_bindings is: an array of objects with required prop qg_id → a map with keys equivalent to qg_id and array values

NodeBinding

  • .kg_id.id
  • .id can be: a string or an array of strings → a string

EdgeBinding

  • .kg_id.id
  • .id can be: a string or an array of strings → a string

BiolinkEntity

  • string → "biolink:PascalCase"

BiolinkRelationPredicate

  • string → "biolink:snake_case"

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages