#NEWLINE# def __db_pull__( self , graph ) : #NEWLINE# #INDENT# nodes = { node : None for node in self . nodes ( ) } #NEWLINE# relationships = list ( self . relationships ( ) ) #NEWLINE# tx = graph . begin ( ) #NEWLINE# for node in nodes : #NEWLINE# #INDENT# tx . entities . append ( { #NEWLINE# #INDENT# 'a' : node , #NEWLINE# #UNINDENT# } ) #NEWLINE# cursor = tx . run ( 'MATCH (a) WHERE id(a)={x} RETURN a, labels(a)' , x = remote ( node ) . _id ) #NEWLINE# nodes [ node ] = cursor #NEWLINE# #UNINDENT# for relationship in relationships : #NEWLINE# #INDENT# tx . entities . append ( { #NEWLINE# #INDENT# 'r' : nodes , #NEWLINE# #UNINDENT# } ) #NEWLINE# tx . run ( 'MATCH ()-[r]->() WHERE id(r)={x} RETURN r' , x = remote ( relationship ) . _id ) #NEWLINE# #UNINDENT# tx . commit ( ) #NEWLINE# for ( node , cursor ) in nodes . items ( ) : #NEWLINE# #INDENT# labels = node . _Node__labels #NEWLINE# labels . clear ( ) #NEWLINE# labels . update ( cursor . evaluate ( 1 ) )