to_digraph

to_digraph(mappings: Iterable[Mapping]) DiGraph[source]

Convert mappings into a simple directed graph data model.

Parameters:

mappings – An iterable of mappings

Returns:

A directed graph in which the nodes are curies.Reference objects. A dictionary of predicate to evidence lists is put under the DIGRAPH_DATA_KEY.

Warning

This function makes two assumptions:

  1. The graph has already been assembled using assemble_evidences()

  2. That only one predicate is used in the graph. If you want to handle multiple prediates, see to_multidigraph()