Skip to content

Commit 8bf0b00

Browse files
committed
removed use of apoc.col.subtract from validateTransaction
1 parent c968e28 commit 8bf0b00

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/main/java/n10s/validation/ValidationProcedures.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ public Stream<ValidationResult> validateSetFromCompiled(
153153
+ " [ item IN $assignedNodeProperties[x] | item.node] ) +"
154154
+ " reduce( nodes = [] , x IN keys($removedNodeProperties) | nodes + "
155155
+ " [ item IN $removedNodeProperties[x] | item.node] ) AS nd "
156-
+ " WITH apoc.coll.subtract(collect( DISTINCT nd), $deletedNodes) AS touchedNodes\n"
156+
+ " WITH reduce (minus = [], x in collect( DISTINCT nd) | case when not (x in $deletedNodes) then minus + x else minus end ) AS touchedNodes\n"
157+
//+ " WITH apoc.coll.subtract(collect( DISTINCT nd), $deletedNodes) AS touchedNodes\n"
157158
+ "CALL n10s.validation.shacl.validateSet(touchedNodes) YIELD focusNode, nodeType, shapeId, propertyShape, offendingValue, resultPath, severity, resultMessage\n"
158159
+ "RETURN {focusNode: focusNode, nodeType: nodeType, shapeId: shapeId, propertyShape: propertyShape, offendingValue: offendingValue, resultPath:resultPath, severity:severity, resultMessage:resultMessage } AS validationResult ";
159160

src/test/java/n10s/validation/SHACLValidationProceduresTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ public void testListShapesInRDFShortenGraph() throws Exception {
695695

696696
}
697697
}
698-
698+
699699
@Test
700700
public void testTxTriggerValidation() throws Exception {
701701
try (Driver driver = GraphDatabase.driver(neo4j.boltURI(),
@@ -731,7 +731,7 @@ public void testTxTriggerValidation() throws Exception {
731731
.toURI() + "\",\"Turtle\", {})");
732732

733733
Result validationResults = session.run("MATCH (p:Person) WITH collect(p) as nodes "
734-
+ "call n10s.validation.shacl.validateTransaction(nodes,[], {}, {}, {}, {}) "
734+
+ "call n10s.validation.shacl.validateTransaction(nodes,[], {}, {}, {}, {}, [], []) "
735735
+ "yield focusNode, nodeType, shapeId, propertyShape, offendingValue, resultPath, severity, resultMessage "
736736
+ "RETURN focusNode, nodeType, shapeId, propertyShape, offendingValue, resultPath, severity, resultMessage");
737737

0 commit comments

Comments
 (0)