Functions & Protocols for serializing Grafter Statements to (and from) any Linked Data format supported by Sesame.


FIXME: write docs


(filename->rdf-format fname)

Given a filename we attempt to return an appropriate RDFFormat object based on the files extension.





(->sesame-rdf-type this)

Convert a native type into a Sesame RDF Type


(sesame-rdf-type->type this)

Convert a Sesame RDF Type into a Native Type


(IStatement->sesame-statement is)

Convert a grafter IStatement into a Sesame statement.



A multimethod to convert an RDF literal into a corresponding Clojure type. This method can be extended to provide custom conversions.


(mimetype->rdf-format mime-type)

Given a mimetype string we attempt to return an appropriate RDFFormat object based on the files extension.


(rdf-serializer destination & {:keys [append format encoding prefixes], :or {append false, encoding "UTF-8", prefixes default-prefixes}})

Coerces destination into an using and returns an RDFSerializer.

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.


(s str)(s str lang-or-uri)

Cast a string to an RDF literal. The second optional argument can either be a keyword corresponding to an RDF language tag e.g. :en, :en-gb, or :fr or a string or URI in which case it is assumed to be a URI identifying the RDF type of the literal.


(sesame-statement->IStatement st)

Convert a sesame Statement into a grafter Quad.