Tutorial: Building with CleaveDB
TRACE — Walk a Chain
While FOLLOW explores an entire neighborhood across one bond type, real business queries often follow an exact sequence of heterogeneous relationships: for example, find who is managed by the person who mentors Ana, or find the manufacturer of an item purchased by Jane. The TRACE command steps through ordered edge chains.
Walking an explicit multi-hop path
List relationship labels in sequence following TRACE:
TRACE "manages", "mentors" FROM "users:ana"CleaveDB starts at Ana, walks outgoing "manages" bonds to intermediate staff members, and from each intermediate member walks outgoing "mentors" bonds to return the final target documents.
Conversational chain syntax with FIND
You can also express multi-hop chains conversationally in plain English using FIND ... OF THE:
FIND THE knows OF THE boss OF users "jane"Read from right to left: locate Jane, find Jane's boss, and then retrieve everyone known by that boss.
