The Dragons world, as a graph.
YANG-DB's tutorial domain: people, dragons, horses, guilds and kingdoms, and who owns, knows, fights or rules whom. See its ontology, the OpenSearch indices it lives in, run its queries, and save a query's results to slice them with aggregations.
Run everything on your own engine.
The page talks to YANG-DB's REST API straight from your browser. Without an engine it shows results recorded from a real one, marked recorded, so you can explore first and run later.
Your engine
- The engine answers at
/health - The Dragons ontology is registered
- The Person index has data
The engine allows requests from any origin, so this works from yang-db.github.io to localhost. If your browser blocks it (Safari blocks http:// from an https:// page), open a local copy instead: docs/examples/dragons/index.html in a clone of the repository.
Start it and load the data
- Start YANG-DB and OpenSearch with Docker. The image is built from source (about 5 minutes the first time):
cd docker && ./buildDocker.sh Dragons docker compose -f docker-compose-os.yml up -d
- Load the tutorial data: the ontology, its indices and 15 CSV files. Connect first, then:
- Connect on the left. All set: explore the schema.
Every step in detail: the Dragons tutorial.
An ontology: the types, not the storage.
Queries are written against the ontology (Dragons.json): entity types, relationship types and their properties. Click a type to see its properties and where it is stored; drag the nodes to rearrange them.
Where the graph lives in OpenSearch.
The index provider (DragonsIndexProvider.conf) maps each type onto indices. Most get one index each. Fire and Freeze are split into partitions by year, and Profession is nested inside the person documents. Every relationship is stored twice, once from each end.
Ask the graph in Cypher.
Pick a query, edit it if you like, and run it. The result is drawn as a graph, listed as rows, or shown as the JSON the API returns. These are the tutorial's queries; CI runs them against OpenSearch on every pull request and checks their answers.
Save a query's results, then slice them.
With the projection cursor, the engine writes every result row into an OpenSearch index. Run an expensive query once, then summarise its rows, break them down by any field and page through them, without running it again. recorded