# `Gno.Store.Adapters.GraphDB`
[🔗](https://github.com/rdf-elixir/gno/blob/v0.1.0/lib/gno/store_adapters/graph_db.ex#L1)

A `Gno.Store.Adapter` implementation for [Ontotext GraphDB](https://graphdb.ontotext.com/).

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](https://graphdb.ontotext.com/documentation/11.2/manage-repos-with-restapi.html)
for health checks and repository information.

# `t`

```elixir
@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()
}
```

# `all_repositories_info`

Fetches information about all repositories.

# `build`

# `build`

# `build!`

# `build!`

# `build_id`

# `from`

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

# `from!`

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

# `graph_semantics`

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`

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

# `load!`

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

# `ping`

Checks if the GraphDB server is available by listing repositories.

# `ping?`

# `repositories_endpoint`

Returns the repositories endpoint for repository management operations.

# `repository_endpoint`

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

# `repository_endpoint`

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

# `repository_info`

Fetches information about the adapter's repository.

# `repository_info`

Fetches information about a specific repository.

# `repository_size`

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

# `repository_size`

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

# `repository_size_endpoint`

Returns the repository size endpoint.

# `repository_size_endpoint`

Returns the repository size endpoint for a given repository name.

# `rest_base`

Returns the GraphDB REST API base endpoint.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
