Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new Open511 polling source (plus bootstrap provider and example) to ingest Open511 road event feeds and emit Drasi graph changes for continuous queries.
Changes:
- Introduces
drasi-source-open511with hybrid incremental polling + periodic full sweeps, Open511 response models, and Open511→Drasi graph mapping. - Adds
drasi-bootstrap-open511to load an initial snapshot from Open511 endpoints. - Adds a runnable “getting started” example (Rust + helper scripts) and registers the new crates in the workspace.
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| examples/lib/open511-getting-started/test-updates.sh | Helper script to poll an endpoint and print observed changes. |
| examples/lib/open511-getting-started/setup.sh | Pre-flight script to validate Open511 endpoint connectivity. |
| examples/lib/open511-getting-started/quickstart.sh | Convenience runner (setup + cargo run). |
| examples/lib/open511-getting-started/main.rs | Runnable DrasiLib example wiring Open511 source + bootstrap + logging reaction. |
| examples/lib/open511-getting-started/diagnose.sh | Quick diagnostic script to fetch and summarize sample API data. |
| examples/lib/open511-getting-started/README.md | Example documentation and quickstart instructions. |
| examples/lib/open511-getting-started/Cargo.toml | Example crate manifest and dependencies. |
| components/sources/open511/tests/integration_test.rs | Ignored integration test with a local mock Open511 server and Drasi subscription assertions. |
| components/sources/open511/src/models.rs | Serde models for Open511 /events responses + basic unit tests. |
| components/sources/open511/src/mapping.rs | Mapping from Open511 events to Drasi nodes/relations and SourceChange sequences. |
| components/sources/open511/src/lib.rs | Open511 source implementation: state load/save, poll loop, dispatching, builder, and plugin export. |
| components/sources/open511/src/descriptor.rs | Plugin descriptor + config DTOs and OpenAPI schema generation. |
| components/sources/open511/src/config.rs | Source configuration types, defaults, and validation. |
| components/sources/open511/src/change_detection.rs | Incremental vs full-sweep change detection logic and tests. |
| components/sources/open511/src/api.rs | Reqwest-based Open511 client with pagination and query-parameter construction. |
| components/sources/open511/README.md | Source plugin documentation and usage guidance. |
| components/sources/open511/Makefile | Build/lint/test convenience targets for the source crate. |
| components/sources/open511/GRAPH_SCHEMA.md | Documented graph schema (labels/properties/relationships) emitted by the source. |
| components/sources/open511/Cargo.toml | Source crate manifest for drasi-source-open511. |
| components/bootstrappers/open511/src/lib.rs | Bootstrap provider implementation using the Open511 API client + mapping. |
| components/bootstrappers/open511/src/descriptor.rs | Bootstrap plugin descriptor + OpenAPI schema generation. |
| components/bootstrappers/open511/README.md | Bootstrap plugin documentation and builder example. |
| components/bootstrappers/open511/Makefile | Build/lint/test convenience targets for the bootstrap crate. |
| components/bootstrappers/open511/Cargo.toml | Bootstrap crate manifest for drasi-bootstrap-open511. |
| Cargo.toml | Registers the new Open511 source + bootstrap crates as workspace members. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Daniel Gerlag <daniel@gerlag.ca>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
drasi-source-open511
A Drasi source that continuously monitors Open511 road event
APIs and turns them into a live graph of road events, affected roads, and geographic areas.
Open511 is an open standard for sharing road event data adopted by transportation
agencies across North America. This source polls any compliant endpoint—DriveBC,
511 Alberta, Québec 511, and others—and emits graph changes as events are created,
updated, or cleared.
How It Works
The source uses a hybrid polling strategy:
(
updated=>timestamp), keeping API traffic minimal.incremental polling alone cannot observe.
See GRAPH_SCHEMA.md for the complete graph model reference.
Quick Start
Configuration
base_urlpoll_interval_secs60full_sweep_interval10request_timeout_secs15page_size500status_filterACTIVEseverity_filterMINOR,MODERATE,MAJOR)event_type_filterINCIDENT,CONSTRUCTION, etc.)area_id_filterroad_name_filterjurisdiction_filterbbox_filterxmin,ymin,xmax,ymaxinitial_cursor_behaviorStartFromBeginningInitial Cursor Behavior
StartFromBeginningStartFromNowStartFromTimestampKnown Open511 Endpoints
https://api.open511.gov.bc.cahttps://511.alberta.ca/apihttps://www.quebec511.info/apiExample Use Cases
1. Alert on highway closures
Notify a team channel whenever a highway is fully closed:
When a road's
statechanges toCLOSED, the query emits an insert.When the closure is lifted (state changes to
OPENor the event is archived),it emits a delete. Pair with a webhook reaction to push alerts to Slack or Teams.
2. Track major incidents in a geographic area
Monitor only major incidents in the Rocky Mountain District:
3. Construction activity dashboard
Feed a dashboard with active construction events and the roads they affect:
The continuous query keeps the dashboard in sync automatically—new construction
appears, updated schedules flow through, and completed work disappears.
4. Bounding-box geofence for a city
Monitor events within a geographic bounding box (e.g. greater Vancouver):
5. Cross-agency monitoring
Run multiple sources against different Open511 endpoints and query across them:
6. Event-to-area analysis
Query which geographic districts have the most active events:
As events are added or cleared in a district, the count updates reactively.
Graph Model
The source produces three node types and two relationship types:
RoadEventid,status,headline,severity,event_type,description,created,updatedRoadname,from,to,direction,state,delayAreaid,nameAFFECTS_ROAD(RoadEvent)→(Road)event_idIN_AREA(RoadEvent)→(Area)For the full property reference, see GRAPH_SCHEMA.md.
Limitations
Minimum practical poll interval is ~30 seconds to avoid rate limiting.
polls are only detected during the next full sweep cycle.
bootstrap loads whatever the API returns at startup time.
Areanodes may be re-emitted as inserts (harmless but redundant).Testing
Related