Functions And Procedures

Use scalar functions in expressions and procedures with CALL …​ YIELD in Cypher. This reference lists available names, returned fields, and argument restrictions. Cypher contains complete graph-algorithm queries, and Multimodal queries shows vector and KV composition.

Scalar And Row Functions

Function Use Notes

count(*), count(expr), count(DISTINCT expr)

Count rows, non-null values, or distinct non-null values.

Empty global counts return zero; grouped empty input has no groups. count(DISTINCT *) is rejected.

collect(expr), collect(DISTINCT expr)

Collect non-null values into a list.

Empty global input returns []. Row-level DISTINCT and distinct aggregate arguments are separate operations.

sum(expr), avg(expr), min(expr), max(expr)

Aggregate values.

Empty global sum is zero; avg, min, and max are null. Use top-level aggregate projection items; compute further expressions after projecting an alias.

coalesce(a, b, …​)

Choose the first non-null expression.

Useful for optional bindings and missing properties; returns null if all arguments are null.

size, isEmpty, head, tail, last, reverse

Inspect or transform supported lists/strings.

Null inputs propagate null. head([]) and last([]) are null; tail([]) is []. Supported input types differ by function.

length(p)

Return hop count for a materialized path alias.

Works for supported MATCH p = …​ materialized path shapes.

nodes(p)

Return ordered node IDs from a path value.

Preserves path order.

relationships(p)

Return ordered relationship descriptors from a path value.

Uses a stable inspection shape.

Aggregate functions work in supported WITH and RETURN projections. CASE, comprehensions, quantified predicates and COUNT { …​ } / COLLECT { …​ } are expression syntax, not additional callable procedures. See Cypher for examples and Cypher And openCypher Compatibility for scope restrictions.

Vector And KV Procedures

Procedure Typical output Use

CALL vector.knn(index, vector, k, options)

node, score

Nearest-neighbor search over a vector index.

CALL kv.get("default", key)

value

Read a payload from the public default KV namespace by node UID.

The public PutKeyValue RPC writes to default. Numeric resource IDs address the internal resource index and are reserved for system-context query paths.

SpaceKey

CALL spacekey.search(index, options) YIELD …​ performs exact spatiotemporal lookup over a durable observation index. See Geospatial and spatiotemporal indexing for coordinate systems, ingestion, limits, and the equivalent SPARQL SERVICE.

Graph Analytics Procedures

Procedure Typical output Notes

CALL gds.pageRank.stream({…​})

nodeId, node, score

Runs PageRank over a pinned graph projection.

CALL gds.wcc.stream({…​})

nodeId, node, componentId, component

Weakly connected components over selected relationship types.

CALL gds.degree.stream({…​})

nodeId, degree, score

Degree centrality over selected orientation.

CALL gds.degreeCentrality.stream({…​})

nodeId, degree, score

Alias-style centrality naming.

CALL gds.closeness.stream({…​})

nodeId, score

Closeness centrality for supported projections.

CALL gds.closenessCentrality.stream({…​})

nodeId, score

Alias-style centrality naming.

CALL gds.betweenness.stream({…​})

nodeId, score

Supports exact or sampled behavior depending on options and budget.

CALL gds.betweennessCentrality.stream({…​})

nodeId, score

Alias-style centrality naming.

Choose existing labels, relationship types, and node identifiers from your dataset. Weighted algorithms also require a numeric relationship property in the expected units.

Common analytics options include relationshipTypes, nodeLabels, orientation, topK, and algorithm-specific controls such as maxIterations, tolerance, dampingFactor, or sourceSampleSize.

Weighted Path Procedures

Procedure Use Important constraints

CALL gds.shortestPath.dijkstra.stream({…​})

Positive-weight shortest paths.

Requires finite positive relationship weights.

CALL gds.shortestPath.astar.stream({…​})

Positive-weight shortest paths with coordinate heuristic.

Requires valid lat/lon properties and conservative heuristic validation, or explicit fallback to Dijkstra.

CALL gds.shortestPath.yens.stream({…​})

Exact k-shortest loopless paths.

Requires positive weights and bounded k.

CALL gds.bellmanFord.stream({…​})

Shortest paths with negative weights.

Negative cycles are diagnostics, not normal answers.

CALL gds.allShortestPaths.stream({…​})

Budgeted all-pairs shortest paths.

Large all-pairs expansion requires source/target/pair budgets.

Write-back procedures are governed separately and feature-flagged. Do not assume write mode is available in a default deployment.

Unsupported Or Guarded Cases

ShrikeDB intentionally rejects:

  • NaN or infinite weights;

  • zero or negative weights for Dijkstra, A*, and Yen;

  • arbitrary runtime weight expressions in the current weighted-path track;

  • unbounded all-pairs output;

  • analytics mutate/write modes unless the specific governed feature is enabled.