Skip to content

Commit 2e3ee1a

Browse files
committed
Adapt graph.project() related tests
1 parent 6220cd1 commit 2e3ee1a

File tree

4 files changed

+39
-34
lines changed

4 files changed

+39
-34
lines changed

doc/modules/ROOT/pages/management-ops/projections/graph-project.adoc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ YIELD
406406
[opts="header", cols="1,3m,1,3m,1m"]
407407
|===
408408
| graph | nodeProjection | nodes | relationshipProjection | rels
409-
| "persons" | {Person={label=Person, properties={}}} | 3 | {KNOWS={orientation=NATURAL, aggregation=DEFAULT, type=KNOWS, properties={}}} | 2
409+
| "persons" | {Person={label=Person, properties={}}} | 3 | {KNOWS={orientation=NATURAL, indexInverse=false, aggregation=DEFAULT, type=KNOWS, properties={}}} | 2
410410
|===
411411
--
412412

@@ -480,8 +480,8 @@ YIELD
480480
.Results
481481
[opts="header", cols="1,3m,1m,1m"]
482482
|===
483-
| graph | knowsProjection | nodes | rels
484-
| "undirectedKnows" | {KNOWS={orientation=UNDIRECTED, aggregation=DEFAULT, type=KNOWS, properties={}}} | 3 | 4
483+
| graph | knowsProjection | nodes | rels
484+
| "undirectedKnows" | {KNOWS={orientation=UNDIRECTED, indexInverse=false, aggregation=DEFAULT, type=KNOWS, properties={}}} | 3 | 4
485485
|===
486486
--
487487

@@ -589,8 +589,8 @@ YIELD
589589
.Results
590590
[opts="header", cols="1,3m,1m,1m"]
591591
|===
592-
| graph | readProjection | nodes | rels
593-
| "readWithProperties" | {READ={orientation=NATURAL, aggregation=DEFAULT, type=READ, properties={numberOfPages={defaultValue=null, property=numberOfPages, aggregation=DEFAULT}}}} | 5 | 4
592+
| graph | readProjection | nodes | rels
593+
| "readWithProperties" | {READ={orientation=NATURAL, indexInverse=false, aggregation=DEFAULT, type=READ, properties={numberOfPages={defaultValue=null, property=numberOfPages, aggregation=DEFAULT}}}} | 5 | 4
594594
|===
595595
--
596596

@@ -671,8 +671,8 @@ YIELD
671671
.Results
672672
[opts="header", cols="1,3m,1m,1m"]
673673
|===
674-
| graph | readProjection | nodes | rels
675-
| "readCount" | {READ={orientation=NATURAL, aggregation=DEFAULT, type=READ, properties={numberOfReads={defaultValue=null, property=*, aggregation=COUNT}}}} | 5 | 3
674+
| graph | readProjection | nodes | rels
675+
| "readCount" | {READ={orientation=NATURAL, indexInverse=false, aggregation=DEFAULT, type=READ, properties={numberOfReads={defaultValue=null, property=*, aggregation=COUNT}}}} | 5 | 3
676676
|===
677677
--
678678

@@ -732,8 +732,8 @@ YIELD
732732
.Results
733733
[opts="header", cols="1,3m,1m,1m"]
734734
|===
735-
| graph | readProjection | nodes | rels
736-
| "readSums" | {READ={orientation=NATURAL, aggregation=DEFAULT, type=READ, properties={numberOfPages={defaultValue=null, property=numberOfPages, aggregation=SUM}}}} | 5 | 3
735+
| graph | readProjection | nodes | rels
736+
| "readSums" | {READ={orientation=NATURAL, indexInverse=false, aggregation=DEFAULT, type=READ, properties={numberOfPages={defaultValue=null, property=numberOfPages, aggregation=SUM}}}} | 5 | 3
737737
|===
738738
--
739739

proc/catalog/src/test/java/org/neo4j/gds/catalog/GraphDropProcTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ void dropGraphFromCatalog() {
109109
"type", "REL",
110110
"orientation", "NATURAL",
111111
"aggregation", "DEFAULT",
112+
"indexInverse", false,
112113
"properties", emptyMap()
113114
)
114115
)

proc/catalog/src/test/java/org/neo4j/gds/catalog/GraphListProcTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ void listASingleLabelRelationshipTypeProjection() {
116116
"type", "REL",
117117
"orientation", "NATURAL",
118118
"aggregation", "DEFAULT",
119+
"indexInverse", false,
119120
"properties", emptyMap()
120121
)
121122
)
@@ -225,6 +226,7 @@ void listGeneratedGraph() {
225226
"type", "REL",
226227
"orientation", "NATURAL",
227228
"aggregation", "NONE",
229+
"indexInverse", false,
228230
"properties", emptyMap()
229231
)
230232
))

proc/catalog/src/test/java/org/neo4j/gds/catalog/GraphProjectProcTest.java

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
import static org.neo4j.gds.AbstractNodeProjection.LABEL_KEY;
8686
import static org.neo4j.gds.ElementProjection.PROPERTIES_KEY;
8787
import static org.neo4j.gds.RelationshipProjection.AGGREGATION_KEY;
88+
import static org.neo4j.gds.RelationshipProjection.INDEX_INVERSE_KEY;
8889
import static org.neo4j.gds.RelationshipProjection.ORIENTATION_KEY;
8990
import static org.neo4j.gds.RelationshipProjection.TYPE_KEY;
9091
import static org.neo4j.gds.TestSupport.assertGraphEquals;
@@ -160,6 +161,7 @@ RELATIONSHIP_PROJECTION_KEY, map(
160161
TYPE_KEY, "REL",
161162
ORIENTATION_KEY, Orientation.NATURAL.name(),
162163
AGGREGATION_KEY, Aggregation.DEFAULT.name(),
164+
INDEX_INVERSE_KEY, false,
163165
PROPERTIES_KEY, emptyMap()
164166
)
165167
),
@@ -435,7 +437,12 @@ void relationshipProjectionOrientations(String orientation) {
435437
"graphName", name,
436438
NODE_PROJECTION_KEY, isA(Map.class),
437439
RELATIONSHIP_PROJECTION_KEY, map("B", genericMap(
438-
map("type", "REL", ORIENTATION_KEY, orientation, PROPERTIES_KEY, emptyMap()),
440+
map(
441+
"type", "REL",
442+
ORIENTATION_KEY, orientation,
443+
INDEX_INVERSE_KEY, false,
444+
PROPERTIES_KEY, emptyMap()
445+
),
439446
AGGREGATION_KEY,
440447
Aggregation.DEFAULT.name()
441448
)),
@@ -473,6 +480,7 @@ RELATIONSHIP_PROJECTION_KEY, map(
473480
map("type", "REL",
474481
ORIENTATION_KEY, "NATURAL",
475482
AGGREGATION_KEY, "DEFAULT",
483+
INDEX_INVERSE_KEY, false,
476484
PROPERTIES_KEY, expectedProperties
477485
)
478486
),
@@ -547,6 +555,7 @@ RELATIONSHIP_PROJECTION_KEY, map(
547555
"type", "REL",
548556
ORIENTATION_KEY, "NATURAL",
549557
AGGREGATION_KEY, aggregation,
558+
INDEX_INVERSE_KEY, false,
550559
PROPERTIES_KEY, map(
551560
"weight", map(
552561
"property", "weight",
@@ -598,6 +607,7 @@ RELATIONSHIP_PROJECTION_KEY, map("B", map(
598607
"type", "REL",
599608
ORIENTATION_KEY, "NATURAL",
600609
AGGREGATION_KEY, "DEFAULT",
610+
INDEX_INVERSE_KEY, false,
601611
PROPERTIES_KEY, map("weight", map(
602612
"property", "weight",
603613
AGGREGATION_KEY, aggregation,
@@ -708,6 +718,7 @@ RELATIONSHIP_PROJECTION_KEY, map(
708718
"type", "REL",
709719
ORIENTATION_KEY, "NATURAL",
710720
AGGREGATION_KEY, "DEFAULT",
721+
INDEX_INVERSE_KEY, false,
711722
PROPERTIES_KEY, map(
712723
"weight", map(
713724
"property", "weight",
@@ -1666,14 +1677,11 @@ static Stream<Arguments> relationshipProjectionVariants() {
16661677
map(
16671678
"REL",
16681679
map(
1669-
"type",
1670-
"REL",
1671-
ORIENTATION_KEY,
1672-
"NATURAL",
1673-
AGGREGATION_KEY,
1674-
"DEFAULT",
1675-
PROPERTIES_KEY,
1676-
emptyMap()
1680+
"type", "REL",
1681+
ORIENTATION_KEY, "NATURAL",
1682+
AGGREGATION_KEY, "DEFAULT",
1683+
INDEX_INVERSE_KEY, false,
1684+
PROPERTIES_KEY, emptyMap()
16771685
)
16781686
)
16791687
),
@@ -1683,14 +1691,11 @@ static Stream<Arguments> relationshipProjectionVariants() {
16831691
map(
16841692
"CONNECTS",
16851693
map(
1686-
"type",
1687-
"REL",
1688-
ORIENTATION_KEY,
1689-
"NATURAL",
1690-
AGGREGATION_KEY,
1691-
"DEFAULT",
1692-
PROPERTIES_KEY,
1693-
emptyMap()
1694+
"type", "REL",
1695+
ORIENTATION_KEY, "NATURAL",
1696+
AGGREGATION_KEY, "DEFAULT",
1697+
INDEX_INVERSE_KEY, false,
1698+
PROPERTIES_KEY, emptyMap()
16941699
)
16951700
)
16961701
),
@@ -1700,14 +1705,11 @@ static Stream<Arguments> relationshipProjectionVariants() {
17001705
map(
17011706
"REL",
17021707
map(
1703-
"type",
1704-
"REL",
1705-
ORIENTATION_KEY,
1706-
"NATURAL",
1707-
AGGREGATION_KEY,
1708-
"DEFAULT",
1709-
PROPERTIES_KEY,
1710-
emptyMap()
1708+
"type", "REL",
1709+
ORIENTATION_KEY, "NATURAL",
1710+
AGGREGATION_KEY, "DEFAULT",
1711+
INDEX_INVERSE_KEY, false,
1712+
PROPERTIES_KEY, emptyMap()
17111713
)
17121714
)
17131715
)

0 commit comments

Comments
 (0)