Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
220 changes: 220 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[codz]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py.cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# UV
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.

# Data files in data/ directory
data/**/*.ifc
data/**/*.ttl

data/intermediate/*.jsonl
data/intermediate/*.json
data/intermediate/*.csv
data/Out/*.jsonl
data/Out/*.json
data/Out/*.csv

#uv.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock
#poetry.toml

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
#pdm.lock
#pdm.toml
.pdm-python
.pdm-build/

# pixi
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
#pixi.lock
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
# in the .venv directory. It is recommended not to include this directory in version control.
.pixi

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.envrc
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# Abstra
# Abstra is an AI-powered process automation framework.
# Ignore directories containing user credentials, local state, and settings.
# Learn more at https://abstra.io/docs
.abstra/

# Visual Studio Code
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
# and can be added to the global gitignore or merged into this file. However, if you prefer,
# you could uncomment the following to ignore the entire vscode folder
# .vscode/

# Ruff stuff:
.ruff_cache/

# PyPI configuration file
.pypirc

# Cursor
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
# refer to https://docs.cursor.com/context/ignore-files
.cursorignore
.cursorindexingignore

# Marimo
marimo/_static/
marimo/_lsp/
__marimo__/

83 changes: 81 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,81 @@
# IFC2RDF
Converter from IFC to RDF.
# Converter from IFC to RDF(This project is under development.)
## Transforming IFC for Smart Building Platforms

## Project overview
This repository presents a Converter from IFC to RDF developed and applied as a case study within the SMART Building Data to OpenBIM Interoperability Project.

## Purpose
This project aims to fundamentally enhance interoperability between smart building operations and IFC-based building information models by developing and releasing an IFC to RDF conversion program. We position this as a preliminary prototype that contributes to standard‑development efforts in semantic integration for the foundational frameworks of future smart buildings.

## Scope of the case study
The scope of this case study is as follows.

- Provision of a converter program to transform IFC based architectural models into RDF representations.

- Experimental alignment of IFC based concepts and Brick Schema concepts via **BDNS tags**.
In this context , BDNS functions as a semantic tagging layer that supports interoperability between IFC and Brick.
This repository provides alignment definitions between BDNS tags and the Brick Schema.

## Input and output

### Input

The current implementation takes IFC STEP files with instance data as input, specifically `.ifc` files.

At present, the converter has been applied and tested with IFC 2x3 models.
Although only IFC 2x3 is explicitly tested at this stage, the overall approach is intended to be extensible to IFC4 and later versions in future development.


#### BDNS Tag Syntax and Storage in IFC

##### 1. Identification Strategy in IFC Models
In accordance with the BDNS specification, each device or asset within an `.ifc` file must be assigned two distinct identifiers:

* **Device/Asset Instance GUID (`asset.guid`)**: A machine-readable, 128-bit auto-generated number. For IFC workflows, this is represented by the 22-character IFC base-64 encoding (the `GlobalId` attribute).
* **Device/Asset Role Name (`asset.name`)**: A human-generated, human-readable identifier that remains fixed for a specific function even if the hardware instance is replaced.

##### 2. BDNS Tag Syntax (asset.name)
The "BDNS Tag" refers to the **Device/Asset Role Name**. To ensure consistency and avoid ambiguity in digital building systems, the following syntax rules must be strictly followed:

**Format:** `X-Y` or `XZ-Y`

* **`X` (Type Abbreviation)**: A 2 to 6 character uppercase alphabetical sequence. This abbreviation must be taken from the official *Building Device and Asset Abbreviation Registry*.
* **`Y` (Building Unique Incremental Number)**: A variable-length integer that is unique to the building.
* **`-` (Separator)**: A hyphen must be used to separate the type abbreviation and the incremental number.
* **`Z` (Optional Asset Type Number)**: Used only if an `asset.type` definition is required.

##### 3. Strict Restrictions and Validation
When implementing or converting to BDNS tags, the following restrictions are mandatory:

* **No Leading Zeros**: In the incremental numbers (`Y` and `Z`), **leading zeros are strictly prohibited** to avoid ambiguity (e.g., `DSSO-1` is valid, while `DSSO-00001` is invalid).
* **Case Sensitivity**: Only **uppercase** alphabetic characters and numeric characters are allowed.
* **Instance vs. Role Separation**: Data that includes machine-specific sequences or zero-padded serial numbers (like `DSSO-00001`) should be interpreted as **Instance Identifiers** rather than **BDNS Tags (Role Names)**. Proper BDNS tags must be explicitly defined using the semantic vocabulary of the Abbreviation Registry.

##### 4. Physical Labeling and Suffixes (Optional)
While the `asset.name` stored in the IFC data must strictly follow the syntax above, physical labels may optionally include a **suffix** (e.g., `asset.name_text`) to capture existing legacy tagging information or specific properties like floor levels. However, this suffix is not part of the core `asset.name` syntax used for digital identification.


### Output

The output is generated as RDF data serialized in Turtle format `.ttl`.

## How to use
To execute the converter, run the main script as follows.

```bash
python run.py
```

As part of the refactoring process, the execution flow is being simplified to rely on a single main run script together with a limited set of essential preprocessing modules.

## Project status
This project is under active development.

The initial implementation was organized around a highly individual development workflow, and the repository is currently being refactored and reorganized to improve clarity, reusability, and suitability for public release.

## License and acknowledgements
This work has been developed within the context of the SMART Building Data to OpenBIM Interoperability Project.

## Repository Structure

## Directory Descriptions
85 changes: 85 additions & 0 deletions data/resources/BDNS mapping partial.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
bdns_abbriviation,bdns_tag,raw_ifc_class,brick_class_candidate
AAV,valve - air admittance valve,IfcFlowController,brick:Valve
ACCH,chiller - air cooled chiller,IfcEnergyConversionDevice,brick:Air_Cooled_Chiller
AHU,air handling unit - air handling unit,IfcEnergyConversionDevice,brick:Air_Handling_Unit
ATS,electric distribution - automatic transfer switch,IfcFlowController,brick:Automatic_Transfer_Switch
BB,electric distribution - busbar,IfcFlowSegment,brick:Electrical_Equipment
BCBOX,dx system - branch controller/selector box,IfcEnergyConversionDevice,brick:HVAC_Equipment
BGU,fire detection - break glass unit,IfcDistributionControlElement,brick:Manual_Fire_Alarm_Activation_Equipment
BLR,burner - boiler,IfcEnergyConversionDevice,brick:Boiler
BMS,system - control,IfcDistributionElement,brick:System
BTK,tank - break tank,IfcFlowStorageDevice,brick:Tank
BTKBS,tank - break tank and booster set,IfcFlowStorageDevice,brick:Tank
BUFF,tank - buffer vessel - generic,IfcFlowStorageDevice,brick:Tank
CALAD,cable management - cable ladder,IfcFlowSegment,brick:Electrical_System
CAM,camera,IfcFlowTerminal,brick:Camera
CATR,cable management - cable tray,IfcFlowSegment,brick:Electrical_System
CDU,condensing unit,IfcEnergyConversionDevice,brick:Condensing_Unit
CKV,valve - check valve,IfcFlowController,brick:Check_Valve
CP,pump - circulating pump,IfcFlowMovingDevice,brick:Circulator_Pump
CTRP,panel - control panel,IfcDistributionElement,brick:ICT_Equipment
CUSF,outlet - connection unit switched fused,IfcFlowTerminal,brick:Electrical_Equipment
CUUF,outlet - connection unit unswitched fused,IfcFlowTerminal,brick:Electrical_Equipment
DATA,outlet - data wall outlet,IfcFlowTerminal,brick:ICT_Equipment
DB,electric distribution - distribution panel / board,IfcDistributionElement,brick:Electrical_Equipment
DG,generator - diesel electricity generator,IfcEnergyConversionDevice,brick:Electrical_Equipment
DL,lighting - fixture - downlight,IfcFlowTerminal,brick:Luminaire
DPOT,water treatment - dosing pot,IfcFlowStorageDevice,brick:HVAC_Equipment
DR,door,IfcDoor,rec:Door
DRC,controller - door controller,IfcDistributionControlElement,brick:Access_Control_Equipment
DSSO,outlet - double switched socket outlet,IfcFlowTerminal,brick:Electrical_Equipment
DUW,distribution ventilation - ductwork,IfcFlowSegment,brick:HVAC_System
DWBP,pump - potable/domestic water booster pump,IfcFlowMovingDevice,brick:Booster_Pump
DWCPC,emergency assistance - disabled wc pull cord,IfcDistributionControlElement,brick:Safety_System
DWST,tank - potable/domestic water storage tank,IfcFlowStorageDevice,brick:Water_Storage_Tank
EISO,electric protective device - electrical isolator (disconnector),IfcFlowController,brick:Disconnect_Switch
EL,lighting - fixture - standalone emergency light,IfcFlowTerminal,brick:Lighting
EM,meter - electric meter,IfcFlowController,brick:Electrical_Meter
EMWC,water treatment - electro magnetic water conditioner,IfcFlowTreatmentDevice,brick:HVAC_Equipment
ERAD,heat emitter - radiator electric,IfcEnergyConversionDevice,brick:Radiator
ET,tank - expansion tank,IfcFlowStorageDevice,brick:Thermal_Expansion_Tank
EVCO,emergency voice communication - outstation,IfcFlowTerminal,brick:Emergency_Phone
EXIT,lighting - fixture - illuminated exit sign,IfcFlowTerminal,brick:Lighting
FACP,panel - fire alarm control panel,IfcElectricDistributionPoint,brick:Fire_Alarm_Control_Panel
FAN,fan,IfcFlowMovingDevice,brick:Fan
FAS,fire detection - alarm annunciator sounder or beacon,IfcDistributionControlElement,brick:Fire_Alarm
FCU,fan coil unit,IfcEnergyConversionDevice,brick:Fan_Coil_Unit
FD,damper - fire damper,IfcFlowController,brick:Damper
FLRDX,outlet - floor duplex outlet,IfcDiscreteAccessory,brick:Electrical_Equipment
FOST,tank - fuel oil storage tank,IfcFlowStorageDevice,brick:Storage_Tank
GWH,water heater - gas water heater,IfcEnergyConversionDevice,brick:Water_Heater
HRU,air handling unit - heat recovery unit,IfcEnergyConversionDevice,brick:Heat_Exchanger
HS,horn strobe,IfcDistributionControlElement,brick:Fire_Safety_Equipment
HX,heat exchanger,IfcEnergyConversionDevice,brick:Heat_Exchanger
IFU,fire detection - input output interface unit,IfcDistributionControlElement,brick:ICT_Equipment
LCM,lighting - control - module,IfcDistributionControlElement,brick:ICT_Equipment
LCP,lighting - control - panel,IfcDistributionControlElement,brick:Interface
LL,lighting - fixture - linear,IfcFlowTerminal,brick:Luminaire
LSW,lighting - control - switch,IfcFlowController,brick:Switch
LVSB,electric distribution - low voltage switchboard,IfcDistributionElement,brick:Electrical_Equipment
MEV,fan - mechanical extract ventilation,IfcFlowMovingDevice,brick:Exhaust_Fan
MFSD,damper - motorised fire smoke damper,IfcFlowController,brick:Damper
MOS,sensor - motion sensor,IfcDistributionControlElement,brick:Motion_Sensor
PL,lighting - fixture - pendant,IfcFlowTerminal,brick:Luminaire
PROXR,access control - proximity reader - generic,IfcDistributionControlElement,brick:Access_Reader
PRV,valve - pressure reducing valve,IfcFlowController,brick:Pressure_Reducing_Valve
PW,distribution piped services - pipework,IfcFlowSegment,brick:HVAC_System
RRFLT,filter - water - reverse rinsing filter,IfcFlowTreatmentDevice,brick:Filter
RTE,access control - door release button,IfcFlowController,brick:Access_Control_Equipment
RTISD,damper - return isolation damper,IfcFlowController,brick:Isolation_Damper
SD,fire detection - smoke detector,IfcDistributionControlElement,brick:Smoke_Detector
SEF,fan - smoke exhaust fan,IfcFlowMovingDevice,brick:Fan
SF,fan - supply fan,IfcFlowMovingDevice,brick:Supply_Fan
SG,air terminal - grille - supply,IfcFlowTerminal,brick:Terminal_Unit
SL,lighting - fixture - spot light,IfcFlowTerminal,brick:Luminaire
SLCR,duct silencer - attenuator,IfcFlowTreatmentDevice,brick:HVAC_Equipment
SRV,ict equipment - multi-purpose server,IfcFurnishingElement,brick:Server
TXMR,transformer,IfcEnergyConversionDevice,brick:Transformer
UVDU,uv disinfection unit,IfcFlowTreatmentDevice,brick:Equipment
VAV,air terminal box - variable air volume box,IfcFlowController,brick:Variable_Air_Volume_Box
VAVS,air terminal box - variable air volume box - supply,IfcFlowController,brick:Variable_Air_Volume_Box
VCD,damper - volume control damper,IfcFlowController,brick:Damper
VLV,valve,IfcFlowController,brick:Valve
WL,lighting - fixture - wall light,IfcFlowTerminal,brick:Luminaire
WM,meter - water meter,IfcFlowController,brick:Water_Meter
WSTT,waste terminal,IfcFlowFitting,brick:Equipment
Loading