# `GgenIgniter.Query`
[🔗](https://github.com/seanchatmangpt/ggen_igniter/blob/v26.9.8/lib/ggen_igniter/query.ex#L1)

Executes a SPARQL SELECT query against an in-memory RDF.Graph via the `sparql` library and reshapes results into plain maps keyed by column name (mirroring the row shape ggen's own Tera templates already consume).

Disclosed limitation, empirically confirmed (not just asserted): the `sparql`
hex package (v0.3.12, the default `--engine sparql` used by this module) does
not correctly honor `ORDER BY`. A join-shaped query mirroring the real gate
fixtures (`?field ex:fieldOf ?entity ; ex:fieldOrder ?field_order . ?entity
ex:entityStruct ?entity_struct .` with `ORDER BY ?field_order` over 10 rows)
came back in reverse order (`[9, 8, 7, 6, 5, 4, 3, 2, 1, 0]` instead of the
requested ascending `[0, 1, ..., 9]`) when run through `run/2`. The same
query run through `GgenIgniter.Query.Oxigraph.run/2` (a real, independent,
spec-conformant SPARQL 1.1 engine) returned the correct ascending order. If
row order matters for a query, use `--engine oxigraph` instead of the
default `--engine sparql`.

# `run`

```elixir
@spec run(RDF.Graph.t(), String.t()) :: [map()]
```

Runs `query_string` against `graph`, returning a list of %{column_name => value} maps.

---

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