grafter.rdf.io
deprecated in 0.12.1
DEPRECATED. Use grafter.rdf4j.formats instead, this namespace
contains the old sesame implementation.
Functions & Protocols for serializing Grafter Statements to (and from)
any Linked Data format supported by Sesame.
ISesameRDFConverter
protocol
members
->sesame-rdf-type
(->sesame-rdf-type this)
Convert a native type into a Sesame RDF Type
sesame-rdf-type->type
(sesame-rdf-type->type this)
Convert a Sesame RDF Type into a Native Type
IStatement->sesame-statement
(IStatement->sesame-statement is)
Convert a grafter IStatement into a Sesame statement.
language
(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)
literal
(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
shounld't need this.
literal-datatype->type
multimethod
A multimethod to convert an RDF literal into a corresponding
Clojure type. This method can be extended to provide custom
conversions.
rdf-serializer
(rdf-serializer 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 RDFSerializer.
Use this to capture the intention to write to a location in a
specific RDF format, e.g.
(grafter.rdf/add (rdf-serializer "/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 sesame RDFFormat
object.
- :encoding The character encoding to be used (default: UTF-8)
- :prefixes A map of RDF prefix names to URI prefixes.
sesame-statement->IStatement
(sesame-statement->IStatement st)
Convert a sesame Statement into a grafter Quad.
ToSesameURI
protocol
members
->sesame-uri
(->sesame-uri this)
Coerce an object into a sesame URIImpl