Package visgraph :: Module dbcore :: Class DbGraphStore
[hide private]
[frames] | no frames]

Class DbGraphStore

source code

A DbGraphStore object may be used for all the standard management of node and edge information but may not be used for path queries.

FIXME possibly make it able to do path queries but *really* slow?

Use the buildSubGraph() API to pull path serchable graphs out of the DBGraphStore.

Instance Methods [hide private]
 
__init__(self, dbinfo=None) source code
 
_doSelect(self, query, *args)
For now, a fetchall based select wrapper.
source code
 
_doInsert(self, query, *args)
Standard insert wrapper.
source code
 
_doUpdate(self, query, *args)
Do an update with 'returning' syntax to know if an update was made.
source code
 
_doInsertRetId(self, query, *args)
Insert with a returning value.
source code
 
_doCommit(self) source code
 
addNode(self, nodeid=None, ninfo=None, **kwargs) source code
 
delEdge(self, eid)
Delete an edge from the graph database.
source code
 
delNode(self, nid)
Delete the given node (and his edges) from the graph dbase.
source code
 
setNodeInfo(self, nid, pname, value) source code
 
getNodeInfo(self, nid, pname, default=None) source code
 
delNodeInfo(self, nid, pname) source code
 
getNodeProps(self, nid) source code
 
addEdge(self, fromid, toid, eid=None, einfo=None) source code
 
getRefsFrom(self, nodeid)
Return a list of edges which originate with us.
source code
 
getRefsTo(self, nodeid)
Return a list of edges which we reference.
source code
 
setEdgeInfo(self, eid, pname, value) source code
 
getEdgeInfo(self, eid, pname, default=None) source code
 
searchNodes(self, propname, propval=None)
Return (but do not cache forward) the nid's of nodes which have a property with the following name (and optionally, value).
source code
 
buildSubGraph(self)
Return a subgraph which may be used to populate from the DB and do path searching.
source code
Method Details [hide private]

delEdge(self, eid)

source code 

Delete an edge from the graph database.

Example: g.delEdge(eid)

delNode(self, nid)

source code 

Delete the given node (and his edges) from the graph dbase.

Example: g.delNode(nid)

NOTE: this will delete any edges which go to or from nid!

getRefsFrom(self, nodeid)

source code 

Return a list of edges which originate with us.

Example: for eid, fromid, toid, einfo in g.getRefsFrom(id)

getRefsTo(self, nodeid)

source code 

Return a list of edges which we reference.

Example: for eid, fromid, toid, einfo in g.getRefsTo(id)

searchNodes(self, propname, propval=None)

source code 

Return (but do not cache forward) the nid's of nodes which
have a property with the following name (and optionally, value).

Example:
    for nid in g.searchNodes('woot', 10)
        print g.getNodeInfo(nid, 'name')
    
NOTE: This is specific to the DbGraphStore...