AshR2RML.Semantic.Ash (AshR2RML v26.8.29)

Copy Markdown View Source

Manufactures Ash resource source from the admitted semantic IR.

Summary

Functions

Renders Ash resource source from ir.

Functions

render(ir, opts \\ [])

@spec render(
  AshR2RML.SemanticIR.t(),
  keyword()
) :: {:ok, String.t()}

Renders Ash resource source from ir.

opts is additive and defaults to producing byte-identical output to before it existed: graphql: true and/or json_api: true add AshGraphql.Resource/ AshJsonApi.Resource to every resource's extensions: list and a minimal, real graphql do type ... end / json_api do type ... end block per resource, with the type name auto-derived from the same mapping IR that already drives r2rml's class_iri/attribute_mappings -- no hand-written GraphQL/JSON:API wiring, no new runtime dependency on ash_graphql/ ash_json_api for AshR2RML itself (they are :test-only, used here solely to verify the emitted source actually compiles as a real Ash resource).

This does not "add support" for GraphQL/JSON:API -- any consumer resource can already add those extensions directly, independent of AshR2RML, because Ash extensions compose. This only auto-derives the minimal starting block from the mapping so a resource author doesn't have to invent the type name by hand.