Skip to content

Graph Schema and Cypher

nbx query gives you read-only access to the local code graph. Run nbx schema first: the installed binary is the authority for its exact labels, properties, and Cypher support.

Terminal window
nbx schema
LabelIdentityRepresents
CODE_SYMBOLsymbol_uidA resolved function, method, class, type, variable, or other code definition.
FILEfile_uidA source file in the analyzed repository.
COMMUNITYcommunity_uidA functional cluster of tightly coupled symbols.
WORKFLOWworkflow_uidAn ordered execution path from an entry point through resolved calls.
DOCUMENTdocument_uidA documentation chunk linked to repository symbols when present.

All node types include repository_id and producer_slot so results remain attributable inside multi-repository boxes.

RelationshipFrom → toMeaning
CALLSsymbol → symbolOne symbol calls another.
IMPORTSsymbol → symbolA resolved import relationship.
EXTENDSsymbol → symbolType or class inheritance.
IMPLEMENTSsymbol → symbolInterface or trait implementation.
USESsymbol → symbolA resolved symbol use outside the more specific edge types.
CONTAINSsymbol → symbolA symbol lexically contains another symbol.
MODULE_INITsymbol → symbolA module initialization relationship.
INVOKES_MACROsymbol → symbolA resolved macro invocation.
RelationshipFrom → to
EXTERNAL_CALLSsymbol → external symbol
EXTERNAL_EXTENDSsymbol → external symbol
EXTERNAL_IMPLEMENTSsymbol → external symbol
EXTERNAL_IMPORTSfile → external symbol
RelationshipFrom → toMeaning
MEMBER_OFsymbol → communityFunctional community membership.
WORKFLOW_CALLworkflow → symbolAn ordered call included in a workflow.
WORKFLOW_OUTCOMEworkflow → symbolAn outcome reached by a workflow.
WORKFLOW_TRAVERSESworkflow → communityA community crossed by a workflow.
CHILD_OFcommunity → communityCommunity hierarchy.
COMMUNITY_CROSSINGcommunity → communityA resolved connection between functional boundaries.
RelationshipFrom → toMeaning
CO_CHANGEDsymbol → symbolSymbols changed together in repository history.
FILE_CO_CHANGEDfile → fileFiles changed together in repository history.
FILE_DEPENDS_ONfile → fileA resolved file dependency.
  • CODE_SYMBOL: name, kind, language, file_path, source ranges, signature, docstring, scope, content, and content or structural hashes.
  • COMMUNITY: label, summary, size, hierarchy_level, and canonical parent identifiers.
  • WORKFLOW: label, description, entry-point fields, max_depth, callsite counts, and resolution counts.
  • FILE: path, language, content_hash, and line_count.
  • DOCUMENT: path, chunk_index, title, heading_trail, referenced_symbol_uids, and source_type.
  • Relationship records: source_uid, target_uid, relationship, source location, centrality_score, and step_index.

Use nbx schema when you need the complete property list for your installed version.

Terminal window
nbx query '
MATCH (caller:CODE_SYMBOL)-[r:CALLS]->(target:CODE_SYMBOL)
WHERE target.name = "refreshToken"
RETURN caller.name AS caller, type(r) AS relationship
LIMIT 50
'
Terminal window
nbx query '
MATCH (symbol:CODE_SYMBOL)-[:MEMBER_OF]->(community:COMMUNITY)
WHERE symbol.name = "refreshToken"
RETURN symbol.name, community.label, community.size
LIMIT 20
'
Terminal window
nbx query '
MATCH (workflow:WORKFLOW)-[step:WORKFLOW_CALL]->(symbol:CODE_SYMBOL)
WHERE workflow.label CONTAINS "Token"
RETURN workflow.label, step.step_index, symbol.name, symbol.file_path
ORDER BY step.step_index
LIMIT 50
'

nbx query supports the subset needed for bounded graph reads:

  • Clauses: MATCH, WHERE, WITH, UNWIND, RETURN, ORDER BY, SKIP, LIMIT, and DISTINCT.
  • Comparison and logic: =, <>, <, >, <=, >=, AND, OR, NOT, IN, CONTAINS, STARTS WITH, ENDS WITH, LIKE, ILIKE, IS NULL, and IS NOT NULL.
  • Scalar functions: toLower, toUpper, and type.
  • Aggregates: count, sum, avg, min, max, and collect.

Not currently supported: OPTIONAL MATCH, CASE, regex matching with =~, XOR, all() / any() / none() predicates, path variables, and path functions.

Add LIMIT while exploring, bind relationship variables when returning type(r) or edge properties, and qualify labels and property names exactly as nbx schema reports them.