Options
All
  • Public
  • Public/Protected
  • All
Menu

Read methods for a MeldState.

Methods are typed to ensure that app code is aware of m-ld data semantics. See the Resource type for more details.

Type parameters

  • Q: BaseQuad

Hierarchy

Index

Methods

countQuads

  • countQuads(...args: Parameters<Source["match"]>): Promise<number>
  • Parameters

    • Rest ...args: Parameters<Source["match"]>

    Returns Promise<number>

get

  • Shorthand method for retrieving a single Subject and its properties by its @id, if it exists.

    Parameters

    • id: string

      the Subject @id

    • Rest ...properties: SubjectProperty[]

      the properties to retrieve. If no properties are specified, all available properties of the subject will be returned.

    Returns Promise<GraphSubject | undefined>

    a promise resolving to the requested Subject with the requested properties, or undefined if not found

match

  • match(subject?: Term | null, predicate?: Term | null, object?: Term | null, graph?: Term | null): Stream<Q>
  • Returns a stream that processes all quads matching the pattern.

    Parameters

    • Optional subject: Term | null

      The optional subject.

    • Optional predicate: Term | null

      The optional predicate.

    • Optional object: Term | null

      The optional object.

    • Optional graph: Term | null

      The optional graph.

    Returns Stream<Q>

    The resulting quad stream.

query

read

  • Actively reads data from the domain.

    The query executes in response to either subscription to the returned result, or calling .then.

    All results are guaranteed to derive from the current state; however since the observable results are delivered asynchronously, the current state is not guaranteed to be live in the subscriber. In order to keep this state alive during iteration (for example, to perform a consequential operation), perform the read in the scope of a read procedure.

    see

    MeldStateMachine.read

    Type parameters

    Parameters

    • request: R

      the declarative read description

    Returns ReadResult

    read subjects

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Static property

Generated using TypeDoc. Delivered by Vercel. @m-ld/m-ld - v0.7.1-4 Source code licensed MIT. Privacy policy