Impala is a module of Insee's Statistical Metadata Repository (RMéS). It exposes linked metadata on web pages and through a SPARQL editor based on Yasgui.
The application is written in TypeScript (src/*.ts, src/*.tsx); the Node
scripts (create-zip.ts, tests/docker/sparql-mock.ts) are run directly by
Node, which strips the type annotations at load time (Node >= 22.18).
- Type check the whole project (tsc)
pnpm typecheck- Run Linting (oxlint)
pnpm lint- Auto-fix linting issues
pnpm lint:fixThe SPARQL endpoint used by the editor and the DESCRIBE prefix applied to
id.insee.fr links are read from Vite environment variables, managed by
vite-envs:
| Variable | Declared in .env |
|---|---|
VITE_SPARQL_ENDPOINT |
http://rdf.insee.fr/sparql |
VITE_SPARQL_PREFIX |
https://rdf.insee.fr/sparql?query=DESCRIBE |
VITE_INSEE_SPARQL_ENDPOINT |
http://rdf.insee.fr/sparql |
VITE_INSEE_SPARQL_ENDPOINT is a comparison value, not a target: id.insee.fr
links are rewritten to a DESCRIBE query only when VITE_SPARQL_ENDPOINT
points somewhere else. Leave it alone.
In development, override the others in a .env.local file. In the Docker
image, they are read when the container starts (see Docker): no
rebuild is needed.
- Run Unit Tests (Vitest)
pnpm test- Run UI Tests (Playwright)
npx playwright test- Run Rewrite Rules Tests (Playwright, against the Docker image)
pnpm test:dockerThese tests build the Docker image, start it next to a fake SPARQL endpoint
(tests/docker/compose.yaml) and check every rewrite rule of
nginx.conf.template: status codes, Location headers and which requests are
proxied. No network access to the production endpoint is needed.
The image serves the application with nginx. All the routing (SPARQL proxying,
dereferencing, headers) lives in nginx.conf.template, installed as an nginx
template so that the SPARQL endpoint it proxies to can be changed without
rebuilding the image:
docker run -p 8080:8080 -e RDF4J_API_URI=https://api-rmes-cache.insee.fr/sparql inseefr/impalaThe VITE_* variables of the editor are injected the same way: at startup,
vite-envs.sh rewrites sparql/index.html with the values found in the
container environment, falling back to .env for the missing ones.
docker run -p 8080:8080 -e VITE_SPARQL_ENDPOINT=https://example.org/sparql inseefr/impala