WorldCypher: Temporal Queries

ArcFlow natively supports time-aware queries — snapshot the graph at any point in time, track trajectories, and compute temporal metrics.

AS OF seq N — time travel queries#

Query the graph as it existed at a specific mutation sequence number. The engine replays the WAL onto a clean snapshot at that sequence.

-- What did the graph look like at sequence 42?
MATCH (n:Person) AS OF seq 42 RETURN n.name, n.age
// Get current sequence, then query an earlier snapshot
const clock = db.query("CALL db.clock()")
const currentSeq = Number(clock.rows[0].get('tick'))
 
// Query state from 100 mutations ago
const snapshot = db.query(`MATCH (n:Person) AS OF seq ${currentSeq - 100} RETURN n.name`)

Sequence is the temporal axis. Use AS OF seq N — exact and replayable. Wall-clock timestamps are not a temporal axis: AS OF <timestamp> is rejected (DEPRECATED_AS_OF_TIMESTAMP).

This page is the query-syntax reference; see Temporal Queries for the canonical treatment of clock domains, domain-tick queries, and deterministic replay.

Temporal procedures#

temporal.velocity — rate of change#

How fast is the graph changing?

const v = db.query("CALL temporal.velocity(7)")  // last 7 days
console.log(v.rows[0].get('totalNodes'))
console.log(v.rows[0].get('totalRelationships'))

temporal.decay — exponential decay#

Rank recent data higher with exponential decay:

const decayed = db.query("CALL temporal.decay(7, 0.01)")
// halfLife=7 days, floor=0.01

temporal.trajectory — entity history#

Track an entity's changes over time:

const trajectory = db.query("CALL temporal.trajectory()")

Temporal database operations#

-- Changes since last checkpoint
CALL db.changesSince
 
-- Compare two temporal versions
CALL db.temporalCompare
 
-- Replay temporal events
CALL db.temporalReplay
 
-- Nodes at a specific point in time
CALL db.nodesAsOf

Temporal live queries#

Combine temporal with live queries for continuous monitoring:

-- Continuously watch for new high-value nodes
LIVE MATCH (n:Person) WHERE n.score > 0.9 RETURN n.name, n.score

Use cases#

  • Audit trails — "What was the state of entity X on March 1st?"
  • Temporal analytics — "How has the network evolved over time?"
  • Event sourcing — replay graph mutations for debugging
  • Regulatory compliance — point-in-time reporting

See Also#

Try it
Open ↗
Loading engine…