Example #1
0
def py2neo20_node(*labels, **properties):
    """Py2neo `node` factory.

    Requires a module-global `graphdb` connection.
    """
    global graphdb

    return first(graphdb.create(py2neo_node(*labels, **properties)))
Example #2
0
def py2neo16_node(*labels, **properties):
    """Implement a Py2neo 2.0-compatible `node` factory.

    Version 1.6 did not support adding labels (which ordinarily would only be
    possible to add *after* node creation).
    """
    global graphdb

    new_node = first(graphdb.create(py2neo_node(**properties)))
    new_node.add_labels(*labels)

    return new_node