跳到主要内容

Cypher API

此文档主要介绍了TuGraph-Cypher的详细使用说明

1.Operators

1.1.Summary

Operators支持进度一览:

类别支持待支持
General operatorsDISTINCT, . for property access[] for dynamic property access
Mathematical operators+, -, *, /, %, ^
Comparison operators=, <>, <, >, <=, >=, IS NULL, IS NOT NULL
String-specific comparison operatorsSTARTS WITH, ENDS WITH, CONTAINS, REGEXP
Boolean operatorsAND, OR, XOR, NOT
String operators+ for concatenation
List operators+ for concatenation, IN to check existence of an element in a list, [] for accessing element(s)

1.2.General operators

  • ✓ Using the DISTINCT operator
MATCH (p:person) RETURN DISTINCT p.born
  • ❏ Accessing properties of a nested literal map using the . operator
WITH {person: {name: 'Anne', age: 25}} AS p
RETURN p.person.name
  • ❏ Filtering on a dynamically-computed property key using the [] operator
CREATE (a:Restaurant {name: 'Hungry Jo', rating_hygiene: 10, rating_food: 7}),
(b:Restaurant {name: 'Buttercup Tea Rooms', rating_hygiene: 5, rating_food:6}),
(c1:Category {name: 'hygiene'}), (c2:Category {name: 'food'})
MATCH (restaurant:Restaurant), (category:Category)
WHERE restaurant["rating_" + category.name] > 6
RETURN DISTINCT restaurant.name

1.3.Mathematical operators

  • ✓ Using the exponentiation operator  ^
WITH 2 AS number, 3 AS exponent
RETURN number ^ exponent AS result
  • ✓ Using the unary minus operator -
WITH -3 AS a, 4 AS b
RETURN b - a AS result

1.4.Comparison operators

  • ✓ Comparing two numbers
WITH 4 AS one, 3 AS two
RETURN one > two AS result

1.5.String-specific comparison operators

  • ✓ Using STARTS WITH to filter names
WITH ['John', 'Mark', 'Jonathan', 'Bill'] AS somenames
UNWIND somenames AS names
WITH names AS candidate
WHERE candidate STARTS WITH 'Jo'
RETURN candidate
  • ✓ Using REGEXP to filter names
WITH ['John', 'Mark', 'Jonathan', 'Bill'] AS somenames
UNWIND somenames AS names
WITH names AS candidate
WHERE candidate REGEXP 'Jo.*n'
RETURN candidate

1.6.Boolean operators

  • ✓ Using boolean operators to filter numbers
WITH [2, 4, 7, 9, 12] AS numberlist
UNWIND numberlist AS number
WITH number
WHERE number = 4 OR (number > 6 AND number < 10)
RETURN number

1.7.String operators

String operators comprise:

  • ✓ concatenating strings: +

1.8.List operators

  • ✓ Concatenating two lists using +
RETURN [1,2,3,4,5]+[6,7] AS myList
  • ✓ Using IN to check if a number is in a list
WITH [2, 3, 4, 5] AS numberlist
UNWIND numberlist AS number
WITH number
WHERE number IN [2, 3, 8]
RETURN number
  • ✓ Accessing elements in a list using the [] operator
WITH ['Anne', 'John', 'Bill', 'Diane', 'Eve'] AS names
RETURN names[1..3] AS result

2.Clauses

2.1.Summary

Clauses支持进度一览:

类别语法备注
Reading clausesMATCH支持
OPTIONAL MATCH支持
MANDATORY MATCH待支持
Projecting clausesRETURN … [AS]支持
WITH … [AS]支持
UNWIND … [AS]支持
Reading sub-clausesWHERE支持
ORDER BY [ASC[ENDING] / DESC[ENDING]]支持
SKIP支持
LIMIT支持
Writing clausesCREATE支持
DELETE支持
DETACH DELETE支持
SET支持
REMOVE支持
Reading/Writing clausesMERGE支持
CALL […YIELD]支持
Set operationsUNION待支持
UNION ALL支持

2.2.MATCH

  • Basic node finding

    • ✓ Get all nodes
    MATCH (n)
    RETURN n
    • ✓ Get all nodes with a label
    MATCH (movie:movie)
    RETURN movie.title
    • ✓ Related nodes
    MATCH (person {name: 'Laurence Fishburne'})-[]-(movie)
    RETURN movie.title
    • ✓ Match with labels
    MATCH (:person {name: 'Laurence Fishburne'})-[]-(movie:movie)
    RETURN movie.title
  • Relationship basics

    • ✓ Outgoing relationships
    MATCH (:person {name: 'Laurence Fishburne'})-[]->(movie)
    RETURN movie.title
    • ✓ Directed relationships and variable
    MATCH (:person {name: 'Laurence Fishburne'})-[r]->(movie)
    RETURN type(r)
    • ✓ Match on relationship type
    MATCH (matrix:movie {title: 'The Matrix'})<-[:acted_in]-(actor)
    RETURN actor.name
    • ✓ Match on multiple relationship types
    MATCH (matrix {title: 'The Matrix'})<-[:acted_in|:directed]-(person)
    RETURN person.name
    • ✓ Match on relationship type and use a variable
    MATCH (matrix {title: 'The Matrix'})<-[r:acted_in]-(actor)
    RETURN r.role
  • Relationships in depth

    • ❏ Relationship types with uncommon characters
    MATCH (n {name: 'Rob Reiner'})-[r:`TYPE WITH SPACE`]->()
    RETURN type(r)
    • ✓ Multiple relationships
    MATCH (laurence {name: 'Laurence Fishburne'})-[:acted_in]->(movie)<-[:directed]-(director)
    RETURN movie.title, director.name
    • ✓ Variable-length relationships
    MATCH (laurence {name: 'Laurence Fishburne'})-[:acted_in*1..3]-(movie:movie)
    RETURN movie.title
    • ✓ Relationship variable in variable-length relationships
    MATCH p = (laurence {name: 'Laurence Fishburne'})-[:acted_in*2]-(co_actor)
    RETURN p
    • ❏ Match with properties on a variable-length path
    MATCH p = (charlie:person)-[* {blocked:false}]-(martin:person)
    WHERE charlie.name = 'Charlie Sheen' AND martin.name = 'Martin Sheen'
    RETURN p
    • ✓ Zero-length paths
    MATCH (matrix:movie {title: 'The Matrix'})-[*0..1]-(x)
    RETURN x
    • ✓ Named paths
    MATCH p = (michael {name: 'Michael Douglas'})-[]->() RETURN p
    • ✓ Matching on a bound relationship
    MATCH (a)-[r]->(b)
    WHERE euid(r)="0_3937_0_0_0"
    RETURN a,b
  • Shortest path

    • ✓ Single shortest path
    MATCH (martin:person {name: 'Carrie-Anne Moss'}), (laurence:person {name: 'Laurence Fishburne'})
    CALL algo.shortestPath(martin, laurence) YIELD nodeCount,totalCost,path RETURN nodeCount,totalCost,path
    • ✓ All shortest paths
    MATCH (martin:person {name: 'Carrie-Anne Moss'}), (laurence:person {name: 'Laurence Fishburne'}) WITH martin, laurence
    CALL algo.allShortestPaths(martin, laurence) YIELD nodeIds,relationshipIds,cost RETURN nodeIds,relationshipIds,cost
  • Get node or relationship by id

    • ✓ Node by id
    MATCH (n)
    WHERE id(n)= 0
    RETURN n
    • ✓ Relationship by id
    MATCH ()-[r]->()
    WHERE euid(r) = "0_3937_0_0_0"
    RETURN r
    • ✓ Multiple nodes by id
    MATCH (n)
    WHERE id(n) IN [0, 3, 5]
    RETURN n

2.3.RETURN

  • ✓ Return nodes
MATCH (n {name: 'Carrie-Anne Moss'}) RETURN n
  • ✓ Return relationships
MATCH (n {name: 'Carrie-Anne Moss'})-[r:acted_in]->(c)
RETURN r
  • ✓ Return property
MATCH (n {name: 'Carrie-Anne Moss'}) RETURN n.born
  • ❏ Return all elements
MATCH p = (a {name: 'A'})-[r]->(b)
RETURN *
  • ❏ Variable with uncommon characters
MATCH (`This isn\'t a common variable`)
WHERE `This isn\'t a common variable`.name = 'A'
RETURN `This isn\'t a common variable`.happy
  • ✓ Aliasing a field
MATCH (a {name: 'Carrie-Anne Moss'})
RETURN a.born AS SomethingTotallyDifferent
  • ✓ Optional properties
MATCH (n)
RETURN n.age
  • ❏ Other expressions
MATCH (a {name: 'Carrie-Anne Moss'})
RETURN a.born > 1900, "I'm a literal", (a)-[]->()

(a)-[]->()  not supported.

  • ✓ Unique results
MATCH (a {name: 'Carrie-Anne Moss'})-[]->(b)
RETURN DISTINCT b

2.4.WHERE

  • Basic usage

    • ✓ Boolean operations
    MATCH (n)
    WHERE n.name = 'Laurence Fishburne' XOR (n.born > 1965 AND n.name = 'Carrie-Anne Moss')
    RETURN n.name, n.born
    • ✓ Filter on node label
    MATCH (n)
    WHERE n:person
    RETURN n.name, n.born
    • ✓ Filter on node property
    MATCH (n)
    WHERE n.born > 2000
    RETURN n.name, n.born
    • ✓ Filter on relationship property
    MATCH (n)-[k:acted_in]->(f)
    WHERE k.role = "Trinity"
    RETURN f.title
    • ❏ Filter on dynamically-computed property
    WITH 'AGE' AS propname
    MATCH (n)
    WHERE n[toLower(propname)]< 30
    RETURN n.name, n.age
    • ✓ Property existence checking
    MATCH (n)
    WHERE exists(n.born)
    RETURN n.name, n.born
  • String matching

    • ✓ Match the beginning of a string
    MATCH (n)
    WHERE n.name STARTS WITH 'Pet'
    RETURN n.name, n.born
    • ✓ Match the ending of a string
    MATCH (n)
    WHERE n.name ENDS WITH 'ter'
    RETURN n.name, n.born
    • ✓ Match anywhere within a string
    MATCH (n)
    WHERE n.name CONTAINS 'ete'
    RETURN n.name, n.born
    • ✓ String matching negation
    MATCH (n)
    WHERE NOT n.name ENDS WITH 's'
    RETURN n.name, n.born
  • Using path patterns in WHERE

    • ❏ Filter on patterns
    MATCH (tobias {name: 'Tobias'}), (others)
    WHERE others.name IN ['Andres', 'Peter'] AND (tobias)<-[]-(others)
    RETURN others.name, others.age
    • ❏ Filter on patterns using NOT
    MATCH (persons), (peter {name: 'Peter'})
    WHERE NOT (persons)-[]->(peter)
    RETURN persons.name, persons.age
    • ❏ Filter on patterns with properties
    MATCH (n)
    WHERE (n)-[:KNOWS]-({name: 'Tobias'})
    RETURN n.name, n.age
    • ✓ Filter on relationship type
    MATCH (n)-[r]->()
    WHERE n.name='Laurence Fishburne' AND type(r) STARTS WITH 'ac'
    RETURN type(r), r.role
  • Lists

    • ✓ IN operator
    MATCH (a)
    WHERE a.name IN ['Laurence Fishburne', 'Tobias']
    RETURN a.name, a.born
  • Missing properties and values

    • ✓ Default to false if property is missing
    MATCH (n)
    WHERE n.belt = 'white'
    RETURN n.name, n.age, n.belt
    • ✓ Default to true if property is missing
    MATCH (n)
    WHERE n.belt = 'white' OR n.belt IS NULL RETURN n.name, n.age, n.belt
    ORDER BY n.name
    • ✓ Filter on null
    MATCH (person)
    WHERE person.name = 'Peter' AND person.belt IS NULL RETURN person.name, person.age,
    person.belt
  • Using ranges

    • ✓ Simple range
    MATCH (a)
    WHERE a.name >= 'Peter'
    RETURN a.name, a.born
    • ✓ Composite range
    MATCH (a)
    WHERE a.name > 'Andres' AND a.name < 'Tobias'
    RETURN a.name, a.born

2.5.SKIP

  • ✓ Skip first three records
MATCH (n:person)
RETURN n.name
ORDER BY n.name
SKIP 3
  • ✓ Return middle two records
MATCH (n:person)
RETURN n.name
ORDER BY n.name
SKIP 1
LIMIT 2
  • ❏ Using an expression with SKIP to return a subset of the records
MATCH (n:person)
RETURN n.name
ORDER BY n.name
SKIP toInteger(3*rand())+ 1

2.6.LIMIT

  • ✓ Return a subset of the records
MATCH (n:person)
RETURN n.name
LIMIT 3
  • ❏ Using an expression with LIMIT to return a subset of the records
MATCH (n:person)
RETURN n.name
LIMIT toInteger(3 * rand())+ 1

2.7.CREATE

  • Create nodes

Note TuGraph不支持创建空的nodes,不支持多labels。

  • ☒ Create single node
CREATE (n)
  • ☒ Create multiple nodes
CREATE (n), (m)
  • ☒ Create a node with a label
CREATE (n:person)
  • ☒ Create a node with multiple labels
CREATE (n:Person:Swedish)
  • ✓ Create node and add labels and properties
CREATE (n:person {id:2001, name: 'Andres'})
  • ✓ Return created node
CREATE (n:person {id:2002, name: 'Andres'})
RETURN n
  • Create relationships

    • ✓ Create a relationship between two nodes
    MATCH (n:person), (m:movie)
    WHERE n.name = 'Jada Pinkett Smith' AND m.title = 'The Matrix'
    CREATE (n)-[r:write]->(m)
    • ✓ Create a relationship and set properties
    MATCH (n:person), (m:movie)
    WHERE n.name = 'Jada Pinkett Smith' AND m.title = 'The Matrix'
    CREATE (n)-[r:acted_in{role: 'Trinity'}]->(m)
    • ❏ Create a full path
    CREATE p = (andres:person {id: 2005, name:'Andres'})-[:acted_in {role: 'Trinity'}]->
    (m:movie {id: 2006})<-[:acted_in {role: 'Trinity'}]-(michael {id: 2006, name:'Michael'})
    RETURN p
  • Use parameters with CREATE

    • ❏ Create node with a parameter for the properties
    CREATE (n:Person $props)
    RETURN n
    • ☒ Create multiple nodes with a parameter for their properties
    UNWIND $props AS map
    CREATE (n)
    SET n = map

    cannot create vertex without label.

2.8.CALL[…YIELD]

  • ✓ Call a procedure using CALL
CALL db.vertexLabels
  • ✓ View the signature for a procedure
CALL dbms.procedures() YIELD name, signature
RETURN signature
  • ❏ Call a procedure using a quoted namespace and name
CALL `db`.`vertexLabels`
  • ✓ Call a procedure with literal arguments
CALL org.opencypher.procedure.example.addNodeToIndex('users', 0, 'name')
  • ❏ Call a procedure with parameter arguments
CALL org.opencypher.procedure.example.addNodeToIndex($indexName,$node,$propKey)
  • ❏ Call a procedure with mixed literal and parameter arguments
CALL org.opencypher.procedure.example.addNodeToIndex('users', $node, 'name')
  • ✓ Call a procedure with literal and default arguments
CALL org.opencypher.procedure.example.addNodeToIndex('users', 0)
  • ✓ Call a procedure within a complex query using CALL…YIELD
CALL db.vertexLabels() YIELD label
RETURN count(label) AS numLabels
  • ❏ Call a procedure and filter its results
CALL db.vertexLabels() YIELD label
WHERE label CONTAINS 'User'
RETURN count(label) AS numLabels
  • ❏ Call a procedure within a complex query and rename its outputs
CALL db.propertyKeys() YIELD propertyKey AS prop
MATCH (n)
WHERE n[prop] IS NOT NULL RETURN prop, count(n) AS numNodes

2.9.UNION

  • ✓ Combine two queries and retain duplicates
MATCH (n:person)
RETURN n.name AS name
UNION ALL MATCH (n:movie)
RETURN n.title AS name
  • ❏ Combine two queries and remove duplicates
MATCH (n:Actor)
RETURN n.name AS name
UNION
MATCH (n:Movie)
RETURN n.title AS name

3.Functions

3.1.Whole List Of Functions

种类功能备注
Predicate functionsexists()
all()不支持
any()不支持
single()不支持
none()不支持
Scalar functionsid()
euid()
properties()
head()
last()
toBoolean()
toFloat()
toInteger()
toString()
type()
startnode()
endnode()
size()
length()
substring()
concat()
label()OpenCypher扩展方法
Aggregating functionsavg()
collect()
count()
max()
min()
percentileCont()
percentileDisc()
stDev()
stDevP()
variance()
varianceP()
sum()
List functionskeys()
labels()返回结果有且只有一个label
nodes()
range()
subscript()不支持
Mathematical functionsabs()
ceil()
floor()
rand()
round()
sign()
String functions/

3.2.Predicate functions

  • exists() judge it whether a vertex or edge has the field  . Scope: whole instance. Example input:
MATCH (n)
WHERE exists(n.born)
RETURN n.name, n.born

Example output:

exists(name)
true

3.3.Scalar functions

  • id() get the id of vertex. Scope: whole instance. Example input:
MATCH (a)
RETURN id(a)

Example output:

vid
1
2
...
  • properties() get  a map containing all the properties of a node or relationship. Scope: whole instance. Example input:
MATCH (n:person {name: 'Laurence Fishburne'})
RETURN n
  • head() get the first element of a list. Scope: whole instance. Example input:
WITH ['one','two','three'] AS coll RETURN coll, head(coll)

Example output:

collhead(coll)
["one","two","three"]"one"
  • last() get the last element of a list. Scope: whole instance. Example input:
WITH ['one','two','three'] AS coll RETURN coll, last(coll)

Example output:

colllast(coll)
["one","two","three"]"three"
  • toFloat() Converts an integer or string value to a floating point number. Scope: whole instance. Example input:
RETURN toFloat('11.5')

Example output:

float
11.5
  • toInteger() Converts a floating point or string value to an integer value. Scope: whole instance. Example input:
RETURN toInteger('2.3') AS integer

Example output:

integer
2
  • toString() Converts an integer, float, boolean value to a string. Scope: whole instance. Example input:
RETURN toString(2.3)
  • type() get the string representation of the relationship type. Scope: whole instance. Example input:
MATCH (n)-[r]->()
WHERE n.name = 'Laurence Fishburne'
RETURN type(r)

Example output:

type
acted_in
acted_in

3.4.Aggregating functions

  • avg() Returns the average of a set of numeric values. Scope: whole instance. Example input:
MATCH (n:person)
RETURN avg(n.born)

Example output:

avg(n.born)
1869.2661654135338
  • collect() Returns a list containing the values returned by an expression. Scope: whole instance. Example input:
MATCH (n:person)
RETURN collect(n.born)

Example output:

collect(n.born)
[1967,...]
  • count() Returns the number of values or records. Scope: whole instance. Example input:
MATCH (n {name: 'Laurence Fishburne'})-[]->(x)
RETURN labels(n), n.born, count(*)

Example output:

labels(n)n.borncount(*)
["person"]19613
  • max() Returns the maximum value in a set of values. Scope: whole instance. Example input:
MATCH (n:person)
RETURN max(n.born)

Example output:

max(n.born)
2003
  • min() Returns the minimum value in a set of values. Scope: whole instance. Example input:
MATCH (n:person)
RETURN min(n.born)

Example output:

min(n.born)
1000
  • percentileCont() Returns the percentile of a value over a group using linear interpolation. Scope: whole instance. Example input:
MATCH (n:person)
RETURN percentileCont(n.born, 0.4)

Example output:

percentileCont(n.born, 0.4)
1953
  • percentileDisc() Returns the nearest value to the given percentile over a group using a rounding method. Scope: whole instance. Output: the percentile of the given value over a group. Example input:
MATCH (n:person)
RETURN percentileDisc(n.born, 0.5)

Example output:

percentileDisc(n.age, 0.5)
1959
  • stDev() Returns the standard deviation for the given value over a group for a sample of a population. Scope: whole instance. Example input:
MATCH (n)
RETURN stDev(n.born)

Example output:

stDev(n.born)
279.53117993401725
  • stDevP() Returns the standard deviation for the given value over a group for an entire population. Scope: whole instance. Example input:
MATCH (n)
RETURN stDevP(n.born)

Example output:

stDevP(n.born)
279.3209270423399
  • variance() Returns the variance for the given value over a group for a sample of a population. Scope: whole instance. Example input:
MATCH (n)
RETURN variance(n.born)

Example output:

variance(n.age)
78137.68055530392
  • varianceP() Returns the variance for the given value over a group for an entire population. Scope: whole instance. Example input:
MATCH (n)
RETURN varianceP(n.born)

Example output:

varianceP(n.age)
78020.18028379219
  • sum() Returns the sum of a set of numeric values. Scope: whole instance. Example input:
MATCH (n:person)
RETURN sum(n.born)

Example output:

sum(n.born)
1243062

3.5.List Funtions:

  • keys() get the field names of some vertex. Scope: whole instance. Example input:
MATCH (a)
RETURN keys(a) LIMIT 1

Example output:

keys(a)
["name","age","eyes"]
  • labels()/label() Returns a list containing the string representations for all the property names of a node, relationship, or map. Scope: whole instance. Example input:
MATCH (a)
RETURN labels(a) LIMIT 1

Example output:

labels
["Person"]
  • nodes()

    Get vertex ids of a path

    Scope: whole instance.

    Example input:

    MATCH p = (from {name: 'Bob'})-[*1..]->(to {name: 'Alice"})
    RETURN nodes(p)

    Example output:

    nodes(p)
    [0, 1, 10, 12]

3.6.Mathematical functions

  • abs() get the absolute value of some data. Scope: whole instance. Example input:
MATCH (a:person {name: 'Laurence Fishburne'}),(e:person {name: 'Carrie-Anne Moss'})
RETURN a.born, e.born, abs(a.born-e.born)

Example output:

a.borne.bornabs(a.born - e.born)
196119676
  • ceil() Returns the smallest floating point number that is greater than or equal to a number and equal to a mathematical integer. Scope: whole instance. Example input:
RETURN ceil(0.1)

Example output:

ceil(0.1)
1.0
  • floor() get the largest floating point number that is less than or equal to the given number and equal to a mathematical integer. Scope: whole instance. Example input:
RETURN floor(0.9)

Example output:

floor(0.9)
0.0
  • round() Returns the value of a number rounded to the nearest integer. Scope: whole instance. Example input:
RETURN round(3.141592)

Example output:

round
3
  • rand() Returns returns a random floating point number in the range from 0 (inclusive) to 1 exclusive). Scope: whole instance. Example input:
RETURN rand()

Example output:

rand()
0.9797131960534085
  • sign() Get the signum of the given number: 0 if the number is 0, -1 for any negative number, and 1 for any positive number. Scope: whole instance. Example input:
RETURN sign(-17), sign(0.1)

Example output:

sign(-17)sign(0.1)
-11

TuGraph 查询语言与 OpenCypher 的不同点如下:

  • Label 数量
    • TuGraph: Each node/relationship must have one and only one label. So error occurs when there is no label, and the 1st label will be picked as the label if there are more than one label.
    • OpenCypher: One node/relationship may have 0 to many labels.
  • Schema.
    • TuGraph: TuGraph has strong schema
    • OpenCypher: schema-less

4.附录1. 语法扩充及不同

TuGraph查询语言与OpenCypher的不同点如下:

  • Label数量
    • TuGraph: Each node/relationship must have one and only one label. So error occurs when there is no label, and the 1st label will be picked as the label if there are more than one label.
    • OpenCypher: One node/relationship may have 0 to many labels.
  • Schema.
    • TuGraph: TuGraph has strong schema
    • OpenCypher: schema-less

5.附录2. 内置procedures列表

5.1.procedures样例

  • dbms.procedures()

    Lists all available procedures.

    Scope: whole instance.

    Output: a list of {signature, name}.

    Example input:

    CALL dbms.procedures()

    Example output:

    signaturename
    db.vertexLabels() :: (label::STRING)db.vertexLabels
    db.edgeLabels() :: (edgeLabels::STRING)db.edgeLabels
    db.indexes() :: (index::LIST)db.indexes
    ......
  • db.subgraph()

    Scope: whole instance.

    Parameters:

    parameterparameter typedescription
    vidslistlist of vertex id

    Output:

    Get a json containing all the properties of nodes and relationships.

    Example input:

    CALL db.subgraph([3937,4126,4066,4010])

    Example output

    subgraph
    {"nodes":[{"identity":3937,"label":"movie","properties":{"duration":136,"id":1,"poster_image":"http://image.tmdb.org/t/p/w185/gynBNzwyaHKtXqlEKKLioNkjKgN.jpg","rated":"R","summary":"Thomas A. Anderson is a man living two lives. By day he is an average computer programmer and by night a malevolent hacker known as Neo who finds himself targeted by the police when he is contacted by Morpheus a legendary computer hacker who reveals the shocking truth about our reality.","tagline":"Welcome to the Real World.","title":"The Matrix"}},{"identity":4010,"label":"user","properties":{"id":44,"login":"Howard"}},{"identity":4066,"label":"user","properties":{"id":202,"login":"Enoch"}},{"identity":4126,"label":"user","properties":{"id":464,"login":"Wilburn"}}],"relationships":[{"dst":4126,"forward":true,"identity":0,"label":"is_friend","label_id":3,"src":4010,"temporal_id":0},{"dst":4010,"forward":true,"identity":0,"label":"is_friend","label_id":3,"src":4066,"temporal_id":0},{"dst":4066,"forward":true,"identity":0,"label":"is_friend","label_id":3,"src":4126,"temporal_id":0}]}
  • db.vertexLabels()

    Lists all available vertex labels of vertex.

    Scope: whole instance.

    Output: a list of {name}.

    Example input:

    CALL db.vertexLabels()

    Example output:

    label
    genre
    keyword
    movie
    ...
  • db.edgeLabels()

    Lists all available labels of edges.

    Scope: whole instance.

    Output: a list of {edge labels}.

    Example input:

    CALL db.edgeLabels()

    Example output:

    relationshipType
    acted_in
    directed
    ...
  • db.createVertexLabel(label_name, primary_field, field_spec...)

    Create a vertex label.

    Scope: whole instance.

    Parameters:

    parameterparameter typedescription
    label_namestringname of vertex label
    primary_fieldstringprimary field of vertex label
    field_speclistspecification of a field

    in which each field_spec is a list of string in the form of [field_name, field_type, true], where true is specified only for optional fields.

    Output: If successful, it returns a success message.

    Example input:

    CALL db.createVertexLabel('Person', 'id', 'id', 'int64', false, 'name', 'string', true)

    Example output:

    Added label [Person]
  • db.getLabelSchema(label_type, label_name)

    Get the schema definition of the label in a subgraph.

    Scope: subgraph, as specified in the graph parameter in REST or RPC request.

    Parameters:

    parameterparameter typedescription
    label_typestringeither 'vertex' or 'edge'
    label_namestringname of the label

    Output: a list of label specifications, in which each element is a list of the following fields:

    field_namefield_typedescription
    namestringname of the field
    typestringtype of the field
    optionalbooleanwhether the field is optional

    Example input:

    CALL db.getLabelSchema('vertex', 'Person')

    Example output:

    nametypeoptional
    idINT32false
    bornINT32true
    nameSTRINGtrue
    poster_imageSTRINGtrue
  • db.createLabel(label_type, label_name, extra, field_spec...)

    Create a vertex or edge label.

    Parameters:

    parameterparameter typedescription
    label_typestringeither 'vertex' or 'edge'
    label_namestringname of the label
    extrastringfor edge, it means constraints; for vertex, it means primary property
    field_speclistspecification of a field

    in which each field_spec is a list of string in the form of [field_name, field_type, optional]. for edge, extra should be a json array string, like this [["label1","label2"], ["label3","label4"]], if edge has no constraints, give an empty json array, like this []

    Output:

    If successful, it returns a success message.

    Example input:

    CALL db.createLabel('vertex', 'new_label', 'id', ['id','int32',false], ['name','string', true]);
    CALL db.createLabel('edge', 'new_edge', '[["id1","id2"]]', ['id','int32',false], ['name', 'string', true]);

    Example output:

    Vertex label [new_label] successfully added.
  • db.deleteLabel(label_type, label_name)

    Delete a vertex or edge label.

    Parameters:

    parameterparameter typedescription
    label_typestringeither 'vertex' or 'edge'
    label_namestringname of the label

    Output:

    field_namefield_typedescription
    affectedintegernumber of vertexes/edges deleted

    Example input:

    CALL db.deleteLabel('vertex', 'Person')

    Example output:

    affected
    1024
  • db.alterLabelDelFields(label_type, label_name, field_names)

    Delete specified fields from the label.

    Parameters:

    parameterparameter typedescription
    label_typestringeither 'vertex' or 'edge'
    label_namestringname of the label
    field_nameslist of stringsnames of the fields to delete

    Output:

    field_namefield_typedescription
    affectedintegernumber of vertexes/edges modified

    Example input:

    CALL db.alterLabelDelFields('vertex', 'Person', ['name', 'image'])

    Example output:

    affected
    1024
  • db.alterLabelAddFields(label_type, label_name, field_value_spec...)

    Adds specified fields to the label.

    Parameters:

    parameterparameter typedescription
    label_typestringeither 'vertex' or 'edge'
    label_namestringname of the label
    field_value_speclistspecification of a field

    in which each field_value_spec is a list of string in the form of [field_name, field_type, field_value, optional], where: field_value is the default value of the field.

    Output:

    field_namefield_typedescription
    affectedintegernumber of vertexes/edges modified

    Example input:

    CALL db.alterLabelAddFields(
    'vertex',
    'new_label',
    ['birth_date', DATE, '', true],
    ['img', BLOB, '', true])

    Example output:

    affected
    1024
  • db.alterLabelModFields(label_type, label_name, field_spec...)

    Modifies the specified fields in the label.

    Parameters:

    parameterparameter typedescription
    label_typestringeither 'vertex' or 'edge'
    label_namestringname of the label
    field_speclistspecification of a field

    in which each field_spec is a list of string in the form of [field_name, field_type, optional].The target field should exist.

    Output:

    field_namefield_typedescription
    affectedintegernumber of vertexes/edges modified

    Example input:

    CALL db.alterLabelModFields(
    'vertex',
    'new_label',
    ['birth_date', DATETIME, true],
    ['gender', BOOL, true])

    Example output:

    affected
    1024
  • db.createEdgeLabel( label_name, field_spec...)

    Create an edge label.

    Parameters:

    parameterparameter typedescription
    label_namestringname of the label
    edge_constraintsstringedge constraints
    field_speclistspecification of a field

    in which each field_spec is a list of string in the form of [field_name, field_type, optional], where optional is specified as true, only for optional fields.

    edge_constraints is a json array string, This parameter limits the combination of starting and ending vertex of the edge, for example: '[["vertex_label1","vertex_label2"],["vertex_label3","vertex_label4"]]', which limits the edge direction can only be from vertex_label1 to vertex_label2 or from vertex_label3 to vertex_label4. If you don't want to have any constraints, give an empty array string, like this '[]'

    Output:

    If successful, it returns a success message.

    Example input:

    CALL db.createEdgeLabel('KNOWS', '[]', 'name', 'int32', true)

    Example output:

    Added type [KNOWS]
  • db.addIndex(label_name, field_name, unique)

    create an index on some field of one vertex label .

    Parameters:

    parameterparameter typedescription
    label_namestringname of the label
    field_namestringspecification of a field
    uniquebooleanSpecifies whether the index is unique

    Output:

    If successful, it returns a success message.

    Example input:

    CALL db.addIndex('Person', 'id', true)

    Example output:

    Added index [Perosn:id]
  • db.addEdgeIndex(label_name, field_name, unique, pair_unique)

    create an index on some field of one edge label .

    Parameters:

    parameterparameter typedescription
    label_namestringname of the label
    field_namestringspecification of a field
    uniquebooleanSpecifies whether the index is unique
    pair_uniquebooleanSpecifies whether the index is pair_unique

    Output:

    If successful, it returns a success message.

    Example input:

    CALL db.addEdgeIndex('BornIn', 'id', true, false)

    Example output:

    Added index [BornIn:id]
  • dbms.security.changePassword(current_password ,new_password)

    Change the current user's password.

    Parameters:

    parameterparameter typedescription
    current_passwordstringthe current password
    new_passwordstringnew password

    Output:

    If successful, it returns a success message.

    Example input:

    CALL dbms.security.changePassword('73@TuGraph','admin')

    Example output:

    true
  • dbms.security.changeUserPassword(user_name, new_password)

    Change the current user's password.

    Parameters:

    parameterparameter typedescription
    user_namestringthe user's name
    new_passwordstringnew password

    Output:

    If successful, it returns a success message.

    Example input:

    CALL dbms.security.changeUserPassword('quest','73@TuGraph')

    Example output:

    true
  • dbms.security.createUser(user_name, password)

    create new user on this graph database.

    Parameters:

    parameterparameter typedescription
    user_namestringthe new user name
    passwordstringthe password of new user

    Output:

    If successful, it returns a success message.

    Example input:

    CALL dbms.security.createUser('quest',"admin")

    Example output:

    true
  • dbms.security.deleteUser(user_name)

    delete user on this graph database.

    Parameters:

    parameterparameter typedescription
    user_namestringthe user name to be deleted

    Output:

    If successful, it returns a success message.

    Example input:

    CALL dbms.security.deleteUser('quest')

    Example output:

    true
  • dbms.security.listUsers()

    get all user's name of the graph database.

    Output:

    a list of user names, in which each element is a list of the following fields:

    parameterparameter typedescription
    user.namestringthe user name
    is.adminbooleanthe permission of this user

    Example input:

    CALL dbms.security.listUsers()

    Example output:

    user.nameis.admin
    admintrue
    ......
  • dbms.security.showCurrentUser()

    get current user's name.

    Output:

    a list of user names, in which each element is a list of the following fields:

    parameterparameter typedescription
    user.userstringthe current user name

    Example input:

    CALL dbms.security.showCurrentUser()

    Example output:

    user.name
    admin
  • dbms.security.listAllowedHosts()

    get the list of ips to be allowed .

    Output:

    a list of ips which are allowed.

    Example input:

    CALL dbms.security.listAllowedHosts()

    Example output:

    host
    192.168.1.22
    ...
  • dbms.security.deleteAllowedHosts(hosts)

    delete some ips from the list of ips to be allowed .

    Output:

    the number of ip which been deleted.

    Example input:

    CALL dbms.security.deleteAllowedHosts('192.168.1.22','192.168.1.23')

    Example output:

    success
    2
  • dbms.security.addAllowedHosts(hosts)

    add some ips from the list of ips to be allowed .

    Output:

    the number of ip which been added.

    Example input:

    CALL dbms.security.addAllowedHosts('192.168.1.22','192.168.1.23')

    Example output:

    success
    2
  • dbms.graph.createGraph(graph_name, description, max_size_GB)

    create a new subgraph in this graph database .

    Parameters:

    parameterparameter typedescription
    graph_namestringthe name of new subgraph
    descriptionstringdescription of new subgraph
    max_size_GBintegerUpper limit of subgraph capacity

    Output:

    if successful , it will return true.

    Example input:

    CALL dbms.graph.createGraph('graph1', 'description', 2045)

    Example output:

    success
    true
  • dbms.graph.deleteGraph(graph_name)

    delete a subgraph in this graph database .

    parameterparameter typedescription
    graph_namestringthe name of subgraph to been deleted

    Output:

    if successful , it will return true.

    Example input:

    CALL dbms.graph.deleteGraph('graph1')

    Example output:

    success
    true
  • dbms.graph.modGraph(graph_name, config)

    delete a subgraph in this graph database .

    Parameters:

    parameterparameter typedescription
    graph_namestringthe name of subgraph to been deleted
    configmapthe configuration to be modified

    Output:

    if successful , it will return true.

    Example input:

    CALL dbms.graph.modGraph('graph1',{description:'this graph', max_size_GB:20})

    Example output:

    success
    true
  • dbms.graph.listGraphs()

    get all subgraphs in this graph database.

    Output:

    a list of {subgraph and configuration}.

    Example input:

    CALL dbms.graph.listGraphs()

    Example output:

    graph.nameconfiguration
    default{"description":"","max_size_GB":1024}
    graph1{"description":"this graph","max_size_GB":20}
    ......
  • dbms.graph.listUserGraphs(user_name)

    get subgraph list which specified user can read or write

    Output:

    a list of {subgraph and configuration}.

    Example input:

    CALL dbms.graph.listUserGraphs("test_user")

    Example output:

    graph.nameconfiguration
    default{"description":"","max_size_GB":1024}
    graph1{"description":"this graph","max_size_GB":20}
    ......
  • dbms.config.list()

    get config of this graph database.

    Output:

    a list of {configuration}.

    Example input:

    CALL dbms.config.list()

    Example output:

    namevalue
    bind_host0.0.0.0
    durabletrue
    ......
  • dbms.config.update(updates)

    get some config of this graph database.

    Output:

    If successful, it returns a success message

    Example input:

    CALL dbms.config.update({
    enable_ip_check:false,
    durable:true,
    optimistic_txn:true,
    enable_audit_log:true})

    Example output:

    Update succeeded.
  • dbms.takeSnapshot()

    take the snapshot on this current graph database.

    Output:

    If successful, it returns the path of snapshot.

    Example input:

    CALL dbms.takeSnapshot()

    Example output:

    path
    log/db/snapshot/2020-07-20_17.20.03
  • dbms.listBackupFiles()

    get the path of backuped files.

    Output:

    If successful, it returns the path of snapshot.

    Example input:

    CALL dbms.listBackupFiles()

    Example output:

    path
    tugraph/db/binlog/binlog_0
  • algo.shortestPath(startNode, endNode, config)

    get one of the shortest paths between two vertexes.

    Parameters:

    parameterparameter typedescription
    startNodeNodethe source node of paths
    endNodeNodethe destination node paths
    configMAPthe filter of shortest paths, the formate as {maxHops:3, relationshipQuery:'HAS_CHILD'}

    Output:

    If successful, it will returns one group result of the shortest path.

    Example input:

    MATCH (n1 {name:'Hugo Weaving'}),(n2 {title:'The Matrix'})
    CALL algo.shortestPath(n1,n2) YIELD nodeCount,totalCost RETURN nodeCount,totalCost

    Example output:

    nodeCounttotalCost
    21
  • algo.allShortestPaths(startNode, endNode, config))

    get the path of backuped files.

    Output:

    If successful, it returns the path of snapshot.

    Example input:

    MATCH (n1 {name:'Hugo Weaving'}),(n2 {title:'The Matrix'})
    CALL algo.allShortestPaths(n1,n2) YIELD nodeIds,cost RETURN nodeIds,cost

    Example output:

    nodeIdscost
    [2,665]1
    ...
  • algo.algo.native.extract(id, config))

    get the field values of a list of vertexes or edges.

    Parameters:

    parameterparameter typedescription
    idANYthe id of vertexes or edges , the id must be variable
    configMAPthe configuration of this extraction of vertexes or edges

    in which each config is a map in the form of {isNode:true, filed:'HAS_CHILD'}, if isNode is specified true, the id is a vertex id, or it is an edge id.

    Output:

    If successful, it returns a list of the value of vertexes or edges specified field .

    Example input:

    with [2,3] as vids CALL algo.native.extract(vids,{isNode:true, field:'id'})
    YIELD value RETURN value

    Example output:

    value
    [4,5]

5.2.内置procedures完整列表

NameDescriptionSignature
db.subgraph列出点的子图db.subgraph(vids::LIST) :: (subgraph::STRING)
db.vertexLabels列出所有Vertex Labeldb.vertexLabels() :: (label::STRING)
db.edgeLabels列出所有Edge Labeldb.edgeLabels() :: (edgeLabels::STRING)
db.indexes列出所有索引db.indexes() :: (label::STRING,field::STRING,label_type:STRING,unique::BOOLEAN,pair_unique::BOOLEAN)
db.listLabelIndexes列出所有与某个Label相关的索引db.listLabelIndexes(label_name:STRING,label_type:STRING) :: (label::STRING,field::STRING,unique::BOOLEAN,pair_unique::BOOLEAN)
db.warmup预热数据db.warmup() :: (time_used::STRING)
db.createVertexLabel创建Vertex Labeldb.createVertexLabel(label_name::STRING,field_specs::LIST) :: (::VOID)
db.createLabel创建Vertex/Edge Labeldb.createLabel(label_type::STRING,label_name::STRING,extra::STRING,field_specs::LIST) :: ()
db.getLabelSchema列出label schemadb.getLabelSchema(label_type::STRING,label_name::STRING) :: (name::STRING,type::STRING,optional::BOOLEAN)
db.getVertexSchema列出点的 schemadb.getVertexSchema(label::STRING) :: (schema::MAP)
db.getEdgeSchema列出边的 schemadb.getEdgeSchema(label::STRING) :: (schema::MAP)
db.deleteLabel删除Vertex/Edge Labeldb.deleteLabel(label_type::STRING,label_name::STRING) :: (::VOID)
db.alterLabelDelFields修改label删除属性db.alterLabelDelFields(label_type::STRING,label_name::STRING,del_fields::LIST) :: (record_affected::INTEGER)
db.alterLabelAddFields修改label添加fielddb.alterLabelAddFields(label_type::STRING,label_name::STRING,add_field_spec_values::LIST) :: (record_affected::INTEGER)
db.alterLabelModFields修改label fielddb.alterLabelModFields(label_type::STRING,label_name::STRING,mod_field_specs::LIST) :: (record_affected::INTEGER)
db.createEdgeLabel创建Edge Labeldb.createEdgeLabel(type_name::STRING,field_specs::LIST) :: (::VOID)
db.addIndex创建索引db.addIndex(label_name::STRING,field_name::STRING,unique::BOOLEAN) :: (::VOID)
db.addEdgeIndex创建索引db.addEdgeIndex(label_name::STRING,field_name::STRING,unique::BOOLEAN,pair_unique::BOOLEAN) :: (::VOID)
db.addVertexCompositeIndex创建组合索引db.addVertexCompositeIndex(label_name::STRING,field_names::LIST,unique::BOOLEAN) :: (::VOID)
db.deleteIndex删除索引db.deleteIndex(label_name::STRING,field_name::STRING) :: (::VOID)
db.deleteCompositeIndex删除组合索引db.deleteIndex(label_name::STRING,field_names::LIST) :: (::VOID)
db.backup备份数据db.backup(destination::STRING) :: ()
dbms.procedures列出所有proceduresdbms.procedures() :: (name::STRING,signature::STRING)
dbms.security.changePassword更改当前用户的密码dbms.security.changePassword(current_password::STRING,new_password::STRING) :: (::VOID)
dbms.security.changeUserPassword更改指定用户的密码dbms.security.changeUserPassword(user_name::STRING,new_password::STRING) :: (::VOID)
dbms.security.createUser创建用户dbms.security.createUser(user_name::STRING,password::STRING) :: (::VOID)
dbms.security.deleteUser删除用户dbms.security.deleteUser(user_name::STRING) :: (::VOID)
dbms.security.listUsers列出所有用户dbms.security.listUsers() :: (user_name::STRING,user_info::MAP)
dbms.security.showCurrentUser列出当前用户信息dbms.security.showCurrentUser() :: (current_user::STRING)
dbms.security.getUserPermissions列出指定用户的权限dbms.security.getUserPermissions(user_name::STRING) :: (user_info::MAP)
dbms.graph.createGraph创建子图dbms.graph.createGraph(graph_name::STRING, description::STRING, max_size_GB::INTEGER) :: (::VOID)
dbms.graph.modGraph修改子图属性dbms.graph.modGraph(graph_name::STRING,config::MAP) :: (::VOID)
dbms.graph.deleteGraph删除子图dbms.graph.deleteGraph(graph_name::STRING) :: (::VOID)
dbms.graph.listGraphs列出所有子图dbms.graph.listGraphs() :: (graph_name::STRING,configuration::MAP)
dbms.graph.getGraphInfo列出指定子图的信息dbms.graph.getGraphInfo(graph_name::STRING)::(graph_name::STRING,configuration::MAP)
dbms.security.addAllowedHosts添加ip到信任列表dbms.security.addAllowedHosts(hosts::LIST) :: (num_new::INTEGER)
dbms.security.deleteAllowedHosts从信任列表删除ipdbms.security.deleteAllowedHosts(hosts::LIST) :: (record_affected::INTEGER)
dbms.security.listAllowedHosts列出信任列表中的主机ipdbms.security.listAllowedHosts() :: (host::STRING)
dbms.config.update更新TuGraph配置dbms.config.update(updates::MAP) :: (message::STRING)
dbms.config.list列出TuGraph配置dbms.config.list() :: (name::STRING,value::ANY)
algo.shortestPath查询两个点间的最短路径algo.shortestPath(startNode::NODE,endNode::NODE,config::MAP) :: (nodeCount::INTEGER,totalCost::FLOAT)
algo.allShortestPaths查询两个点间的所有最短路径algo.allShortestPaths(startNode::NODE,endNode::NODE,config::MAP) :: (nodeIds::LIST,relationshipIds::LIST,cost::LIST)
algo.native.extract查询指定VertexId/EdgeUid(列表)指定field的值(列表)algo.native.extract(id::ANY,config::MAP) :: (value::ANY)
db.flushDB刷新dbdb.flushDB() :: (::VOID)
dbms.security.listRoles列出所有角色dbms.security.listRoles() :: (role_name::STRING,role_info::MAP)
dbms.security.createRole创建角色dbms.security.createRole(role_name::STRING,desc::STRING) :: (::VOID)
dbms.security.deleteRole删除角色dbms.security.deleteRole(role_name::STRING) :: (::VOID)
dbms.security.getRoleInfo获取角色详细信息dbms.security.getRoleInfo(role::STRING) :: (role_info::MAP)
dbms.security.disableRole禁用/启用角色dbms.security.disableRole(role::STRING,disable::BOOLEAN) :: (::VOID)
dbms.security.modRoleDesc修改角色描述信息dbms.security.modRoleDesc(role::STRING,description::STRING) :: (::VOID)
dbms.security.rebuildRoleAccessLevel删除角色权限并重建dbms.security.rebuildRoleAccessLevel(role::STRING,access_level::MAP) :: (::VOID)
dbms.security.modRoleAccessLevel修改角色对指定图的访问权限dbms.security.modRoleAccessLevel(role::STRING,access_level::MAP) :: (::VOID)
dbms.security.modRoleFieldAccessLevel修改角色对指定属性的访问权限dbms.security.modRoleFieldAccessLevel(role::STRING,graph::STRING,label::STRING,field::STRING,label_type::STRING,field_access_level::STRING) :: (::VOID)
dbms.security.getUserInfo获取用户详细信息dbms.security.getUserInfo(user::STRING) :: (user_info::MAP)
dbms.security.disableUser禁用/启用用户dbms.security.disableUser(user::STRING,disable::BOOLEAN) :: (::VOID)
dbms.security.setCurrentDesc设置当前用户描述信息dbms.security.setCurrentDesc(description::STRING) :: (::VOID)
dbms.security.setUserDesc设置用户描述信息dbms.security.setUserDesc(user::STRING,description::STRING) :: (::VOID)
dbms.security.getUserMemoryUsage获取用户内存用量dbms.security.getUserMemoryUsage(user::STRING) :: (memory_usage::INTEGER)
dbms.security.setUserMemoryLimit设置用户内存限制dbms.security.setUserMemoryLimit(user::STRING,memorylimit::INTEGER) :: (::VOID)
dbms.security.deleteUserRoles删除用户与角色的联系dbms.security.deleteUserRoles(user::STRING,roles::LIST) :: (::VOID)
dbms.security.rebuildUserRoles清空用户角色的关系并重建dbms.security.rebuildUserRoles(user::STRING,roles::LIST) :: (::VOID)
dbms.security.addUserRoles新增用户与角色的联系dbms.security.addUserRoles(user::STRING,roles::LIST) :: (::VOID)
db.plugin.loadPlugin装载plugindb.plugin.loadPlugin(plugin_type::STRING,plugin_name::STRING,plugin_content::STRING or MAP,code_type::STRING,plugin_description::STRING,read_only::BOOLEAN,version::STRING) :: (::VOID)
db.plugin.deletePlugin删除plugindb.plugin.deletePlugin(plugin_type::STRING,plugin_name::STRING) :: (::VOID)
db.plugin.listPlugin列出已装载的plugindb.plugin.listPlugin(plugin_type::STRING,plugin_version::STRING) :: (plugin_description::LIST)
db.plugin.getPluginInfo获取plugin的详细信息db.plugin.getPluginInfo(plugin_type::STRING,plugin_name::STRING,show_code::BOOLEAN)::(plugin_description::MAP)
db.plugin.callPlugin执行plugindb.plugin.callPlugin(plugin_type::STRING,plugin_name::STRING,param::STRING,timeout::DOUBLE,in_process::BOOLEAN) :: (success::BOOLEAN,result::STRING)
db.importor.dataImportor导入点或边数据db.importor.dataImportor(description::STRING,content::STRING,continue_on_error::BOOLEAN,thread_nums::INTEGER,delimiter::STRING) :: (::VOID)
db.importor.schemaImportor导入点或边schemadb.importor.schemaImportor(description::STRING) :: (::VOID)
db.addFullTextIndex添加全文索引db.addFullTextIndex(is_vertex::BOOLEAN, label_name::STRING, field_name::STRING) :: (::VOID)
db.deleteFullTextIndex删除全文索引db.deleteFullTextIndex(is_vertex::BOOLEAN, label_name::STRING, field_name::STRING) :: (::VOID)
db.rebuildFullTextIndex重建全文索引db.rebuildFullTextIndex(vertex_labels::STRING, edge_labels::STRING) :: (::VOID)
db.fullTextIndexes查看全文索引db.fullTextIndexes() :: (is_vertex::BOOLEAN, label::STRING, field::STRING)
dbms.meta.count查看点边总数db.dbms.meta.count() :: (type::STRING, number::INTEGER)
dbms.meta.countDetail查看点边总数详情db.dbms.meta.countDetail() :: (is_vertex::BOOLEAN, label::STRING, count::INTEGER)
dbms.meta.refreshCount重新统计点边数量,统计期间停写。db.dbms.meta.refreshCount() :: (::VOID)
dbms.task.listTasks查询正在执行的任务dbms.task.listTasks()::(tasks::LIST)
dbms.task.terminateTask中止任务dbms.task.terminateTask(task_id::STRING)::(::VOID)
dbms.ha.clusterInfoHA模式下查看集群状态dbms.ha.clusterInfo() :: (cluster_info::LIST, is_master::BOOLEAN)
db.dropDB清空数据库db.dropDB() :: (::VOID)