AshR2RML.Ggen (AshR2RML v26.8.29)

Copy Markdown View Source

ggen-facing deterministic compilation bundle.

AshR2RML does not invoke ggen or write files. It manufactures a path/content graph so ggen can own rendering, filesystem actuation, migration versioning, replay, and receipts without independently reconstructing semantic decisions.

Turtle and JSON-LD are alternate RDF input serializations. Both are admitted into the same normalized profile before manufacture so ggen never receives a serialization-specific semantic fork.

Cloud ggen may also run in Ash-first mode. In that mode the maintained source is the Ash resource graph itself and compile_ash_ttl_bundle/1 emits the ontology, operational SHACL shapes, and R2RML Turtle required by ggen.

Semantic types use the same boundary: compile_semantic_types_bundle/2 admits a content-addressed plan and returns deterministic generated artifacts. Runtime integration uses compile_runtime_contract/1 to manufacture the exact-subject, authority-bound input consumed by the marketplace runtime integration pack. ggen still owns DO.

Summary

Functions

Manufacture a deterministic ggen bundle containing only Ash resource source with auto-derived graphql do ... end/json_api do ... end blocks, from the same admitted mapping IR compile_bundle/1 uses -- additive, does not change compile_bundle/1's output.

Manufacture cloud-ggen TTL inputs directly from one or more Ash resources.

Parse a JSON-LD 1.1 RDF/SHACL profile, then manufacture the same deterministic ggen bundle.

Manufacture an exact-subject runtime integration contract for the GGen marketplace pack.

Manufacture a deterministic ggen path/content graph from a semantic type profile.

Parse an RDF/SHACL Turtle profile, then manufacture the same deterministic ggen bundle.

Functions

compile_api_bundle(profile, opts \\ [])

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

Manufacture a deterministic ggen bundle containing only Ash resource source with auto-derived graphql do ... end/json_api do ... end blocks, from the same admitted mapping IR compile_bundle/1 uses -- additive, does not change compile_bundle/1's output.

This does not add a GraphQL/JSON:API runtime dependency to AshR2RML itself: any consumer resource can already add AshGraphql.Resource/AshJsonApi.Resource directly, independent of AshR2RML, because Ash extensions compose. opts is graphql: true and/or json_api: true (both default false); see AshR2RML.Semantic.Ash.render/2 for exactly what's derived.

compile_ash_ttl_bundle(resources_or_bundle)

@spec compile_ash_ttl_bundle(module() | [module()] | AshR2RML.Mapping.Bundle.t()) ::
  {:ok, map()} | {:error, term()}

Manufacture cloud-ggen TTL inputs directly from one or more Ash resources.

compile_bundle(profile)

@spec compile_bundle(map()) ::
  {:ok, map()} | {:error, AshR2RML.Compilation.t() | term()}

compile_jsonld_bundle(jsonld, opts \\ [])

@spec compile_jsonld_bundle(
  String.t() | map() | list(),
  keyword()
) :: {:ok, map()} | {:error, term()}

Parse a JSON-LD 1.1 RDF/SHACL profile, then manufacture the same deterministic ggen bundle.

compile_runtime_contract(input)

@spec compile_runtime_contract(map()) :: {:ok, map()} | {:error, atom()}

Manufacture an exact-subject runtime integration contract for the GGen marketplace pack.

compile_semantic_types_bundle(source, opts \\ [])

@spec compile_semantic_types_bundle(
  term(),
  keyword()
) :: {:ok, map()} | {:error, term()}

Manufacture a deterministic ggen path/content graph from a semantic type profile.

compile_turtle_bundle(turtle, opts \\ [])

@spec compile_turtle_bundle(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, term()}

Parse an RDF/SHACL Turtle profile, then manufacture the same deterministic ggen bundle.