DCATR.Directory (DCAT-R.ex v0.1.0)

Copy Markdown View Source

A named collection of graphs and nested directories.

Directories enable hierarchical organization of graphs, providing structure for navigation, scoped metadata, and targeted operations.

Each directory can contain DCATR.Graphs and nested DCATR.Directorys as members.

Access Functions

Direct access (non-recursive)

  • members/1 - all direct Element members
  • graphs/1 - direct Graph members only (callback)
  • directories/1 - direct Directory members only (callback)

Recursive access (generated by DCATR.Directory.Type)

Summary

Functions

Returns all graphs through the entire sub-directory tree.

Returns all elements through the entire sub-directory tree.

Finds a graph by ID recursively through the sub-directory tree.

Returns all direct element members.

Types

t()

@type t() :: %DCATR.Directory{
  __additional_statements__: term(),
  __id__: term(),
  members: term()
}

Functions

all_graphs(container)

@spec all_graphs(DCATR.Directory.Type.schema()) :: [DCATR.Graph.t()]

Returns all graphs through the entire sub-directory tree.

all_members(container)

@spec all_members(DCATR.Directory.Type.schema()) :: [DCATR.Element.t()]

Returns all elements through the entire sub-directory tree.

build(id)

build(id, initial)

build!(id)

build!(id, initial)

build_id(attributes)

find_graph(container, id)

@spec find_graph(DCATR.Directory.Type.schema(), RDF.IRI.coercible()) ::
  DCATR.Graph.t() | nil

Finds a graph by ID recursively through the sub-directory tree.

from(value)

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

from!(value)

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

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

members(container)

Returns all direct element members.

new(id, attrs \\ [])

new!(id, attrs \\ [])