Skip to main content

Interface: ICitationGraph

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

Citation graph interface for Neo4j storage.

Remarks

Manages citations between Chive eprints 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 an eprint
await citationGraph.upsertCitationsBatch([
{ citingUri, citedUri, isInfluential: true, source: 'semantic-scholar' },
]);

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

Since

0.1.0

Methods

deleteCitationsForPaper()

deleteCitationsForPaper(paperUri): Promise<void>

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

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

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.


findCoCitedPapers()

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

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

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

Gets citation counts for an eprint.

Parameters

paperUri

AtUri

AT-URI of the eprint

Returns

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

Citation statistics


getCitingPapers()

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

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

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

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

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

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.