@@ -223,21 +223,21 @@ def _validate_node(
223
223
224
224
def _enforce_nodes (
225
225
self ,
226
- extracted_nodes : list [Neo4jNode ],
226
+ nodes : list [Neo4jNode ],
227
227
schema : GraphSchema ,
228
228
lexical_graph_config : LexicalGraphConfig ,
229
229
pruning_stats : PruningStats ,
230
230
) -> list [Neo4jNode ]:
231
231
"""
232
- Filter extracted nodes to be conformant to the schema.
232
+ Filter nodes to be conformant to the schema.
233
233
234
234
Keep only those whose label is in schema
235
235
(unless schema has additional_node_types=True, default value)
236
236
For each valid node, validate properties. If a node is left without
237
237
properties, prune it.
238
238
"""
239
239
valid_nodes = []
240
- for node in extracted_nodes :
240
+ for node in nodes :
241
241
if node .label in lexical_graph_config .lexical_graph_node_labels :
242
242
valid_nodes .append (node )
243
243
continue
@@ -329,14 +329,14 @@ def _validate_relationship(
329
329
330
330
def _enforce_relationships (
331
331
self ,
332
- extracted_relationships : list [Neo4jRelationship ],
332
+ relationships : list [Neo4jRelationship ],
333
333
filtered_nodes : list [Neo4jNode ],
334
334
schema : GraphSchema ,
335
335
lexical_graph_config : LexicalGraphConfig ,
336
336
pruning_stats : PruningStats ,
337
337
) -> list [Neo4jRelationship ]:
338
338
"""
339
- Filter extracted nodes to be conformant to the schema.
339
+ Filter relationships to be conformant to the schema.
340
340
341
341
Keep only those whose types are in schema, start/end node conform to schema,
342
342
and start/end nodes are in filtered nodes (i.e., kept after node enforcement).
@@ -347,7 +347,7 @@ def _enforce_relationships(
347
347
348
348
valid_rels = []
349
349
valid_nodes = {node .id : node .label for node in filtered_nodes }
350
- for rel in extracted_relationships :
350
+ for rel in relationships :
351
351
if rel .type in lexical_graph_config .lexical_graph_relationship_types :
352
352
valid_rels .append (rel )
353
353
continue
0 commit comments