UltipaDocs
Products
Solutions
Resources
Company
Start Free Trial
UltipaDocs
Start Free Trial
  • Introduction
  • Database Installation
  • Deployment Topologies
  • Clustering
  • Cloud Deployments
  • Database Info
  • Backup & Restore
  • Monitoring
  • Performance
  1. Docs
  2. /
  3. Operations

Database Info

Built-in functions for inspecting the running database: version, license, loaded plugins, graph stats, and schema. Call any of them inline with RETURN.

Version & Build

GQL
RETURN db.version()

Returns a single string set at build time. Use it as the simplest "is the server up and responding?" check from any driver. Reading it does not require RBAC privileges beyond a successful login.

License & Tier

GQL
RETURN db.license()

Returns a map describing the licensing state actually in effect at runtime — not what was passed at startup, what the enforcer is using.

FieldTypeMeaning
editionString"Community Edition" or "Licensed". Reflects whether a real license file was loaded and accepted.
typeStringLicense tier: free or paid.
licenseIdStringLicense identifier; empty on Community Edition / Free Tier.
customerId, customerNameStringCustomer fields from the signed license payload. Empty on Free Tier.
maxNodes, maxEdgesIntegerPer-graph caps. 10_000_000_000 (10 billion) each on Free Tier.
maxDatabasesIntegerGraph count cap. 3 on Free Tier.
issuedAt, expiresAtInteger (epoch seconds)License validity window. expiresAt = -1 means no expiry (Free Tier default).
expiredBooleantrue if the wall-clock has passed expiresAt — the enforcer flips the database to read-only at that point.
readOnlyBooleanWhether the enforcer is currently forcing read-only mode (expired license, or cap exceeded).
violationsIntegerRunning count of attempts to exceed a cap since last restart.

Cross-check the result against -license-file at startup: if you passed a path but edition still shows Community Edition, the file failed to parse — re-check the path and that the file is the signed .lic distributed by Ultipa, not a placeholder.

See Installation → License for the full Free Tier vs Paid Tier comparison.

Loaded Plugins

GQL
RETURN db.plugins()

Returns a list of maps, one per plugin currently loaded into the running process. Each entry includes:

FieldTypeMeaning
nameStringPlugin name (e.g., "hanp").
namespaceStringLogical grouping (e.g., "community" for the bundled community algorithms).
typeStringPlugin category — algorithm, procedure, function.
versionStringPlugin-reported version.
descriptionStringFree-text summary.
fullNameStringQualified name used in calls (namespace.name).
params, returnsListPer-parameter and per-return metadata (name, type, description, plus required / default for params).

This is the authoritative answer to "is plugin X actually loaded on this server?" Compare against the plugin's expected version before opening a bug — a stale build can look like a logic error.

Empty list means no plugins are loaded; this is normal for a vanilla Community install with no -plugin-dir and no built-in registrations enabled.

Graph Overview

GQL
RETURN db.overview()

A two-key map summarizing the current graph's shape:

FieldTypeContents
labelCountsListOne row per label ({label, count, type} where type is "node" or "edge").
edgePatternsListOne row per distinct (fromLabel)-[:edgeLabel]->(toLabel) triple actually observed in the graph, with the matching edgeCount.

edgePatterns is computed by scanning every edge and looking up endpoint labels — fast on small graphs, an O(E) hit on large ones. If you only need label counts, use db.stats() instead (served from the stats cache, no scan).

Statistics

GQL
RETURN db.stats()

Returns a comprehensive map served from the in-memory statistics cache. No scan, O(1).

FieldTypeMeaning
nodeCount, edgeCountIntegerTotal counts in the current graph.
labelCounts, edgeLabelCountsMap<String, Integer>Per-label counts. Keys are label names.
nodePropertyStats, edgePropertyStatsMap<String, Map<String, Integer>>Per-label property frequency (label → property → count).
unlabeledNodeCount, unlabeledEdgeCountIntegerEntities with no label assigned. Surfaced separately so an all-unlabeled graph stays distinguishable from an empty one.
unlabeledNodePropertyStats, unlabeledEdgePropertyStatsMap<String, Integer>Property frequency for the unlabeled bucket.
graphNameStringThe graph this stats payload was computed for (matches CURRENT_GRAPH).
statsReadyBooleanfalse indicates the cache is in a transient mismatch state — see statsDiagnostic.
statsDiagnosticStringPresent only when statsReady = false. Possible values include stats_nil, label_mapping_missing, label_counts_empty_but_nodes_present, edge_label_counts_empty_but_edges_present.

Treat a statsReady = false result as a signal to run db.reload_stats() (next section), not as bad data — the count fields are still the best available answer, just possibly stale.

Rebuilding Statistics

GQL
RETURN db.reload_stats()

Forces a full rebuild of the stats cache by re-scanning every node and edge in the current graph. Edge-label counts, node-label counts, total counts, self-loop counts, and per-label property stats are all recomputed and atomically swapped in — the next db.stats() / RETURN COUNT(r) returns the freshly computed values.

db.rebuild_stats() and db.repair_stats() are aliases for the same function — pick whichever reads best in the context where you call it.

Cost is O(N + E) — proportional to graph size. Run it after a manual restore or any operation where the stats cache might have diverged from on-disk truth.

Returns a small map:

FieldTypeMeaning
successBooleantrue on a successful rebuild.
messageStringHuman-readable summary ("Property statistics rebuilt successfully").

Schema Introspection

GQL
RETURN db.node_labels()
RETURN db.edge_labels()
RETURN db.label_property()
CallReturnsWhen to use
db.node_labels()ListAll distinct node labels currently present (served from stats cache).
db.edge_labels()ListAll distinct edge labels currently present.
db.label_property()Map<String, Map>Per-label schema: {labelName: {type: "node"|"edge", properties: [propName, ...]}}.

db.label_property() returns properties observed on at least one stored entity (open graphs) or declared in schema metadata (closed / schema-enforced graphs). On a large open graph it has to scan every node and edge — prefer db.stats() if you only need counts.