Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 109 additions & 0 deletions pages/advanced-algorithms/available-algorithms/refactor.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,115 @@ The `refactor` module provides utilities for changing nodes and relationships.
If you want to execute this algorithm on graph projections, subgraphs or portions of the graph, be sure to check out [how to run a MAGE module on subgraphs](/advanced-algorithms/run-algorithms#run-procedures-on-subgraph).
</Callout>

### `from(relationship, new_from)`

Redirect the relationship to use a new start (from) node.

#### Input:

- `relationship: Relationship` ➡ the relationship to be modified.
- `new_from: Node` ➡ new start (from) node.

#### Output:

- `relationship` - the modified relationship.

#### Usage:

```cypher
MERGE (ivan:Person {name: "Ivan"}) MERGE (matija:Person {name: "Matija"}) MERGE (diora:Person {name:"Idora"}) CREATE (ivan)-[:Friends]->(matija);
```

The following query changes the the relationship `Ivan ➡ Matija` to `Idora ➡ Matija`.
```cypher
MATCH (:Person {name: "Ivan"})-[rel:Friends]->(:Person {name: "Matija"}) MATCH (idora: Person {name:"Idora"}) CALL refactor.from(rel, idora) YIELD relationship RETURN relationship;
```

### `to(relationship, new_to)`

Redirect the relationship to use a new end (to) node.

#### Input:

- `relationship: Relationship` ➡ the relationship to be modified.
- `new_to: Node` ➡ new end (to) node.

#### Output:

- `relationship` - the modified relationship.

#### Usage:

```cypher
MERGE (ivan:Person {name: "Ivan"}) MERGE (matija:Person {name: "Matija"}) MERGE (diora:Person {name:"Idora"}) CREATE (ivan)-[:Friends]->(matija);
```
The following query changes the the relationship `Ivan ➡ Matija` to `Ivan ➡ Idora`.
```cypher
MATCH (:Person {name: "Ivan"})-[rel:Friends]->(:Person {name: "Matija"}) MATCH (idora: Person {name:"Idora"}) CALL refactor.to(rel, idora) YIELD relationship RETURN relationship;
```

### `rename_label(old_label, new_label, nodes)`

Rename a label from `old_label` to `new_label` for all nodes. If `nodes` is provided renaming is applied only to the given nodes. If a node doesn't contain the `old_label` the procedure doesn't modify it.

#### Input:

- `old_label: str` ➡ old label name.
- `new_label: str` ➡ new label name.
- `nodes: List[Node]` ➡ list of nodes to be modified.

### Output:

- `nodes_changed: int` ➡ number of modified nodes.

#### Usage:

```cypher
CREATE (:Node1 {title: "Node1"}) CREATE (:Node2 {title: "Node2"}) CREATE (:Node1);
```
The following query changes the label of the first node to `Node`
```cypher
MATCH(n) WITH collect(n) AS nodes CALL refactor.rename_label("Node1", "Node3", nodes) YIELD nodes_changed RETURN nodes_changed;
```
```plaintext
+----------------------------+
| nodes_changed |
+----------------------------+
| 2 |
+----------------------------+
```

### `rename_node_property(old_property, new_property, nodes)`

Rename a property from `old_property` to `new_property` for all nodes. If `nodes` is provided renaming is applied only to the given nodes. If a node doesn't contain the `old_property` the procedure doesn't modify it.

#### Input:

- `old_property: str` ➡ old property name.
- `new_label: str` ➡ new property name.
- `nodes: List[Node]` ➡ list of nodes to be modified.

### Output:

- `nodes_changed: int` ➡ number of modified nodes.

#### Usage:

```cypher
CREATE (:Node1 {title: "Node1"}) CREATE (:Node2 {description: "Node2"}) CREATE (:Node3) CREATE (:Node4 {title: "title", description: "description"});
```
The following query will modify `Node1` and `Node4`.
```cypher
MATCH(n) WITH collect(n) AS nodes CALL refactor.rename_node_property("title", "description", nodes) YIELD nodes_changed RETURN nodes_changed;
```
```plaintext
+----------------------------+
| nodes_changed |
+----------------------------+
| 2 |
+----------------------------+
```

### `categorize(original_prop_key, rel_type, is_outgoing, new_label, new_prop_name_key, copy_props_list)`

Generates a new category of nodes based on a specific property key from the existing nodes in the graph. Then, it creates relationships between the original and new category nodes to organize a graph based on these categories.
Expand Down
376 changes: 303 additions & 73 deletions pages/configuration/configuration-settings.mdx

Large diffs are not rendered by default.

21 changes: 20 additions & 1 deletion pages/data-migration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ description: Master the process of data migration with Memgraph. In-depth docume
---

import { Callout } from 'nextra/components'
import { Card, Cards } from 'nextra/components'

# Data migration

Expand Down Expand Up @@ -87,4 +88,22 @@ into Memgraph using [GQLAlchemy](https://memgraph.github.io/gqlalchemy/how-to-gu
## NetworkX, PyG or DGL graph

If you are a Python user you can import NetworkX, PyG or DGL graph into Memgraph
using [GQLAlchemy](https://memgraph.github.io/gqlalchemy/how-to-guides/translators/import-python-graphs/).
using [GQLAlchemy](https://memgraph.github.io/gqlalchemy/how-to-guides/translators/import-python-graphs/).

## Memgraph's office hours

Schedule a 30 min session with one of our engineers to discuss how Memgraph fits
with your architecture. Our engineers are highly experienced in helping
companies of all sizes to integrate and get the most out of Memgraph in their
projects. Talk to us about data modeling, optimizing queries, defining
infrastructure requirements or migrating from your existing graph database. No
nonsense or sales pitch, just tech.

![](/pages/getting-started/memgraph-office-hours.svg)

<Cards>
<Card
title="Book a call"
href="https://memgraph.com/office-hours"
/>
</Cards>
20 changes: 20 additions & 0 deletions pages/data-migration/migrate-from-neo4j.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: Migrate from Neo4j to Memgraph
description: Switch from Neo4j to Memgraph smoothly. Detailed documentation to guide the migration process for a seamless transition to Memgraph.
---

import { Card, Cards } from 'nextra/components'

# Migrate from Neo4j to Memgraph

Memgraph is a native in-memory graph database specialized for real-time
Expand Down Expand Up @@ -512,3 +514,21 @@ open-source repository MAGE to solve graph analytics problems, create awesome
customized visual displays of your nodes and relationships with [Graph Style
Script](/data-visualization/graph-style-script) and above all - enjoy your new
graph database!

## Memgraph's office hours

Schedule a 30 min session with one of our engineers to discuss how Memgraph fits
with your architecture. Our engineers are highly experienced in helping
companies of all sizes to integrate and get the most out of Memgraph in their
projects. Talk to us about data modeling, optimizing queries, defining
infrastructure requirements or migrating from your existing graph database. No
nonsense or sales pitch, just tech.

![](/pages/getting-started/memgraph-office-hours.svg)

<Cards>
<Card
title="Book a call"
href="https://memgraph.com/office-hours"
/>
</Cards>
20 changes: 19 additions & 1 deletion pages/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,22 @@ data using Memgraph Lab.
/>
</Cards>

</Steps>
</Steps>

## Memgraph's office hours

Schedule a 30 min session with one of our engineers to discuss how Memgraph fits
with your architecture. Our engineers are highly experienced in helping
companies of all sizes to integrate and get the most out of Memgraph in their
projects. Talk to us about data modeling, optimizing queries, defining
infrastructure requirements or migrating from your existing graph database. No
nonsense or sales pitch, just tech.

![](/pages/getting-started/memgraph-office-hours.svg)

<Cards>
<Card
title="Book a call"
href="https://memgraph.com/office-hours"
/>
</Cards>
File renamed without changes.
1 change: 0 additions & 1 deletion pages/help-center/errors/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"durability": "Durability",
"memory": "Memory",
"modules": "Modules",
"overview": "Overview",
"ports": "Ports",
"python-modules": "Python modules",
"snapshots": "Snapshots",
Expand Down
Loading