ArcFlow
Company
Managed Services
Markets
  • News
  • LOG IN
  • GET STARTED

OZ brings Visual Intelligence to physical venues, a managed edge layer that lets real-world environments see, understand, and act in real time.

Talk to us

ArcFlow

  • World Models
  • Sensors

Managed Services

  • OZ VI Venue 1
  • Case Studies

Markets

  • Sports
  • Broadcasting
  • Robotics

Company

  • About
  • Technology
  • Careers
  • Contact

Ready to see it live?

Talk to the OZ team about deploying at your venues, from a single pilot match to a full regional rollout.

Schedule a deployment review

© 2026 OZ. All rights reserved.

LinkedIn
ArcFlow Docs
Get Started
  • Get Started
  • Quickstart
  • Installation
  • Project Setup
  • Platforms
  • Bindings
  • Licensing
  • Pricing
Capabilities
  • Vector Search
  • Graph Algorithms
  • Sync
  • MCP Server (AI Agents)
  • Live Queries
  • Programs
  • Temporal
  • Spatial
  • Trusted RAG
  • Behavior Graph
  • Agent-Native
  • Event Sourcing
  • GPU Acceleration
  • Intent Relay
Concepts
  • World Model
  • Graph Model
  • Query Language (GQL)
  • Graph Patterns
  • SQL vs GQL
  • Parameters
  • Query Results
  • Persistence & WAL
  • Error Handling
  • Observations & Evidence
  • Confidence & Provenance
  • Proof Artifacts & Gates
  • Skills
GQL / WorldCypher
  • Overview
  • MATCH
  • WHERE
  • RETURN
  • OPTIONAL MATCH
  • CREATE
  • SET
  • MERGE
  • DELETE
  • REMOVE
  • WITH
  • UNION
  • UNWIND
  • CASE
  • Spatial Queries
  • Temporal Queries
  • Algorithms Reference
  • Triggers
Schema
  • Overview
  • Indexes
  • Constraints
  • Data Types
Functions
  • Built-in Functions
  • Aggregations
  • Procedures
  • Shortest Path
  • EXPLAIN
  • PROFILE
Skills
  • Overview
  • CREATE SKILL
  • PROCESS NODE
  • REPROCESS EDGES
Operations
  • CLI
  • REPL Commands
  • Snapshot & Restore
  • Server Modes & PG Wire
  • Persistence
  • Import & Export
  • Docker
  • Architecture
  • Cloud Architecture
  • Sync Protocol (Deep Dive)
Guides
  • Agent Integration
  • World Model
  • Graph Model Fundamentals
  • Trusted RAG
  • Using Skills
  • Behavior Graphs
  • Swarm & Multi-Agent
  • Migration Guide
  • Filesystem Workspace
  • From SQL to GQL
  • ArcFlow for Coding Agents
  • Data Quality & Pipeline Integrity
  • Code Intelligence
Tutorials
  • Knowledge Graph
  • Entity Linking
  • Vector Search
  • Graph Algorithms
Recipes
  • CRUD
  • Multi-MATCH
  • MERGE (Upsert)
  • Full-Text Search
  • Temporal Queries
  • Batch Projection
  • GraphRAG
Use Cases
  • Agent Tooling
  • Knowledge Management
  • RAG Pipeline
  • Fraud Detection
  • Sports Analytics
  • Grounded Neural Objects
  • Behavior Graphs
  • Autonomous Systems
  • Digital Twins
  • Robotics & Perception
Reference
  • TypeScript API
  • GQL Conformance
  • Compatibility Matrix
  • Glossary
  • Data Types
  • Operators
  • Error Codes
  • Known Issues

Recipe: Batch Projection

Project entities and relationships into the world model at scale. MERGE semantics make every batch idempotent — replay the same data and the graph converges, never duplicates.

Basic batch#

const mutations = [
  "MERGE (p:Person {id: 'p1', name: 'Alice'})",
  "MERGE (p:Person {id: 'p2', name: 'Bob'})",
  "MERGE (o:Org {id: 'o1', name: 'Acme'})",
]
const count = db.batchMutate(mutations)
// count === 3

Entity + relationship batch#

Split into two phases for reliable linking:

// Phase 1: Create all nodes
db.batchMutate([
  "MERGE (p:Person {id: 'p1', name: 'Alice', workspaceId: 'ws1'})",
  "MERGE (o:Org {id: 'o1', name: 'Acme', workspaceId: 'ws1'})",
  "MERGE (f:Fact {uuid: 'f1', predicate: 'employment', confidence: 0.87})",
])
 
// Phase 2: Create all relationships (nodes guaranteed to exist)
db.batchMutate([
  "MATCH (p:Person {id: 'p1'}) MATCH (f:Fact {uuid: 'f1'}) MERGE (p)-[:SUBJECT_OF]->(f)",
  "MATCH (f:Fact {uuid: 'f1'}) MATCH (o:Org {id: 'o1'}) MERGE (f)-[:OBJECT_IS]->(o)",
])

Pipeline function#

interface PipelineEntity {
  label: string
  id: string
  properties: Record<string, string | number | boolean>
}
 
interface PipelineRelation {
  fromLabel: string
  fromId: string
  toLabel: string
  toId: string
  relType: string
}
 
function projectBatch(db: ArcflowDB, entities: PipelineEntity[], relations: PipelineRelation[]) {
  // Phase 1: Entities
  const entityMutations = entities.map(e => {
    const props = Object.entries(e.properties)
      .map(([k, v]) => `${k}: ${typeof v === 'string' ? `'${v}'` : v}`)
      .join(', ')
    return `MERGE (n:${e.label} {id: '${e.id}', ${props}})`
  })
  db.batchMutate(entityMutations)
 
  // Phase 2: Relationships
  const relMutations = relations.map(r =>
    `MATCH (a:${r.fromLabel} {id: '${r.fromId}'}) MATCH (b:${r.toLabel} {id: '${r.toId}'}) MERGE (a)-[:${r.relType}]->(b)`
  )
  if (relMutations.length > 0) {
    db.batchMutate(relMutations)
  }
}

Performance notes#

  • batchMutate executes all queries under a single write lock — no per-query locking overhead
  • MERGE is safe for re-runs — idempotent by design
  • For very large batches (10K+), split into chunks of ~1000 mutations

See Also#

  • MERGE reference — upsert semantics for idempotent writes
  • CRUD Recipe — basic create, read, update, delete patterns
  • Use Case: Knowledge Management — batch ingest in an entity extraction pipeline
Try it
Open ↗⌘↵ to run
Loading engine…
← PreviousTemporal QueriesNext →GraphRAG