SPARQL.ex v0.3.0 SPARQL.Query.Result.Format behaviour View Source
A behaviour for SPARQL query result formats.
A SPARQL.Query.Result.Format
for a format can be implemented like this
defmodule SomeFormat do
use SPARQL.Query.Result.Format
import RDF.Sigils
@id ~I<http://example.com/some_format>
@name :some_format
@extension "ext"
@media_type "application/some-format"
end
When @id
, @name
, @extension
and @media_type
module attributes are
defined the resp. behaviour functions are generated automatically and return
these values.
Then you'll have to do the main work by implementing a
RDF.Serialization.Encoder
and a RDF.Serialization.Decoder
for the format.
By default it is assumed that these are defined in Encoder
and Decoder
moduler under the SPARQL.Query.Result.Format
module of the format, i.e. in
the example above in SomeFormat.Encoder
and SomeFormat.Decoder
. If you
want them in another module, you'll have to override the encoder/0
and/or
decoder/0
functions in your SPARQL.Query.Result.Format
module.
Link to this section Summary
Callbacks
The SPARQL.Query.Result.Format.Decoder
module for the result format.
The SPARQL.Query.Result.Format.Encoder
module for the result format.
The usual file extension for the SPARQL query result format.
An IRI of the SPARQL query result format.
The MIME type of the SPARQL query result format.
An name atom of the SPARQL query result format under which it can referenced.
A list of the supported query forms of the SPARQL query result format.
Link to this section Callbacks
decoder()
View Source
decoder() :: module()
decoder() :: module()
The SPARQL.Query.Result.Format.Decoder
module for the result format.
encoder()
View Source
encoder() :: module()
encoder() :: module()
The SPARQL.Query.Result.Format.Encoder
module for the result format.
extension()
View Source
extension() :: binary()
extension() :: binary()
The usual file extension for the SPARQL query result format.
id()
View Source
id() :: RDF.IRI.t()
id() :: RDF.IRI.t()
An IRI of the SPARQL query result format.
media_type()
View Source
media_type() :: binary()
media_type() :: binary()
The MIME type of the SPARQL query result format.
name()
View Source
name() :: atom()
name() :: atom()
An name atom of the SPARQL query result format under which it can referenced.
supported_query_forms()
View Source
supported_query_forms() :: [SPARQL.Query.forms()]
supported_query_forms() :: [SPARQL.Query.forms()]
A list of the supported query forms of the SPARQL query result format.