Liking cljdoc? Tell your friends :D

grafter-2.rdf.protocols

Abstract functions for interacting with RDF & RDF backends, such as RDF4j.

Abstract functions for interacting with RDF & RDF backends, such as
RDF4j.
raw docstring

addclj

(add target triples)
(add target graph triples)
(add target graph format triple-stream)
(add target graph base-uri format triple-stream)

Adds a sequence of statements to the specified datasink. Supports all the same targets as add-statement.

Takes an optional string/URI to use as a graph.

Depending on the target, this function will also write any prefixes associated with the rdf-writer to the target.

Returns target.

Adds a sequence of statements to the specified datasink.  Supports
all the same targets as add-statement.

Takes an optional string/URI to use as a graph.

Depending on the target, this function will also write any prefixes
associated with the rdf-writer to the target.

Returns target.
sourceraw docstring

add-batchedclj

(add-batched target triples)
(add-batched target graph-or-triples triples-or-batch-size)
(add-batched target graph triples batch-size)

Adds a collection of statements to a repository in batches. The batch size is optional and default-batch-size will be used if not specified. Some repository implementations cache added statements in memory until explicitly flushed which can cause out-of-memory errors if a large number of statements are added through add. Spliting the input sequence into batches limits the number of cached statements and therefore can reduce memory pressure.

Adds a collection of statements to a repository in batches. The batch size is optional and default-batch-size
will be used if not specified. Some repository implementations cache added statements in memory until explicitly
flushed which can cause out-of-memory errors if a large number of statements are added through add. Spliting the
input sequence into batches limits the number of cached statements and therefore can reduce memory pressure.
sourceraw docstring

add-statementclj

(add-statement target statement)
(add-statement target graph statement)

Add an RDF statement to the target datasink. Datasinks must implement grafter-2.rdf.protocols/ITripleWriteable.

Datasinks include RDF4j RDF repositories, connections and anything built by rdf-writer.

Takes an optional string/URI to use as a graph.

Add an RDF statement to the target datasink.  Datasinks must
implement `grafter-2.rdf.protocols/ITripleWriteable`.

Datasinks include RDF4j RDF repositories, connections and anything
built by rdf-writer.

Takes an optional string/URI to use as a graph.
sourceraw docstring

blank-node?clj/smultimethod

Predicate function that tests whether the supplied value is considered to be a blank node type.

Predicate function that tests whether the supplied value is
considered to be a blank node type.
sourceraw docstring

BNodecljs

source

deleteclj

(delete target quads)
(delete target graph triples)

Deletes a sequence of statements from the specified repository.

Takes an optional string/URI to use as a graph.

Returns target.

Deletes a sequence of statements from the specified repository.

Takes an optional string/URI to use as a graph.

Returns target.
sourceraw docstring

delete-batchedclj

(delete-batched target quads)
(delete-batched target graph-or-quads triples-or-batch-size)
(delete-batched target graph triples batch-size)

Deletes a collection of statements from a repository in batches. The batch size is optional and default-batch-size will be used if not specified.

Deletes a collection of statements from a repository in batches. The batch size is optional and default-batch-size
will be used if not specified.
sourceraw docstring

IDatatypeURIclj/sprotocol

datatype-uriclj/s

(datatype-uri this)

Returns the RDF literals datatype URI as either a java.net.URI or grafter.vocabularies.core.URI, depending upon host platform

Returns the RDF literals datatype URI as either a java.net.URI or
grafter.vocabularies.core.URI, depending upon host platform
source

IGrafterRDFTypeclj/sprotocol

This protocol coerces a backend RDF type, e.g. an RDF4j quad object into an equivalent Grafter RDF type. For example given an RDF4j quad it will convert it into a Grafter Quad.

This protocol coerces a backend RDF type, e.g. an RDF4j quad object
into an equivalent Grafter RDF type.  For example given an RDF4j
quad it will convert it into a Grafter Quad.

->grafter-typeclj/s

(->grafter-type this)

Convert a backend RDF Type into a Native Type

Convert a backend RDF Type into a Native Type
sourceraw docstring

IRawValueclj/sprotocol

raw-valueclj/s

(raw-value this)

Returns the naked value of a literal. For native primitive values e.g. a java.lang.Integer or JS Boolean, this will return the supplied value (like identity). However for more complex types such as LangString's it will coerce the value into a more natural primitive type.

Returns the naked value of a literal.  For native primitive
values e.g. a java.lang.Integer or JS Boolean, this will return the
supplied value (like identity).  However for more complex types such
as LangString's it will coerce the value into a more natural
primitive type.
source

IRDFStringclj/sprotocol

langclj/s

(lang this)

Return the strings language tag (as a clojure Keyword)

Return the strings language tag (as a clojure Keyword)
source

ISPARQLablecljprotocol

NOTE this protocol is intended for low-level access. End users should use query instead.

Run an arbitrary SPARQL query. Works with ASK, DESCRIBE, CONSTRUCT and SELECT queries.

You can call this on a Repository however if you do you may in some cases cause a resource leak, for example if the sequence of results isn't fully consumed.

To use this without leaking resources it is recommended that you call ->connection on your repository, inside a with-open; and then consume all your results inside of a nested doseq/dorun/etc...

e.g.

(with-open [conn (->connection repo)]
   (doseq [res (query conn "SELECT * WHERE { ?s ?p ?o .}")]
      (println res)))
NOTE this protocol is intended for low-level access.  End users
should use query instead.

Run an arbitrary SPARQL query.  Works with `ASK`, `DESCRIBE`,
`CONSTRUCT` and `SELECT` queries.

You can call this on a Repository however if you do you may in some
cases cause a resource leak, for example if the sequence of results
isn't fully consumed.

To use this without leaking resources it is recommended that you
call `->connection` on your repository, inside a `with-open`; and
then consume all your results inside of a nested `doseq`/`dorun`/etc...

e.g.

````
(with-open [conn (->connection repo)]
   (doseq [res (query conn "SELECT * WHERE { ?s ?p ?o .}")]
      (println res)))
````

query-datasetclj

(query-dataset this sparql-string model)
(query-dataset this sparql-string model opts)
sourceraw docstring

ISPARQLUpdateablecljprotocol

update!clj

(update! this sparql-string)

Issue a SPARQL Update statement against the repository

Issue a SPARQL Update statement against the repository
source

IStatementclj/sprotocol

An RDF triple or quad

An RDF triple or quad

contextclj/s

(context statement)

objectclj/s

(object statement)

predicateclj/s

(predicate statement)

subjectclj/s

(subject statement)
sourceraw docstring

ITransactablecljprotocol

Low level protocol for transactions support. Most users probably want to use grafter-2.rdf4j.repository/with-transaction

Low level protocol for transactions support.  Most users probably
want to use grafter-2.rdf4j.repository/with-transaction

beginclj

(begin repo)

Start a transaction

Start a transaction

commitclj

(commit repo)

Commit a transaction

Commit a transaction

rollbackclj

(rollback repo)

Rollback a transaction

Rollback a transaction
sourceraw docstring

ITripleDeleteablecljprotocol

This protocol can be implemented by anything which you can delete statements from. For example a SPARQL Update Endpoint.

This protocol can be implemented by anything which you can delete
statements from.  For example a SPARQL Update Endpoint.

delete-statementclj

(delete-statement this statement)
(delete-statement this graph statement)
sourceraw docstring

ITripleReadablecljprotocol

Use the higher level wrapper function statements if you just wish to read in some RDF.

This protocol exists for implementers to hook in additional sources of statements.

Takes a source of statements or triples and converts it into a seq of triples.

A hash of options is passed to each implementation, they may be ignored or handled depending on the circumstance.

Use the higher level wrapper function statements if you just wish to read in some RDF.

This protocol exists for implementers to hook in additional sources of statements.

Takes a source of statements or triples and converts it into a seq
of triples.

A hash of options is passed to each implementation, they may be
ignored or handled depending on the circumstance.

to-statementsclj

(to-statements this options)
sourceraw docstring

ITripleWriteablecljprotocol

This protocol is implemented by anything which you can put statements into.

This protocol is implemented by anything which you can put
statements into.
sourceraw docstring

IURIablecljsprotocol

->uricljs

(->uri url)

Convert into a grafter.vocabularies.core/URI

Convert into a grafter.vocabularies.core/URI
source

LangStringclj/s

source

languageclj/s

(language s lang)

Create an RDF langauge string out of a value string and a given language tag. Language tags should be keywords representing the country code, e.g.

(language "Bonsoir" :fr)

Create an RDF langauge string out of a value string and a given
language tag.  Language tags should be keywords representing the
country code, e.g.

(language "Bonsoir" :fr)
sourceraw docstring

literalclj/s

(literal val datatype-uri)

You can use this to declare an RDF typed literal value along with its URI. Note that there are implicit coercions already defined for many core clojure/java datatypes, so for common datatypes you shouldn't need this.

You can use this to declare an RDF typed literal value along with
its URI.  Note that there are implicit coercions already defined for
many core clojure/java datatypes, so for common datatypes you
shouldn't need this.
sourceraw docstring

make-blank-nodeclj/s

(make-blank-node)
(make-blank-node id)

Construct a new blank node. If 0-arity is used a blank node with a new locally unique process id is used.

Construct a new blank node.  If 0-arity is used a blank node with a
new locally unique process id is used.
sourceraw docstring

OffsetDateclj/s

source

Quadclj/s

source

rdf:langStringclj/sdeprecated

source

RDFLiteralclj/s

source

Tripleclj

source

triple=clj/s

(triple= & quads)

Equality test for an RDF triple or quad, that checks whether the supplied RDF statements are equal in terms of RDFs semantics i.e. two quads will be equal regardless of their graph/context providing their subject, predicate and objects are equal.

Like clojure.core/= this function can be applied to any number of statements.

Equality test for an RDF triple or quad, that checks whether the supplied RDF
statements are equal in terms of RDFs semantics i.e. two quads will be equal
regardless of their graph/context providing their subject, predicate and
objects are equal.

Like clojure.core/= this function can be applied to any number of statements.
sourceraw docstring

triple?clj/s

(triple? t)

Predicate function to test if object is a valid RDF triple.

Predicate function to test if object is a valid RDF triple.
sourceraw docstring

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

× close