Skip to content

Commit 209b3b8

Browse files
committed
Updated variables in NODE_PROPERTIES_QUERY and REL_PROPERTIES_QUERY
1 parent 8dd8a02 commit 209b3b8

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/neo4j_graphrag/schema.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@
3333
"YIELD label, other, elementType, type, property "
3434
"WHERE NOT type = 'RELATIONSHIP' AND elementType = 'node' "
3535
"AND NOT label IN $EXCLUDED_LABELS "
36-
"WITH label AS nodeLabels, collect({property:property, type:type}) AS properties "
37-
"RETURN {labels: nodeLabels, properties: properties} AS output"
36+
"WITH label AS nodeLabel, collect({property:property, type:type}) AS properties "
37+
"RETURN {label: nodeLabel, properties: properties} AS output"
3838
)
3939

4040
REL_PROPERTIES_QUERY = (
4141
"CALL apoc.meta.data() "
4242
"YIELD label, other, elementType, type, property "
4343
"WHERE NOT type = 'RELATIONSHIP' AND elementType = 'relationship' "
4444
"AND NOT label in $EXCLUDED_LABELS "
45-
"WITH label AS nodeLabels, collect({property:property, type:type}) AS properties "
46-
"RETURN {type: nodeLabels, properties: properties} AS output"
45+
"WITH label AS relType, collect({property:property, type:type}) AS properties "
46+
"RETURN {type: relType, properties: properties} AS output"
4747
)
4848

4949
REL_QUERY = (
@@ -293,7 +293,7 @@ def get_structured_schema(
293293
index = []
294294

295295
structured_schema = {
296-
"node_props": {el["labels"]: el["properties"] for el in node_properties},
296+
"node_props": {el["label"]: el["properties"] for el in node_properties},
297297
"rel_props": {el["type"]: el["properties"] for el in rel_properties},
298298
"relationships": relationships,
299299
"metadata": {"constraint": constraint, "index": index},

tests/e2e/test_schema_e2e.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def test_cypher_returns_correct_node_properties(driver: Driver) -> None:
3636
{
3737
"output": {
3838
"properties": [{"property": "property_a", "type": "STRING"}],
39-
"labels": "LabelA",
39+
"label": "LabelA",
4040
}
4141
}
4242
]

tests/unit/test_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def _query_return_value(*args: Any, **kwargs: Any) -> list[Any]:
4444
{
4545
"output": {
4646
"properties": [{"property": "property_a", "type": "STRING"}],
47-
"labels": "LabelA",
47+
"label": "LabelA",
4848
}
4949
}
5050
]

0 commit comments

Comments
 (0)