src/pybel/grounding.py
def ground_nodelink(graph_nodelink_dict, skip_namespaces: Optional[Collection[str]] = None) -> None:
    """Ground entities in a nodelink data structure."""
    name = graph_nodelink_dict.get('graph', {}).get('name', 'graph')

    for data in tqdm(graph_nodelink_dict['links'], desc='grounding edges in {}'.format(name)):
        _process_edge_side(data.get(SOURCE_MODIFIER), skip_namespaces=skip_namespaces)
        _process_edge_side(data.get(TARGET_MODIFIER), skip_namespaces=skip_namespaces)
        if ANNOTATIONS in data:
            _process_annotations(data, skip_namespaces=skip_namespaces)

    for node in tqdm(graph_nodelink_dict['nodes'], desc='grounding nodes in {}'.format(name)):
        _process_node(node, skip_namespaces=skip_namespaces)
Ground entities in a nodelink data structure.
Ground entities in a nodelink data structure.
Ground entities in a nodelink data structure .
def ground_nodelink(graph_nodelink_dict, skip_namespaces: Optional[Collection[str]] = None) -> None:
    name = graph_nodelink_dict.get('graph', {}).get('name', 'graph')
    for data in tqdm(graph_nodelink_dict['links'], desc='grounding edges in {}'.format(name)):
        _process_edge_side(data.get(SOURCE_MODIFIER), skip_namespaces=skip_namespaces)
        _process_edge_side(data.get(TARGET_MODIFIER), skip_namespaces=skip_namespaces)
        if ANNOTATIONS in data:
            _process_annotations(data, skip_namespaces=skip_namespaces)
    for node in tqdm(graph_nodelink_dict['nodes'], desc='grounding nodes in {}'.format(name)):
        _process_node(node, skip_namespaces=skip_namespaces)
def ground_nodelink ( graph_nodelink_dict , skip_namespaces : Optional [ Collection [ str ] ] = None ) -> None : name = graph_nodelink_dict . get ( 'graph' , { } ) . get ( 'name' , 'graph' ) for data in tqdm ( graph_nodelink_dict [ 'links' ] , desc = 'grounding edges in {}' . format ( name ) ) : _process_edge_side ( data . get ( SOURCE_MODIFIER ) , skip_namespaces = skip_namespaces ) _process_edge_side ( data . get ( TARGET_MODIFIER ) , skip_namespaces = skip_namespaces ) if ANNOTATIONS in data : _process_annotations ( data , skip_namespaces = skip_namespaces ) for node in tqdm ( graph_nodelink_dict [ 'nodes' ] , desc = 'grounding nodes in {}' . format ( name ) ) : _process_node ( node , skip_namespaces = skip_namespaces )
Ground entities in a nodelink data structure.
Ground entities in a nodelink data structure .
"""Ground entities in a nodelink data structure."""
graph_nodelink_dict
skip_namespaces
Optional[Collection[str]]