OpenGov summary: Difference between revisions

83 bytes removed ,  Wednesday at 22:50
Line 20: Line 20:
A knowledge graph is like a smart map of information:
A knowledge graph is like a smart map of information:


- Nodes = things (entities), e.g., "FEMA", "Disaster Assistance Program", "Stafford Act".
* Nodes = things (entities), e.g., "FEMA", "Disaster Assistance Program", "Stafford Act".


- Edges = relationships between them, e.g., "FEMA sponsors → Disaster Assistance Program", "Disaster Assistance Program is authorized by → Stafford Act", "Stafford Act funds flow to → multiple agencies".
* Edges = relationships between them, e.g., "FEMA sponsors → Disaster Assistance Program", "Disaster Assistance Program is authorized by → Stafford Act", "Stafford Act funds flow to → multiple agencies".


- The power comes from being able to ask questions across connections, like "Show me all programs authorized by laws passed after 2010 that FEMA sponsors and that have >$100M funding."
* The power comes from being able to ask questions across connections, like "Show me all programs authorized by laws passed after 2010 that FEMA sponsors and that have >$100M funding."


Traditional databases or spreadsheets can store facts, but knowledge graphs excel at revealing connections and enabling complex, relationship-based searches.
Traditional databases or spreadsheets can store facts, but knowledge graphs excel at revealing connections and enabling complex, relationship-based searches.
Line 30: Line 30:
2. How MediaWiki + Cargo Creates This
2. How MediaWiki + Cargo Creates This


- MediaWiki handles the "Wikipedia-like" part:
* MediaWiki handles the "Wikipedia-like" part:


  - Each federal entity gets its own page (e.g., a page called "Federal Emergency Management Agency" or "Wildfire Mitigation Grant Program").
**Each federal entity gets its own page (e.g., a page called "Federal Emergency Management Agency" or "Wildfire Mitigation Grant Program").


  - Pages have readable narrative text, history, discussion tabs, and look official with a USWDS (U.S. Web Design System) skin.
**Pages have readable narrative text, history, discussion tabs, and look official with a USWDS (U.S. Web Design System) skin.


  - This makes it citizen-friendly — people read summaries, see context, and get directed to official .gov links.
**This makes it citizen-friendly — people read summaries, see context, and get directed to official .gov links.


- Cargo turns those pages into structured, graph-like data:
* Cargo turns those pages into structured, graph-like data:


  - Templates act like fill-in-the-blank forms. For example, a "Federal Program" template might have fields like:
**Templates act like fill-in-the-blank forms. For example, a "Federal Program" template might have fields like:


    - Program Name
***Program Name


    - Sponsoring Agency (links to the Agency page)
***Sponsoring Agency (links to the Agency page)


    - Authorizing Legislation (links to the Statute page)
***Authorizing Legislation (links to the Statute page)


    - Annual Funding Amount
***Annual Funding Amount


    - Eligibility Summary
***Eligibility Summary


    - Primary Official URL (always points back to the real .gov site)
***Primary Official URL (always points back to the real .gov site)


    - Status (Active / Proposed / Expired)
***Status (Active / Proposed / Expired)


  - When someone (or the AI pipeline) fills in the template on a page, Cargo automatically stores the answers in database tables — one table per template type.
**When someone (or the AI pipeline) fills in the template on a page, Cargo automatically stores the answers in database tables — one table per template type.


    - Example: All "Federal Program" templates feed into a single "Programs" table in the background, with columns matching the fields.
***Example: All "Federal Program" templates feed into a single "Programs" table in the background, with columns matching the fields.


  This is where the knowledge graph emerges:
  This is where the knowledge graph emerges:


  - Because fields can link to other pages (e.g., "Sponsoring Agency" contains a link to the "FEMA" page), Cargo knows relationships exist.
**Because fields can link to other pages (e.g., "Sponsoring Agency" contains a link to the "FEMA" page), Cargo knows relationships exist.


  - The system doesn't need fancy triple-store tech (like RDF/OWL in heavier graphs); it uses simple relational tables but supports joins, list fields, and hierarchy traversal to mimic graph behavior.
**The system doesn't need fancy triple-store tech (like RDF/OWL in heavier graphs); it uses simple relational tables but supports joins, list fields, and hierarchy traversal to mimic graph behavior.


3. Querying the Graph — The Real Power
3. Querying the Graph — The Real Power
Line 72: Line 72:
Examples in OpenGov Encyclopedia context:
Examples in OpenGov Encyclopedia context:


- Simple lookup: "List all active programs sponsored by NOAA with funding >$50 million."
* Simple lookup: "List all active programs sponsored by NOAA with funding >$50 million."


  - Cargo scans the "Programs" table, filters on Sponsor = "NOAA", Funding > 50M, Status = "Active".
**Cargo scans the "Programs" table, filters on Sponsor = "NOAA", Funding > 50M, Status = "Active".


- Relationship traversal (graph-like):
* Relationship traversal (graph-like):


  - "Show every program authorized by legislation containing '42 U.S.C.' that is sponsored by an agency in the Department of the Interior."
**"Show every program authorized by legislation containing '42 U.S.C.' that is sponsored by an agency in the Department of the Interior."


    - Joins the Programs table to Agencies table (via Sponsor field) and checks the Authorizing Legislation field.
***Joins the Programs table to Agencies table (via Sponsor field) and checks the Authorizing Legislation field.


- Cross-entity discovery:
* Cross-entity discovery:


  - "Find all disaster-related programs connected to FEMA, including their authorizing laws and related agencies."
**"Find all disaster-related programs connected to FEMA, including their authorizing laws and related agencies."


    - Uses joins and list fields (e.g., if a program has multiple linked agencies or statutes).
***Uses joins and list fields (e.g., if a program has multiple linked agencies or statutes).


- Dynamic pages:
* Dynamic pages:


  - A task-oriented page like "Prepare for Wildland Fire" can embed live query results: a table of relevant programs, pulled fresh from Cargo data, with links back to official sites.
**A task-oriented page like "Prepare for Wildland Fire" can embed live query results: a table of relevant programs, pulled fresh from Cargo data, with links back to official sites.


Queries can output as:
Queries can output as:


- Tables/lists on wiki pages
* Tables/lists on wiki pages


- Maps (if coordinates are stored)
* Maps (if coordinates are stored)


- JSON/CSV exports (for feeding agency LLMs or dashboards)
* JSON/CSV exports (for feeding agency LLMs or dashboards)


- Inline dynamic content (updates whenever source data changes)
* Inline dynamic content (updates whenever source data changes)


4. Why This Counts as a Knowledge Graph (Even If Lightweight)
4. Why This Counts as a Knowledge Graph (Even If Lightweight)


- It has entities (pages/nodes) and typed relationships (via template fields and links).
* It has entities (pages/nodes) and typed relationships (via template fields and links).


- You can traverse connections using joins, HOLDS (for lists), WITHIN (for hierarchies), etc.
* You can traverse connections using joins, HOLDS (for lists), WITHIN (for hierarchies), etc.


- It's queryable at scale — supports parametric searches agencies need for AI (e.g., "programs related to arid land agriculture with >$50M funding").
* It's queryable at scale — supports parametric searches agencies need for AI (e.g., "programs related to arid land agriculture with >$50M funding").


- Data stays fresh and attested — tied to official .gov sources via the AI pipeline, with confidence scores and always-link-back banners.
* Data stays fresh and attested — tied to official .gov sources via the AI pipeline, with confidence scores and always-link-back banners.


- Unlike heavier graphs (e.g., Neo4j or RDF stores used in some federal pilots), it's simple, open-source, low-maintenance, and integrated with readable wiki pages.
* Unlike heavier graphs (e.g., Neo4j or RDF stores used in some federal pilots), it's simple, open-source, low-maintenance, and integrated with readable wiki pages.


In short: OpenGov Encyclopedia combines Wikipedia-style readability with database-like structure. Humans get helpful narrative pages that point to official sources; machines/AI get a clean, connected, verifiable graph of federal entities and relationships — all without duplicating agency content.
In short: OpenGov Encyclopedia combines Wikipedia-style readability with database-like structure. Humans get helpful narrative pages that point to official sources; machines/AI get a clean, connected, verifiable graph of federal entities and relationships — all without duplicating agency content.