|
The Assimilation Monitoring Project
|
Functions | |
| def | node_new |
| def | print_row |
Variables | |
| tuple | 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 = {} |
| list | nodetypeindex = indextbl['nodetype'] |
| list | Ringindex = indextbl['Ring'] |
| topnode = \ | |
| tuple | TheOneRing = node_new('Ring', 'TheOneRing') |
| tuple | servidor = node_new('Drone', 'servidor') |
| string | query = "START a=node({A}) MATCH a-[r:IS_A]->b RETURN a, r, b" |
| def testpy2neo.node_new | ( | nodetype, | |
| nodename, | |||
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 testpy2neo.py.
| def testpy2neo.print_row | ( | row | ) |
Definition at line 89 of file testpy2neo.py.
| tuple testpy2neo.graph_db = neo4j.GraphDatabaseService("http://localhost:7474/db/data/") |
Definition at line 28 of file testpy2neo.py.
| dictionary testpy2neo.indextbl = {} |
Definition at line 40 of file testpy2neo.py.
| list testpy2neo.indices = [key for key in nodetypes.keys() if nodetypes[key]] |
Definition at line 38 of file testpy2neo.py.
| list testpy2neo.nodetypeindex = indextbl['nodetype'] |
Definition at line 49 of file testpy2neo.py.
| dictionary testpy2neo.nodetypes = {'Ring': True, 'Drone':True, 'Switch':True, 'NIC': False, 'IPaddr':True, 'MACaddr': True} |
Definition at line 33 of file testpy2neo.py.
| dictionary testpy2neo.nodetypetbl = {} |
Definition at line 41 of file testpy2neo.py.
| string testpy2neo.query = "START a=node({A}) MATCH a-[r:IS_A]->b RETURN a, r, b" |
Definition at line 86 of file testpy2neo.py.
| list testpy2neo.Ringindex = indextbl['Ring'] |
Definition at line 50 of file testpy2neo.py.
| tuple testpy2neo.servidor = node_new('Drone', 'servidor') |
Definition at line 80 of file testpy2neo.py.
| tuple testpy2neo.TheOneRing = node_new('Ring', 'TheOneRing') |
Definition at line 79 of file testpy2neo.py.
| testpy2neo.topnode = \ |
Definition at line 52 of file testpy2neo.py.