Query Language (GQL)
ArcFlow queries are written in GQL — the ISO standard for graph query languages (ISO/IEC 39075). If you know Cypher, you already know it. If you don't, it reads like ASCII art.
ArcFlow's implementation of GQL is called WorldCypher — the query language for spatial-temporal world models. It passes 100% of the openCypher TCK (3881/3881 scenarios), fully implements ISO GQL V2, and adds extensions for temporal snapshots, live standing queries, confidence filtering, and spatial predicates that GQL leaves to implementations.
Reading data#
MATCH — find patterns#
-- Find all people
MATCH (n:Person) RETURN n.name, n.age
-- Find by property
MATCH (n:Person {name: 'Alice'}) RETURN n
-- Find with conditions
MATCH (n:Person) WHERE n.age > 25 RETURN n.name ORDER BY n.age DESC LIMIT 10Relationship traversal#
-- One hop
MATCH (a:Person)-[:KNOWS]->(b:Person) RETURN a.name, b.name
-- Variable-length (1 to 3 hops)
MATCH (a:Person {name: 'Alice'})-[:KNOWS*1..3]->(b) RETURN b.name
-- Any relationship type
MATCH (a:Person)-[r]->(b) RETURN a.name, type(r), b.nameMulti-MATCH (cross-entity joins)#
-- Find a person and a company independently, return both
MATCH (p:Person {id: 'p1'}) MATCH (c:Company {id: 'c1'}) RETURN p.name, c.nameAggregations#
MATCH (n:Person) RETURN count(*) AS total, avg(n.age) AS avgAge
MATCH (n:Person) RETURN n.city, count(*) AS residents ORDER BY residents DESCWriting data#
CREATE — add new data#
CREATE (n:Person {name: 'Alice', age: 30})
CREATE (a:Person {name: 'Alice'})-[:KNOWS]->(b:Person {name: 'Bob'})MERGE — find or create#
-- Creates only if no matching node exists
MERGE (n:Person {id: 'p1', name: 'Alice'})SET — update properties#
MATCH (n:Person {name: 'Alice'}) SET n.age = 31DELETE — remove data#
MATCH (n:Person {name: 'Alice'}) DELETE n
MATCH (n:Person {name: 'Alice'}) DETACH DELETE n -- also removes relationshipsREMOVE — delete a property#
MATCH (n:Person {name: 'Alice'}) REMOVE n.emailParameters#
Always use parameters for user-supplied values — they prevent injection and improve readability:
// Good — parameterized
db.query("MATCH (n:Person {name: $name}) RETURN n", { name: userInput })
// Bad — string interpolation (injection risk)
db.query(`MATCH (n:Person {name: '${userInput}'}) RETURN n`)String functions#
WHERE n.name CONTAINS 'ali'
WHERE n.name STARTS WITH 'A'
RETURN toLower(n.name) AS lowerName
RETURN COALESCE(n.email, 'none') AS emailAlgorithms#
Run graph algorithms directly — no projection setup:
CALL algo.pageRank()
CALL algo.louvain()
CALL algo.betweenness()
CALL algo.vectorSearch('my_index', $vector, 10)Temporal queries#
Query the graph at a point in time:
MATCH (n:Person) AS OF seq N RETURN n.nameFull-text search#
CREATE FULLTEXT INDEX person_search FOR (n:Person) ON (n.name)
CALL db.index.fulltext.queryNodes('person_search', 'Alice')Live queries#
-- Standing query — continuously re-evaluates
LIVE MATCH (n:Person) WHERE n.score > 0.9 RETURN n
-- Live algorithm — incrementally maintained
LIVE CALL algo.pageRank()
-- Persistent view
CREATE LIVE VIEW top_people AS MATCH (n:Person) WHERE n.score > 0.9 RETURN n.nameSee the GQL & WorldCypher Reference for the complete feature table.
See Also#
- GQL / WorldCypher Reference — full syntax overview
- MATCH reference — pattern matching in depth
- Graph Patterns — path expressions and variable-length traversals
- GQL Conformance — ISO/IEC 39075 standards lineage