kroma

kroma.tasks.query_engine

Query

query asks each named strategy for local context and concatenates the results.

Call

query(concept_code, pcmap, dictionary, options)
  -> parents, children, synonyms, labels

register_query_strategy(name, strategy) -> None

Unknown option names are skipped. A strategy that raises is skipped, and the other options still return.

Source: query_engine.py.

Strategies

StrategyOption names
DictionaryStrategyenvo, sweet, mouse, human, yago, wikidata, mi, mi2, matonto, emmo, omim, ordo
SparqlStrategyncit, doid, dbpedia
OntologyStrategyontology
ConceptNetStrategyconceptnet

A custom source is any object with fetch(code, pcmap, dictionary, topk) registered under a name.