Memgraph
Description
Memgraph is an in-memory graph database for realtime and scalable analytics which speaks Cypher over the Bolt protocol. Hop connects to it with a graph database connection of the Memgraph type. See Graph databases for the other graph databases Hop works with.
Run Memgraph in docker
Example command to start a Memgraph server in a container:
docker run -it -p 7687:7687 memgraph/memgraph
Memgraph Lab, the browser of Memgraph, runs in a container of its own: docker run -p 3000:3000 memgraph/lab.
What works
Use a graph database connection of the Memgraph type. With it, these work:
-
Graph query, including Return graph
-
Graph output, including the validation against the graph model and its indexes
-
Graph index and Graph constraint, in Memgraph’s syntax, see Memgraph syntax
-
Execution logging (
HOP_GRAPH_LOGGING_CONNECTION), the Get graph logging info transform and the Graph logging perspective -
The graph database location for execution information
What doesn’t work
-
Neo4j import: it runs neo4j-admin. Load the files of Generate graph CSVs with plain column names and
LOAD CSVinstead. -
Named indexes and constraints: Memgraph identifies them by their label and properties. The Graph index and Graph constraint actions ignore the names you give them, and drop them by label and properties.
-
Node key constraints (a combination of properties which has to exist and be unique, a Neo4j Enterprise feature) and constraints on relationships: Memgraph doesn’t have them. The Graph constraint action only offers unique and existence constraints on nodes.
-
Edge indexes on more than one property, and existence constraints on more than one property.
Memgraph syntax
The Memgraph connection type makes Hop generate Memgraph’s syntax, like a SQL dialect does for relational databases:
| Operation | Statement |
|---|---|
Graph index: node index |
|
Graph index: relationship index |
|
Graph index: drop |
|
Graph constraint: unique |
|
Graph constraint: existence |
|
Graph constraint: drop |
|
Graph output and Cypher output with Create indexes |
A unique constraint for a single key property, an index for several |
Memgraph doesn’t run some statements in an explicit transaction: information queries like SHOW INDEX INFO, and index and constraint changes.
Hop runs them on their own, in auto-commit transactions: in the Graph index and Graph constraint actions, in the Graph script action, and in the Graph query transform when every statement of a batch is one of them.
Known issues
With a Neo4j connection (protocol bolt) instead of a Memgraph connection, Hop uses the Neo4j syntax and transactions: creating indexes and constraints fails, for example with Index manipulation not allowed in multicommand transactions..
Change the type of the connection to Memgraph to solve this: convert the Neo4j connection to a graph database connection and select the Memgraph type.
Check the Memgraph docs for more information on indexing.