src/pybel/manager/citation_utils.py
def _enrich_citations(
    graph: BELGraph,
    manager: Optional[Manager],
    group_size: Optional[int] = None,
    offline: bool = False,
    prefix: Optional[str] = None,
) -> Set[str]:
    """Overwrite all citations of the given prefix using the predefined lookup functions.

    :param graph: A BEL Graph
    :param group_size: The number of identifiers to query at a time. Defaults to 200 identifiers.
    :return: A set of identifiers for which lookup was not possible
    """
    if manager is None:
        manager = Manager()
    if prefix is None:
        prefix = 'pubmed'

    identifiers = {identifier for identifier in get_citation_identifiers(graph, prefix) if identifier}
    identifier_map, errors = _get_citations_by_identifiers(
        manager,
        identifiers=identifiers,
        group_size=group_size,
        offline=offline,
        prefix=prefix,
    )

    for u, v, k in filter_edges(graph, CITATION_PREDICATES[prefix]):
        identifier = graph[u][v][k][CITATION].identifier

        identifier_data = identifier_map.get(identifier)
        if identifier_data is None:
            logger.warning('Missing data for %s:%s', prefix, identifier)
            errors.add(identifier)
            continue

        graph[u][v][k][CITATION].update(identifier_data)

    return errors
Overwrite all citations of the given prefix using the predefined lookup functions.

    :param graph: A BEL Graph
    :param group_size: The number of identifiers to query at a time. Defaults to 200 identifiers.
    :return: A set of identifiers for which lookup was not possible
    
Overwrite all citations of the given prefix using the predefined lookup functions.
Overwrite all citations of the given prefix using the predefined lookup functions .
def _enrich_citations(
    graph: BELGraph,
    manager: Optional[Manager],
    group_size: Optional[int] = None,
    offline: bool = False,
    prefix: Optional[str] = None,
) -> Set[str]:
    if manager is None:
        manager = Manager()
    if prefix is None:
        prefix = 'pubmed'
    identifiers = {identifier for identifier in get_citation_identifiers(graph, prefix) if identifier}
    identifier_map, errors = _get_citations_by_identifiers(
        manager,
        identifiers=identifiers,
        group_size=group_size,
        offline=offline,
        prefix=prefix,
    )
    for u, v, k in filter_edges(graph, CITATION_PREDICATES[prefix]):
        identifier = graph[u][v][k][CITATION].identifier
        identifier_data = identifier_map.get(identifier)
        if identifier_data is None:
            logger.warning('Missing data for %s:%s', prefix, identifier)
            errors.add(identifier)
            continue
        graph[u][v][k][CITATION].update(identifier_data)
    return errors
def _enrich_citations ( graph : BELGraph , manager : Optional [ Manager ] , group_size : Optional [ int ] = None , offline : bool = False , prefix : Optional [ str ] = None , ) -> Set [ str ] : if manager is None : manager = Manager ( ) if prefix is None : prefix = 'pubmed' identifiers = { identifier for identifier in get_citation_identifiers ( graph , prefix ) if identifier } identifier_map , errors = _get_citations_by_identifiers ( manager , identifiers = identifiers , group_size = group_size , offline = offline , prefix = prefix , ) for u , v , k in filter_edges ( graph , CITATION_PREDICATES [ prefix ] ) : identifier = graph [ u ] [ v ] [ k ] [ CITATION ] . identifier identifier_data = identifier_map . get ( identifier ) if identifier_data is None : logger . warning ( 'Missing data for %s:%s' , prefix , identifier ) errors . add ( identifier ) continue graph [ u ] [ v ] [ k ] [ CITATION ] . update ( identifier_data ) return errors
Overwrite all citations of the given prefix using the predefined lookup functions.
Overwrite all citations of the given prefix using the predefined lookup functions .
"""Overwrite all citations of the given prefix using the predefined lookup functions.

    :param graph: A BEL Graph
    :param group_size: The number of identifiers to query at a time. Defaults to 200 identifiers.
    :return: A set of identifiers for which lookup was not possible
    """
A set of identifiers for which lookup was not possible
A set of identifiers for which lookup was not possible
graph
BELGraph
A BEL Graph
A BEL Graph
manager
Optional[Manager]
group_size
Optional[int]
The number of identifiers to query at a time. Defaults to 200 identifiers.
The number of identifiers to query at a time . Defaults to 200 identifiers .
offline
bool
prefix
Optional[str]