Skip to main content

Interface: IGraphDatabase

Defined in: src/types/interfaces/graph.interface.ts:144

Graph database interface for Neo4j.

Methods​

aggregateFacets()​

aggregateFacets(currentFacets?): Promise<readonly FacetAggregation[]>

Defined in: src/types/interfaces/graph.interface.ts:220

Aggregates facet values with counts.

Parameters​

currentFacets?​

readonly FacetFilter[]

Returns​

Promise<readonly FacetAggregation[]>


calculateConsensus()​

calculateConsensus(proposalUri): Promise<ConsensusResult>

Defined in: src/types/interfaces/graph.interface.ts:269

Calculates consensus for a proposal.

Parameters​

proposalUri​

AtUri

Returns​

Promise<ConsensusResult>


createEdge()​

createEdge(edge): Promise<void>

Defined in: src/types/interfaces/graph.interface.ts:182

Creates an edge between nodes.

Parameters​

edge​

EdgeInput

Returns​

Promise<void>


createProposal()​

createProposal(proposal): Promise<void>

Defined in: src/types/interfaces/graph.interface.ts:274

Creates a proposal.

Parameters​

proposal​
createdAt​

Date

kind​

NodeKind

proposalType​

"create" | "update" | "merge" | "deprecate"

proposedNode​

Partial<GraphNode>

proposerDid​

DID

rationale​

string

subkind​

string

targetUri​

AtUri

uri​

AtUri

Returns​

Promise<void>


createVote()​

createVote(vote): Promise<void>

Defined in: src/types/interfaces/graph.interface.ts:259

Creates a vote on a proposal.

Parameters​

vote​

Vote

Returns​

Promise<void>


deleteNode()​

deleteNode(uri): Promise<void>

Defined in: src/types/interfaces/graph.interface.ts:289

Deletes a node.

Parameters​

uri​

AtUri

Returns​

Promise<void>


findRelatedNodes()​

findRelatedNodes(nodeUri, maxDepth?): Promise<readonly GraphNode[]>

Defined in: src/types/interfaces/graph.interface.ts:192

Finds related nodes by traversing edges.

Parameters​

nodeUri​

AtUri

maxDepth?​

number

Returns​

Promise<readonly GraphNode[]>


getEdges()​

getEdges(nodeUri, relationSlug?): Promise<readonly GraphEdge[]>

Defined in: src/types/interfaces/graph.interface.ts:187

Gets edges from a node, optionally filtered by relation.

Parameters​

nodeUri​

AtUri

relationSlug?​

RelationshipSlug

Returns​

Promise<readonly GraphEdge[]>


getFieldAncestors()​

getFieldAncestors(fieldIds, maxDepth?): Promise<Map<string, readonly GraphNode[]>>

Defined in: src/types/interfaces/graph.interface.ts:207

Gets ancestor field nodes for multiple field IDs by traversing narrower edges in reverse. Used to expand field hierarchies for search indexing.

Parameters​

fieldIds​

readonly string[]

UUIDs of field nodes to get ancestors for

maxDepth?​

number

Maximum hierarchy depth to traverse (default 10)

Returns​

Promise<Map<string, readonly GraphNode[]>>

Map of field ID to array of ancestor field nodes (excluding the field itself)


getHierarchy()​

getHierarchy(rootUri, maxDepth?): Promise<NodeHierarchy>

Defined in: src/types/interfaces/graph.interface.ts:197

Gets node hierarchy for tree views.

Parameters​

rootUri​

AtUri

maxDepth?​

number

Returns​

Promise<NodeHierarchy>


getNode()​

getNode(id, subkind?): Promise<null | GraphNode>

Defined in: src/types/interfaces/graph.interface.ts:158

Gets a node by ID and optional subkind.

Parameters​

id​

string

subkind?​

string

Returns​

Promise<null | GraphNode>


getNodeByUri()​

getNodeByUri(uri): Promise<null | GraphNode>

Defined in: src/types/interfaces/graph.interface.ts:153

Gets a node by URI.

Parameters​

uri​

AtUri

Returns​

Promise<null | GraphNode>


getNodesByIds()​

getNodesByIds(ids, subkind?): Promise<Map<string, GraphNode>>

Defined in: src/types/interfaces/graph.interface.ts:167

Gets multiple nodes by IDs in a single query.

Parameters​

ids​

readonly string[]

Node identifiers to fetch

subkind?​

string

Optional subkind filter

Returns​

Promise<Map<string, GraphNode>>

Map of id to GraphNode (missing nodes are not included)


getProposal()​

getProposal(uri): Promise<null | NodeProposal>

Defined in: src/types/interfaces/graph.interface.ts:240

Gets a proposal by URI.

Parameters​

uri​

AtUri

Returns​

Promise<null | NodeProposal>


getProposalByRkey()​

getProposalByRkey(rkey): Promise<null | NodeProposal>

Defined in: src/types/interfaces/graph.interface.ts:254

Gets a proposal by its record key.

Parameters​

rkey​

string

Record key, the last segment of the proposal's AT-URI

Returns​

Promise<null | NodeProposal>

The proposal, or null if no proposal has that record key

Remarks​

Every proposal link in the UI carries the record key rather than the full AT-URI, because an AT-URI cannot sit in a single dynamic route segment. Without this lookup those links resolve against getProposal, which matches on the full URI and therefore never matches.


getProposalsForNode()​

getProposalsForNode(nodeUri): Promise<readonly NodeProposal[]>

Defined in: src/types/interfaces/graph.interface.ts:225

Gets pending proposals for a node.

Parameters​

nodeUri​

AtUri

Returns​

Promise<readonly NodeProposal[]>


getVotesForProposal()​

getVotesForProposal(proposalUri): Promise<readonly Vote[]>

Defined in: src/types/interfaces/graph.interface.ts:264

Gets votes for a proposal.

Parameters​

proposalUri​

AtUri

Returns​

Promise<readonly Vote[]>


listNodes()​

listNodes(options): Promise<NodeSearchResult>

Defined in: src/types/interfaces/graph.interface.ts:172

Lists nodes with filtering.

Parameters​

options​

NodeSearchOptions

Returns​

Promise<NodeSearchResult>


listProposals()​

listProposals(filters): Promise<{ hasMore: boolean; offset: number; proposals: readonly NodeProposal[]; total: number; }>

Defined in: src/types/interfaces/graph.interface.ts:230

Lists proposals with filtering.

Parameters​

filters​

ProposalFilters

Returns​

Promise<{ hasMore: boolean; offset: number; proposals: readonly NodeProposal[]; total: number; }>


queryByFacets()​

queryByFacets(facets): Promise<readonly string[]>

Defined in: src/types/interfaces/graph.interface.ts:215

Queries eprints by facets.

Parameters​

facets​

readonly FacetFilter[]

Returns​

Promise<readonly string[]>


searchNodes()​

searchNodes(query, options?): Promise<NodeSearchResult>

Defined in: src/types/interfaces/graph.interface.ts:177

Searches nodes by text query.

Parameters​

query​

string

options?​

NodeSearchOptions

Returns​

Promise<NodeSearchResult>


upsertNode()​

upsertNode(node): Promise<void>

Defined in: src/types/interfaces/graph.interface.ts:148

Upserts a node.

Parameters​

node​

NodeInput

Returns​

Promise<void>