Skip to content

Commit c891f3b

Browse files
Apply changes requested by the PR review
1 parent d3dee75 commit c891f3b

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

docs/source/user_guide_kg_builder.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ This schema information can be provided to the `SimpleKGBuilder` as demonstrated
125125
# ...
126126
)
127127
128-
Prompt Template, Lexical Graph Config, Schema Enforcement, and Error Behavior
129-
--------------------------------------------------------
128+
Extra configurations
129+
--------------------
130130

131131
These parameters are part of the `EntityAndRelationExtractor` component.
132132
For detailed information, refer to the section on :ref:`Entity and Relation Extractor`.
@@ -138,7 +138,7 @@ They are also accessible via the `SimpleKGPipeline` interface.
138138
# ...
139139
prompt_template="",
140140
lexical_graph_config=my_config,
141-
enforce_schema=SchemaEnforcementMode.Strict
141+
enforce_schema="STRICT"
142142
on_error="RAISE",
143143
# ...
144144
)

src/neo4j_graphrag/experimental/components/entity_relation_extractor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ def _enforce_nodes(
409409
schema_entity = schema.entities.get(node.label)
410410
if not schema_entity:
411411
continue
412-
allowed_props = schema_entity.get("properties", {})
412+
allowed_props = schema_entity.get("properties", [])
413413
filtered_props = self._enforce_properties(node.properties, allowed_props)
414414
if filtered_props:
415415
valid_nodes.append(
@@ -461,7 +461,7 @@ def _enforce_relationships(
461461
(start_label, rel.type, end_label) not in potential_schema):
462462
continue
463463

464-
allowed_props = schema_relation.get("properties", {})
464+
allowed_props = schema_relation.get("properties", [])
465465
filtered_props = self._enforce_properties(rel.properties, allowed_props)
466466

467467
valid_rels.append(

src/neo4j_graphrag/experimental/components/types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,5 +174,5 @@ class GraphResult(DataModel):
174174

175175

176176
class SchemaEnforcementMode(str, Enum):
177-
NONE = "none"
178-
STRICT = "strict"
177+
NONE = "NONE"
178+
STRICT = "STRICT"

0 commit comments

Comments
 (0)