i've pushed data using gremlin-python. want run spcific queries on it. i'm using gizmo that.
i want achieve degree of centrality each node. how do that?
currently i've query return same :
g.v().group(). ......1> by(id). ......2> by(union(__(), oute('mentions').count()).fold())
how i'm achieving is:
def query(self, q): gizmo import mapper, request gremlinpy import gremlin req = request('localhost', 8182) gremlin = gremlin('g') mapper = mapper(request=req, gremlin=gremlin) # s = mapper.gremlin.v().ine('mentions').count().tolist() # res = mapper.query(gremlin=s) # print(res.get_data()[0]) print("something") res = mapper.query(script=q) # print(res.get_data()[0]) print("something") print(res.data) print(res.first(), res.data) # exit(0) return res.first()
what want display data fetched inside res variable.
but each time errors :
attributeerror: 'coroutine' object has no attribute 'data' attributeerror: 'coroutine' object has no attribute 'get_data'
or similar try.
how fetch results fetched coroutine object?
note: sample query i'm passing function query() g.v().count()
is there other better way run generic queries python in gremlin shell , fetch results?
graph db: janusgraph
backend: cassandra
indexing backend: elasticsearch
you mention gizmo relate multiple projects, think mean one:
https://github.com/emehrkay/gizmo
according documentation, project meant tinkerpop 2.x , rexster. don't believe works tinkerpop 3.x , gremlin server janusgraph based on. if need python ogm of sort tinkerpop 3.x might consider:
Comments
Post a Comment