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: pages/advanced-algorithms/available-algorithms.mdx
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,7 +86,7 @@ If you want to know more and learn how this affects you, read our [announcement]
86
86
|[collections](/advanced-algorithms/available-algorithms/collections)| C++ | The collections module is a collection manipulation module that offers functions to work with lists in Cypher queries, allowing operations like filtering, sorting, and modification for efficient data handling. |
87
87
|[create](/advanced-algorithms/available-algorithms/create)| C++ | The create module is a set of powerful tools that provide additional capabilities for creating nodes and relationships in the Memgraph graph database. |
88
88
|[csv_utils](/advanced-algorithms/available-algorithms/csv_utils)| C++ | An utility module for creating and deleting CSV files. |
89
-
|[date](/advanced-algorithms/available-algorithms/date)|C++ | The `date` module provides various utilities to handle date and time operations within the Cypher query language. |
89
+
|[date](/advanced-algorithms/available-algorithms/date)|Python| The `date` module provides various utilities to handle date and time operations within the Cypher query language. |
90
90
|[do](/advanced-algorithms/available-algorithms/do)| C++ | A module that is used to define conditions not expressible in Cypher to control query execution. |
91
91
|[export_util](/advanced-algorithms/available-algorithms/export_util)| Python | A module for exporting the graph database in different formats (JSON). |
92
92
|[graph_analyzer](/advanced-algorithms/available-algorithms/graph_analyzer)| Python | This Graph Analyzer query module offers insights about the stored graph or a subgraph. |
@@ -100,6 +100,7 @@ If you want to know more and learn how this affects you, read our [announcement]
100
100
|[meta](/advanced-algorithms/available-algorithms/meta)| C++ | Provides information about graph nodes and relationships. |
101
101
|[meta_util](/advanced-algorithms/available-algorithms/meta_util)| Python | A module that contains procedures describing graphs on a meta-level. |
102
102
|[migrate](/advanced-algorithms/available-algorithms/migrate)| Python | A module that can access data from a MySQL, SQL Server or Oracle database. |
103
+
|[mgps](/advanced-algorithms/available-algorithms/mgps)| Python | A module containing various utility functions. |
103
104
|[neighbors](/advanced-algorithms/available-algorithms/neighbors)| C++ | The neighbors module allows users to interact with and query nodes that have direct relationships to a specified node. |
104
105
|[node](/advanced-algorithms/available-algorithms/node)| C++ | A module that provides a comprehensive toolkit for managing graph nodes, enabling creation, deletion, updating, merging, and more. |
105
106
|[nodes](/advanced-algorithms/available-algorithms/nodes)| C++ | A module that provides a comprehensive toolkit for managing multiple graph nodes, enabling linking, updating, type deduction and more. |
Merges the properties, labels and relationships for the source nodes to the target node.
973
+
974
+
{<h4className="custom-header"> Input: </h4>}
975
+
976
+
-`subgraph: Graph` (**OPTIONAL**) ➡ A specific subgraph, which is an [object of type Graph](/advanced-algorithms/run-algorithms#run-procedures-on-subgraph) returned by the `project()` function, on which the algorithm is run.
977
+
If subgraph is not specified, the algorithm is computed on the entire graph by default.
978
+
979
+
-`nodes: List[Node]` ➡ List of nodes that will be merged into the first node of the list. Exception is thrown if the node list is empty.
-`combine` ➡ if there are multiple values of the properties, they will be merged into a list of values. if there is only one property, then it will be the same value
983
+
-`override` ➡ last property in the list wins
984
+
-`overwrite` ➡ same as `override`
985
+
-`discard` ➡ discard the properties of the nodes - value will be null
986
+
-`.*: string` ➡ equivalent to properties
987
+
-`mergeRels: boolean` ➡ specify whether the relationships will be merged into the target node or discarded.
988
+
989
+
{<h4className="custom-header"> Output: </h4>}
990
+
991
+
-`node: Node` ➡ Merged node with updated properties, labels and relationships.
Replace each substring of the given string that matches the given regular expression with the given replacement.
144
+
145
+
{<h4className="custom-header"> Input: </h4>}
146
+
147
+
-`subgraph: Graph` (**OPTIONAL**) ➡ A specific subgraph, which is an [object of type Graph](/advanced-algorithms/run-algorithms#run-procedures-on-subgraph) returned by the `project()` function, on which the algorithm is run.
148
+
If subgraph is not specified, the algorithm is computed on the entire graph by default.
149
+
-`text: string` ➡ Text that needs to be replaced.
150
+
-`regex: string` ➡ Regular expression by which to replace the string.
151
+
-`replacement: string` ➡ Target string to replace the matched string.
152
+
153
+
{<h4className="custom-header"> Usage: </h4>}
154
+
155
+
Use the following queries to do text replacement:
156
+
157
+
```cypher
158
+
RETURN text.replace('Hello World!', '[^a-zA-Z]', '') AS result;
159
+
```
160
+
161
+
Result:
162
+
163
+
```plaintext
164
+
+--------------+
165
+
| result |
166
+
+--------------+
167
+
| "HelloWorld" |
168
+
+--------------+
169
+
```
170
+
171
+
```cypher
172
+
RETURN text.replace('MAGE is a Memgraph Product', 'MAGE', 'GQLAlchemy') AS result;
173
+
```
174
+
175
+
Result:
176
+
177
+
```plaintext
178
+
+------------------------------------+
179
+
| result |
180
+
+---------- -------------------------+
181
+
| "GQLAlchemy is a Memgraph Product" |
182
+
+------------------------------------+
183
+
```
184
+
185
+
### `regReplace()`
186
+
187
+
Replace each substring of the given string that matches the given regular expression with the given replacement.
188
+
189
+
{<h4className="custom-header"> Input: </h4>}
190
+
191
+
-`subgraph: Graph` (**OPTIONAL**) ➡ A specific subgraph, which is an [object of type Graph](/advanced-algorithms/run-algorithms#run-procedures-on-subgraph) returned by the `project()` function, on which the algorithm is run.
192
+
If subgraph is not specified, the algorithm is computed on the entire graph by default.
193
+
-`text: string` ➡ Text that needs to be replaced.
194
+
-`regex: string` ➡ Regular expression by which to replace the string.
195
+
-`replacement: string` ➡ Target string to replace the matched string.
196
+
197
+
{<h4className="custom-header"> Usage: </h4>}
198
+
199
+
Use the following query to do text replacement:
200
+
201
+
```cypher
202
+
RETURN text.regreplace("Memgraph MAGE Memgraph MAGE", "MAGE", "GQLAlchemy") AS output;
203
+
```
204
+
205
+
Result:
206
+
207
+
```plaintext
208
+
+---------------------------------------+
209
+
| result |
210
+
+---------------------------------------+
211
+
| "GQLAlchemy MAGE Memgraph GQLAlchemy" |
212
+
+---------------------------------------+
213
+
```
214
+
215
+
### `distance()`
216
+
217
+
Compare the given strings with the Levenshtein distance algorithm.
218
+
219
+
{<h4className="custom-header"> Input: </h4>}
220
+
221
+
-`subgraph: Graph` (**OPTIONAL**) ➡ A specific subgraph, which is an [object of type Graph](/advanced-algorithms/run-algorithms#run-procedures-on-subgraph) returned by the `project()` function, on which the algorithm is run.
222
+
If subgraph is not specified, the algorithm is computed on the entire graph by default.
223
+
-`text1: string` ➡ Source string.
224
+
-`text2: string` ➡ Destination string for comparison.
225
+
226
+
{<h4className="custom-header"> Usage: </h4>}
227
+
228
+
Use the following query to calculate distance between texts:
229
+
230
+
```cypher
231
+
RETURN text.distance("Levenshtein", "Levenstein") AS result;
0 commit comments