AshR2RML.OBDA.Ontop (AshR2RML v26.8.22)

Copy Markdown View Source

Operator-invoked adapter for Ontop's query CLI.

This module does not start an endpoint and is never called implicitly by the compiler. query/1 executes the real external process. query/2 exists for deterministic unit testing with an injected runner and is permanently marked :test_double_only; its result must not be attached as a parity witness.

:prefix_args allows an operator to place Ontop behind an execution wrapper, including the official Docker image, without changing the semantic command.

Summary

Functions

Parse Ontop SELECT CSV output into deterministic string-keyed row maps.

Execute Ontop as a real external process.

Execute through an injected runner for unit tests; never a crown/parity witness.

Functions

command(opts)

@spec command(keyword() | map()) ::
  {:ok, {String.t(), [String.t()]}} | {:error, AshR2RML.Refusal.t()}

parse_csv(output)

@spec parse_csv(String.t()) :: [map()]

Parse Ontop SELECT CSV output into deterministic string-keyed row maps.

query(opts)

@spec query(keyword() | map()) ::
  {:ok, AshR2RML.OBDA.Observation.t()} | {:error, AshR2RML.OBDA.Observation.t()}

Execute Ontop as a real external process.

query(opts, runner)

@spec query(keyword() | map(), function()) ::
  {:ok, AshR2RML.OBDA.Observation.t()} | {:error, AshR2RML.OBDA.Observation.t()}

Execute through an injected runner for unit tests; never a crown/parity witness.