Simple SPARQL utility
Simple SPARQL utility
(add-context q context)
Adds a context to a query. The context is a map of prefix to namespace.
Adds a context to a query. The context is a map of prefix to namespace.
(context-iri context iri-fn)
Returns an IRI function that takes a string, and calls a 3-argument version of the iri-fn that accepts the original IRI, the detected namespace, and the local value. If no namespace is detected, then a 1 argument version will be called.
Returns an IRI function that takes a string, and calls a 3-argument version of the iri-fn that accepts the original IRI, the detected namespace, and the local value. If no namespace is detected, then a 1 argument version will be called.
The file containing SPARQL credentials
The file containing SPARQL credentials
(decode-json-results {{:keys [vars link] :as head} :head
{:keys [bindings] :as results} :results}
iri-fn)
Decodes JSON results from a SPARQL query.
Decodes JSON results from a SPARQL query.
(default-service)
(get-auth* service credentials)
Returns the authorization header for a service, if credentials are available.
Returns the authorization header for a service, if credentials are available.
(keyword3 s)
(keyword3 _ nms n)
A helper function for keyword being called with 3 args for a curie. Single arguments will return the argument (a string)
A helper function for keyword being called with 3 args for a curie. Single arguments will return the argument (a string)
(load-credentials path)
(process-args [f & r :as args])
Query args are flexible, with the following options: service: Optional. The URL of the SPARQL service. This is first to allow for easy partial binding. q: The query to execute. named vars: Optional. :iri-fn The function to construct IRI values. Defaults to quoll.rdf/iri :context The context for IRI creation. Only useful when the iri-fn can accept both 1 and 3 arguments. A keyword map of prefixes or :default.
Query args are flexible, with the following options: service: Optional. The URL of the SPARQL service. This is first to allow for easy partial binding. q: The query to execute. named vars: Optional. :iri-fn The function to construct IRI values. Defaults to quoll.rdf/iri :context The context for IRI creation. Only useful when the iri-fn can accept both 1 and 3 arguments. A keyword map of prefixes or :default.
(query & args)
Issues a SPARQL query. See process-args for the argument values
Issues a SPARQL query. See process-args for the argument values
(query-table & args)
Issues a SPARQL query, returning a seq of vectors. See process-args for the argument values
Issues a SPARQL query, returning a seq of vectors. See process-args for the argument values
(rdf-resource term)
(rdf-resource iri-fn {:keys [type value] :as term})
The environment variable for the default SPARQL endpoint URL
The environment variable for the default SPARQL endpoint URL
The directory containing SPARQL configuration
The directory containing SPARQL configuration
(string3 s)
(string3 _ nms n)
A helper function for str being called with 3 args for a curie.
A helper function for str being called with 3 args for a curie.
(uri u)
(url u)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close