All Projects â†’ memgraph â†’ mage

memgraph / mage

Licence: Apache-2.0 license
MAGE - Memgraph Advanced Graph Extensions 🔮

Programming Languages

C++
36643 projects - #6 most used programming language
python
139335 projects - #7 most used programming language
rust
11053 projects
c
50402 projects - #5 most used programming language
Cuda
1817 projects
CMake
9771 projects

Projects that are alternatives of or similar to mage

Neo4j Graph Algorithms
Efficient Graph Algorithms for Neo4j
Stars: ✭ 713 (+701.12%)
Mutual labels:  graph-algorithms, graph-database, cypher
Neo4j Apoc Procedures
Awesome Procedures On Cypher for Neo4j - codenamed "apoc"                     If you like it, please ★ above ⇧            
Stars: ✭ 1,291 (+1350.56%)
Mutual labels:  graph-algorithms, graph-database
GraphiPy
GraphiPy: Universal Social Data Extractor
Stars: ✭ 61 (-31.46%)
Mutual labels:  graph-algorithms, graph-database
NeoClient
🦉 Lightweight OGM for Neo4j which support transactions and BOLT protocol.
Stars: ✭ 21 (-76.4%)
Mutual labels:  graph-database, cypher
Movies Python Bolt
Neo4j Movies Example application with Flask backend using the neo4j-python-driver
Stars: ✭ 197 (+121.35%)
Mutual labels:  graph-database, cypher
Neo4j Streams
Neo4j Kafka Integrations, Docs =>
Stars: ✭ 126 (+41.57%)
Mutual labels:  stream-processing, graph-database
neo4j-faker
Use faker cypher functions to generate demo and test data with cypher
Stars: ✭ 30 (-66.29%)
Mutual labels:  graph-database, cypher
Redisgraph
A graph database as a Redis module
Stars: ✭ 1,292 (+1351.69%)
Mutual labels:  graph-database, cypher
angular-neo4j
Neo4j Bolt driver wrapper for Angular
Stars: ✭ 18 (-79.78%)
Mutual labels:  graph-database, cypher
dagger
Dagger is an easy-to-use, configuration over code, cloud-native framework built on top of Apache Flink for stateful processing of real-time streaming data.
Stars: ✭ 238 (+167.42%)
Mutual labels:  stream-processing, real-time-analytics
Public-Transport-SP-Graph-Database
Metropolitan Transport Network from São Paulo mapped in a NoSQL graph database.
Stars: ✭ 25 (-71.91%)
Mutual labels:  graph-database, cypher
Neo4j Etl
Data import from relational databases to Neo4j.
Stars: ✭ 165 (+85.39%)
Mutual labels:  graph-database, cypher
Neo4j 3d Force Graph
Experiments with Neo4j & 3d-force-graph https://github.com/vasturiano/3d-force-graph
Stars: ✭ 159 (+78.65%)
Mutual labels:  graph-database, cypher
Movies Javascript Bolt
Neo4j Movies Example with webpack-in-browser app using the neo4j-javascript-driver
Stars: ✭ 123 (+38.2%)
Mutual labels:  graph-database, cypher
ml-models
Machine Learning Procedures and Functions for Neo4j
Stars: ✭ 63 (-29.21%)
Mutual labels:  graph-database, cypher
spotify-song-recommender
A Spotify song recommendation engine built with the power of graph analytics.
Stars: ✭ 34 (-61.8%)
Mutual labels:  graph-algorithms, memgraph
Movies Java Bolt
Neo4j Movies Example application with SparkJava backend using the neo4j-java-driver
Stars: ✭ 66 (-25.84%)
Mutual labels:  graph-database, cypher
Neo4j
Graphs for Everyone
Stars: ✭ 9,582 (+10666.29%)
Mutual labels:  graph-database, cypher
janusgraph-docker
Yet another JanusGraph, Cassandra/Scylla and Elasticsearch in Docker Compose setup
Stars: ✭ 54 (-39.33%)
Mutual labels:  graph-database, cypher
blockchain-etl-streaming
Streaming Ethereum and Bitcoin blockchain data to Google Pub/Sub or Postgres in Kubernetes
Stars: ✭ 57 (-35.96%)
Mutual labels:  stream-processing, real-time-analytics


MAGE
MAGE

Memgraph Advanced Graph Extensions 🔮

This open-source repository contains all available user-defined graph analytics modules and procedures that extend the Cypher query language, written by the team behind Memgraph and its users. You can find and contribute implementations of various algorithms in multiple programming languages, all runnable inside Memgraph. This project aims to give everyone the tools they need to tackle the most challenging graph problems.

Introduction to query modules with MAGE

Memgraph introduces the concept of query modules, user-defined procedures that extend the Cypher query language. These procedures are grouped into modules that can be loaded into Memgraph. How to run them can be seen on their official documentation. When started, Memgraph will automatically attempt to load the query modules from all *.so and *.py files it finds in the default directory defined with flag --query-modules-directory.

Further reading

If you want more info about MAGE, check out the official MAGE Documentation.

Algorithm proposition

Furthermore, if you have an algorithm proposition, please fill in the survey on mage.memgraph.com.

Community

Make sure to check out the Memgraph community and join us on a survey of streaming graph algorithms! Drop us a message on the channels below:

Follow @memgraphmage Discourse forum Discord Memgraph Github Memgraph YouTube

Overview

Memgraph compatibility

With changes in Memgraph API, MAGE started to track version numbers. The table below lists the compatibility of MAGE with Memgraph versions.

MAGE version Memgraph version
>= 1.0 >= 2.0.0
^0 >= 1.4.0 <= 1.6.1

How to install MAGE?

There are two options to install MAGE. For the Docker installation, you only need Docker installed. To build from source, you will need Python3, Make, CMake, Clang, UUID and Rust.

After the installation, you will be ready to query Memgraph and use MAGE modules. Make sure to have one of the querying platforms installed as well.

1. Installing MAGE with Docker

a) Install MAGE from Docker Hub

1. This command downloads the image from Docker Hub and runs Memgraph preloaded with MAGE modules:

docker run -p 7687:7687 memgraph/memgraph-mage

b) Install MAGE with Docker build of the repository

0. Make sure that you have cloned the MAGE Github repository and positioned yourself inside the repo in your terminal:

git clone https://github.com/memgraph/mage.git && cd mage

1. To build the MAGE image run the following command:

docker build  -t memgraph-mage .

This will build any new algorithm added to MAGE, and load it inside Memgraph.

2. Start the container with the following command and enjoy Memgraph with MAGE:

docker run --rm -p 7687:7687 --name mage memgraph-mage

NOTE: if you made any changes while the MAGE Docker container was running, you will need to stop it and rebuild the whole image, or you can copy the mage directory inside the Docker container and do the rebuild from there. To learn more about development with MAGE and Docker, visit the documentation.

2. Installing MAGE on Linux distro from source

Note: This step is more suitable for local development.

Prerequisites

  • Linux based Memgraph package you can download here. We offer Ubuntu, Debian and CentOS based Memgraph packages. To install, proceed to the following site.
  • To build and install MAGE query modules you will need: Python3, Make, CMake, Clang, UUID and Rust.

Since Memgraph needs to load MAGE's modules, there is the setup script to help you.

Run the build command of the setup script. It will generate a mage/dist directory with all the *.so and *.py files. Flag -p (--path) represents where will contents of mage/dist directory be copied. You need to copy it to /usr/lib/memgraph/query_modules directory, because that's where Memgraph is looking for query modules by default.

python3 setup build -p /usr/lib/memgraph/query_modules

Note that query modules are loaded into Memgraph on startup so if your instance was already running you will need to execute the following query inside one of the querying platforms to load them: CALL mg.load_all();

Running MAGE

This is an example of running the PageRank algorithm on a simple graph. You can find more details on the documentation page.

// Create the graph from the image below

CALL pagerank.get()
YIELD node, rank;
Graph input MAGE output
graph_input graph_output

MAGE Spells

Algorithms Lang Description
betweenness_centrality C++ The betweenness centrality of a node is defined as the sum of the of all-pairs shortest paths that pass through the node divided by the number of all-pairs shortest paths in the graph. The algorithm has O(nm) time complexity.
betweenness_centrality_online C++ The betweenness centrality of a node is defined as the sum of the of all-pairs shortest paths that pass through the node divided by the number of all-pairs shortest paths in the graph. The algorithm has O(nm) time complexity.
biconnected_components C++ An algorithm for calculating maximal biconnected subgraph. A biconnected subgraph is a subgraph with a property that if any vertex were to be removed, the graph will remain connected.
bipartite_matching C++ An algorithm for calculating maximum bipartite matching, where matching is a set of nodes chosen in such a way that no two edges share an endpoint.
bridges C++ A bridge is an edge, which when deleted, increases the number of connected components. The goal of this algorithm is to detect edges that are bridges in a graph.
community_detection C++ The Louvain method for community detection is a greedy method for finding communities with maximum modularity in a graph. Runs in O(nlogn) time.
community_detection_online C++ A dynamic community detection algorithm suitable for large-scale graphs based upon label propagation. Runs in O(m) time and has O(mn) space complexity.
cycles C++ Algorithm for detecting cycles on graphs
cugraph CUDA Collection of NVIDIA GPU-powered algorithms integrated in Memgraph. Includes centrality measures, link analysis and graph clusterings.
distance_calculator Python Module for finding the geographical distance between two points defined with 'lng' and 'lat' coordinates.
export_util Python A module for exporting the graph database in different formats (JSON).
graph_analyzer Python This Graph Analyzer query module offers insights about the stored graph or a subgraph.
graph_coloring Python An algorithm for assigning labels to the graph elements subject to certain constraints. In this form, it is a way of coloring the graph vertices such that no two adjacent vertices are of the same color.
import_util Python A module for importing data generated by the export_util().
json_util Python A module for loading JSON from a local file or remote address.
katz_centrality C++ Katz centrality is a centrality measurement that outputs a node's influence based on the number of shortest paths and their weighted length.
katz_centrality_online C++ Online implementation of the Katz centrality. Outputs the approximate result for Katz centrality while maintaining the order of rankings.
max_flow Python An algorithm for calculating maximum flow through a graph using capacity scaling
node2vec Python An algorithm for calculating node embeddings from static graphs.
node2vec_online Python An algorithm for calculating node embeddings as new edges arrive
node_similarity Python A module that contains similarity measures for calculating the similarity between two nodes.
nxalg Python A module that provides NetworkX integration with Memgraph and implements many NetworkX algorithms
pagerank C++ An algorithm that yields the influence measurement based on the recursive information about the connected nodes influence
pagerank_online C++ A dynamic algorithm made for calculating PageRank in a graph streaming scenario.
rust_example Rust Example of a basic module with input parameters forwarding, made in Rust.
set_cover Python The algorithm for finding minimum cost subcollection of sets that covers all elements of a universe.
temporal_graph_networks Python GNN temporal graph algorithm to predict links or do node classification.
tsp Python An algorithm for finding the shortest possible route that visits each vertex exactly once.
union_find Python A module with an algorithm that enables the user to check whether the given nodes belong to the same connected component.
uuid_generator C++ A module that generates a new universally unique identifier (UUID).
vrp Python An algorithm for finding the shortest route possible between the central depot and places to be visited. The algorithm can be solved with multiple vehicles that represent a visiting fleet.
weakly_connected_components C++ A module that finds weakly connected components in a graph.

Advanced configuration

Testing MAGE

To test that everything is built, loaded, and working correctly, a python script can be run. Make sure that the Memgraph instance with MAGE is up and running.

# Running unit tests for C++ and Python
python3 test_unit

# Running end-to-end tests
python3 test_e2e

Furthermore, to test only specific end-to-end tests, you can add argument -k with substring referring to the algorithm that needs to be tested. To test a module named <query_module>, you would have to run python3 test_e2e -k <query_module> where <query_module> is the name of the specific module you want to test.

# Running specific end-to-end tests
python3 test_e2e -k weakly_connected_components

Contributing

We encourage everyone to contribute with their own algorithm implementations and ideas. If you want to contribute or report a bug, please take a look at the contributions guide.

Code of Conduct

Everyone participating in this project is governed by the Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to [email protected].

Feedback

Your feedback is always welcome and valuable to us. Please don't hesitate to post on our Community Forum.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].