In [12]:
import graphistry
# !pip install graphistry -q
# graphistry.register(key='...', protocol='https', server='www.acme.com', ...)
In [13]:
g = graphistry.tigergraph(
protocol='http', server='www.acme.org',
user='tigergraph', pwd='tigergraph',
db='Storage', #optional
#web_port = 14240, api_port = 9000, verbose=True
)
In [14]:
g2 = g.gsql_endpoint(
'StorageImpact', {'vertexType': 'Service', 'input': 61921, 'input.type': 'Pool'},
#{'edges': '@@edgeList', 'nodes': '@@nodeList'}
)
print('# edges:', len(g2._edges))
g2.plot()
Out[14]:
In [15]:
g3 = g.gsql("""
INTERPRET QUERY () FOR GRAPH Storage {
OrAccum<BOOL> @@stop;
ListAccum<EDGE> @@edgeList;
SetAccum<vertex> @@set;
@@set += to_vertex("61921", "Pool");
Start = @@set;
while Start.size() > 0 and @@stop == false do
Start = select t from Start:s-(:e)-:t
where e.goUpper == TRUE
accum @@edgeList += e
having t.type != "Service";
end;
print @@edgeList;
}
""",
#{'edges': '@@edgeList', 'nodes': '@@nodeList'} # can skip by default
)
print('# edges:', len(g3._edges))
g3.plot()
Out[15]:
In [ ]: