Reputation: 1024
I'm using Graphexp for visualising graph. Graphexp is internally using gremlin query to get the output.
This is the query which Graphexp is doing:
nodes = g.V().limit(50).toList();edges = g.V(nodes).aggregate('node').outE().as('edge').inV().where(within('node')).select('edge').toList();[nodes,edges]
I've created my own API on top of Janusraph for CRUD operation. I'm inserting two vertices and one edge between them with some specifiers (key, value pairs) in edge.
After running above query, Graphexp is returning:
id: {relationId: "551-6co-13it-m54"}
inV: 28696
inVLabel: "vertex"
label: "intend"
outV: 8232
outVLabel: "vertex"
properties:
owner_id: {key: "owner_id", value: "18699980"}
rel_id: {key: "rel_id", value: "intend"}
rel_name: {key: "rel_name", value: ""}
relation_specifier: {key: "relation_specifier", value: "[]"}
src_specifier: {key: "src_specifier", value: "-1466934972"}
tar_specifier: {key: "tar_specifier", value: "[]"}
__proto__: Object
type: "edge"
As we can see few things are coming empty here. Example: rel_name, tar_specifier, etc.
Now I'm getting some other result with different query:
My Query(written in Java):
g.V().has("name", source).outE().where(__.inV().has("name", target)).valueMap().toList()
Using my own API I'm sending source and target in above query.
My Query Response:
{
"res": [
{
"tar_specifier": "[for month]",
"src_specifier": "[]",
"relation_specifier": "[]",
"rel_name": "intend",
"owner_id": "",
"rel_id": "-1466934972",
"doc_id": "18699980"
}
]
}
My expected output is the last one it's showing the data in the exact way I sent. IDK why in UI the response they are getting is totally messed up.
Example: "rel_name" is "intend" in the last output (as expected) whereas in UI response it's getting assigned to rel_id.
We both are using different Gremlin query but still the data is not supposed to get assigned somewhere else or getting empty.
I had debug the UI and I got the same query and response as mentioned above.
I'm new to Gremlin but, I have understanding of different databases and I believe that data organisation doesn't depends upon the query.
Thank you in advance!
Upvotes: 1
Views: 178