Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "util/QuadUtil"

Index

Functions

Const parseQuads

  • parseQuads(readable: Guarded<Readable>, contentType?: undefined | string): Promise<Quad[]>
  • Helper function to convert a Readable into an array of quads.

    Parameters

    • readable: Guarded<Readable>

      The readable object.

    • Optional contentType: undefined | string

      The content-type of the stream.

    Returns Promise<Quad[]>

    A promise containing the array of quads.

Const pushQuad

  • pushQuad(quads: Quad[], subject: NamedNode, predicate: NamedNode, object: NamedNode | Literal): number
  • Generates a quad with the given subject/predicate/object and pushes it to the given array.

    Parameters

    • quads: Quad[]
    • subject: NamedNode
    • predicate: NamedNode
    • object: NamedNode | Literal

    Returns number

Const serializeQuads

  • serializeQuads(quads: Quad[], contentType?: undefined | string): Guarded<Readable>
  • Helper function for serializing an array of quads, with as result a Readable object.

    Parameters

    • quads: Quad[]

      The array of quads.

    • Optional contentType: undefined | string

      The content-type to serialize to.

    Returns Guarded<Readable>

    The Readable object.