Class SPARQLProtocolClient

Interacting with a remote RDF endpoint is accomplished through this interface. This is typically a triplestore, but does not have to be. A custom REST interface could be serving RDF data and answering queries through some non-standard (non-SPARQL) interface.

The interface for fetching triples based on the subject as well as modifying the graph through quad change objects is well-defined and the same for different implementation. On the other hand, querying is open ended and depends entirely on the endpoint and therefore it is left to be specified, including at the interface level, to implementations.

Hierarchy

  • SPARQLProtocolClient

Implements

Constructors

Properties

client: SparqlClient
endpointUrl: string
graphs: Set<NamedNode<string>>
propertyFilter: ((n: NamedNode<string>) => Boolean) = ...

Type declaration

    • (n: NamedNode<string>): Boolean
    • Parameters

      • n: NamedNode<string>

      Returns Boolean

updateUrl: string = endpointUrl
valueFilter: ((l: Term) => Boolean) = ...

Type declaration

    • (l: Term): Boolean
    • Parameters

      • l: Term

      Returns Boolean

Methods

  • Retrieve all triples asserted for a given list of subjects. The subjects can be regular NamedNode or a quad (triple in a named graph).

    Returns

    a dataset which contains all the quads with the passed in subjects.

    Parameters

    • Rest ...subjects: (NamedNode<string> | Quad)[]

      The list of subjects of interest.

    Returns Promise<Dataset<Quad, Quad>>

  • Apply a set of changes to the remote data store.

    Returns

    An object with the ok boolean property indicating if the change was successful or not and an error property containing the error in case of failure.

    Parameters

    • changes: KBChange[]

      The changes will result in a SPARQL query where they are applied in the passed in order.

    Returns Promise<{
        error?: string;
        ok: boolean;
    }>

  • Run a SPARQL select query and return a list of matches in the form of binding objects indexed by the variables in the select clause.

    Returns

    An array of bindings, i.e. objects with properties the SPARQL select variables. For example [ {"sub":"http://dbpedia.org/resource/New_York_City", "label": "Mew York" } ]

    Parameters

    • query: {
          queryString: string;
      }

      A valid SPARQL select query. For example select ?sub ?label where { ?sub rdfs:label ?label }

      • queryString: string

    Returns Promise<object[]>

Generated using TypeDoc