Skip to content

Validate Cypher against the schema without executing it

POST
/api/v1/admin/kg/validate
curl --request POST \
--url http://localhost:11044/api/v1/admin/kg/validate \
--header 'Content-Type: application/json' \
--header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>' \
--data '{ "args": { "additionalProperty": "example" }, "captureAs": "example", "cypher": "example", "params": { "additionalProperty": { "choices": [ "example" ], "default": "example", "description": "example", "required": true, "type": "string" } }, "surface": "studio" }'
username
string

Optional, and never needed: the call always acts as the signed-in principal. Naming the principal changes nothing; naming anyone else is refused with 403.

The Cypher to check, in cypher, against the acting user’s schema with the same preflight strict execution runs; only cypher is read, so params/args are not substituted and captureAs is ignored

Media typeapplication/json

Cypher to run through the virtual-cypher engine — the body of /execute, and of /validate, which reads only cypher.

object
args

Arguments for params. A blank value means not supplied, so the default applies.

object
key
additional properties
captureAs

Capture the result set as this named scope; reference it later as (x:$name). The statement must RETURN one labelled node variable. Synchronous mode only.

string
cypher
required

The statement, run verbatim — or, when params is given, a view body whose $name references are substituted first.

string
params

Declared parameters for the cypher, as a view declares them. Each $name is substituted from args merged over its default, exactly as when a saved view runs.

object
key
additional properties

A declared bind variable of a saved view, referenced as $name in its Cypher and supplied per invocation, keyed by that name wherever a view’s params are declared or listed

object
choices

The fixed set of values this param accepts — rendered as a select, enforced at invocation. Absent = any value of the declared type.

Array
default

Used when an invocation omits this param. Absent = required on invocation, unless required: false.

description

What the argument means — rendered verbatim as the field’s hint.

string
required

False lets an invocation omit a param that has no default; it is then bound to null.

boolean
type

The coercion applied to supplied values, and the form control a UI renders (int/number a number field, boolean a checkbox, date a date picker). float and double are aliases of number.

string
default: string
Allowed values: string int number float double boolean date
surface

Where the statement was written, recorded in the query log: studio for a query written in Query Studio’s editor. Omitted, it is logged as query. Any other value is a 400.

string
Allowed values: studio

The verdict; message is present even when null

Media typeapplication/json

The result of validating cypher against the schema without executing it.

object
message

A single human-readable summary, or null when there is nothing to say.

string
ok
required

True when the cypher passes the strict preflight — the same check strict execution applies.

boolean
violations
required

What the schema contradicts, one entry per defect.

Array<string>

Example generated

{
"message": "example",
"ok": true,
"violations": [
"example"
]
}

No authenticated principal

Media typeapplication/json

A refusal carrying only a human-readable reason.

object
error
required

What went wrong, in the terms the caller can act on.

string

Example generated

{
"error": "example"
}

username names someone other than the signed-in principal

Media typeapplication/json

A refusal carrying only a human-readable reason.

object
error
required

What went wrong, in the terms the caller can act on.

string

Example generated

{
"error": "example"
}