def remove_directed_edge(self, node, name, other_node): MemoryObjectGraph.remove_directed_edge(self, node, name, other_node) for r in node._neonode.relationships(): if r.end == other_node and r.type == name: r.delete() # return early, which means if we had the same link multiple times, # we only remove one of them. This could be used for doing ref-counting if necessary return
def add_directed_edge(self, node, name, other_node): MemoryObjectGraph.add_directed_edge(self, node, name, other_node) setattr(node._neonode, name, other_node._neonode)
def __init__(self, dbpath): MemoryObjectGraph.__init__(self) neo.open(dbpath)
def clear(self): """Delete all objects in this graph.""" MemoryObjectGraph.clear(self) neo.delete_all_data()