Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TripleStore

Hierarchy

  • TripleStore

Implements

Index

Constructors

constructor

Properties

NEXT_ID

NEXT_ID: number

allIDs

allIDs: TripleIds

freeIDs

freeIDs: number[]

indexO

indexO: Map<any, TripleIds>

indexP

indexP: Map<any, TripleIds>

indexS

indexS: Map<any, TripleIds>

indexSelections

indexSelections: IObjectOf<Map<any, Subscription<Edit, TripleIds>>>

queries

queries: Map<string, ISubscribable<TripleIds>>

streamAll

streamAll: Stream<TripleIds>

streamO

streamO: Stream<Edit>

streamP

streamP: Stream<Edit>

streamS

streamS: Stream<Edit>

triples

triples: Triple[]

Methods

__@iterator

  • __@iterator(): IterableIterator<Triple>

add

addJoin

  • Like addMultiJoin(), but optimized for only two input queries. Returns a rstream subscription computing the natural join of the given input query results.

    Parameters

    Returns QuerySolution

addMultiJoin

Protected addParamQueries

  • addParamQueries(patterns: Iterable<Pattern>): IterableIterator<ISubscribable<Set<IObjectOf<any>>>>
  • Parameters

    Returns IterableIterator<ISubscribable<Set<IObjectOf<any>>>>

addParamQuery

  • addParamQuery(__namedParameters: [any, any, any], id?: string): QuerySolution
  • Creates a new parametric query using given pattern with at least 1 query variable. Query vars are strings with ? prefix. The rest of the string is considered the variable name.

    g.addParamQuery(["?a", "friend", "?b"]);

    Internally, the query pattern is translated into a basic param query with an additional result transformation to resolve the stated query variable solutions. Returns a rstream subscription emitting arrays of solution objects like:

    [{a: "asterix", b: "obelix"}, {a: "romeo", b: "julia"}]

    Parameters

    • __namedParameters: [any, any, any]
    • Optional id: string

    Returns QuerySolution

addPathQuery

  • Converts the given path pattern into a number of sub-queries and return a rstream subscription of re-joined result solutions. If maxLen is given and greater than the number of actual path predicates, the predicates are repeated.

    Parameters

    • path: PathPattern
    • Default value len: number = path[1].length
    • Optional id: string

    Returns QuerySolution

addPatternQuery

  • Creates a new query subscription from given SPO pattern. Any null values in the pattern act as wildcard selectors and any other value as filter for the given triple component. E.g. the pattern [null, "type", "person"] matches all triples which have "type" as predicate and "person" as object. Likewise the pattern [null, null, null] matches ALL triples in the graph.

    By default, the returned rstream subscription emits sets of matched triples. If only the raw triple IDs are wanted, set emitTriples arg to false.

    Parameters

    • pattern: Pattern
    • Optional id: string

    Returns ISubscribable<Triples>

  • Parameters

    • pattern: Pattern
    • Optional id: string
    • Optional emitTriples: boolean

    Returns ISubscribable<TripleIds | Triples>

addQueryFromSpec

  • Compiles given query spec into a number of sub-queries and result transformations. Returns rstream subscription of final result sets. See QuerySpec docs for further details.

    Parameters

    Returns QuerySolution

Private broadcastTriple

delete

Protected findTriple

get

  • get(t: Triple, notFound?: any): any

Protected getIndexSelection

  • getIndexSelection(stream: Stream<Edit>, key: any, id: string): Subscription<any, TripleIds>

has

into

  • into(triples: Iterable<Triple>): boolean

Protected nextID

  • nextID(): number

replace

  • Replaces triple a with b, iff a is actually in the store. Else does nothing.

    Parameters

    Returns boolean

toDot

  • toDot(opts?: Partial<DotOpts>): string
  • Parameters

    • Optional opts: Partial<DotOpts>

    Returns string

Generated using TypeDoc