Liking cljdoc? Tell your friends :D

rdf


*rdf*clj

Dynamic var of which RDF implementation to use for creating RDF concepts.

The implementation must be an instance that is supported by the rdf.protocols/RDF protocol.

Use with-rdf to temporarily change the RDF implementation.

Dynamic var of which RDF implementation to use for creating RDF concepts.

The implementation must be an instance that is supported by the
rdf.protocols/RDF protocol.

Use with-rdf to temporarily change the RDF implementation.
sourceraw docstring

add-tripleclj

(add-triple g t)
(add-triple g subj pred obj)

Return a graph with the triple added

Return a graph with the triple added
sourceraw docstring

blanknodeclj

(blanknode)
(blanknode label)

Create a blank node. If the argument label is provided, it may be used to locally identify the blank node.

Create a blank node.  If the argument label is provided,
it may be used to locally identify the blank node.
sourceraw docstring

blanknode-refclj

(blanknode-ref lit)

Return a reference string for blank node

Return a reference string for blank node
sourceraw docstring

blanknode?clj

(blanknode? term)

Return true if term is a blank node

Return true if term is a blank node
sourceraw docstring

graphclj

(graph)
(graph g)

Create a graph of RDF triples.

If argument g is provided, it's triples will be added to the graph.

The type of underlying storage for the graph is determined by the rdf var, which can be modified with with-rdf.

Create a graph of RDF triples.

If argument g is provided, it's triples will be added
to the graph.

The type of underlying storage for the graph is determined by the
*rdf* var, which can be modified with with-rdf.
sourceraw docstring

graph?clj

(graph? g)
source

iriclj

(iri iri)

Create a IRI.

Create a IRI.
sourceraw docstring

iri-strclj

(iri-str i)

Return the IRI string of i

Return the IRI string of i
sourceraw docstring

iri?clj

(iri? term)

Return true if term is an IRI

Return true if term is an IRI
sourceraw docstring

literalclj

(literal lit)
(literal lit type-or-lang)
(literal lit type lang)

Create or return an RDF literal.

If only one argument is provided, and the value is a (literal?), then it would be returned as-is or mapped to the current rdf factory. Otherwise, the argument is assumed to be a string representing the lexical value of a literal with a datatype equivalent to (rdf.ns/xsd :string).

If the second argument is provided, it should be either the datatype iri (e.g. (rdf.ns/xsd :int)), or a non-nil language tag, represented as as a string or keyword .

If a third argument is provided, it is the language tag (or nil), while the second argument must be a datatype iri.

Create or return an RDF literal.

If only one argument is provided, and the value is a
(literal?), then it would be returned as-is or mapped to
the current *rdf* factory. Otherwise, the argument is
assumed to be a string representing the lexical value of a
literal with a datatype equivalent to (rdf.ns/xsd :string).

If the second argument is provided, it should be either
the datatype iri (e.g. (rdf.ns/xsd :int)),
or a non-nil language tag, represented as as a string
or keyword .

If a third argument is provided, it is the language tag
(or nil), while the second argument must be a datatype iri.
sourceraw docstring

literal-langclj

(literal-lang lit)

Return the language tag of RDF literal, or nil if the literal has no language.

Return the language tag of RDF literal,
or nil if the literal has no language.
sourceraw docstring

literal-strclj

(literal-str lit)

Return the lexical string of RDF literal

Return the lexical string of RDF literal
sourceraw docstring

literal-typeclj

(literal-type lit)

Return the language type IRI of RDF literal

Return the language type IRI of RDF literal
sourceraw docstring

literal?clj

(literal? term)

Return true if term is a literal

Return true if term is a literal
sourceraw docstring

ntriples-strclj

(ntriples-str t)

Return the N-Triples representation of the RDF term or triple t

Examples: (ntriples-str (literal "Hello" :en)) ; => "Hello"@en (ntriples-str t) ; => _:b0 http://example.com/ "Hello" .

Return the N-Triples representation of the RDF term or triple t

Examples:
    (ntriples-str (literal "Hello" :en)) ; => "Hello"@en
    (ntriples-str t) ; => _:b0 <http://example.com/> "Hello" .
sourceraw docstring

objectclj

(object t)
source

predicateclj

(predicate t)
source

rdf-implclj

(rdf-impl)
(rdf-impl r)

Select an RDF implementation for given keyword. The implementation can be used with rdf, with-rdf, as well as the first argument for the rdf.protocols/RDF protocol methods.

The implementations include at least:

:clojure - Clojure-centric representation using Clojure maps/hash :simple - Commons RDF Simple implementation :any - Any Commons RDF implementations discovered on class path

These implementations are also available if the corresponding Commons RDF integration modules (and their dependencies) are on the classpath:

:jena - Commons RDF mapping of Apache Jena :rdf4j - Commnos RDF mapping of Eclipse RDF4J :jsonldjava - Commons RDF mapping of JSONLD-Java

Called with no arguments this function selects the default implementation, currently :clojure

Select an RDF implementation for given keyword. The implementation
can be used with *rdf*, with-rdf, as well as the first argument for
the rdf.protocols/RDF protocol methods.

The implementations include at least:

  :clojure - Clojure-centric representation using Clojure maps/hash
  :simple - Commons RDF Simple implementation
  :any - Any Commons RDF implementations discovered on class path

These implementations are also available if the corresponding
Commons RDF integration modules (and their dependencies) are
on the classpath:

  :jena - Commons RDF mapping of Apache Jena
  :rdf4j - Commnos RDF mapping of Eclipse RDF4J
  :jsonldjava - Commons RDF mapping of JSONLD-Java

Called with no arguments this function selects the
default implementation, currently :clojure
sourceraw docstring

subjectclj

(subject t)
source

term?clj

(term? t)

Return true if t is an RDF term (IRI, blank node or string)

Return true if t is an RDF term (IRI, blank node or string)
sourceraw docstring

tripleclj

(triple t)
(triple subj pred obj)

Create an RDF triple, either from an existing triple t, or for a new triple given as subj pred obj.

Example: (triple (blanknode) (iri "http://schema.org/name") (literal "Example"))

Create an RDF triple, either from an existing triple t,
or for a new triple given as subj pred obj.

Example:
    (triple (blanknode) (iri "http://schema.org/name") (literal "Example"))
sourceraw docstring

triple-countclj

(triple-count g)

Return count of triples in graph

Return count of triples in graph
sourceraw docstring

triple?clj

(triple? t)
source

with-rdfcljmacro

(with-rdf r & body)

Modify rdf to set which RDF implementation to use. The implementation can be either a a keyword (e.g. :simple) or an RDF instance, (e.g. rdf-impl :clojure).

Modify *rdf* to set which RDF implementation to use.
The implementation can be either a a keyword (e.g. :simple) or
an RDF instance, (e.g. rdf-impl :clojure).
sourceraw docstring

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

× close