Skip to main content

Interface: ICitationGraph

Defined in: src/types/interfaces/discovery.interface.ts:892

Methods​

deleteCitationsForPaper()​

deleteCitationsForPaper(paperUri): Promise<void>

Defined in: src/types/interfaces/discovery.interface.ts:989

Deletes all citations for an eprint.

Parameters​

paperUri​

AtUri

AT-URI of the eprint

Returns​

Promise<void>

Remarks​

Used when an eprint is removed from Chive's index.


deleteRelatedWorksForPaper()​

deleteRelatedWorksForPaper(paperUri): Promise<void>

Defined in: src/types/interfaces/discovery.interface.ts:1011

Deletes all RELATES_TO edges for an eprint.

Parameters​

paperUri​

AtUri

AT-URI of the eprint

Returns​

Promise<void>

Remarks​

Used when an eprint is removed from Chive's index.


ensureEprintNodes()​

ensureEprintNodes(uris): Promise<void>

Defined in: src/types/interfaces/discovery.interface.ts:917

Creates graph nodes for eprints the caller has verified are indexed.

Parameters​

uris​

readonly string[]

AT-URIs of works known to be indexed as Chive eprints

Returns​

Promise<void>

Remarks​

ICitationGraph.upsertCitationsBatch matches its endpoints rather than creating them, so an edge can never assert a paper Chive does not hold. That guard depends on something else creating the nodes, and nothing did: an eprint reached PostgreSQL and Elasticsearch while the graph gained a node for it only if someone interacted with it. This is how a caller holding the eprint index supplies them.


findCoCitedPapers()​

findCoCitedPapers(paperUri, minCoCitations?): Promise<readonly CoCitedPaper[]>

Defined in: src/types/interfaces/discovery.interface.ts:967

Finds papers frequently cited together with a given eprint.

Parameters​

paperUri​

AtUri

AT-URI of the source eprint

minCoCitations?​

number

Minimum co-citation count threshold

Returns​

Promise<readonly CoCitedPaper[]>

Papers co-cited with the source, sorted by strength

Remarks​

Uses bibliographic coupling algorithm. Returns papers that share many citing papers with the query paper.


getCitationCounts()​

getCitationCounts(paperUri): Promise<{ citedByCount: number; influentialCitedByCount: number; referencesCount: number; }>

Defined in: src/types/interfaces/discovery.interface.ts:975

Gets citation counts for an eprint.

Parameters​

paperUri​

AtUri

AT-URI of the eprint

Returns​

Promise<{ citedByCount: number; influentialCitedByCount: number; referencesCount: number; }>

Citation statistics


getCitationNetwork()​

getCitationNetwork(options?): Promise<CitationNetworkResult>

Defined in: src/types/interfaces/discovery.interface.ts:954

Reads the citation graph as a graph, rather than one paper's neighbours.

Parameters​

options?​

CitationNetworkOptions

Which network to read and how much of it

Returns​

Promise<CitationNetworkResult>

Every directed citation in the network, and how many there are

Remarks​

The per-paper queries above answer "who cites this one". They cannot answer where a paper sits among the others, because they never return an edge that does not touch the paper asked about -- so a view built on them shows a star and calls it a network.

When focusUri is given, that paper's own edges are collected first and the rest of the network fills the remaining budget. A truncated network therefore always still contains the paper the reader is looking at, which is the one guarantee the caller cannot recover for itself.


getCitingPapers()​

getCitingPapers(paperUri, options?): Promise<CitationQueryResult>

Defined in: src/types/interfaces/discovery.interface.ts:926

Gets papers that cite a given eprint.

Parameters​

paperUri​

AtUri

AT-URI of the cited eprint

options?​

CitationQueryOptions

Query options

Returns​

Promise<CitationQueryResult>

Papers that cite the given eprint


getReferences()​

getReferences(paperUri, options?): Promise<CitationQueryResult>

Defined in: src/types/interfaces/discovery.interface.ts:935

Gets papers that a given eprint cites (references).

Parameters​

paperUri​

AtUri

AT-URI of the citing eprint

options?​

CitationQueryOptions

Query options

Returns​

Promise<CitationQueryResult>

Papers referenced by the given eprint


upsertCitationsBatch()​

upsertCitationsBatch(citations): Promise<void>

Defined in: src/types/interfaces/discovery.interface.ts:902

Upserts a batch of citations into the graph.

Parameters​

citations​

readonly CitationRelationship[]

Citations to upsert

Returns​

Promise<void>

Remarks​

Creates or updates CITES edges between Eprint nodes. Deduplicates based on (citingUri, citedUri) pair.


upsertRelatedWorksBatch()​

upsertRelatedWorksBatch(relationships): Promise<number>

Defined in: src/types/interfaces/discovery.interface.ts:1001

Creates RELATES_TO edges between eprints for related work records.

Parameters​

relationships​

readonly RelatedWorkInput[]

Related work relationships to upsert

Returns​

Promise<number>

Number of edges created or updated

Remarks​

Creates or updates RELATES_TO edges. Only creates edges where both eprints exist as Eprint nodes in the graph.