Getting Node object from Edge
See original GitHub issueWhen I am working with an Edge
, there is a scenario where I want to find which Node
is it, and I only have Memgraph node ID
, and not the whole object. And I would want further to make a query with those Nodes
I got from Edge
property, but I can’t as I can’t make a query towards database with Memgraph ID of Node
.
In other words, it would be good to return Node
instead of Node-id in Memgraph
when calling edge.start_node
or edge.end_node
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Need to pass node object created in loop to edges
2) For each edge in edges, create edge with 'source', 'target'. The problem that I am having is that to create the edge...
Read more >Get started viewing and changing the DOM - Microsoft Edge ...
To edit the tag name of a node, double-click the tag name and then type in the new tag name. Open the DOM...
Read more >Edge Detect Node for Blender 2.8 - YouTube
Hello Blender friends. Here is a quick demonstration on how to use a Node Group I created to add edge detail to 3D...
Read more >Finding the corresponding node in array using edges in ...
So, the simple answer is: For the current node: Find all Edges such that current node as Source, that have a Target that...
Read more >get_edges: Get node IDs associated with edges in DiagrammeR
Obtain a vector, data frame, or list of node IDs associated with edges in a graph object. An optional filter by edge attribute...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So the reason for this kind of implementation is twofold. Since the memgraph as per bolt specification returns not nodes but nodes id when fetching edge the only way to tackle this issue is from the client-side. Not there can be two solutions:
One would be to implicitly change every user’s query to fetch nodes as well and to bind the nodes to edges, which would make another layer of query parsing from the client’s side that would be very complicated (you would need to return all the nodes that could be found in edges). Or make it easier but slower for, for every fetched edge performer another query that would get nodes (if that didn’t already happen) => This solution is needlessly complex
Another solution would be to keep the graph structure constantly in memory, in other words whenever a user would fetch nodes, we keep them in memory and map them if possible to edges (that’s how neo4j does it). The issue is an obvious inconsistency, sometimes you get id and sometimes you get node…
And that’s the reason this implementation has not changed much from current, I think what you are looking for is great but that would be a feature for a higher level querying (OGM)
Okay, I really didn’t have an idea how such a feature could complicate things easily a lot. It makes sense for the user to handle nodes in a query then due to the reasons you provided. Thanks for such a detailed answer.