This document is intended for new users to get started quickly and contains an introduction, features, installation, and use of TuGraph.
1. Introduction
TuGraph is a large-scale graph computing system independently developed by Ant Group, providing graph database engine and graph analysis engine. Its main features are large data storage and computation, high throughput, and flexible API, while supporting efficient online transaction processing (OLTP) and online analytical processing (OLAP). LightGraph and GeaGraph are former names of TuGraph.
The main functional features include:
- Labeled property Graph Model
- Support multiple Graphs
- Full ACID transaction processing
- Built-in 25+ graph analysis algorithm
- Graph visualization tool based on Web client
- RESTful API and RPC are supported
- OpenCypher graph query language
- Stored procedure based on C++/Python/Java
- The Traversal API for efficient graph algorithm development
Performance and scalability features include:
- TB large capacity
- High throughput of ten million vertices per second
- High Availability Support (Enterprise Edition)
- High-performance Batch Import
- Online/offline backup
2. The installation
TuGraph can be installed quickly via Docker Image or locally via RPM /deb packages.
rpm/deb/docker images download address: https://www.tugraph.org/download
Fast experience through Docker
The Docker environment installed locally
The docker official documentation:https://docs.docker.com/get-started/
Pull the docker images
docker pull tugraph/tugraph-runtime-centos7Start docker
docker run -d -p 7070:7070 -p 9090:9090 --name tugraph_demo tugraph/tugraph-runtime-centos7 lgraph_server # 7070 is default http port,for web visiting。 # 9090 is default RPC port,for RPC client visiting。Open by browser
http://x.x.x.x:7070Default account
admin,Default password73@TuGraphStart
docker run -dt -p 7070:7070 --name tugraph_demo tugraph/tugraph-runtime-centos7 docker exec -it tugraph_demo bash # start the service lgraph_server -d start
Web operations
Create schema and import data
After login, click "Help", click "Quick Start", click "new schema", and click "import data" to complete the creation of Movie Graph.
Movie Graph:
| Label | Type | Description |
|---|---|---|
| movie | node | Represents a specific movie |
| person | node | An individual, in the case of a film, may be an actor, director, or screenwriter. |
| genre | node | The genre of the film, e.g. drama, horror。 |
| keyword | node | It means some keywords related to the movie, such as "Save the world", "virtual reality", "subway". |
| user | node | Represents the audience of the movie. |
| produce | node | Represents the producer of the film. |
| acted_in | relationship | Which films the actor appeared in. |
| direct | relationship | Who is the director of the film. |
| write | relationship | Represents the screenwriter relationship of the film. |
| has_genre | relationship | Represents the type of a movie。 |
| has_keyword | relationship | Tags that represent some keywords of the movie, that is, more granular categories. |
| rate | relationship | Represents the user's rating of the movie. |
Query demo
demo 1
Query all the actors in the movie 'Forrest Gump' and return a subgraph of the movie and the actors.
MATCH (m:movie {title: 'Forrest Gump'})<-[:acted_in]-(a:person) RETURN a, m
demo 2
Query all actors in the movie 'Forrest Gump' and list the roles the actors played in the movie.
MATCH (m:movie {title: 'Forrest Gump'})<-[r:acted_in]-(a:person) RETURN a.name,r.role
demo 3
Query all Michael's movies rated below 3.
MATCH (u:user {login: 'Michael'})-[r:rate]->(m:movie) WHERE r.stars < 3 RETURN m.title, r.stars
demo 4
Search for users who have the same hated movies as Michael, with the dislike criteria being less than three points.
MATCH (u:user {login: 'Michael'})-[r:rate]->(m:movie)<-[s:rate]-(v) WHERE r.stars < 3 AND s.stars < 3 RETURN u, m, v
demo5
To recommend movies to Michael, the method is to find out the users who hate the same movies as Michael, and then screen out the movies that these users like.
MATCH (u:user {login: 'Michael'})-[r:rate]->(m:movie)<-[s:rate]-(v)-[r2:rate]->(m2:movie) WHERE r.stars < 3 AND s.stars < 3 AND r2.stars > 3 RETURN u, m, v, m2
demo 6
Find out what Michael's friends like.
MATCH (u:user {login: 'Michael'})-[:is_friend]->(v:user)-[r:rate]->(m:movie) WHERE r.stars > 3 RETURN u, v, m
demo 7
Recommend similar movies to users who like 'Forrest Gump' by finding out which movies people who rate 'Forrest Gump' high also like.
MATCH (m:movie {title:'Forrest Gump'})<-[r:rate]-(u:user)-[r2:rate]->(m2:movie) WHERE r.stars>3 AND r2.stars>3 RETURN m, u,m2