Skip to content

calypr/loom

Repository files navigation

ARANGODB_PROTO

FHIR graph loader and dataframe server, with ArangoDB as the primary execution backend.

This repo has two main runtime surfaces:

  • arango-fhir-proto: CLI for FHIR loading (including immutable complete generations) and catalog diagnostics
  • arango-fhir-server: Fiber server for compiler-backed GraphQL reads and a temporary one-file import compatibility endpoint. It also exposes published dataframe reads backed by ClickHouse when configured.

The current product direction is:

  • load raw FHIR NDJSON into one collection per resource type
  • store graph edges in fhir_edge
  • profile populated fields into fhir_field_catalog
  • lower typed dataframe requests through the FHIR-aware compiler into scoped AQL
  • expose the current compiler-backed GraphQL transport

ArangoDB is the only runtime backend. The tracked experimental/ directory contains the local Arango compose setup.

Docs

Current Layout

Local Dev

Start local Arango:

rtk docker compose -f experimental/docker-compose.yml up -d

Generate/build:

make generate-fhir
make generate-graphql
make build

The repository root is also the server command, so a plain build works:

go build .

Load the bundled sample dataset:

./bin/arango-fhir-proto load \
  --backend arango \
  --url http://127.0.0.1:8529 \
  --database fhir_proto \
  --meta-dir META \
  --project ARANGODB_PROTO \
  --auth-resource-path EllrottLab-GDC_Data

For an immutable, generation-qualified load instead of the mutable prototype load above, use a complete META directory and an operator-supplied opaque generation ID. This command deliberately has no --truncate flag:

./bin/arango-fhir-proto load-generation \
  --generation local-meta-2026-07-11 \
  --backend arango \
  --url http://127.0.0.1:8529 \
  --database fhir_proto \
  --meta-dir META \
  --project ARANGODB_PROTO \
  --auth-resource-path EllrottLab-GDC_Data

Start the server in local demo mode:

./bin/arango-fhir-server \
  --listen :8080 \
  --no-auth \
  --backend arango \
  --url http://127.0.0.1:8529 \
  --database fhir_proto

To read the active immutable generation instead, add --dataset-generations. That mode disables POST /api/v1/imports; use load-generation (or the future bundle/job API) to create a complete snapshot.

Then open:

The full step-by-step flow, including a sample GraphQL dataframe mutation, lives in docs/QUICKSTART.md.

Local cluster deployment

The Helm deployment now lives in the gen3-helm repository at helm/loom. It owns the Loom chart and its official ClickStack dependencies; see that repository's README for kind/minikube installation and port forwarding instructions.

Published dataframe materializations

Loom can stream a validated dataframe recipe into a versioned ClickHouse table. The operator command accepts a compiler-shaped JSON recipe:

{
  "project": "ARANGODB_PROTO",
  "rootResourceType": "Patient",
  "fields": [
    {"name": "patient_id", "select": "id", "valueMode": "FIRST"}
  ],
  "schema": [
    {"name": "patient_id", "clickhouseType": "Nullable(String)"}
  ]
}
./bin/arango-fhir-proto materialize-dataframe \
  --request dataframe.json \
  --name case-explorer \
  --clickhouse-url clickhouse://127.0.0.1:9000 \
  --clickhouse-database loom

The server exposes READY materializations through the existing GraphQL endpoint:

query Rows($input: DataframeRowsInput!) {
  dataframeRows(input: $input) {
    columns
    rows
    pageInfo { hasNextPage endCursor }
    materialization { id name rowCount columns { name clickhouseType } }
  }
}

The browser never receives a ClickHouse table name or SQL capability. Loom validates the requested columns, filters, sort, page size, project, generation, and materialization state before querying ClickHouse. An explicit schema preflight validates column names/types before the table is created and rejects rows that emit undeclared or incompatible values. Aggregates accept the same EQ and CONTAINS filters as row reads.

If you are starting from a fresh checkout, go there next:

Build Targets

Important make targets:

  • make generate-fhir
  • make generate-graphql
  • make build
  • make build-server
  • make build-cli
  • make graphql-check
  • make test
  • make conformance
  • make compiler-bench

make generate-graphql is important now. The GraphQL schema and generated artifacts are not purely static, and the repo includes a small reproducible workaround in the generation target for a gqlgen scalar/codegen edge case.

Current HTTP Surfaces

The server mounts:

  • GET /healthz
  • GET /apollo
  • GET /graphql
  • POST /graphql
  • POST /api/v1/imports (legacy one-file import; disabled with --dataset-generations)

HTTP wiring lives in internal/httpapi/routes.go and internal/httpapi/server.go.

Primary Collections

The loader bootstraps:

  • one collection per FHIR resource type discovered in the NDJSON input
  • fhir_edge
  • fhir_field_catalog
  • loom_dataset_lifecycle for generation-aware loads (never truncated)

See internal/ingest/backend.go.

Status

What is current and real:

  • GraphQL introspection for populated traversals/fields/pivots
  • GraphQL dataframe execution on Arango
  • generated schema metadata in fhirschema
  • derived field aliases in graphqlapi/query and explicit lowering rules in internal/dataframe

About

GraphQL server built on top of ArangoDB to be used for creating dataframes from FHIR ndjson

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages