(count-subjects client)
Returns the number of subjects at endpoint of client
client
conforms to ::sparql-client
specReturns the number of subjects at endpoint of `client` - Where - `client` conforms to `::sparql-client` spec
(create-load-context query-url update-url graph-uri)
Returns io-context
for query-endpoint
update-endpoint
graph-uri
query-url
is the URL of the query endpoint of the clientupdate-url
is the URL of the update endpoint of the clientgraph-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` *]
(decode-bnode-kwi-name bkwi)
Returns a string description of bkwi
suitable for embedding in SPARQL
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`
(default-binding-translators endpoint-url graph-uri)
Binding translators used to simplify bindings. See sparq-endpoint.core
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.
(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
DEPRECATED. use rdf/read-rdf
instead
DEPRECATED. use `rdf/read-rdf` instead
(make-sparql-reader & {:keys [graph-uri query-url binding-translator auth]})
Returns an instance of SparqlReader.
graph-uri
is the named graph within the SPARQL endpoint. nil implies DEFAULTquery-url
is the query endpointbinding-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 updatesuri-fn
:= (fn [binding]...) -> URI representation.
Default is just the URI stringlang-fn
:= (fn [binding] ...) -> parsed language tag.
Default is just the language string with nodatatype-fn
:= (fn [binding] -` Parsed datatypebinding
:= {:value ...
:type ...
&maybe
:xml:lang ...
:datatype ...}
This occurs in bindings of the form {var
binding
, ...} returned by a
SPARQL query.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.
(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.
graph-uri
is the named graph within the SPARQL endpoint. nil implies DEFAULTquery-url
is the query endpointbinding-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 updatesuri-fn
:= (fn [binding]...) -> URI representation.
Default is just the URI stringlang-fn
:= fn [binding] -> parsed language tag.
Default is just the language stringdatatype-fn
:= fn [binding] -> Parsed datatypebinding
:= {:value ...
:type ...
&maybe
:xml:lang ...
:datatype ...}
This occurs in bindings of the form {var
binding
, ...} returned by a
SPARQL query.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.
A native-normal graph describing the supporting vocabulary for sparql-client
A native-normal graph describing the supporting vocabulary for sparql-client
(property-path path)
Returns a traversal function [g c a q] -[c a' q'] equivalent to
path`
path
is a SPARQL property path, e.g. 'myns:prop1/myns:prop2'g
is an sparql update clientc
is a traversal contexta
is an accumulator (typically a set)a'
has been conj'ed with the ?o
bindings of query
q
is an input queue to the traversalq'
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`.
(quote-str s)
Returns s
, in excaped quotation marks.
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.
[ann element] -> SPARQL description of element
rendeer-element
[ann element] -> #{:bnode/BnodeClass :bnode/Simple}ann
is a native-normal graph describing the context of element
in the
original RDF graph.element
is a node in the graphelement
is a :bnode/Bnode, it will be rendered in [nested [brackets]] in a way
That can be embedded in a SPARQL query.[ann element] -> SPARQL description of `element` - Dispatched on `rendeer-element` [ann element] -> #{:bnode/BnodeClass :bnode/Simple} - Where - `ann` is a native-normal graph describing the context of `element` in the original RDF graph. - `element` is a node in the graph - NOTE: if `element` is a :bnode/Bnode, it will be rendered in [nested [brackets]] in a way That can be embedded in a SPARQL query.
(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.
client
is a sparql-clientclient-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.
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`
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` * *]
(update-endpoint! client update)
Side-effect: update
is sent to client
update
is a sparql updateclient
is a SparqlUpdaterSide-effect: `update` is sent to `client` - Where - `update` is a sparql update - `client` is a SparqlUpdater
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`.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close