Liking cljdoc? Tell your friends :D

ont-app.sparql-client.core


count-subjectsclj

(count-subjects client)

Returns the number of subjects at endpoint of client

  • Where
    • client conforms to ::sparql-client spec
Returns the number of subjects at endpoint of  `client`
- Where
  - `client` conforms to  `::sparql-client` spec
sourceraw docstring

create-load-contextclj

(create-load-context query-url update-url graph-uri)

Returns io-context for query-endpoint update-endpoint graph-uri

  • Where
    • query-url is the URL of the query endpoint of the client
    • update-url is the URL of the update endpoint of the client
    • graph-uri is a KWI for the URI of the nameed graph associated with the file to be loaded by rdf/load-rdf
    • io-context is a native-normal graph serving as the the first, 'context' argument to rdf/load-rdf dispatched on [SparqlUpdater *]
Returns `io-context` for `query-endpoint` `update-endpoint` `graph-uri`
- Where
  - `query-url` is the URL of the query endpoint of the client
  - `update-url` is the URL of the update endpoint of the client
  - `graph-uri` is a KWI for the URI of the nameed graph associated with the file to
     be loaded by `rdf/load-rdf`
  - `io-context` is a native-normal graph serving as the the first, 'context' argument
     to `rdf/load-rdf` dispatched on [`SparqlUpdater` *]
sourceraw docstring

decode-bnode-kwi-nameclj

(decode-bnode-kwi-name bkwi)

Returns a string description of bkwi suitable for embedding in SPARQL

  • where
    • bkwi is a keyword encoded by (mint-kwi bnode-class)
    • bnode is a bnode annotated and rendered with render-element
Returns a string description of `bkwi` suitable for embedding in SPARQL
- where
  - `bkwi` is a keyword encoded by (`mint-kwi` `bnode-class`)
  - `bnode` is a bnode annotated and rendered with `render-element`
sourceraw docstring

default-binding-translatorsclj

(default-binding-translators endpoint-url graph-uri)

Binding translators used to simplify bindings. See sparq-endpoint.core

  • Wnere
  • endpoint-url and graph-uri are used to mint unique values for bnodes.
Binding translators used to simplify bindings. See sparq-endpoint.core
- Wnere
- `endpoint-url` and `graph-uri` are used to mint unique values for bnodes.
sourceraw docstring

drop-client!clj

(drop-client! g)

Side-effect: the named graph associated with client is dropped from its endpoint

Side-effect: the named graph associated with `client` is dropped from its endpoint
sourceraw docstring

kwi-forclj

Issues a warning if no ns metadata is found for the URI

Issues a warning if no ns metadata is found for the URI
sourceraw docstring

load-rdf-filecljmultimethoddeprecated

DEPRECATED. use rdf/read-rdf instead

DEPRECATED. use `rdf/read-rdf` instead
sourceraw docstring

make-sparql-readerclj

(make-sparql-reader & {:keys [graph-uri query-url binding-translator auth]})

Returns an instance of SparqlReader.

  • Where
  • graph-uri is the named graph within the SPARQL endpoint. nil implies DEFAULT
  • query-url is the query endpoint
  • binding-translator := {:uri uri-fn :lang lang-fn :datatype datatype-fn} default is sparql-endpoint.core/default-translators)
  • auth (optional) is the authorization token needed to perform updates
  • uri-fn := (fn [binding]...) -> URI representation. Default is just the URI string
  • lang-fn := (fn [binding] ...) -> parsed language tag. Default is just the language string with no
  • datatype-fn := (fn [binding] -` Parsed datatype
  • binding := {:value ... :type ... &maybe :xml:lang ... :datatype ...} This occurs in bindings of the form {var binding, ...} returned by a SPARQL query.
  • See also sparql-endpoint.core.
Returns an instance of SparqlReader.
- Where
- `graph-uri` is the named graph within the SPARQL endpoint. nil implies DEFAULT
- `query-url` is the query endpoint
- `binding-translator` := {:uri `uri-fn` :lang `lang-fn` :datatype `datatype-fn`}
   default is sparql-endpoint.core/default-translators)
- `auth` (optional)  is the authorization token needed to perform updates
- `uri-fn` := (fn [binding]...) -> URI representation. 
  Default is just the URI string
- `lang-fn` := (fn [binding] ...) -> parsed language tag. 
   Default is just the language string with no
- `datatype-fn` := (fn [binding] -` Parsed datatype
- `binding` := {:value ... 
               :type ... 
                &maybe 
               :xml:lang ... 
               :datatype ...}
   This occurs in bindings of the form {`var` `binding`, ...} returned by a 
    SPARQL query.
- See also sparql-endpoint.core.
sourceraw docstring

make-sparql-updaterclj

(make-sparql-updater
  &
  {:keys [graph-uri query-url binding-translator update-url auth]
   :or {binding-translator (default-binding-translators query-url graph-uri)}
   :as args})

Returns an instance of SparqlUpdater.

  • Where
  • graph-uri is the named graph within the SPARQL endpoint. nil implies DEFAULT
  • query-url is the query endpoint
  • binding-translator := {:uri uri-fn :lang lang-fn :datatype datatype-fn} default is sparql-endpoint.core/default-translators)
  • update-url (optional) is update endpoint (or nil if read-only)
  • auth (optional) is the authorization token needed to perform updates
  • uri-fn := (fn [binding]...) -> URI representation. Default is just the URI string
  • lang-fn := fn [binding] -> parsed language tag. Default is just the language string
  • datatype-fn := fn [binding] -> Parsed datatype
  • binding := {:value ... :type ... &maybe :xml:lang ... :datatype ...} This occurs in bindings of the form {var binding, ...} returned by a SPARQL query.
  • See also sparql-endpoint.core.
Returns an instance of SparqlUpdater.
- Where
- `graph-uri` is the named graph within the SPARQL endpoint. nil implies DEFAULT
- `query-url` is the query endpoint
- `binding-translator` := {:uri `uri-fn` :lang `lang-fn` :datatype `datatype-fn`}
  default is sparql-endpoint.core/default-translators)
- `update-url` (optional) is update endpoint (or nil if read-only)
- `auth` (optional)  is the authorization token needed to perform updates
- `uri-fn` := (fn [binding]...) -> URI representation. 
  Default is just the URI string
- `lang-fn` := fn [binding] -> parsed language tag. 
   Default is just the language string
- `datatype-fn` := fn [binding] -> Parsed datatype
- `binding` := {:value ... 
              :type ... 
              &maybe 
              :xml:lang ... 
              :datatype ...}
  This occurs in bindings of the form {`var` `binding`, ...} returned by a 
  SPARQL query.
- See also sparql-endpoint.core.
sourceraw docstring

ontologyclj

A native-normal graph describing the supporting vocabulary for sparql-client

A native-normal graph describing the supporting vocabulary for sparql-client
sourceraw docstring

prefixedclj

Returns sparql-string, prepended with appropriate PREFIX decls.

Returns `sparql-string`, prepended with appropriate PREFIX decls.
sourceraw docstring

property-pathclj

(property-path path)

Returns a traversal function [g c a q] -[c a' q'] equivalent topath`

  • Where
    • path is a SPARQL property path, e.g. 'myns:prop1/myns:prop2'
    • g is an sparql update client
    • c is a traversal context
    • a is an accumulator (typically a set)
    • a' has been conj'ed with the ?o bindings of query
    • q is an input queue to the traversal
    • q' is the rest of q
    • query is query-for-o template, with (first q) as subject and path as the predicate. This binds a single var ?o.
Returns a traversal function [g c a q] -` [c a' q'] equivalent to `path`
- Where
  - `path` is a SPARQL property path, e.g. 'myns:prop1/myns:prop2'
  - `g` is an sparql update client
  - `c` is a traversal context
  - `a` is an accumulator (typically a set)
  - `a'` has been conj'ed with the `?o` bindings of `query`
  - `q` is an input queue to the traversal
  - `q'` is the rest of `q`
  - `query` is `query-for-o template`, with (first `q`) as subject and `path`
     as the predicate. This binds a single var `?o`.
sourceraw docstring

quote-strclj

(quote-str s)

Returns s, in excaped quotation marks.

  • Where
    • s is a string, typically to be rendered in a query or RDF source.
Returns `s`, in excaped quotation marks.
- Where
  - `s` is a string, typically to be rendered in a query or RDF source.
sourceraw docstring

reset-annotation-graphclj

(reset-annotation-graph
  client
  &
  {:keys [client-model bnode-query collect-bindings ignore-if]
   :or {bnode-query query-for-all-bnodes
        collect-bindings collect-bnode-query-binding
        ignore-if (fn [_ann _clause-type _node _property counterpart]
                      (string? counterpart))}})

Returns client' annotated for blank nodes so that round-trippable values can be provided. Overwrites any previous annotations.

  • Where
    • client is a sparql-client
    • client-model is a native-normal graph containing a subgraph of the client's graph with triples containing the bnodes we wish to annotate. Optional. Defalt will build a new client model from bnode-query and collect-bindings
    • bnode-query is a SPARQL query for the client model. Default is query-for-all-bnodes
    • collect-bindings is a reduce-spo function collecting the output of bnode-query into a new client-model
    • ignore-if := (fn [ann clause-type node property counterpart] -> truthy when a given clause should not inform annotations for bnodes. Referenced in ignore-triple-clause? function.
Returns `client`' annotated for blank nodes so that round-trippable values can be
provided. Overwrites any previous annotations.
- Where
  - `client` is a sparql-client
  - `client-model` is a native-normal graph containing a subgraph of the client's
     graph with triples containing the bnodes we wish to annotate. Optional. Defalt
     will build a new client model from `bnode-query` and `collect-bindings`
  - `bnode-query` is a SPARQL query for the client model. Default is
    `query-for-all-bnodes`
  - `collect-bindings` is a `reduce-spo` function collecting the output of
     `bnode-query` into a new `client-model`
  - `ignore-if` := (fn [ann clause-type node property counterpart] -> truthy when a
    given clause should not inform annotations for bnodes. Referenced in
    `ignore-triple-clause?` function.
sourceraw docstring

standard-read-contextclj

The standard context argument to rdf/read-rdf dispatched on [SparqlUpdater *] and basis for create-load-context

The standard context argument to `rdf/read-rdf` dispatched on [`SparqlUpdater` *] and basis for `create-load-context`
sourceraw docstring

standard-write-contextclj

Standard 'context' argument to rdf/write-rdf for methods dispatched on [sparql-client/IGraph * *]

Standard 'context' argument to `rdf/write-rdf` for methods dispatched on  [`sparql-client/IGraph` * *]
sourceraw docstring

update-endpoint!clj

(update-endpoint! client update)

Side-effect: update is sent to client

  • Where
    • update is a sparql update
    • client is a SparqlUpdater
Side-effect: `update` is sent to `client`
- Where
  - `update` is a sparql update
  - `client` is a SparqlUpdater
sourceraw docstring

warn-on-no-ns-metadata-for-kwi?clj

True when we should warn if there is no ns metadata found for the URI being translated into a KWI in kwi-for.

True when we should warn if there is no ns metadata found for the URI
being translated into a KWI in `kwi-for`.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close