UltipaDocs
Products
Solutions
Resources
Company
Start Free Trial
UltipaDocs
Start Free Trial
  • Introduction
  • GQL vs Other Languages
    • Overview
    • Node and Edge Patterns
    • Path Patterns
    • Quantified Paths
    • Questioned Paths
    • Shortest Paths
    • Graph Patterns
    • Overview
    • Open Graph
    • Closed Graph
    • Constraints
    • Unique Identifiers
    • INSERT
    • INSERT OVERWRITE
    • SET
    • REMOVE
    • DELETE
    • Query Composition
    • Result Table and Visualization
    • MATCH
    • OPTIONAL MATCH
    • FILTER
    • LET
    • FOR
    • ORDER BY
    • LIMIT
    • SKIP
    • CALL
    • RETURN
    • Composite Query
    • NEXT
    • All Functions
    • Element Functions
    • Path Functions
    • Aggregate Functions
    • Mathematical Functions
    • Trigonometric Functions
    • String Functions
    • List Functions
    • Datetime Functions
    • Spatial Functions
    • Null Functions
    • Utility Functions
    • Type Conversion Functions
    • Table Functions
    • AI & Vector Functions
    • Database Functions
  • Operators
  • Predicates
    • CASE
    • LET Value Expression
    • Value Query Expression
    • List Comprehension
    • Index
    • Full-text Index
    • Vector Index
  • Transactions
  • Triggers
  • Query Management
  • Backup and Restore
    • Variables
    • Values and Types
    • Comments
    • Reserved Words
    • Syntactic Notation
  • GQL Conformance
  1. Docs
  2. /
  3. ISO GQL
  4. /
  5. Functions

Database Functions

db.version()

Returns the database version string.

GQL
RETURN db.version()

db.license()

Returns license information.

GQL
RETURN db.license()

db.plugins()

Returns a list of loaded plugins.

GQL
RETURN db.plugins()

db.stats()

Returns statistics of the current graph, including node/edge counts, label counts, and properties.

GQL
RETURN db.stats()

The returned record contains the following fields:

FieldTypeDescription
graphNameSTRINGName of the current graph
nodeCountINTTotal number of nodes
edgeCountINTTotal number of edges
unlabeledNodeCountINTNumber of nodes without labels
unlabeledEdgeCountINTNumber of edges without labels
labelCountsRECORDNode counts per label (e.g., {"Paper": 3})
edgeLabelCountsRECORDEdge counts per label (e.g., {"Cites": 2})
nodePropertyStatsRECORDNode property counts per label (e.g., {"Paper": {"title": 3, "score": 3}})
edgePropertyStatsRECORDEdge property counts per label (e.g., {"Cites": {"weight": 2}})
unlabeledNodePropertyStatsRECORDProperty counts for unlabeled nodes
unlabeledEdgePropertyStatsRECORDProperty counts for unlabeled edges
GQL
LET stats = db.stats()
RETURN stats.nodeCount AS nodes, stats.edgeCount AS edges

db.overview()

Returns the current graph overview with label counts and edge patterns.

GQL
RETURN db.overview()

The returned record contains:

FieldTypeDescription
labelCountsLISTList of {label, count, type} records for each node/edge label
edgePatternsLISTList of {fromLabel, edgeLabel, toLabel, edgeCount} records describing connection patterns

db.nodeLabels()

Returns all node labels in the current graph.

GQL
RETURN db.nodeLabels()

db.edgeLabels()

Returns all edge labels in the current graph.

GQL
RETURN db.edgeLabels()

db.labelProperty()

Returns the properties defined for each label in the current graph. For closed graphs, returns schema-defined properties. For open graphs, discovers properties by scanning data.

GQL
RETURN db.labelProperty()

The returned record maps each label name to a {type, properties} record, where type is "node" or "edge" and properties is a list of property names.

db.reloadStats()

Rebuilds statistics from storage for the current graph.

GQL
RETURN db.reloadStats()

Backup and Restore Functions

Refer to Backup and Restore.