Skip to main content

Interface: ICitationGraph

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

Citation graph interface for Neo4j storage.

Remarks

Manages citations between Chive preprints in Neo4j. Only stores citations where BOTH papers are indexed in Chive (not all external citations).

All data is rebuildable from external sources (ATProto compliant).

Example

// Index citations for a preprint
await citationGraph.upsertCitationsBatch([
{ citingUri, citedUri, isInfluential: true, source: 'semantic-scholar' },
]);

// Find co-cited papers
const coCited = await citationGraph.findCoCitedPapers(preprintUri, 3);

Since

0.1.0

Methods

deleteCitationsForPaper()

deleteCitationsForPaper(paperUri): Promise<void>

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

Deletes all citations for a preprint.

Parameters

paperUri

AtUri

AT-URI of the preprint

Returns

Promise<void>

Remarks

Used when a preprint is removed from Chive's index.


findCoCitedPapers()

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

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

Finds papers frequently cited together with a given preprint.

Parameters

paperUri

AtUri

AT-URI of the source preprint

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:886

Gets citation counts for a preprint.

Parameters

paperUri

AtUri

AT-URI of the preprint

Returns

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

Citation statistics


getCitingPapers()

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

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

Gets papers that cite a given preprint.

Parameters

paperUri

AtUri

AT-URI of the cited preprint

options?

CitationQueryOptions

Query options

Returns

Promise<CitationQueryResult>

Papers that cite the given preprint


getReferences()

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

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

Gets papers that a given preprint cites (references).

Parameters

paperUri

AtUri

AT-URI of the citing preprint

options?

CitationQueryOptions

Query options

Returns

Promise<CitationQueryResult>

Papers referenced by the given preprint


upsertCitationsBatch()

upsertCitationsBatch(citations): Promise<void>

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

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 Preprint nodes. Deduplicates based on (citingUri, citedUri) pair.