Convert IFC building models to a Linked Building Data graph in Neo4j — no RDF, no Turtle files.
Project description
ifctoneo4j
Convert IFC building models to a Linked Building Data graph in Neo4j — no RDF, no Turtle files.
Install
pip install ifctoneo4j
Note:
ifcopenshellmust be installed separately — it is not on PyPI. Download it from ifcopenshell.org or install via conda:conda install -c conda-forge ifcopenshell
For bounding box geometry and interface detection, also install:
pip install ifctoneo4j[geometry]
Python API
Basic usage
import ifctoneo4j
# Step 1 — parse the IFC file (no database needed)
result = ifctoneo4j.parse("model.ifc")
print(result)
# ParseResult(nodes=187, rels=186, elements=93)
# Step 2 — write to Neo4j
ifctoneo4j.write(
result,
neo4j_uri="bolt://localhost:7687",
neo4j_user="neo4j",
neo4j_password="secret",
)
parse() options
result = ifctoneo4j.parse(
"model.ifc",
properties_level=1, # 1 = flat props on nodes (default)
# 2 = separate OPM PropertyNode per value
# 3 = OPM + versioned StateNode with timestamp
include_units=False, # attach QUDT unit URIs to numeric properties
base_uri="https://linkedbuildingdata.org/building#", # URI prefix
)
write() options
ifctoneo4j.write(
result,
neo4j_uri="bolt://localhost:7687",
neo4j_user="neo4j",
neo4j_password="secret",
database="neo4j", # target database name (important for AuraDB)
clear_db=False, # set True to wipe the database before importing
batch_size=500, # rows per Neo4j transaction
)
# returns {"nodes": 187, "rels": 186, "prop_nodes": 0}
AuraDB (cloud)
ifctoneo4j.write(
result,
neo4j_uri="neo4j+s://xxxxxxxx.databases.neo4j.io",
neo4j_user="your-username",
neo4j_password="your-password",
database="your-database-name",
clear_db=True,
)
CLI
ifctoneo4j model.ifc \
--neo4j-uri bolt://localhost:7687 \
--neo4j-user neo4j \
--neo4j-password secret
Common flags
| Flag | Description |
|---|---|
--database |
Target database name (default: neo4j) |
--clear-db |
Delete all data before importing |
--properties-level 2 |
OPM property nodes instead of flat props |
--units |
Attach QUDT unit URIs to numeric properties |
--geometry |
Compute bounding boxes |
--interfaces |
Detect element interfaces (requires --geometry) |
--geolocation |
Extract site lat/lon as WKT POINT |
--batch-size 1000 |
Rows per transaction (default: 500) |
--no-elements |
Spatial hierarchy only, skip elements |
-v |
Verbose / debug logging |
# Full example with geometry and AuraDB
ifctoneo4j model.ifc \
--neo4j-uri neo4j+s://xxxxxxxx.databases.neo4j.io \
--neo4j-user myuser --neo4j-password mypassword \
--database mydb \
--clear-db --geometry --geolocation
What gets created in Neo4j
The graph follows the BOT spatial hierarchy:
Site -[HAS_BUILDING]-> Building -[HAS_STOREY]-> Storey -[HAS_SPACE]-> Space
Storey/Space -[CONTAINS_ELEMENT]-> Element
Wall -[HAS_SUB_ELEMENT]-> Door/Window
Element nodes get multi-label classification — a solid wall becomes :Element:Wall:Wall_SOLIDWALL, an axial fan becomes :Element:Fan:Fan_AXIAL.
Properties from IFC property sets are stored as camelCase_property_simple on each node:
MATCH (w:Wall)
WHERE w.isExternal_property_simple = true
RETURN w.name, w.globalId
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ifctoneo4j-0.1.0.tar.gz.
File metadata
- Download URL: ifctoneo4j-0.1.0.tar.gz
- Upload date:
- Size: 57.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de6c40e2261a8db76e5f85908d4eff1d5f5aa58c5d1a10c03e6a56e0ec6a206a
|
|
| MD5 |
7806564c96b0e99bf2077069d8326c2f
|
|
| BLAKE2b-256 |
11bb6e5dd6de53f1829c1d38bda80a076a0ed0f1eef32e761144ef504f1d419f
|
Provenance
The following attestation bundles were made for ifctoneo4j-0.1.0.tar.gz:
Publisher:
publish.yml on alfarseniko/ifctoneo4j
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ifctoneo4j-0.1.0.tar.gz -
Subject digest:
de6c40e2261a8db76e5f85908d4eff1d5f5aa58c5d1a10c03e6a56e0ec6a206a - Sigstore transparency entry: 1180482316
- Sigstore integration time:
-
Permalink:
alfarseniko/ifctoneo4j@2b063b8edb1c80120da96e7e9a5227ac158833ca -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/alfarseniko
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2b063b8edb1c80120da96e7e9a5227ac158833ca -
Trigger Event:
release
-
Statement type:
File details
Details for the file ifctoneo4j-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ifctoneo4j-0.1.0-py3-none-any.whl
- Upload date:
- Size: 63.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17e6a3c211049145c0f1f2d3fc5c2cf5fa1d3bafecbec1a1a4d59e0fcce58547
|
|
| MD5 |
74a06472e297049aa903d42d10a4e396
|
|
| BLAKE2b-256 |
3b5670e01337f7952b32185756be64569632ba847683cf51176a7612988a955b
|
Provenance
The following attestation bundles were made for ifctoneo4j-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on alfarseniko/ifctoneo4j
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ifctoneo4j-0.1.0-py3-none-any.whl -
Subject digest:
17e6a3c211049145c0f1f2d3fc5c2cf5fa1d3bafecbec1a1a4d59e0fcce58547 - Sigstore transparency entry: 1180482337
- Sigstore integration time:
-
Permalink:
alfarseniko/ifctoneo4j@2b063b8edb1c80120da96e7e9a5227ac158833ca -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/alfarseniko
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2b063b8edb1c80120da96e7e9a5227ac158833ca -
Trigger Event:
release
-
Statement type: