Comunica
    Preparing search index...

    An implementation of the SPARQL 1.1 Graph Store HTTP Protocol.

    Graphs are identified directly through the request path, such as /store/person/1.ttl, and indirectly through the graph and default parameters on the graph store itself.

    Index

    Constructors

    Properties

    context: any
    ALLOWED_METHODS: "DELETE, GET, HEAD, OPTIONS, POST, PUT" = 'DELETE, GET, HEAD, OPTIONS, POST, PUT'

    The HTTP methods a graph handles, as advertised via the Allow and Access-Control-Allow-Methods headers.

    ALLOWED_METHODS_STORE: "OPTIONS, POST" = 'OPTIONS, POST'

    The HTTP methods the graph store itself handles, which only accepts new graphs.

    PATH: "/store" = '/store'

    The path on which the graph store is served.

    Methods

    • Determine if a graph is present in the graph store. The default graph is always present.

      Parameters

      • engine: QueryEngineBase

        A SPARQL engine.

      • graph: NamedNode<string> | DefaultGraph

        The graph to look for.

      Returns Promise<boolean>

    • Parse the RDF payload of a request, which may consist of multiple parts.

      Parameters

      • engine: QueryEngineBase

        A SPARQL engine.

      • request: IncomingMessage

        Request object.

      • contentType: string

        The content type of the request body.

      • baseIRI: string

        The base IRI that relative IRIs in the payload are resolved against.

      • readBody: () => Promise<string>

        A callback that reads the request body.

      Returns Promise<AsyncIterator<Quad>[]>

      The quads of each part.

    • Store the RDF payload of a request in a graph.

      Parameters

      • engine: QueryEngineBase

        A SPARQL engine.

      • graph: NamedNode<string> | DefaultGraph | undefined

        The graph to store the payload in, or undefined to create a new graph for it.

      • replace: boolean

        If the previous contents of the graph must be replaced instead of merged with.

      • request: IncomingMessage

        Request object.

      • graphStoreIri: string

        The IRI of the graph store, under which new graphs are created.

      • readBody: () => Promise<string>

        A callback that reads the request body.

      Returns Promise<IGraphStoreResult>

    • Determine the media type of a content type header value, without any of its parameters.

      Parameters

      • contentType: string

        A content type header value.

      Returns string

    • Determine the graph that a request applies to, if it is a Graph Store HTTP Protocol request.

      Parameters

      • request: IncomingMessage

        Request object.

      • requestUrl: UrlWithParsedQuery

        The parsed request URL.

      • graphStoreIri: string

        The IRI of the graph store.

      Returns IGraphStoreTarget | undefined

      The graph, or undefined if this is not a graph store request.

    • Split a multipart/form-data payload into the RDF payloads it consists of.

      Parameters

      • body: string

        The multipart payload.

      • contentType: string

        The content type of the payload, which declares the boundary.

      Returns { body: string; contentType: string }[]

      The content type and body of each part.