grafter.rdf.formats

Symbols used to specify different Linked Data Serializations.

->rdf-format

multimethod

Extensible multi-method that coerces mime-type strings, or strings or keys representing file extensions for RDF types into RDFFormat objects for use with Sesame.

e.g. it can coerce :nt, “nt” or “application/n-triples” into the appropriate RDFFormat object.

def-format

macro

(def-format sym docstr format)

Define a bunch of format coercions from mime-type and file extension to RDFFormat. This macro inspects the RDFFormat object it is given and generates appropriate multi-methods to do the coercion for you.

If you want to define new coercions custom coercions (not baked into sesame) you can extend the ->rdf-format multimethod directly.

filename->rdf-format

(filename->rdf-format fname)

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

mimetype->rdf-format

multimethod

Extensible multimethod that accepts a mime-type string and returns the appropriate sesame RDFFormat object.

NOTE: the ->rdf-format function also uses this, and supports both mime-types and file extensions.

rdf-binary

deprecated in 0.8.0

Deprecated. 0.8.0: Sesame’s Binary RDFFormat

rdf-format->parser

multimethod

FIXME: write docs

rdf-json

deprecated in 0.8.0

Deprecated. JSON RDF Format

rdf-jsonld

deprecated in 0.8.0

Deprecated. JSONLD RDF Format

rdf-n3

deprecated in 0.8.0

Deprecated. N3 RDF Format

rdf-nquads

deprecated in 0.8.0

Deprecated. NQuads RDFFormat

rdf-ntriples

deprecated in 0.8.0

Deprecated. NTriples RDFFormat

rdf-trig

deprecated in 0.8.0

Deprecated. Trig RDFFormat

rdf-trix

deprecated in 0.8.0

Deprecated. Trix RDFFormat

rdf-turtle

deprecated in 0.8.0

Deprecated. Turtle RDFFormat

rdf-xml

deprecated in 0.8.0

Deprecated. RDF-XML RDFFormat

url->rdf-format

(url->rdf-format url)

Parse a URL for the file extension of its last path segment, ignoring query string and other URL parts.