You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/graph-data-science.adoc
+31-59
Original file line number
Diff line number
Diff line change
@@ -61,11 +61,11 @@ Now, let's import the data.
61
61
.Create unique constraints on the names of the nodes `:Location`, `:Region`, `:Battle`, `:Person`, and `:House`. This ensures your data integrity and improves performance.
62
62
[source, cypher]
63
63
----
64
-
CREATE CONSTRAINT ON (n:Location) ASSERT n.name IS UNIQUE;
65
-
CREATE CONSTRAINT ON (n:Region) ASSERT n.name IS UNIQUE;
66
-
CREATE CONSTRAINT ON (n:Battle) ASSERT n.name IS UNIQUE;
67
-
CREATE CONSTRAINT ON (n:Person) ASSERT n.name IS UNIQUE;
68
-
CREATE CONSTRAINT ON (n:House) ASSERT n.name IS UNIQUE;
64
+
CREATE CONSTRAINT IF NOT EXISTS FOR (n:Location) REQUIRE (n.name) IS UNIQUE;
65
+
CREATE CONSTRAINT IF NOT EXISTS FOR (n:Region) REQUIRE (n.name) IS UNIQUE;
66
+
CREATE CONSTRAINT IF NOT EXISTS FOR (n:Battle) REQUIRE (n.name) IS UNIQUE;
67
+
CREATE CONSTRAINT IF NOT EXISTS FOR (n:Person) REQUIRE (n.name) IS UNIQUE;
68
+
CREATE CONSTRAINT IF NOT EXISTS FOR (n:House) REQUIRE (n.name) IS UNIQUE;
69
69
----
70
70
71
71
.Then, ingest the data.
@@ -411,7 +411,7 @@ FOREACH (d IN dead_spouse |
411
411
SET spouse:Dead
412
412
);
413
413
414
-
MATCH (p:Person) where exists (p.death_year)
414
+
MATCH (p:Person) where p.death_year is not null
415
415
SET p:Dead;
416
416
417
417
MATCH (p:Person)-[:DEFENDER_KING|ATTACKER_KING]-()
@@ -559,15 +559,15 @@ To estimate the required memory for a subset of your graph, for example, the `Pe
== Graph catalog: standard creation and Cypher projection
666
654
667
-
The GDS library supports two approaches for loading projected graphs - *standard creation* (`gds.graph.create()`) and *Cypher projection* (`gds.graph.create.cypher()`).
655
+
The GDS library supports two approaches for loading projected graphs - *standard creation* (`gds.graph.project()`) and *Cypher projection* (`gds.graph.project.cypher()`).
668
656
669
657
In the *standard creation* approach, which you used to create your graph, you specify node labels and relationship types and project them onto the in-memory graph as labels and relationship types with new names.
670
658
You can further specify properties for each node label and relationship type.
@@ -688,7 +676,7 @@ You need to return `id`, `source`, and `target` columns and can optionally retur
688
676
689
677
[source, cypher]
690
678
----
691
-
CALL gds.graph.create.cypher(
679
+
CALL gds.graph.project.cypher(
692
680
'got-interactions-cypher',
693
681
'MATCH (n:Person) RETURN id(n) AS id',
694
682
'MATCH (s:Person)-[i:INTERACTS]->(t:Person) RETURN id(s) AS source, id(t) AS target, i.weight AS weight'
@@ -709,7 +697,7 @@ The projected relationship does not exist in the stored graph.
709
697
710
698
[source, cypher]
711
699
----
712
-
CALL gds.graph.create.cypher(
700
+
CALL gds.graph.project.cypher(
713
701
'same-house-graph',
714
702
'MATCH (n:Person) RETURN id(n) AS id',
715
703
'MATCH (p1:Person)-[:BELONGS_TO]-(:House)-[:BELONGS_TO]-(p2:Person) RETURN id(p1) AS source, id(p2) AS target'
@@ -833,7 +821,7 @@ If you have removed it from the catalog, you have to create it again:
0 commit comments