Question about SimplePropertyGraphStore #16731
Unanswered
yingflower
asked this question in
Q&A
Replies: 1 comment
-
Update the code part: def get(
self,
properties: Optional[dict] = None,
ids: Optional[List[str]] = None,
) -> List[LabelledNode]:
"""Get nodes."""
nodes = list(self.graph.nodes.values())
if properties:
nodes = [
n
for n in nodes
if any(n.properties.get(k) == v for k, v in properties.items())
]
# Filter by node_ids
if ids:
nodes = [n for n in nodes if n.id in ids]
return nodes |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In file of : core/graph_stores/simple_labelled.py
class SimplePropertyGraphStore(PropertyGraphStore):
The function get is defined like this:
def get(
self,
properties: Optional[dict] = None,
ids: Optional[List[str]] = None,
) -> List[LabelledNode]:
"""Get nodes."""
nodes = list(self.graph.nodes.values())
if properties:
nodes = [
n
for n in nodes
if any(n.properties.get(k) == v for k, v in properties.items())
]
If the properties and ids are all set to None, or are all empty, we will get all of the nodes stored in the graph store.
Is this ok?
Beta Was this translation helpful? Give feedback.
All reactions