Parses an N3 Patch document and makes sure it conforms to the specification requirements. Requirements can be found at Solid Protocol, ยง5.3.1: https://solid.github.io/specification/protocol#n3-patch

Hierarchy

Constructors

Methods

  • Checks if the input can be handled by this class. If it cannot handle the input, rejects with an error explaining why.

    Returns

    A promise resolving if the input can be handled, rejecting with an Error if not.

    Parameters

    • __namedParameters: BodyParserArgs

      Input that could potentially be handled.

    Returns Promise<void>

  • Finds all quads in a where/deletes/inserts formula. The returned quads will be updated so their graph is the default graph instead of the N3 reference to the formula. Will error in case there are multiple instances of the subject/predicate combination.

    Parameters

    • store: Store<Quad, Quad, Quad, Quad>
    • subject: Quad_Subject
    • predicate: NamedNode<string>

    Returns Quad[]

  • Extracts the deletes/inserts/conditions from a solid:InsertDeletePatch entry.

    Parameters

    • patch: Quad_Subject
    • store: Store<Quad, Quad, Quad, Quad>

    Returns { conditions: Quad[]; deletes: Quad[]; inserts: Quad[] }

    • conditions: Quad[]
    • deletes: Quad[]
    • inserts: Quad[]
  • Verifies if the delete/insert triples conform to the specification requirements:

    • They should not contain blank nodes.
    • They should not contain variables that do not occur in the conditions.

    Parameters

    • otherQuads: Quad[]
    • conditionVars: Set<string>

    Returns void