Skip to content

Commit

Permalink
Pattern expression should only be used for existance check. (neo4j-co…
Browse files Browse the repository at this point in the history
…ntrib#2653)

Co-authored-by: Linnéa Andersson <[email protected]>
  • Loading branch information
2 people authored and vga91 committed Mar 23, 2022
1 parent 32f27d8 commit 6238547
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions core/src/test/java/apoc/load/XmlTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -269,12 +269,12 @@ private void commonAssertionsWithNextWordRels(String query, Map<String, Object>
});

// no node more than one NEXT/NEXT_SIBLING
testCallEmpty(db, "match (n) where size( (n)-[:NEXT]->() ) > 1 return n", null);
testCallEmpty(db, "match (n) where size( (n)-[:NEXT_SIBLING]->() ) > 1 return n", null);
testCallEmpty(db, "match (n) where size([p = (n)-[:NEXT]->() | p ]) > 1 return n", null);
testCallEmpty(db, "match (n) where size([p = (n)-[:NEXT_SIBLING]->() | p ]) > 1 return n", null);

// no node more than one IS_FIRST_CHILD / IS_LAST_CHILD
testCallEmpty(db, "match (n) where size( (n)<-[:FIRST_CHILD_OF]-() ) > 1 return n", null);
testCallEmpty(db, "match (n) where size( (n)<-[:LAST_CHILD_OF]-() ) > 1 return n", null);
testCallEmpty(db, "match (n) where size([p = (n)<-[:FIRST_CHILD_OF]-() | p ]) > 1 return n", null);
testCallEmpty(db, "match (n) where size([p = (n)<-[:LAST_CHILD_OF]-() | p ]) > 1 return n", null);

// NEXT_WORD relationship do connect all word nodes
testResult(db, "match p=(:XmlDocument)-[:NEXT_WORD*]->(e:XmlWord) where not (e)-[:NEXT_WORD]->() return length(p) as len",
Expand All @@ -299,12 +299,12 @@ public void testLoadXmlWithNextEntityRels() {
});

// no node more than one NEXT/NEXT_SIBLING
testCallEmpty(db, "match (n) where size( (n)-[:NEXT]->() ) > 1 return n", null);
testCallEmpty(db, "match (n) where size( (n)-[:NEXT_SIBLING]->() ) > 1 return n", null);
testCallEmpty(db, "match (n) where size([p = (n)-[:NEXT]->() | p ]) > 1 return n", null);
testCallEmpty(db, "match (n) where size([p = (n)-[:NEXT_SIBLING]->() | p ]) > 1 return n", null);

// no node more than one IS_FIRST_CHILD / IS_LAST_CHILD
testCallEmpty(db, "match (n) where size( (n)<-[:FIRST_CHILD_OF]-() ) > 1 return n", null);
testCallEmpty(db, "match (n) where size( (n)<-[:LAST_CHILD_OF]-() ) > 1 return n", null);
testCallEmpty(db, "match (n) where size([p = (n)<-[:FIRST_CHILD_OF]-() | p ]) > 1 return n", null);
testCallEmpty(db, "match (n) where size([p = (n)<-[:LAST_CHILD_OF]-() | p ]) > 1 return n", null);

// NEXT_WORD relationship do connect all word nodes
testResult(db, "match p=(:XmlDocument)-[:NE*]->(e:XmlCharacters) where not (e)-[:NE]->() return length(p) as len",
Expand Down

0 comments on commit 6238547

Please sign in to comment.