Skip to content

Commit d1bed12

Browse files
committed
Fix documentation for remote projection
- no more property schemas - concurrency config
1 parent d7829bf commit d1bed12

File tree

1 file changed

+8
-20
lines changed

1 file changed

+8
-20
lines changed

doc/modules/ROOT/pages/gds-session.adoc

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,9 @@ The Cypher query must contain the `gds.graph.project.remote()` function to proje
126126
gds.graph.project(
127127
graph_name: str,
128128
query: str,
129-
nodePropertySchema: dict[str, GdsPropertyTypes],
130-
relationshipPropertySchema: dict[str, GdsPropertyTypes],
131-
undirectedRelationshipTypes: list[str],
132-
inverseIndexedRelationshipTypes: list[str],
129+
concurrency: int = 4,
130+
undirected_relationship_types: Optional[List[str]] = None,
131+
inverse_indexed_relationship_types: Optional[List[str]] = None,
133132
): (Graph, Series[Any])
134133
----
135134

@@ -139,8 +138,7 @@ gds.graph.project(
139138
| Name | Optional | Description
140139
| graph_name | no | Name of the graph.
141140
| query | no | Projection query.
142-
| nodePropertySchema | yes | Mapping of node property names to their types.
143-
| relationshipPropertySchema | yes | Mapping of relationship property names to their types.
141+
| concurrency | yes | Concurrency to use for building the graph within the session.
144142
| undirectedRelationshipTypes | yes | List of relationship type names that should be treated as undirected.
145143
| inverseIndexedRelationshipTypes | yes | List of relationship type names that should be indexed in reverse.
146144
|===
@@ -165,15 +163,6 @@ Instead, the graph name is provided to the `gds.graph.project()` endpoint.
165163
For full details and examples on how to write Cypher projection queries, see the https://neo4j.com/docs/graph-data-science/current/management-ops/graph-creation/graph-project-cypher-projection/[Cypher projection documentation in the GDS Manual].
166164

167165

168-
==== Property schemas
169-
170-
The optional parameters `nodePropertySchema` and `relationshipPropertySchema` are useful when projecting graphs with multiple node labels or relationship types which have distinct property sets (_heterogeneous graphs_).
171-
172-
If these parameters are not provided, the type of each property is inferred from the first row of data seen by the projection function.
173-
For homogeneous graphs this is usually sufficient, while for heterogeneous graphs it is not.
174-
For this reason, we recommend to always use the property schema parameters.
175-
176-
177166
==== Relationship type undirectedness and inverse indexing
178167

179168
The optional parameters `undirectedRelationshipTypes` and `inverseIndexedRelationshipTypes` are used to configure undirectedness and inverse indexing of relationships.
@@ -226,8 +215,8 @@ With the `gds` GDS Session active, project the graph and specify node and relati
226215
from graphdatascience.session import GdsPropertyTypes
227216
228217
G, result = gds.graph.project(
229-
"my-graph",
230-
"""
218+
graph_name="my-graph",
219+
query="""
231220
CALL {
232221
MATCH (u1:User)
233222
OPTIONAL MATCH (u1)-[r:KNOWS]->(u2:User)
@@ -246,8 +235,6 @@ G, result = gds.graph.project(
246235
relationshipProperties: properties(rel)
247236
})
248237
""",
249-
nodePropertySchema={"cost": GdsPropertyTypes.DOUBLE},
250-
relationshipPropertySchema={"since": GdsPropertyTypes.LONG, "price": GdsPropertyTypes.DOUBLE},
251238
)
252239
----
253240

@@ -263,12 +250,13 @@ For instance, you can run the PageRank and FastRP algorithms on the projected gr
263250
gds.pageRank.mutate(G, mutateProperty="pr")
264251
gds.fastRP.mutate(G, featureProperties=["pr"], embeddingDimension=2, nodeSelfInfluence=0.1, mutateProperty="embedding")
265252
266-
# Stream the results back together with the `name` property fetched from the database
253+
# Stream the results back together with the `name` property fetched from the database
267254
gds.graph.nodeProperties.stream(G, db_node_properties=["name"], node_properties=["pr", "embedding"])
268255
----
269256

270257
For a full list of the available algorithms, see the https://neo4j.com/docs/graph-data-science-client/{page-version}/api/[API reference].
271258

259+
272260
== Remote write-back
273261

274262
The GDS Session's in-memory graph was projected from data in AuraDB, so write-back operations will persist the data back to the same AuraDB instance.

0 commit comments

Comments
 (0)