S2Graph

Warning

This module is under active development and may change significantly in future versions.

class s2.graph.S2Graph(edges=None, papers=None, authors=None)

Class for storing citation network subgraph.

Parameters
  • edges (EdgeMap, optional) –

    Stores subgraph edge information. While S2Paper and S2Author already contain the information required to reconstruct citation graphs, they do not allow arbitrary subgraphs and are not as lightweight as a simple mapping of identifiers.

    Defaults to defaultdict with factory for Neighbours for in-memory storage.

  • papers (S2PaperMap, optional) –

    Stores S2Paper objects retrievable by PaperId. Recommended to use s2.store.S2DataStore to avoid keeping large amounts of data in memory.

    Defaults to dict.

  • authors (S2AuthorMap, optional) –

    Stores S2Author objects retrievable by AuthorId. Recommended to use s2.store.S2DataStore to avoid keeping large amounts of data in memory.

    Defaults to dict.