Deze pagina is nog niet beschikbaar in uw eigen taal. We werken er hard aan om meer taalversies toe te voegen. Bedankt voor uw steun.
- What's New
- Service Overview
- Getting Started
-
User Guide
- What Is GES?
- Product Advantages
- Applicable Scenarios
- Basic Concepts
- Constraints and Limitations
- Related Services
- GES Overview
- Permissions Management
- Importing Metadata
- Creating Graphs
- Managing Graphs
-
Accessing and Analyzing Graph Data
- Graph Editor
- Accessing the GES Graph Editor
- Dynamic Graphs
- Graph Exploration
- Multi-Graph Management (Database Edition)
- Adding Custom Operations
- Editing Schema
- Visual Query
- Gremlin Query
- Cypher Query
- DSL Query
- Analyzing Graphs Using Algorithms
- Analyzing Graphs on the Canvas
- Graph Display in 3D View
- Filter Criteria
- Editing Properties
- Statistics Display
- View Running Records
- Viewing Query Results
- Viewing Graph Tasks
- Configuring Permissions
-
Algorithms
- Algorithm List
- PageRank
- PersonalRank
- K-core
- K-hop
- Shortest Path
- All Shortest Paths
- Filtered Shortest Path
- SSSP
- Shortest Path of Vertex Sets
- n-Paths
- Closeness Centrality
- Label Propagation
- Louvain
- Link Prediction
- Node2vec
- Real-time Recommendation
- Common Neighbors
- Connected Component
- Degree Correlation
- Triangle Count
- Clustering Coefficient
- Betweenness Centrality
- Edge Betweenness Centrality
- Origin-Destination Betweenness Centrality
- Circle Detection with a Single Vertex
- Common Neighbors of Vertex Sets
- All Shortest Paths of Vertex Sets
- Filtered Circle Detection
- Subgraph Matching
- Filtered All Pairs Shortest Paths
- Filtered All Shortest Paths
- TopicRank
- Filtered n-Paths
- Temporal Paths
- Best Practices
- FAQs
-
API Reference
- Before You Start
- Calling APIs
- Management Plane APIs (V2)
-
Service Plane APIs
-
Memory Edition
-
Vertex Operation APIs
- Querying Vertices That Meet Filter Criteria
- Querying Vertex Details
- Adding a Vertex
- Deleting a Vertex
- Updating Vertex Properties
- Querying Vertex Data in Batches
- Adding Vertices in Batches
- Deleting Vertices in Batches
- Updating Vertex Properties in Batches
- Adding a Vertex Label
- Deleting a Vertex Label
- Exporting Filtered Vertices
- Deleting Filtered Vertices
- Edge Operation APIs
- Metadata Operation APIs
- Index Operation APIs
- Gremlin Operation APIs
-
Algorithm APIs
- Running Algorithms
-
Algorithm API Parameter References
- Common Algorithm Parameters
- PageRank
- PersonalRank
- K-core
- K-hop
- Common Neighbors
- Common Neighbors of Vertex Sets
- Link Prediction
- Shortest Path
- All Shortest Paths
- Filtered Shortest Path
- SSSP
- Shortest Path of Vertex Sets
- n-Paths
- Filtered n-Paths
- Filtered All Pairs Shortest Paths
- All Shortest Paths of Vertex Sets
- Filtered All Shortest Paths
- Connected Component
- Label Propagation
- Louvain
- Node2vec
- Real-time Recommendation
- Degree Correlation
- Triangle Count
- Cluster Coefficient
- Closeness Centrality
- Filtered Circle Detection
- Subgraph Matching
- Topicrank
- Temporal Graph APIs
- Path APIs
- Graph Statistics APIs
- Graph Operation APIs
- Subgraph Operation APIs
- Job Management APIs
- Custom Operations APIs
- Cypher Queries
- Filtered Query
- Filtered Query V2
- Updating Specified Properties of Vertices and Edges by Importing a File
- Deleting Vertices and Edges by Files
- Granular Permission Control APIs
-
Vertex Operation APIs
- Database Edition
-
Memory Edition
- GES Metrics
- Appendix
-
devg
- Overview
- Preparations
- Importing a Project
-
Using the Service Plane SDK
- Initializing the Client of the GES Service Plane
- Querying Vertices That Meet Filtering Conditions
- Querying Edges That Meet Filtering Conditions
- Querying Vertex Details
- Querying Edge Details
- Querying Graph Metadata Details
- Querying General Information About a Graph
- Executing Gremlin Queries
-
Running Algorithms
- PageRank
- PersonalRank
- K-hop
- K-core
- Shortest Path
- All Shortest Paths
- Filtered Shortest Path
- SSSP
- Shortest Path of Vertex Sets
- n Paths
- Closeness
- Label Propagation
- Louvain Algorithm
- Link Prediction
- Node2vec
- Real-time Recommendation
- Common Neighbors
- Connected Component
- Degree Correlation Algorithm
- Triangle Count
- Cluster Coefficient
- Filtered Circle Detection
- Subgraph Matching
- Filtered All Pairs Shortest Paths
- Filtered All Shortest Paths
- TopicRank
- Filtered n Paths
- Common Neighbors of Vertex Sets
- All Shortest Paths of Vertex Sets
- Querying Job Status
- Canceling a Job
- Adding a Vertex
- Deleting a Vertex
- Adding an Edge
- Deleting an Edge
- Adding an Index
- Deleting an Index
- Querying Indexes
- Exporting a Graph
- Removing a Graph
- Adding a Property
- Querying Path Details
- Incrementally Importing Data to Graphs
- Adding Vertices in Batches
- Deleting Vertices in Batches
- Adding Edges in Batches
- Deleting Edges in Batches
- Updating Vertex Properties in Batches
- Updating Edge Properties in Batches
-
Using the Management Plane SDK
- Initializing the Client of the GES Management Plane
- Querying Quotas
- Verifying Metadata Files
- Querying the Graph List
- Querying Graph Details
- Creating a Graph
- Closing a Graph
- Starting a Graph
- Deleting a Graph
- Querying Backups of All Graphs
- Querying the Backup List of a Graph
- Adding a New Backup
- Deleting a Backup
- Querying Job Status
- Using Cypher JDBC Driver to Access GES
- Relationships Between SDKs and REST APIs
-
FAQs
- Customer Consultation
-
API Use
- How Do I Import Data to GES?
- When Binding an EIP to an Existing Instance or an Instance Being Created, What Should I Do to Deal with Insufficient Permissions for Creating Agencies?
- When Binding an EIP to an Existing Instance or an Instance Being Created, What Should I Do to Deal with Insufficient Quotas for Creating Agencies?
- Can I Run Several Gremlin/Cypher Commands At a Time?
- If a Vertex Is Deleted, What Will Happen to Edges Formed Based on the Vertex?
- What Do I Do If an Error Message Indicating a Vertex Does Not Exist Is Displayed When Properties of the Vertex Whose ID Contains Chinese Characters Are Modified?
- GUI
- Others
Show all
Cypher Query
Cypher is a declarative graph query language. You can use Cypher statements to obtain query result and modify data in GES.
The procedure is as follows:
- Access the GES graph editor. For details, see Accessing the GES Graph Editor.
- Use label-based vertex and edge indexes during Cypher query.
If this is your first time using Cypher, click Create Index in the upper right corner of the result display area. You do not need to perform this operation in subsequent operations.Figure 1 Result display area
NOTE:
After an index is created, wait for 30 seconds for the index to take effect and then perform Cypher query.
- In the graph data query area, enter the query statement and press Enter.
Cypher Statements
The following are typical query statements.
- Querying a vertex
match (n:movie) return n: Query the vertex whose label is movie.
match (n) return n limit 100: Query details about 100 vertices.
match (n{Occupation:'artist'}) return id(n), n.Gender limit 100: Query the first 100 vertices whose Occupation is artist, and return their IDs and genders.
match (n) where id(n)='Vivian' return n: Query the vertex whose ID is Vivian.
match (n) return n skip 50 limit 100: Query all vertices of a graph. Skip the first 50 vertices, and return a total of 100 vertices.
- Querying an edge
match (n)-[r]->(m) return r, n, m: Query all edges. Return the edges and vertices at both ends.
match (n)-[r:rate]->(m) return r, n, m: Query the edges whose label is rate.
match (n)-[r:rate|:friends]-(m) where id(n)='Vivian' return n,r,m: Query all edges whose start vertex is Vivian and edge label is rate or friends.
- Searching by path
match p=(n:user)--(m1:user)--(m2:movie) return p limit 100: Query the paths whose start vertex is user, first-hop end vertex is user, and second-hop end vertex is movie. Returns the first 100 paths.
- Aggregating and deduplicating based on groups
match (n) return count(*): Query the number of all vertices in a graph.
match (n:user) return n.Gender, count(n): Collect statistics on the number of user vertices in every gender.
match (n:user) return distinct n.Occupation: Return deduplicated occupations of all user vertices.
- Sorting
match (n:user) return id(n) as name order by name: Change IDs of all user vertices to name, and sort the vertices by name.
- Creating a vertex
create(n:movie{_ID_:'The Captain', Year:2019})return n: Create a vertex whose ID is The Captain, label is movie, and Year is 2019. Return the vertex.
create(n:movie{_ID_:'The Captain', Year:2019})-[r:rate]-> (m:movie{_ID_:'The Climbers',Title: 'The Climbers', Year:2019}) return r: Create two vertices and their associated edges.
- Creating an edge
match (n),(m) where id(n)= 'The Captain' and id(m)= 'Lethal Weapon' create (n)-[r:rate]->(m) return r : Create an edge whose label is rate between two vertices with specified IDs. (You are advised to use this query in 2.2.21 and later versions.)
- Modifying properties
match (n) where id(n)= 'The Captain' set n.Title= 'The Captain' return n: Search for the vertex whose ID is The Captain and change the attribute Title to Ji Zhang.
- Deleting a vertex
match (n) where id(n)=' The Captain' delete n: Search and delete the vertex whose ID is The Captain.
match (n) where id(n)=' "detach delete n": Search for the vertex whose ID is The Captain. Delete the vertex and its edges.
- Querying a schema
If you call db.schema() independently, only the schema metadata of the vertices is returned. Multiple isolated vertices are displayed on the canvas.
- You can press the up and down arrow keys in the text box to view historical query commands.
- When you enter a syntax keyword, the system automatically displays historical statements with the same keyword.
Figure 2 Historical queries
- Keywords in the text box are displayed in different colors.
- Reserved words in gray
Note: A reserved word is predefined in the syntax system of a programming language. Reserved words vary depending on programming languages.
- String values in orange
- Key-value pairs in purple. They are of the non-string type in the key:value format.
- Delimiters in red. Regular delimiters including square brackets [], curly brackets {}, parenthesis (), commas (,), and semicolons (;).
- Variables in green
Figure 3 Cypher keywords - Reserved words in gray
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.