a different CSV to Brick tool (this one for simple spaces)

72 views
Skip to first unread message

Erik Paulson

unread,
Oct 2, 2020, 4:29:09 PM10/2/20
to Brick User Forum (Unified Building Metadata Schema)
In the BMS->Brick thread, Gabe has been building out a 'BrickBuilder' tool to create a Brick model from a CSV. Not to try to confuse everyone, but I whipped up a different simple tool to create a Brick model from a CSV, but this one is more focused on a simple CSV format for nested entities, like you'd find in modeling spaces.


I'm interested in getting some feedback, especially around the format of the CSV. My goal is to keep it very simple so people who might not know anything about Brick or RDF could edit the spreadsheet and give back data that could be imported easily. If the tool is useful, it can go into the brickschema github org and turned into a real tool.

The details:

Consider this CSV:

brick:Building,brick:Floor,brick:Lighting_Zone,brick:Room,,brick:isFedBy,,brick:Area

ex:B1,ex:F1,,ex:101,,ex:VAV1,,200

,,,ex:102,,ex:VAV1,,

,ex:F2,,ex:201,,ex:VAV3,,400

,,,ex:202,,,,

,,ex:L1,ex:204,,,,

,,,ex:205,,,,900

,ex:F3,,ex:303,,,,

,,,ex:304,,ex:VAV4,


(This is easier to follow/visualize on the git repo README)
The header row is used for the RDF types. Entities are nested under objects to the left of them, and if there's nothing to the left of them, they're nested under the row above them. (The 'nesting' means brick:hasPart)

The blank column in the header row splits the CSV into sections - the second section is a set of additional relationships that apply to the last entity in the row, e.g. room 101 isFedBy VAV1. (That only applies to the last entity, Floor 1 is not fed by VAV1)

The other blank column in the header row splits off a 3rd section where instead of relationships to other entities, literals are applied - so Room101 has area "200"

The output of the tool on the CSV above is

@prefix brick: <https://brickschema.org/schema/1.1/Brick#> .

@prefix ex: <http://example.com/building#> .


ex:B1 a brick:Building ;

    brick:hasPart ex:F1,

        ex:F2,

        ex:F3 .


ex:101 a brick:Room ;

    brick:Area "200" ;

    brick:isFedBy ex:VAV1 .


ex:102 a brick:Room ;

    brick:isFedBy ex:VAV1 .


ex:201 a brick:Room ;

    brick:Area "400" ;

    brick:isFedBy ex:VAV3 .


ex:202 a brick:Room .


ex:204 a brick:Room .


ex:205 a brick:Room ;

    brick:Area "900" .


ex:303 a brick:Room .


ex:304 a brick:Room ;

    brick:isFedBy ex:VAV4 .


ex:F1 a brick:Floor ;

    brick:hasPart ex:101,

        ex:102 .


ex:F2 a brick:Floor ;

    brick:hasPart ex:201,

        ex:202,

        ex:L1 .


ex:F3 a brick:Floor ;

    brick:hasPart ex:303,

        ex:304 .


ex:L1 a brick:Lighting_Zone ;

    brick:hasPart ex:204,

        ex:205 .


Hopefully that makes sense, and looking forward to any comments!

-Erik



Gabe Fierro

unread,
Oct 11, 2020, 3:58:20 PM10/11/20
to Erik Paulson, Brick User Forum (Unified Building Metadata Schema)
Hi Erik:

I really like the tool! In terms of accessibility, I think your idea of providing a 'spreadsheet template' with a well-defined translation to components of a Brick model is a good one. Many of the building science practitioners/researchers I have met are more comfortable moving around cells in a spreadsheet than writing Python code. I could also see this being extended to support different templates on different sheets (instead of the BLANK column). I might try to borrow the idea of "inheriting" from upper cells in the brick-builder tool as well to make this friendlier for spreadsheet editing -- the deduplication of information in the format seems helpful for the Excel-style workflow, whereas the current approach in brick-builder is more amenable for the output from OpenRefine.

Best,
Gabe




--
You received this message because you are subscribed to the Google Groups "Brick User Forum (Unified Building Metadata Schema)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brickschema...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brickschema/CAKJO4n41%3DRmskuYrxs4yvGYgz5hdhF0QfT6hG7Bq43cW_nX7bw%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages