src/pybel/io/sbel.py
def add_sbel_row(graph: BELGraph, data: SBEL) -> str:
    """Add a single SBEL data dictionary to a graph."""
    u = parse_result_to_dsl(data['source'])
    v = parse_result_to_dsl(data['target'])
    edge_data = {
        k: v
        for k, v in data.items()
        if k not in {'source', 'target', 'key'}
    }
    for side in (SOURCE_MODIFIER, TARGET_MODIFIER):
        side_data = edge_data.get(side)
        if side_data:
            _handle_modifier(side_data)
    if CITATION in edge_data:
        edge_data[CITATION] = CitationDict(**edge_data[CITATION])
    return graph.add_edge(u, v, key=hash_edge(u, v, edge_data), **edge_data)
Add a single SBEL data dictionary to a graph.
Add a single SBEL data dictionary to a graph.
Add a single SBEL data dictionary to a graph .
def add_sbel_row(graph: BELGraph, data: SBEL) -> str:
    u = parse_result_to_dsl(data['source'])
    v = parse_result_to_dsl(data['target'])
    edge_data = {
        k: v
        for k, v in data.items()
        if k not in {'source', 'target', 'key'}
    }
    for side in (SOURCE_MODIFIER, TARGET_MODIFIER):
        side_data = edge_data.get(side)
        if side_data:
            _handle_modifier(side_data)
    if CITATION in edge_data:
        edge_data[CITATION] = CitationDict(**edge_data[CITATION])
    return graph.add_edge(u, v, key=hash_edge(u, v, edge_data), **edge_data)
def add_sbel_row ( graph : BELGraph , data : SBEL ) -> str : u = parse_result_to_dsl ( data [ 'source' ] ) v = parse_result_to_dsl ( data [ 'target' ] ) edge_data = { k : v for k , v in data . items ( ) if k not in { 'source' , 'target' , 'key' } } for side in ( SOURCE_MODIFIER , TARGET_MODIFIER ) : side_data = edge_data . get ( side ) if side_data : _handle_modifier ( side_data ) if CITATION in edge_data : edge_data [ CITATION ] = CitationDict ( ** edge_data [ CITATION ] ) return graph . add_edge ( u , v , key = hash_edge ( u , v , edge_data ) , ** edge_data )
Add a single SBEL data dictionary to a graph.
Add a single SBEL data dictionary to a graph .
"""Add a single SBEL data dictionary to a graph."""
graph
BELGraph
data
SBEL