The interface for the graph database.

interface IGraphDatabase {
    addEdge(from: string, to: string): void;
    addNode(name: string, content: string, index: IIndex[], node: string): void;
    close(): void;
    getContent(nodes: string[], maxDepth?: number, contentSize?: number): {
        [key: string]: string[];
    };
    getName(): string;
    getOwnerId(): string;
    loadFromDisk(version: string): void;
    remove(name: string): void;
    saveToDisk(version: string): void;
}

Hierarchy (view full)

Methods

  • Add an edge to the database.

    Parameters

    • from: string

      The node to add the edge from.

    • to: string

      The node to add the edge to.

    Returns void

  • Add a node to the database.

    Parameters

    • name: string

      The name of the content.

    • content: string

      The content.

    • index: IIndex[]

      The index of the node.

    • node: string

      The node to add.

    Returns void

  • Close the database.

    Returns void

  • Get the content of the nodes and their neighbors.

    Parameters

    • nodes: string[]

      The nodes to get the content of.

    • OptionalmaxDepth: number

      The maximum depth to search (default 1).

    • OptionalcontentSize: number

      The size of the content to return (content +/- contentSize, default 0).

    Returns {
        [key: string]: string[];
    }

    The content of the nodes and their neighbors.

    • [key: string]: string[]
  • Get the name of the database.

    Returns string

  • Load the database from disk.

    Parameters

    • version: string

      The version of the data collection.

    Returns void

  • Remove content from the database.

    Parameters

    • name: string

      The name of the content to remove.

    Returns void

  • Save the database to disk.

    Parameters

    • version: string

      The version of the data collection.

    Returns void