Both the backlinks and (forward) links of a given tree can be computed using a query to the \rel/links relation, and the context (immediate parents) of a given tree can be obatined from the \query/transclusion relation:
\def\query/backlinks[x]{
\open\query
\rel{\edges}{\incoming}{\rel/links}{\x}
}
\def\query/links[x]{
\open\query
\rel{\edges}{\outgoing}{\rel/links}{\x}
}
\def\query/context[x]{
\open\query
\rel{\edges}{\incoming}{\rel/transclusion}{\x}
}