Gno.Store.Adapters.GraphDB (Gno v0.1.0)

Copy Markdown View Source

A Gno.Store.Adapter implementation for Ontotext GraphDB.

GraphDB is a RDF4J-based triplestore with reasoning support. It uses repository-based URL patterns following the RDF4J REST API convention.

Manifest Configuration

@prefix gno:  <https://w3id.org/gno#> .
@prefix gnoa: <https://w3id.org/gno/store/adapter/> .

<GraphDB> a gnoa:GraphDB
    ; gno:storeEndpointScheme "http"              # optional (default: "http")
    ; gno:storeEndpointHost "localhost"           # optional (default: "localhost")
    ; gno:storeEndpointPort 7200                  # optional (default: 7200)
    ; gno:storeEndpointDataset "my-repository"   # required
.

Default Graph Semantics

GraphDB uses union default graph semantics by default: the default graph is the union of all named graphs and the real default graph. The adapter automatically normalizes this by setting the default-graph-uri parameter to <http://www.openrdf.org/schema/sesame#nil> for query operations.

This can be overridden per manifest with gno:storeDefaultGraphSemantics "isolated".

Prerequisites

A GraphDB repository must be created before using this adapter (e.g. via the GraphDB Workbench UI or REST API). For test repositories, use ruleset: "empty" to avoid inference overhead.

Administration

This adapter provides access to GraphDB's REST API for health checks and repository information.

Summary

Functions

Fetches information about all repositories.

Returns the graph semantics for a specific adapter instance.

Checks if the GraphDB server is available by listing repositories.

Returns the repositories endpoint for repository management operations.

Returns the repository-specific endpoint for the adapter's repository.

Returns the repository-specific endpoint for a given repository name.

Fetches information about the adapter's repository.

Fetches information about a specific repository.

Fetches the size (number of statements) of the adapter's repository.

Fetches the size (number of statements) of a specific repository.

Returns the repository size endpoint.

Returns the repository size endpoint for a given repository name.

Returns the GraphDB REST API base endpoint.

Types

t()

@type t() :: %Gno.Store.Adapters.GraphDB{
  __additional_statements__: term(),
  __id__: term(),
  dataset: 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

all_repositories_info(adapter)

Fetches information about all repositories.

build(id)

build(id, initial)

build!(id)

build!(id, initial)

build_id(attributes)

from(value)

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

from!(value)

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

graph_semantics(adapter)

Returns the graph semantics for a specific adapter instance.

Checks the default_graph_semantics_config manifest property first, falling back to default_graph_semantics/0.

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()

ping(adapter, opts \\ [])

Checks if the GraphDB server is available by listing repositories.

ping?(adapter, opts \\ [])

repositories_endpoint(adapter)

Returns the repositories endpoint for repository management operations.

repository_endpoint(adapter)

Returns the repository-specific endpoint for the adapter's repository.

repository_endpoint(adapter, repository_name)

Returns the repository-specific endpoint for a given repository name.

repository_info(adapter)

Fetches information about the adapter's repository.

repository_info(adapter, repository_name)

Fetches information about a specific repository.

repository_size(adapter)

Fetches the size (number of statements) of the adapter's repository.

repository_size(adapter, repository_name)

Fetches the size (number of statements) of a specific repository.

repository_size_endpoint(adapter)

Returns the repository size endpoint.

repository_size_endpoint(adapter, repository_name)

Returns the repository size endpoint for a given repository name.

rest_base(adapter)

Returns the GraphDB REST API base endpoint.