Functions

The built-in function library WhisperGraph Cypher ships — aggregation, string, numeric, collection, node, type-conversion, and date functions.

Updated July 2026

Functions Documentation

WhisperGraph Cypher ships a function library you use inside RETURN, WITH, and WHERE. The tables below give the call and the value it returns. For the clauses that hold these functions, see Syntax & Clauses; for the CALL procedures (explain, whisper.variants, whisper.history, whisper.origins), see Procedures.

Aggregation

Aggregations collapse rows; any non-aggregated column in the same RETURN or WITH becomes a grouping key.

FunctionExampleResult
countcount(c)row count
count(DISTINCT ...)count(DISTINCT ip)distinct count
sumsum(x) over [1,2,3,4]10
avgavg(x) over [2,4,6]4.0
min / maxmin(x) / max(x) over [5,2,8]2 / 8
collectcollect(c.name)[0..3]a list
collect(DISTINCT ...)collect(DISTINCT x) over [1,1,2][1,2]

String

FunctionExampleResult
toUpper / uppertoUpper("abc")ABC
toLower / lowertoLower("ABC")abc
trim / ltrim / rtrimtrim(" hi ")hi
replacereplace("foobar","bar","baz")foobaz
substringsubstring("hello",1,3)ell
splitsplit("a,b,c",",")["a","b","c"]
left / rightleft("hello",2)he
reversereverse("abc")cba
toStringtoString(123)123

String concatenation uses +.

Numeric

FunctionExampleResult
absabs(-5)5
ceil / floorceil(4.2) / floor(4.8)5.0 / 4.0
roundround(4.5)5
signsign(-3)-1
sqrtsqrt(16)4.0
log / log10 / explog10(1000)3.0
randrand()a value in [0,1)
e / pipi()π

Arithmetic operators: +, -, *, /, %, ^ (exponent).

Trigonometric

FunctionExampleResult
sin / cos / tancos(0)1
asin / acos / atan / atan2atan2(0,1)0
degreesdegrees(pi())180
radiansradians(180)π

Collection

FunctionExampleResult
sizesize([1,2,3])3
head / lasthead([10,20,30])10
tailtail([10,20,30])[20,30]
rangerange(1,5)[1,2,3,4,5]
reversereverse([1,2,3])[3,2,1]
keyskeys(node)property keys
isEmptyisEmpty([])true

Node and relationship

FunctionExampleResult
id / elementIdid(n)a node id
labelslabels(n)["ASN"]
typetype(r)RESOLVES_TO
propertiesproperties(n)a property map
startNode / endNodestartNode(r).namea node
nodes / relationshipssize(nodes(p))path length

Type conversion

FunctionExampleResult
toInteger / toInttoInteger("42")42 (bad input → null)
toFloattoFloat("3.14")3.14
toBooleantoBoolean("true")true
toIntegerList / toFloatList / toStringList / toBooleanListtoIntegerList(["1","2"])[1,2]

Input that cannot be parsed yields null rather than an error — toInteger("abc") returns null.

Date and time

FunctionExampleResult
timestamptimestamp()epoch millis
datetoString(date())2026-06-17
datetime / localdatetime / timedatetime()a datetime
durationduration("P1D")a duration

Geospatial and misc

FunctionExampleResult
pointpoint({x:1.0,y:2.0})a point
distancedistance(point({x:0,y:0}), point({x:3,y:4}))geographic distance (x,y treated as lon,lat)
coalescecoalesce(a.missing, "default")default
randomUUIDrandomUUID()a UUID string

Reading threat properties off a node

You do not need a function to read a verdict — the threat posture lives directly on the node. An IPV4 node carries threatScore, threatLevel, isThreat, isTor, and isAnonymizer, so a single anchored read gives you the whole posture with no extra hops.

MATCH (ip:IPV4 {name: "185.220.101.1"})
RETURN ip.name AS ip, ip.threatScore AS score, ip.threatLevel AS level,
       ip.isThreat AS isThreat, ip.isTor AS isTor, ip.isAnonymizer AS isAnonymizer
LIMIT 1

For the scored reasoning behind a verdict — the feeds, weights, and factors — call explain(). See explain() — Threat Verdicts.