View Source Ontogen.Store.Adapter behaviour (Ontogen v0.1.1)
A behaviour for SPARQL triple stores hosting an Ontogen.Repository
.
Summary
Functions
Returns the Ontogen.Store.Adapter
module for the given string.
Checks if the given module
is a Ontogen.Store.Adapter
module.
Returns the store adapter name for the given store adapter module.
Types
@type endpoint_url() :: String.t() | nil
@type graph_name() :: RDF.IRI.t() | nil
@type result() :: SPARQL.Query.Result.t() | RDF.Data.t() | nil
@type t() :: struct()
@type type() :: module()
Callbacks
@callback determine_graph_store_endpoint(t()) :: {:ok, endpoint_url()} | {:error, any()}
@callback determine_query_endpoint(t()) :: {:ok, endpoint_url()} | {:error, any()}
@callback determine_update_endpoint(t()) :: {:ok, endpoint_url()} | {:error, any()}
@callback handle_sparql(Ontogen.Store.SPARQL.Operation.t(), t(), graph_name(), keyword()) :: {:ok, result()} | :ok | {:error, any()}
Functions
Returns the Ontogen.Store.Adapter
module for the given string.
Example
iex> Ontogen.Store.Adapter.type("Oxigraph")
Ontogen.Store.Adapters.Oxigraph
iex> Ontogen.Store.Adapter.type("Commit")
nil
iex> Ontogen.Store.Adapter.type("NonExisting")
nil
Checks if the given module
is a Ontogen.Store.Adapter
module.
Returns the store adapter name for the given store adapter module.
Example
iex> Ontogen.Store.Adapter.type_name(Ontogen.Store.Adapters.Fuseki)
"Fuseki"
iex> Ontogen.Store.Adapter.type_name(Ontogen.Store.Adapters.Oxigraph)
"Oxigraph"
iex> Ontogen.Store.Adapter.type_name(Ontogen.Repository)
** (RuntimeError) Invalid Ontogen.Store.Adapter type: Ontogen.Repository
iex> Ontogen.Store.Adapter.type_name(NonExisting)
** (RuntimeError) Invalid Ontogen.Store.Adapter type: NonExisting