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.
(add-triple g t)
(add-triple g subj pred obj)
Return a graph with the triple added
Return a graph with the triple added
(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.
(blanknode-ref lit)
Return a reference string for blank node
Return a reference string for blank node
(blanknode? term)
Return true if term is a blank node
Return true if term is a blank node
(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.
(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.
(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.
(literal-str lit)
Return the lexical string of RDF literal
Return the lexical string of RDF literal
(literal-type lit)
Return the language type IRI of RDF literal
Return the language type IRI of RDF literal
(literal? term)
Return true if term is a literal
Return true if term is a literal
(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" .
(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
(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)
(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"))
(triple-count g)
Return count of triples in graph
Return count of triples in graph
(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).
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close