# `Gno.Manifest`
[🔗](https://github.com/rdf-elixir/gno/blob/v0.1.0/lib/gno/manifest/manifest.ex#L1)

RDF-based configuration for `Gno.Service`s.

Extends `DCATR.Manifest` with a `Gno.Service` link. Manifest files are
Turtle files loaded from a `DCATR.Manifest.LoadPath`. All files in the
environment-specific subdirectory are loaded and merged into a single graph.

Custom manifest types can be defined via `Gno.Manifest.Type`, and manifest
files can be generated with `Gno.Manifest.Generator`.

## Application Configuration

Gno's manifest system is configured through the `:dcatr` application:

    config :dcatr,
      env: Mix.env(),
      load_path: ["config/gno"],
      manifest_type: Gno.Manifest,
      manifest_base: "http://example.com/"

- `:env` - the current environment, used to select the environment-specific
  subdirectory (e.g. `config/gno/dev/`, `config/gno/test/`)
- `:load_path` - directory paths for manifest file discovery
  (see `DCATR.Manifest.LoadPath`)
- `:manifest_type` - the manifest module to use (always `Gno.Manifest` for
  plain Gno, or a custom module implementing `Gno.Manifest.Type`)
- `:manifest_base` - base URI for resolving relative URIs in manifest files

Additionally, an HTTP adapter must be configured for `Tesla`:

    config :tesla, adapter: Tesla.Adapter.Hackney

## Directory Structure

Manifest files are organized by environment:

    config/gno/
    ├── dev/
    │   ├── service.ttl
    │   ├── repository.ttl
    │   └── fuseki.ttl
    └── test/
        ├── service.ttl
        ├── repository.ttl
        └── oxigraph.ttl

## Loading

The manifest and its components can be loaded programmatically:

    {:ok, manifest} = Gno.manifest()
    {:ok, service}  = Gno.service()
    {:ok, store}    = Gno.store()

# `t`

```elixir
@type t() :: %Gno.Manifest{
  __additional_statements__: term(),
  __id__: term(),
  dataset: term(),
  load_path: term(),
  service: term()
}
```

# `build`

# `build`

# `build!`

# `build!`

# `build_id`

# `dataset`

Loads the dataset from the cached manifest's repository.

# `dataset!`

Loads the dataset or raises on error.

# `from`

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

# `from!`

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

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

# `manifest`

```elixir
@spec manifest(keyword()) :: {:ok, t()} | {:error, DCATR.ManifestError.t()}
```

Loads the complete manifest with caching support.

## Options

- `:load_path` - Override default load path
- `:service_id` - Explicit service ID for loading
- `:reload` - Force cache reload (bypass cache)
- Additional options passed to `load_dataset/1` and `load_manifest/2`

# `manifest!`

Loads the manifest or raises on error.

# `repository`

Loads the repository from the cached manifest's service.

# `repository!`

Loads the repository or raises on error.

# `service`

Loads the service from the cached manifest.

# `service!`

Loads the service or raises on error.

# `service_type`

Returns the service type module used by this manifest type.

Extracts the service type from the `:service` link property definition in the
manifest's Grax schema. Used for type introspection and validation.

# `store`

# `store!`

---

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