Gno.Store (Gno v0.1.0)

Copy Markdown View Source

Base Grax schema for triple stores hosting a DCATR.Repository.

Concrete store types are defined by Gno.Store.Adapter implementations (e.g. Gno.Store.Adapters.Fuseki). This module provides generic endpoint resolution and delegates SPARQL operations to the appropriate adapter.

It can also be used directly as a generic adapter for any SPARQL 1.1 protocol-compliant triple store that has no dedicated adapter implementation:

@prefix gno: <http://gno.app/> .

<MyStore> a gno:Store
    ; gno:storeQueryEndpoint <http://localhost:7878/query>       # required
    ; gno:storeUpdateEndpoint <http://localhost:7878/update>     # optional
    ; gno:storeGraphStoreEndpoint <http://localhost:7878/store>  # optional
.

Summary

Functions

Returns the list of known store adapter class IRIs.

Returns the list of available store adapter modules.

Returns the base endpoint URL for the store.

Returns the base endpoint URL with the given path appended.

Returns the SPARQL Graph Store Protocol endpoint URL for the store.

Returns the SPARQL query endpoint URL for the store.

Returns the SPARQL update endpoint URL for the store.

Types

t()

@type t() :: %Gno.Store{
  __additional_statements__: term(),
  __id__: term(),
  default_graph_semantics_config: term(),
  graph_store_endpoint: term(),
  host: term(),
  port: term(),
  query_endpoint: term(),
  scheme: term(),
  update_endpoint: term(),
  userinfo: term()
}

Functions

adapter_classes()

Returns the list of known store adapter class IRIs.

adapters()

Returns the list of available store adapter modules.

build(id)

build(id, initial)

build!(id)

build!(id, initial)

build_id(attributes)

default_graph_iri(adapter)

endpoint_base(store)

Returns the base endpoint URL for the store.

Constructed from the store's scheme, host, port, and dataset properties. Returns {:error, ...} if the required properties are missing.

endpoint_base!(store)

endpoint_base_with_path(store, path)

Returns the base endpoint URL with the given path appended.

endpoint_base_with_path!(store, path)

from(value)

@spec from(Grax.Schema.t()) :: {:ok, t()} | {:error, any()}

from!(value)

@spec from!(Grax.Schema.t()) :: t()

graph_semantics(adapter)

graph_store_endpoint(store_adapter)

Returns the SPARQL Graph Store Protocol endpoint URL for the store.

graph_store_endpoint!(store)

load(graph, id, opts \\ [])

@spec load(
  RDF.Graph.t() | RDF.Description.t(),
  RDF.IRI.coercible() | RDF.BlankNode.t(),
  opts :: keyword()
) :: {:ok, t()} | {:error, any()}

load!(graph, id, opts \\ [])

@spec load!(
  RDF.Graph.t() | RDF.Description.t(),
  RDF.IRI.coercible() | RDF.BlankNode.t(),
  opts :: keyword()
) :: t()

query_endpoint(store_adapter)

Returns the SPARQL query endpoint URL for the store.

Uses the explicitly configured query_endpoint if set, otherwise delegates to the adapter's Gno.Store.Adapter.determine_query_endpoint/1.

query_endpoint!(store)

update_endpoint(store_adapter)

Returns the SPARQL update endpoint URL for the store.

update_endpoint!(store)