Your OpenSearch indices are already a graph.
YANG-DB maps an ontology onto the indices you already have and answers relationship questions in Cypher, GraphQL or SPARQL. You don't run a second database or a sync pipeline, and no data is copied out.
Interactive exampleTraces →OpenTelemetry spans, queried in place
Interactive exampleFlights →OpenSearch's sample flights as a graph
Interactive exampleDragons →Schema, indices, live Cypher, projection
Name your indices. Get a graph.
You don't write the mapping by hand. The assistant reads your index mappings and a few aggregations, proposes entities and the links between them with the evidence for each, checks the result against your data, and registers it.
Map your indices
Name the OpenSearch indices you already have. The mapping assistant suggests one graph across them, with the evidence for every entity and link, checks it against your data, recommends index and query changes, and registers it. Nothing in your indices changes.
- Watch it build: read, detect, link, derive, name, stage by stage.
- Experiment: answer its choices, rename anything, suggest again.
- Six recorded samples (traces, logs, flights, a shop, Dragons), or your own engine.
Pick a question and see the pattern it walks.
OpenTelemetry spans, read from the index Data Prepper writes for trace analytics, with no copy and no reshaping. The trace view shows one trace at a time; these patterns ask across every trace at once. Each one runs in CI against OpenSearch on every pull request.
The traces ontology. Service and Trace have no index of their own: they are values of the spans' serviceName and traceId fields.
Ask about relationships without moving the data.
Most OpenSearch clusters already hold connected data: orders that point at customers, logs that point at hosts, alerts that point at users. Getting from one to the other today means hand-written loops of searches, or a second database to keep in sync.
Joins by hand
Three hops means three searches, each one feeding ids into a terms query, plus paging, de-duplication and error handling in your application code. That code gets rewritten for every new question.
A second database
A separate graph store answers these questions well, but you load the data into it, keep it in sync with OpenSearch, and run, secure and pay for two systems.
A graph layer on top
YANG-DB describes your indices as entities and relationships, plans each query from index statistics, and runs it as searches against the cluster you already operate. You write the pattern, and the engine works out the searches.
The full feature list, how a query runs, and how YANG-DB compares with Neptune, Neo4j and JanusGraph: YANG-DB at a glance.
Where YANG-DB fits.
It isn't a replacement for a native graph database. It's for when the data is already in OpenSearch and you'd rather query it there than copy it somewhere else. A side-by-side with Neptune, Neo4j and JanusGraph is in the overview.
● A good fit when
- The data is already in OpenSearch and is the source of truth
- You need multi-hop questions over it: who owns what, which accounts share a device, which hosts an alert touched
- You want graph queries on the same cluster as your search and dashboards
- Copying the data into a second store is too costly, too slow or not allowed
● Look elsewhere when
- You need transactional writes through the query language
- Your questions are unbounded paths or graph algorithms such as shortest path, PageRank or community detection
- The API must enforce authentication today without a gateway in front
- The graph doesn't otherwise belong in OpenSearch
A graph on OpenSearch, on your laptop, in a minute.
Docker Compose starts OpenSearch 3.10.1, OpenSearch Dashboards and YANG-DB with the Dragons sample ontology. The loader and the checks need only Python 3's standard library.
Start the stack
From a clone of the repository:
cd docker YANGDB_IMAGE=ghcr.io/yang-db/yang.db \ YANGDB_TAG=0.13.0 \ docker compose -f docker-compose-os.yml up -d curl http://localhost:8888/fuse/health
Load the Dragons
This loads about 22,000 rows and checks every documented query against them:
python3 docker/e2e/doc_queries.py --load --reset
Ask the graph
Or open the playground at localhost:8888/dragons/swagger and pick a query from the list.
curl -H 'Accept: application/json' \ 'http://localhost:8888/fuse/query/cypher/run?ontology=Dragons&cypher=MATCH%20(d:Dragon)%20RETURN%20*'
No Docker? Unpack the release distribution, set opensearch.hosts in dragon/config/application.conf to your OpenSearch 3.x cluster, and run dragon/start-fuse-service.sh (Java 21).
| Your OpenSearch | YANG-DB | Java | Docker image |
|---|---|---|---|
| 3.x (tested against 3.10.1) | 0.13.0 | 21 | ghcr.io/yang-db/yang.db:0.13.0 |
| 2.19 | 0.10.1 | 11 | ghcr.io/yang-db/yang.db:0.10.1 |
| 1.3 | 0.8.0 | 11 | distribution only |
What each release supports, by OpenSearch, Java and feature: releases and compatibility; what each one added, with links to the docs: release timeline. On Amazon OpenSearch Service: the AWS guide (runs in your VPC; a SigV4 proxy is needed until F1).
Docs and examples.
The Traces example
OpenTelemetry spans as a graph, read from the index Data Prepper writes: no copy, no reshaping.
InteractiveThe Flights example
OpenSearch's sample flights as a graph, from the sample index as it is or a reshaped copy.
InteractiveThe Dragons example
The tutorial dataset: every index layout, live Cypher queries, and a projection walkthrough.
InteractiveSearch + graph
17 use cases: word, phrase, query-string and fuzzy search, and text filters at any position of a pattern.
GuideMap your existing indices
From your indices to a registered ontology, with the assistant's API, CLI or page.
ArchitectureThe life of a query
From text to results, through every module it passes.
HonestyKnown issues
What doesn't work yet, with IDs and causes.
More: overview and comparison · Dragons tutorial · REST API · index provider · V1 spec · modules · long-running queries · projection & count cursors · benchmark · AWS guide · event indices design · releases · release timeline
Where the project is heading.
Each release runs on a current OpenSearch, is tested end to end in CI, and is measured against the one before. Ideas below are candidates, not commitments.
Done
- 0.13.0 released: full-text search and
NOTin Cypher, saved results per ontology with a list / delete / expire API - 0.12.0 released: your existing indices as a graph, the mapping assistant, several ontologies and saved results on OpenSearch 3.x
- OpenSearch 3.10.1 and Java 21; 2.19 data opens in place (0.11)
- OpenSearch 2.19 over REST, replacing the 1.3 transport client (0.9)
- End-to-end CI: every documented query runs on Docker for each PR
- A real extension point for query languages and modules
- Speed work: plain searches, growing bulks, less engine CPU (0.10)
- Consistent cursors with Point in Time, opt in (0.10)
- V1 spec published with a JSON Schema (0.10)
- Saved results: read back page by page and aggregate (0.10.1; 0.12 on 3.x)
- F21 Existing indices as a graph: event, derived and field mappings, no reindexing (0.12)
- Several ontologies in one engine, each initialised, loaded and queried (0.12)
- Interactive examples: OpenTelemetry traces, Flights (reshaped or in place) and Dragons
- A shorter site: the mapping assistant and traces up front, details in the docs
- Q25 One relationship type stored in several types' documents, followed from either end; the mapping assistant suggests one type for every source (0.13)
- F34.1 Text filters: Cypher
CONTAINS/STARTS WITH/ENDS WITHand V1 full-text filters correct at every position of a pattern, checked against OpenSearch (0.13) - F34.2 Full-text search in Cypher:
search.match,match_phrase,query_string,fuzzyat any position in a pattern, checked against OpenSearch (0.13) - Q33
NOTin Cypher works, and a condition Cypher can't express is an error instead of being ignored (0.13) - Search + graph example page: 17 use cases of text search inside graph patterns, each checked against OpenSearch in CI
- F22.3 Saved results per ontology: aggregates work for every ontology; list, delete and expire them through the API (0.13)
- Release timeline: every release and what it added, each feature linked to its docs and examples
- Agent playbook: measured cost per unit of work, which model does what, and a cost estimate before every task
- A13 The
visualizeendpoints draw SVGs again on Java 21: Graphviz in the Docker image (0.13) - F32 Mapping assistant: point it at your indices, get one graph across them, checked against your data with advice, then registered; an API, a CLI and a page (0.12)
- Smaller runtime: Groovy 2.4, rest-assured and test libraries no longer ship in the engine jar
Next
- 0.14.0 Search everywhere, leaner results: a search + graph tutorial and search on the traces example (F34.3), rows ordered by text score (F34.4), Cypher
RETURNreturns only what's listed, progress while results are saved - 0.15.0 Paths: variable-length paths and
shortestPath()(F2), per-query profiling with?profile=true(F3) - 0.16.0 Production readiness: authentication and SigV4 / basic auth to OpenSearch (F1), the AWS blueprint tested on a real domain, a metrics endpoint, large loads in pieces,
ORbranches in parallel, queries and cursors that survive a restart (F35) - 0.17.0 Showcase datasets: IMDb, financial fraud transfers, the ICIJ Offshore Leaks, and the LDBC social-network benchmark at 1.7 billion relationships on AWS, against Amazon Neptune and Neo4j
Ideas
- F4 Gremlin: a parser spike is done; REST first, then the Gremlin Server protocol
- F22.4 Graph queries over saved results
- F12 A Python SDK from the OpenAPI spec
- F13 Graph exploration in OpenSearch Dashboards
- Nested objects inside event documents, as entities of their own
Full plan: ROADMAP.md, and the release timeline. Want one of these sooner? Say so in an issue, or send a pull request.
