(->model closeable-model)
Generate as Model
from the stream of Triple
.
The stream is consumed in the process, and cannot be traversed again.
NOTE: closes the underlying QueryExecution
.
Generate as `Model` from the stream of `Triple`. The stream is consumed in the process, and cannot be traversed again. NOTE: closes the underlying `QueryExecution`.
(->query-execution r)
Returns the underlying QueryExecution
from the query results
Returns the underlying `QueryExecution` from the query results
(->result r)
Returns the underlying ResultSet
from the query results
See also: copy-result-set
for a re-usable ResultSet
Returns the underlying `ResultSet` from the query results See also: `copy-result-set` for a re-usable ResultSet
(->triples m)
Returns the unconverted Jena Iterator of org.apache.jena.graph.Triple
Returns the unconverted Jena Iterator of `org.apache.jena.graph.Triple`
(copy-result-set result)
Returns a copy of a ResultSet
allowing it to be re-used.
Make sure to apply this function if you intend to re-use the
ResultSet
after initial traversal.
See also: reset-if-rewindable!
Returns a copy of a `ResultSet` allowing it to be re-used. Make sure to apply this function if you intend to re-use the `ResultSet` after initial traversal. See also: `reset-if-rewindable!`
(falsey-string str)
JavaScript-ism to return nil on an empty string.
JavaScript-ism to return nil on an empty string.
(query connection prefixes pq options)
(query connection
prefixes
syntax
pq
{:keys [bindings timeout] :as call-options})
Executes a SPARQL SELECT, ASK, DESCRIBE or CONSTRUCT based on the
query type against the connection
. connection
can be a String
for a SPARQL endpoint URL or Dataset
, Model
.
Returns a lazy-seq of results that can be traversed iteratively.
SELECT returns a seq of ResultBinding
s in a native Clojure format.
DESCRIBE and CONSTRUCT return a seq of Triples (s, p, o) in a native
Clojure format. ASK returns a boolean.
See also: ->result
(SELECT), ->model
(DESCRIBE, CONSTRUCT) and
->query-execution
. Or use the result->csv
..., and model->json-ld
convenience methods for serialization to strings.
WARNING: The underlying QueryExecution
must be closed in order to
prevent resources from leaking. Call the query in a with-open
or
close manually with (.close (->query-execution (query)))
.
Executes a SPARQL SELECT, ASK, DESCRIBE or CONSTRUCT based on the query type against the `connection`. `connection` can be a String for a SPARQL endpoint URL or `Dataset`, `Model`. Returns a lazy-seq of results that can be traversed iteratively. SELECT returns a seq of `ResultBinding`s in a native Clojure format. DESCRIBE and CONSTRUCT return a seq of Triples (s, p, o) in a native Clojure format. ASK returns a boolean. See also: `->result` (SELECT), `->model` (DESCRIBE, CONSTRUCT) and `->query-execution`. Or use the `result->csv`..., and `model->json-ld` convenience methods for serialization to strings. WARNING: The underlying `QueryExecution` must be closed in order to prevent resources from leaking. Call the query in a `with-open` or close manually with `(.close (->query-execution (query)))`.
(query-with-bindings pq prefixes bindings)
The query
can be provided with a map of bindings
.
Each binding is a String->URL, String->URI, String->Node or String->RDFNode.
Any other type (e.g. String, Float) will be set as Literal.
Alternatively, you can supply a map of
{:type (optional, uri or string), :lang (optional, str or keyword), :value}
which will be coerced to the appropriate Literal
automatically.
Does not warn when setting a binding that does not exist.
The `query` can be provided with a map of `bindings`. Each binding is a String->URL, String->URI, String->Node or String->RDFNode. Any other type (e.g. String, Float) will be set as Literal. Alternatively, you can supply a map of `{:type (optional, uri or string), :lang (optional, str or keyword), :value}` which will be coerced to the appropriate `Literal` automatically. Does not warn when setting a binding that does not exist.
(reset-if-rewindable! result)
Resets a RewindableResulSet
See: ResultSetRewindable.
Resets a `RewindableResulSet` See: [ResultSetRewindable](https://jena.apache.org/documentation/javadoc/arq/org/apache/jena/query/ResultSetRewindable.html).
(result->model result)
Converts ResultSet
to a Model
.
NOTE: CONSTRUCT and DESCRIBE queries are better suited for conversion to Model
.
Converts `ResultSet` to a `Model`. NOTE: CONSTRUCT and DESCRIBE queries are better suited for conversion to `Model`.
(serialize-model model format)
(serialize-model model format out)
Serializes a Model
to a string or to an output stream
See: Jena Model Write formats.
Serializes a `Model` to a string or to an output stream See: [Jena Model Write formats](https://jena.apache.org/documentation/io/rdf-output.html#jena_model_write_formats).
(serialize-result method result)
(serialize-result method result output-stream)
Serializes a Result
to a string
Serializes a `Result` to a string
(update! connection prefixes pq options)
(update! connection prefixes syntax pq {:keys [bindings]})
Execute a SPARQL UPDATE query
against the connection
,
returning nil if success, throw an exception otherwise. bindings
will be substituted when possible, can be empty.
connection
can be a String for a SPARQL endpoint URL or Dataset
.
Execute a SPARQL UPDATE `query` against the `connection`, returning nil if success, throw an exception otherwise. `bindings` will be substituted when possible, can be empty. `connection` can be a String for a SPARQL endpoint URL or `Dataset`.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close