Skip to main content
Version: 3.2

2.10 Projections

Projections are reusable, versioned Cypher queries against the knowledge graph. You save a query once, publish it, and then run it (or let other systems call it) by its slug, so the same query stays consistent everywhere it is used. They build on the graph a Build has processed.

There are two kinds:

  • Views: return nodes and relationships. Results are automatically filtered by the caller's Graph Access Rules, so each caller sees only the part of the graph they are allowed to.
  • Functions: return any result, such as counts, aggregations or single values. Running a Function requires an explicit Graph Access Rule grant.

Both kinds share the same building blocks: a Definition (the Cypher query), optional Parameters, a unique Slug, and Versions.

Manage them from the Projections section in the sidebar. The list has Views and Functions tabs, each split into Published and Unpublished, and Add New creates either kind.

The Projections list with its Views and Functions tabs and the Published and Unpublished sub-tabs

Parameters

To make a query reusable, reference parameters in the Cypher with a $ prefix (for example $id). DCH detects them automatically and lists them under Parameters, where you give each a value before running the query. Values are interpreted by type, so 1 is a number, true a boolean, and quoted text a string.

Versions

Projections are versioned like Workflows:

  • Draft: the working copy you edit.
  • Published: the live version. Only one version is published at a time, and publishing a draft archives the previously published one.

Editing changes the current draft; published versions stay frozen. Deleting the last remaining version deletes the projection.

Consuming a projection

A projection is meant to be called by its Slug. Once a version is published, other systems run the query through DCH by that slug and always get the published version, without needing to know the underlying Cypher. A projection must be published before it can be consumed this way.