Getting Started

This guide gives you a quick start to use GraphScope for graph analysis tasks on your local machine.


We’ll start by installing GraphScope with a single-line command.

python3 -m pip install graphscope --upgrade


If you occur a very low downloading speed, try to use a mirror site for the pip.

python3 -m pip install graphscope --upgrade \

Running GraphScope Analytical Engine on Local

The graphscope package includes everything you need to analysis a graph on your local machine. Now you may import it in a Python session and start your job.

import graphscope as gs
from graphscope.dataset.modern_graph import load_modern_graph


# load the modern graph as example.
#(modern graph is an example property graph for Gremlin queries given by Apache at
graph = load_modern_graph()

# triggers label propagation algorithm(LPA)
# on the modern graph(property graph) and print the result.
ret = gs.lpa(graph)
print(ret.to_dataframe(selector={'id': '', 'label': 'r'}))

# project a modern graph (property graph) to a homogeneous graph
# and run single source shortest path(SSSP) algorithm on it, with assigned source=1.
pg = graph.project(vertices={'person': None}, edges={'knows': ['weight']})
ret = gs.sssp(pg, src=1)
print(ret.to_dataframe(selector={'id': '', 'distance': 'r'})

What’s the Next

As shown in the above example, it is very easy to use GraphScope to analyze a graph with our provided algorithms on your local machine. Next, you may want to learn more about the following topics: