# Ontology Snippet & Domain Explorer Dashboard

## PURPOSE
A Streamlit + Plotly dashboard that visualizes the "Discover page" and the reasoning layer Genie uses in the demo. It lets a student browse **domains** (commercial, uptake, healthcare), filter assets by **certification** and popularity, inspect **ontology snippets** with their confidence scores and linked people, and chart the Q3 injectable performance that reveals the Spain/Germany issues — all in one interactive view. It is the front end of the semantic layer that makes Genie's answers trustworthy.

## WHY THIS MATTERS
The video stresses that domains "organize data and AI assets around how your particular business is structured," and that certified assets deserve more trust than one-off analysis. It also shows Genie surfacing nine ontology snippets as the evidence behind an answer. A dashboard that renders domains, certification, and snippet confidence makes that invisible metadata visible — which is exactly what platform teams need to get business users to trust and reuse curated assets.

## HOW TO BUILD
1. `pip install -r requirements.txt`; run with `streamlit run starter/main.py`.
2. Build two deterministic DataFrames: `assets` (id, name, type, domain, certified, popularity) and `snippets` (id, domain, text, confidence, related_people).
3. Sidebar: multiselect domains, a certification filter, and a confidence slider that filters snippets.
4. Main area: a Plotly bar chart of Q3 injectable performance by market (highlighting Spain/Germany), plus a snippet table and an asset explorer with metric-view rows.
5. Add a per-asset detail expander so clicking a snippet shows the assets it relates to — mirroring "click to understand how it was created."

```python
sel_domains = st.sidebar.multiselect("Domains", options=domains, default=domains)
certified_only = st.sidebar.checkbox("Certified only", value=True)
view = assets[assets["domain"].isin(sel_domains)]
if certified_only:
    view = view[view["certified"]]
fig = px.bar(q3, x="market", y="units", color="product_form",
             title="Q3 injectable vs oral performance")
st.plotly_chart(fig, use_container_width=True)
```

## WHEN TO USE IN PRODUCTION
Use it as the human-facing catalog companion to a governed semantic layer — onboarding business users, reviewing certification coverage, and debugging why an assistant trusts one asset over another. Great for data-mesh and domain-oriented teams. Don't use it for high-frequency operational monitoring (Streamlit reruns the whole script), for write-heavy admin workflows, or as a substitute for the actual catalog API.

## HOW IT HELPS STUDENTS
They learn Streamlit state, Plotly charting, and how to expose data-quality and governance signals instead of only business metrics. Building the confidence-slider and certification filter teaches the difference between *showing data* and *earning trust in data*.

## STARTER CODE
`starter/main.py` is a runnable Streamlit + Plotly skeleton with deterministic sample data, sidebar filters, a Q3 performance chart, and `# TODO` markers for live catalog and snippet APIs.
