Skip to content

Commit adaeaf7

Browse files
Add documentation for store filter query parameters
1 parent bcfe9be commit adaeaf7

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

doc/asciidoc/management-ops/graph-catalog/graph-project-subgraph.adoc

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ CALL gds.beta.graph.project.subgraph(
5656
| Name | Type | Default | Optional | Description
5757
| concurrency | Integer | 4 | yes | The number of concurrent threads used for filtering the graph.
5858
| jobId | String | Generated internally | yes | An ID that can be provided to more easily track the projection's progress.
59+
| parameters | Map | {} | yes | A map of user-defined query parameters that are passed into the node and relationship filters.
5960
|===
6061

6162
.Results
@@ -155,6 +156,7 @@ YIELD graphName, nodeCount, relationshipCount, projectMillis
155156
<4> Project `READS` relationships without any of their properties.
156157

157158

159+
[[catalog-graph-project-subgraph-node-filter-example]]
158160
=== Node filtering
159161

160162
[role=query-example]
@@ -252,3 +254,32 @@ YIELD graphName, fromGraphName, nodeCount, relationshipCount
252254
| "teenagers-books" | "social-graph" | 3 | 1
253255
|===
254256
--
257+
258+
259+
=== Using query parameters
260+
261+
Similar to https://neo4j.com/docs/cypher-manual/current/syntax/parameters/[Cypher], it is also possible to set query parameters.
262+
As an example we can rewrite the <<catalog-graph-project-subgraph-node-filter-example, node filter example>> from above using parameters instead of integer literals:
263+
264+
[role=query-example]
265+
--
266+
.Create a new graph containing only users of a certain age group:
267+
[source, cypher, role=noplay]
268+
----
269+
CALL gds.beta.graph.project.subgraph(
270+
'teenagers-parameterized',
271+
'social-graph',
272+
'n.age > $lower AND n.age <= $upper',
273+
'*',
274+
{ parameters: { lower: 13, upper: 18 } }
275+
)
276+
YIELD graphName, fromGraphName, nodeCount, relationshipCount
277+
----
278+
279+
.Results
280+
[opts="header"]
281+
|===
282+
| graphName | fromGraphName | nodeCount | relationshipCount
283+
| "teenagers-parameterized" | "social-graph" | 2 | 1
284+
|===
285+
--

0 commit comments

Comments
 (0)