src/pybel/io/jgif.py
def from_cbn_jgif(graph_jgif_dict):
    """Build a BEL graph from CBN JGIF.

    Map the JGIF used by the Causal Biological Network Database to standard namespace and annotations, then
    builds a BEL graph using :func:`pybel.from_jgif`.

    :param dict graph_jgif_dict: The JSON object representing the graph in JGIF format
    :rtype: BELGraph

    Example:
    .. code-block:: python

        import requests
        from pybel import from_cbn_jgif
        apoptosis_url = 'http://causalbionet.com/Networks/GetJSONGraphFile?networkId=810385422'
        graph_jgif_dict = requests.get(apoptosis_url).json()
        graph = from_cbn_jgif(graph_jgif_dict)

    .. warning::

        Handling the annotations is not yet supported, since the CBN documents do not refer to the resources used
        to create them. This may be added in the future, but the annotations must be stripped from the graph
        before uploading to the network store using :func:`pybel.struct.mutation.strip_annotations`.

    """
    graph_jgif_dict = map_cbn(graph_jgif_dict)

    graph_jgif_dict['graph'][GRAPH_NAMESPACE_URL] = NAMESPACE_URLS
    graph_jgif_dict['graph'][GRAPH_ANNOTATION_URL] = ANNOTATION_URLS
    graph_jgif_dict['graph']['metadata'].update({
        METADATA_AUTHORS: 'Causal Biological Networks Database',
        METADATA_LICENSES: """
        Please cite:

        - www.causalbionet.com
        - https://bionet.sbvimprover.com

        as well as any relevant publications.

        The sbv IMPROVER project, the website and the Symposia are part of a collaborative project
        designed to enable scientists to learn about and contribute to the development of a new crowd
        sourcing method for verification of scientific data and results. The current challenges, website
        and biological network models were developed and are maintained as part of a collaboration among
        Selventa, OrangeBus and ADS. The project is led and funded by Philip Morris International. For more
        information on the focus of Philip Morris International’s research, please visit www.pmi.com.
        """.replace('\n', '\t'),
        METADATA_CONTACT: 'CausalBiologicalNetworks.RD@pmi.com',
    })

    graph = from_jgif(graph_jgif_dict)
    return graph
Build a BEL graph from CBN JGIF.

    Map the JGIF used by the Causal Biological Network Database to standard namespace and annotations, then
    builds a BEL graph using :func:`pybel.from_jgif`.

    :param dict graph_jgif_dict: The JSON object representing the graph in JGIF format
    :rtype: BELGraph

    Example:
    .. code-block:: python

        import requests
        from pybel import from_cbn_jgif
        apoptosis_url = 'http://causalbionet.com/Networks/GetJSONGraphFile?networkId=810385422'
        graph_jgif_dict = requests.get(apoptosis_url).json()
        graph = from_cbn_jgif(graph_jgif_dict)

    .. warning::

        Handling the annotations is not yet supported, since the CBN documents do not refer to the resources used
        to create them. This may be added in the future, but the annotations must be stripped from the graph
        before uploading to the network store using :func:`pybel.struct.mutation.strip_annotations`.

    
Build a BEL graph from CBN JGIF.
Map the JGIF used by the Causal Biological Network Database to standard namespace and annotations, then
builds a BEL graph using :func:`pybel.from_jgif`.
Build a BEL graph from CBN JGIF . Map the JGIF used by the Causal Biological Network Database to standard namespace and annotations then builds a BEL graph using : func : ` pybel . from_jgif ` .
def from_cbn_jgif(graph_jgif_dict):
    graph_jgif_dict = map_cbn(graph_jgif_dict)
    graph_jgif_dict['graph'][GRAPH_NAMESPACE_URL] = NAMESPACE_URLS
    graph_jgif_dict['graph'][GRAPH_ANNOTATION_URL] = ANNOTATION_URLS
    graph_jgif_dict['graph']['metadata'].update({
        METADATA_AUTHORS: 'Causal Biological Networks Database',
        METADATA_LICENSES: """
        Please cite:
        - www.causalbionet.com
        - https://bionet.sbvimprover.com
        as well as any relevant publications.
        The sbv IMPROVER project, the website and the Symposia are part of a collaborative project
        designed to enable scientists to learn about and contribute to the development of a new crowd
        sourcing method for verification of scientific data and results. The current challenges, website
        and biological network models were developed and are maintained as part of a collaboration among
        Selventa, OrangeBus and ADS. The project is led and funded by Philip Morris International. For more
        information on the focus of Philip Morris International’s research, please visit www.pmi.com.
        """.replace('\n', '\t'),
        METADATA_CONTACT: 'CausalBiologicalNetworks.RD@pmi.com',
    })
    graph = from_jgif(graph_jgif_dict)
    return graph
def from_cbn_jgif ( graph_jgif_dict ) : graph_jgif_dict = map_cbn ( graph_jgif_dict ) graph_jgif_dict [ 'graph' ] [ GRAPH_NAMESPACE_URL ] = NAMESPACE_URLS graph_jgif_dict [ 'graph' ] [ GRAPH_ANNOTATION_URL ] = ANNOTATION_URLS graph_jgif_dict [ 'graph' ] [ 'metadata' ] . update ( { METADATA_AUTHORS : 'Causal Biological Networks Database' , METADATA_LICENSES : """
        Please cite:

        - www.causalbionet.com
        - https://bionet.sbvimprover.com

        as well as any relevant publications.

        The sbv IMPROVER project, the website and the Symposia are part of a collaborative project
        designed to enable scientists to learn about and contribute to the development of a new crowd
        sourcing method for verification of scientific data and results. The current challenges, website
        and biological network models were developed and are maintained as part of a collaboration among
        Selventa, OrangeBus and ADS. The project is led and funded by Philip Morris International. For more
        information on the focus of Philip Morris International’s research, please visit www.pmi.com.
        """ . replace ( '\n' , '\t' ) , METADATA_CONTACT : 'CausalBiologicalNetworks.RD@pmi.com' , } ) graph = from_jgif ( graph_jgif_dict ) return graph
Build a BEL graph from CBN JGIF.
Build a BEL graph from CBN JGIF .
"""Build a BEL graph from CBN JGIF.

    Map the JGIF used by the Causal Biological Network Database to standard namespace and annotations, then
    builds a BEL graph using :func:`pybel.from_jgif`.

    :param dict graph_jgif_dict: The JSON object representing the graph in JGIF format
    :rtype: BELGraph

    Example:
    .. code-block:: python

        import requests
        from pybel import from_cbn_jgif
        apoptosis_url = 'http://causalbionet.com/Networks/GetJSONGraphFile?networkId=810385422'
        graph_jgif_dict = requests.get(apoptosis_url).json()
        graph = from_cbn_jgif(graph_jgif_dict)

    .. warning::

        Handling the annotations is not yet supported, since the CBN documents do not refer to the resources used
        to create them. This may be added in the future, but the annotations must be stripped from the graph
        before uploading to the network store using :func:`pybel.struct.mutation.strip_annotations`.

    """
None
BELGraph
Example:
.. code-block:: python

    import requests
    from pybel import from_cbn_jgif
    apoptosis_url = 'http://causalbionet.com/Networks/GetJSONGraphFile?networkId=810385422'
    graph_jgif_dict = requests.get(apoptosis_url).json()
    graph = from_cbn_jgif(graph_jgif_dict)

.. warning::

    Handling the annotations is not yet supported, since the CBN documents do not refer to the resources used
    to create them. This may be added in the future, but the annotations must be stripped from the graph
    before uploading to the network store using :func:`pybel.struct.mutation.strip_annotations`.
graph_jgif_dict
The JSON object representing the graph in JGIF format
The JSON object representing the graph in JGIF format