Skip to content

DBO-1 feat(demo): add DBO-in-BMS reference impl - #1735

Open
ekodikara wants to merge 2 commits into
google:masterfrom
ekodikara:feature/DBO-1-demo-implementation
Open

DBO-1 feat(demo): add DBO-in-BMS reference impl#1735
ekodikara wants to merge 2 commits into
google:masterfrom
ekodikara:feature/DBO-1-demo-implementation

Conversation

@ekodikara

Copy link
Copy Markdown

Adds _demo_implementation/, a runnable example of the code a building management system needs around the Digital Buildings Ontology: creating a device, mapping its points, and placing it in the building.

Six things it demonstrates:

  1. Point mappings keep the native BMS point and its DBO meaning on the same row. Neither replaces the other.
  2. The ontology is version-pinned by content digest, so a build is reproducible and CI reports when the vocabulary moves.
  3. Entity types are inferred and ranked from a device's mapped point set instead of picked from a dropdown of 40 variants.
  4. MISSING is a first-class state with a required justification, which is what DBO expects when a device cannot supply a required field.
  5. Location is a CONTAINS edge in the same table as FEEDS and HAS_PART, not a column on the device.
  6. Four CI gates, ending with the upstream instance validator.

Verified: 92 unit tests pass, and the generated building config passes tools/validators/instance_validator with "All entities validated SUCCESSFULLY" (one expected warning for the intentional MISSING field).

Building the sample site against the real validator surfaced three rules that are not stated in the ontology YAML - FACILITIES code patterns, zone entities needing links or a translation, and justification for MISSING. All three are handled in code and written up in the README.

This directory is a reference only. It is not wired into the ontology or the upstream tooling, and nothing outside _demo_implementation/ changes.

Adds _demo_implementation/, a runnable example of the code a building
management system needs around the Digital Buildings Ontology: creating a
device, mapping its points, and placing it in the building.

Six things it demonstrates:

  1. Point mappings keep the native BMS point and its DBO meaning on the
     same row. Neither replaces the other.
  2. The ontology is version-pinned by content digest, so a build is
     reproducible and CI reports when the vocabulary moves.
  3. Entity types are inferred and ranked from a device's mapped point
     set instead of picked from a dropdown of 40 variants.
  4. MISSING is a first-class state with a required justification, which
     is what DBO expects when a device cannot supply a required field.
  5. Location is a CONTAINS edge in the same table as FEEDS and HAS_PART,
     not a column on the device.
  6. Four CI gates, ending with the upstream instance validator.

Verified: 92 unit tests pass, and the generated building config passes
tools/validators/instance_validator with "All entities validated
SUCCESSFULLY" (one expected warning for the intentional MISSING field).

Building the sample site against the real validator surfaced three rules
that are not stated in the ontology YAML - FACILITIES code patterns, zone
entities needing links or a translation, and justification for MISSING.
All three are handled in code and written up in the README.

This directory is a reference only. It is not wired into the ontology or
the upstream tooling, and nothing outside _demo_implementation/ changes.
@google-cla

google-cla Bot commented Aug 27, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

The README had drifted from the code while the dashboard was being
added. Three things were wrong or missing:

  - It quoted two different test counts in two places, one of them two
    rounds of work out of date.
  - The Makefile had a shortcut for every command except serve, even
    though the README implied all of them were covered.
  - __init__.py never exported the dashboard, so "from bms_dbo import
    serve" failed despite the package docstring advertising a small,
    importable public surface.

Rather than just correcting the text, this adds tests/test_package.py so
the same drift fails the build next time: every name in __all__ must
exist, every CLI command and make target the README mentions must be
real, and the test counts it quotes must agree with each other. The last
one was checked by hand against a deliberately broken README to confirm
it fails when it should.

299 tests pass and the exported config still clears the upstream
instance validator.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant