The Assimilation Project  based on Assimilation version
testpy2neo Namespace Reference


def node_new (nodetype, nodename, properties={})
def print_row (row)


 graph_db = neo4j.GraphDatabaseService("http://localhost:7474/db/data/")
dictionary nodetypes = {'Ring': True, 'Drone':True, 'Switch':True, 'NIC': False, 'IPaddr':True, 'MACaddr': True}
list indices = [key for key in nodetypes.keys() if nodetypes[key]]
dictionary indextbl = {}
dictionary nodetypetbl = {}
 nodetypeindex = indextbl['nodetype']
 Ringindex = indextbl['Ring']
 topnode = \
 TheOneRing = node_new('Ring', 'TheOneRing')
 servidor = node_new('Drone', 'servidor')
string query = "START a=node({A}) MATCH a-[r:IS_A]->b RETURN a, r, b"

Function Documentation

def testpy2neo.node_new (   nodetype,
  properties = {} 
Possibly creates a new node, puts it in its appropriate index and creates an IS_A relationship
with the nodetype object corresponding its nodetype.
It is created and added to indexes if it doesn't already exist in its corresponding index - if there is one.
If it already exists, the pre-existing node is returned.
If this object type doesn't have an index, it will always be created.
Note that the nodetype has to be in the nodetypetable - even if its NULL (for error detection).
The IS_A relationship may be useful -- or not.  Hard to say at this point...

Definition at line 57 of file

def testpy2neo.print_row (   row)

Definition at line 89 of file

Variable Documentation

testpy2neo.graph_db = neo4j.GraphDatabaseService("http://localhost:7474/db/data/")

Definition at line 28 of file

dictionary testpy2neo.indextbl = {}

Definition at line 40 of file

list testpy2neo.indices = [key for key in nodetypes.keys() if nodetypes[key]]

Definition at line 38 of file

testpy2neo.nodetypeindex = indextbl['nodetype']

Definition at line 49 of file

dictionary testpy2neo.nodetypes = {'Ring': True, 'Drone':True, 'Switch':True, 'NIC': False, 'IPaddr':True, 'MACaddr': True}

Definition at line 33 of file

dictionary testpy2neo.nodetypetbl = {}

Definition at line 41 of file

string testpy2neo.query = "START a=node({A}) MATCH a-[r:IS_A]->b RETURN a, r, b"

Definition at line 86 of file

testpy2neo.Ringindex = indextbl['Ring']

Definition at line 50 of file

testpy2neo.servidor = node_new('Drone', 'servidor')

Definition at line 80 of file

testpy2neo.TheOneRing = node_new('Ring', 'TheOneRing')

Definition at line 79 of file

testpy2neo.topnode = \

Definition at line 52 of file