Functions & Protocols for serializing Grafter Statements to (and from) any Linked Data format supported by RDF4j.
Functions & Protocols for serializing Grafter Statements to (and from) any Linked Data format supported by RDF4j.
A multimethod to convert a backend RDF literal into a corresponding Clojure type. This method can be extended to provide custom conversions. You should typically not need to call this directly, instead see backend-quad->grafter-quad.
A multimethod to convert a backend RDF literal into a corresponding Clojure type. This method can be extended to provide custom conversions. You should typically not need to call this directly, instead see backend-quad->grafter-quad.
(backend-quad->grafter-quad st)
Convert an RDF4j backend quad into a grafter Quad.
Convert an RDF4j backend quad into a grafter Quad.
A default set of common prefixes
A default set of common prefixes
(->backend-type this)
Convert an arbitrary statement type into an RDF4j Statement type
Convert an arbitrary statement type into an RDF4j Statement type
(quad->backend-quad is)
Convert a grafter IStatement into a backend (RDF4j) statement type.
Convert a grafter IStatement into a backend (RDF4j) statement type.
(rdf-writer destination
&
{:keys [append format encoding prefixes]
:or {append false encoding "UTF-8" prefixes default-prefixes}})
Coerces destination into an java.io.Writer using clojure.java.io/writer and returns an RDFWriter.
Use this to capture the intention to write to a location in a specific RDF format, e.g.
(grafter-2.rdf/add (rdf-writer "/tmp/foo.nt" :format :nt) quads)
Accepts also the following optional options:
:append If set to true it will append new values to the end of
the file destination (default: false
).
:format If a String or a File are provided the format parameter can be optional (in which case it will be infered from the file extension). This should be a clojure keyword representing the format extension e.g. :nt.
:encoding The character encoding to be used (default: UTF-8)
:prefixes A map of RDF prefix names to URI prefixes.
Coerces destination into an java.io.Writer using clojure.java.io/writer and returns an RDFWriter. Use this to capture the intention to write to a location in a specific RDF format, e.g. (grafter-2.rdf/add (rdf-writer "/tmp/foo.nt" :format :nt) quads) Accepts also the following optional options: - :append If set to true it will append new values to the end of the file destination (default: `false`). - :format If a String or a File are provided the format parameter can be optional (in which case it will be infered from the file extension). This should be a clojure keyword representing the format extension e.g. :nt. - :encoding The character encoding to be used (default: UTF-8) - :prefixes A map of RDF prefix names to URI prefixes.
(statements this & {:keys [format buffer-size base-uri] :as options})
Attempts to coerce an arbitrary source of RDF statements into a sequence of grafter Statements, using the RDF4j backend.
If the source is a quad store quads from all the named graphs will be returned. Any triples in an unnamed graph will be ignored.
Takes optional parameters which may be used depending on the context e.g. specifiying the format of the source triples.
The :format
option is supplied by the wrapping function and may be
nil, or act as an indicator about the format of the triples to read.
Implementers can choose whether or not to ignore or require the
format parameter.
The :buffer-size
option can be used to configure the buffer size
at which statements are parsed from an RDF stream. Its default
value of 32 was found to work well in practice, and also aligns with
chunk size of Clojure's lazy sequences.
The :base-uri
option can be supplied to automatically re@base
URI's on a new prefix when reading.
Attempts to coerce an arbitrary source of RDF statements into a sequence of grafter Statements, using the RDF4j backend. If the source is a quad store quads from all the named graphs will be returned. Any triples in an unnamed graph will be ignored. Takes optional parameters which may be used depending on the context e.g. specifiying the format of the source triples. The `:format` option is supplied by the wrapping function and may be nil, or act as an indicator about the format of the triples to read. Implementers can choose whether or not to ignore or require the format parameter. The `:buffer-size` option can be used to configure the buffer size at which statements are parsed from an RDF stream. Its default value of 32 was found to work well in practice, and also aligns with chunk size of Clojure's lazy sequences. The `:base-uri` option can be supplied to automatically re`@base` URI's on a new prefix when reading.
(->rdf4j-uri this)
Coerce an object into a sesame URIImpl
Coerce an object into a sesame URIImpl
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close