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

[Symbol.iterator]

  • [Symbol.iterator](): IterableIterator<Triple>

add

addJoin

addMultiJoin

Protected addParamQueries

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

addParamQuery

  • addParamQuery(__namedParameters: [any, any, any], id?: undefined | 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: undefined | 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: undefined | string

      -

    Returns QuerySolution

addPatternQuery

  • addPatternQuery(pattern: Pattern, id?: undefined | string): ISubscribable<Triples>
  • addPatternQuery(pattern: Pattern, id?: undefined | string, emitTriples?: undefined | false): ISubscribable<TripleIds>
  • addPatternQuery(pattern: Pattern, id?: undefined | string, emitTriples?: undefined | true): ISubscribable<Triples>
  • 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: undefined | string

      -

    Returns ISubscribable<Triples>

  • Parameters

    • pattern: Pattern
    • Optional id: undefined | string
    • Optional emitTriples: undefined | false

    Returns ISubscribable<TripleIds>

  • Parameters

    • pattern: Pattern
    • Optional id: undefined | string
    • Optional emitTriples: undefined | true

    Returns ISubscribable<Triples>

addQueryFromSpec

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

toDot

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

Generated using TypeDoc