Skip to content

Add Brick → bSDD dictionary export - #797

Open
gtfierro wants to merge 5 commits into
masterfrom
gtf-bsdd-export
Open

Add Brick → bSDD dictionary export#797
gtfierro wants to merge 5 commits into
masterfrom
gtf-bsdd-export

Conversation

@gtfierro

@gtfierro gtfierro commented Aug 11, 2026

Copy link
Copy Markdown
Member

Adds an offline export of Brick as a buildingSMART Data Dictionary import document.

The exporter reads the built Brick+imports.ttl and writes one generated JSON
dictionary. The output is never hand-edited.

make Brick.ttl
uv run python tools/bsdd/generate_bsdd.py
uv run pytest tests/test_bsdd_export.py

The default Brick build is unchanged; make bsdd remains a separate target and
the generated bsdd/ directory is ignored.

Mapping scope

  • Brick classes become bSDD Classes. Labels and definitions come from the
    built graph. bSDD permits one ParentClassCode; the most-specific Brick
    parent is used in the tree and additional parents are emitted as IsChildOf
    relations.
  • Quantity kinds become numeric bSDD Properties, with units and dimensions
    derived from QUDT and translated through the checked-in bSDD unit map. Brick
    quantities that explicitly reference a QUDT quantity kind use that quantity
    kind as their canonical property.
  • EntityProperties become entityProperty<Code> Properties, keeping them
    distinct from physical quantity kinds. For example, brick:volume maps to
    entityPropertyVolume, while the physical quantity is Volume.
  • Structured EntityProperties become bSDD Complex Properties whose scalar
    children use parent.field codes, such as
    entityPropertyCoordinates.latitude.
  • ClassProperties are emitted from brick:hasQuantity,
    brick:hasSubstance, and EntityProperty SHACL attachments.
  • IFC mappings come directly from tools/bsdd/mappings/ifc.csv. Each row
    maps one exact Brick class code to RelatedIfcEntityNamesList; mappings do
    not inherit through the class hierarchy.

Deliberate boundaries

  • Only live, Brick-owned classes are published. Imported vocabularies,
    including RealEstateCore location classes, are not republished under Brick
    URIs.
  • The export has no network dependency. mappings/units.csv and ifc.csv are
    checked-in, reviewed inputs.
  • The exporter does not map general Brick relationships such as feeds,
    hasPoint, or controls, because they do not have an equivalent bSDD class
    relation.
  • Brick substances are emitted as allowed values of an observation property;
    they are not bSDD materials.

The dictionary is emitted with Status: Preview. Publishing and activation are
deliberate manual steps outside this PR.

Generates the buildingSMART Data Dictionary import file from the built
ontology. bSDD only accepts a dictionary as a single JSON document, so the
whole thing is derived on every run rather than hand-edited.

- tools/bsdd/generate_bsdd.py: reads Brick+imports.ttl (not Brick.ttl, which
  has no live location classes) and emits bsdd/brick-bsdd.json plus a report
  of everything dropped, merged or left incomplete
- tools/bsdd/fetch_ifc_dictionary.py and mappings/: IFC entity and unit
  correspondences, refreshable from the bSDD API
- make bsdd target, kept out of the default build since it is only needed
  when publishing
- tests/test_bsdd_export.py: validates the generated dictionary
bSDD's UseOwnUri requires every owned URI to begin with the dictionary's own
DictionaryUri, so the imported REC location classes could only be published
under brickschema.org identifiers with their w3id.org/rec IRIs demoted to a
HasReference relation. That is republishing another vocabulary's content under
Brick's name, which the bSDD guidelines warn against, and it is RealEstateCore's
to publish rather than Brick's.

The dictionary is now 1,274 classes, all in the Brick namespace, and carries no
buildings, levels, rooms, spaces or zones. The seven Brick classes that subclass
rec:Collection -- System, Loop, PV_Array, Point_Collection, Automation_Collection
and the two EV charging hubs -- are still exported, but as roots with no
ParentClassCode; the report lists them in a new section. Drops the six ifc.csv
rows that mapped location terms.

test_only_brick_terms_are_published keeps foreign URIs and relations out.
@github-actions

Copy link
Copy Markdown

The latest build of the Brick ontology on this PR is available here.

@github-actions

Copy link
Copy Markdown

The latest build of the Brick ontology on this PR is available here.

@gtfierro

Copy link
Copy Markdown
Member Author

brick-bsdd.json

Here is the current JSON export

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