Skip to main content

GetSchema

Inspect node and customer connection categories. Requires objects.read permission; no input or output blobs are used. Ownership links are excluded in every scope, including referenced and cached results.

scope is node, edge or all (the default). ref optionally restricts inspection to an earlier node/connection selection in this transaction. refresh defaults to true; false permits the transaction’s cached schema. A referenced query always recomputes its selected objects.

Response​

The requested nodes and edges fields are arrays, including when empty. Each record contains class, matched and a properties object mapping names to {"count":123,"type":"String"}. Nodes additionally contain type; connections contain src_type, src_class, dst_type and dst_class. refreshed is a UTC timestamp. Counts retain their 64-bit range.

Class names alone do not identify a category. Indexes are listed separately by GetIndexes; owner links are operational data, not schema edges. Empty registered categories remain visible with matched:0 and empty properties, including after DeleteAll. RemoveClass removes an empty category; its numeric ID becomes reusable after the removal commits. Existing readers keep the schema from their original snapshot.

[{"GetSchema":{"scope":"all","refresh":true}}]

An example response is:

[{
"GetSchema": {
"status": 0,
"refreshed": "2026-01-01T00:00:00Z",
"nodes": [
{"type":"entity","class":"Person","matched":2,
"properties":{"name":{"count":2,"type":"String"}}},
{"type":"image","class":"Person","matched":1,"properties":{}}
],
"edges": [
{"class":"AppearsIn","src_type":"entity","src_class":"Person",
"dst_type":"image","dst_class":"Person","matched":1,"properties":{}}
]
}
}]

Invalid scopes, undeclared references or missing permissions return a command error. See Responses for transaction error envelopes.

Inspect a selection​

These examples assume three DocsSchemaPerson entities: Ada, age 36; Grace, age 40; and Sam, age 20. A DocsSchemaKnows connection from Ada to Grace has the property since: 2020. Responses below omit the changing refreshed timestamp.

First, select people aged 30 or older. GetSchema inspects only the two selected entities, even though results.count returns no entity rows.

[{
"FindEntity": {
"with_class": "DocsSchemaPerson",
"_ref": 1,
"constraints": ["$age", ">=", 30],
"results": {
"count": true
}
}
}, {
"GetSchema": {
"ref": 1
}
}]
[{
"FindEntity": {
"count": 2,
"returned": 0,
"status": 0
}
}, {
"GetSchema": {
"edges": [],
"nodes": [{
"class": "DocsSchemaPerson",
"matched": 2,
"properties": {
"age": {
"count": 2,
"type": "Number"
},
"name": {
"count": 2,
"type": "String"
}
},
"type": "entity"
}],
"status": 0
}
}]

A connection selection reports the full typed source and destination category. Only the selected connection contributes to the property counts.

[{
"FindConnection": {
"with_class": "DocsSchemaKnows",
"_ref": 1,
"results": {
"count": true
}
}
}, {
"GetSchema": {
"ref": 1
}
}]
[{
"FindConnection": {
"count": 1,
"returned": 0,
"status": 0
}
}, {
"GetSchema": {
"edges": [{
"class": "DocsSchemaKnows",
"dst_class": "DocsSchemaPerson",
"dst_type": "entity",
"matched": 1,
"properties": {
"since": {
"count": 1,
"type": "Number"
}
},
"src_class": "DocsSchemaPerson",
"src_type": "entity"
}],
"nodes": [],
"status": 0
}
}]