| api | ||
| fuseki | ||
| kg | ||
| osl | ||
| python | ||
| .gitignore | ||
| Caddyfile.snippet | ||
| docker-compose.yml | ||
| LICENSE | ||
| README.md | ||
Health Methods KG Starter (Task-first, theory + practice)
This repository bootstraps a methods knowledge graph for health/public health analytics:
- what methods exist (stat/ML/math)
- what tasks they address (task-first navigation)
- what data types they operate on
- assumptions and outputs
- practical implementations (libraries, repos), tutorials, papers
- live updates via an API that writes validated triples into Fuseki named graphs
- SHACL shapes to keep your graph consistent
Services
- Fuseki: http://localhost:3030/ (dataset: /kg)
- OSL wiki: http://localhost:8080/
- API: http://localhost:8000/ (Swagger docs at /docs)
Start
docker compose up -d
Load seed data into Fuseki
cd python
python -m venv .venv
# Windows: .venv\Scripts\activate
# Linux/macOS: source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
python -m tools.load_seed
python -m tools.validate_seed
Live updates from OSL
For live updates, have OSL pages/forms POST JSON to the API endpoints:
- POST /upsert/method
- POST /upsert/implementation
Examples are in python/tools/example_requests.md.
Versioning and consistency
Each API write:
- replaces the current snapshot in
KG_GRAPH_INSTANCESfor the edited subject - appends the same triples into a timestamped edit graph
.../graph/method-edits/<version>/<timestamp>.../graph/implementation-edits/<version>/<timestamp>
What to edit next
- expand vocabularies: tasks, datatypes, assumptions, outputs
- add more methods and link them using: generalizes / extends / neuralImplementationOf / oftenCombinedWith
- add tutorial & paper instances
- add evaluation metrics vocabulary and
ex:evaluatedBy
OSL Templates & Forms
See osl/Templates/README_OSL_TEMPLATES.md for pages you can import (Template:Method, optional Form:Method) and a live-update box that posts to the API.
Caddy reverse proxy (bastler_internal)
This stack is designed to sit behind a separate Caddy reverse proxy compose. All services join the external Docker network bastler_internal (see docker-compose.yml). A ready-to-use Caddyfile snippet is in Caddyfile.snippet.
Authelia + CORS (subdomains)
This repo ships a Caddy snippet (Caddyfile.snippet) that protects api.osl.bastler.space and fuseki.osl.bastler.space using Authelia forward_auth.
CORS
The API enables CORS for the OSL origin. Set via OSL_ORIGIN env var in docker-compose.yml (default: https://osl.bastler.space).
DNS
You need DNS records for:
osl.bastler.spaceapi.osl.bastler.spacefuseki.osl.bastler.space
Unless you already have a wildcard record like *.bastler.space pointing at your Caddy entrypoint (or you use Caddy on-demand TLS with appropriate DNS pointing). If no wildcard exists, create A/AAAA (or CNAME) records for each subdomain.