jmirtsch / GitIFCPrototype

First Public prototype of Git IFC Folder based serialization
9 stars 2 forks source link

IfcRelContainedInSpatialStructure #3

Open mtveerman opened 7 years ago

mtveerman commented 7 years ago

See: https://github.com/jmirtsch/GitIFCPrototype/blob/6181030c2c604fffb14f6f743b423ec398b1b044/111111%20Test%20IfcGit/045leWpMj4oQIEZ829grmf%20Project/045leWpMj4oQIEZ829grmh%20Site/045leWpMj4oQIEZ829grme%20Building/045leWpMj4oQIEZ81sLAAA%20BuildingStorey/0GDokRCPb3nPU27Rv5we1H%20Beam/IfcBeam.ifcjson#L2

Somehow I would not expect to find an IfcRelContainedInSpatialStructure definition in the definition of the IfcBeam. An IfcRelContainedInSpatialStructure could hold more than one entity, so why not treat it as a separate entity?

jmirtsch commented 7 years ago

I agree, it's not intuitive. But it was one way of explicitly expressing the folder relationships in a human intuitive way without penalizing the path lengths. This is the first implementation and can be greatly improved. If you explicitly add relationships folder structure looks like this: 170823 ifc folder hierarchy

And embedding the relationships looks like this. 170924 ifc folder hierarchy

radumg commented 7 years ago

Ah, the age-old database normalisation issue.

To see if i get this right @jmirtsch , is this beam defined/duplicated anywhere else ?

jmirtsch commented 7 years ago

This is the better of both, although it quickly hits windows path length which is a real drawback.

It also means that any elements with multiple aggregations or element container relationships would be merged (which is rare and not really an issue if the relationships doesn't provide further attributes or relationships).

171001 prototype folder hierarchy

I guess for spatial elements we could simply use (and enforce) the short name instead of guid to alleviate the file length.

radumg commented 7 years ago

I like that one, question is whether those IsDecomposedBy and ContainsElements folders are required ? If not implicit in the data types, could those relationships be recorded in a top-level table, for example relationships.json ? Could help with the container relationships issue you mention above?

Second question is whether those GUIDs could be shortened ? I'm thinking a short hash algorithm for folder name and full GUID in json file ? Yes, potential for collisions would theoretically increase, but the folder structure should by and large alleviate that ? Also wondering if using the names by themselves could introduce issues ? I'm thinking of instances where elements were not specifically named in the BIM authoring tool, so their names might not be unique enough ?

PS : hope you don't mind me asking these questions @jmirtsch , i'm learning lots about IFC by exploring these topics. hopefully they also help :)

jmirtsch commented 7 years ago

Discussion is great, I can only encourage other points of view and opinions. I think the mere fact this serialization of IFC helps you learn and understand is a great characteristic and is a worthwhile benefit.

In IFC, there are multiple ways to aggregate elements. Commonly http://www.buildingsmart-tech.org/ifc/IFC4/Add2/html/link/ifcrelaggregates.htm but also other sub types of http://www.buildingsmart-tech.org/ifc/IFC4/Add2/html/link/ifcreldecomposes.htm (ie IfcRelNests implies ordered aggregation). But the less folders the better for file path lengths etc. I'm going to alter the serialization so an aggregation is implicitly assumed, and any other relationship is explicitly aggregated. The guids are already a character compression of a conventional Guid (as I understand it, helped to fit files on floppy discs). But alternatives could be considered. Readily helps identify elements when this is the schema format. I haven't yet located a where rule or implementer agreement on aggregated element naming, but the guid format could be used if no name is defined (or if duplicate names are detected). The element is still explicitly defined in the json in either way. I'm proposing that this only be used for spatial breakdown (ie unlikely to stories have the same name).

mtveerman commented 7 years ago

(I love this while git/IFC discussion!!)

I think I still stick with my idea of having a folder per IFC entity, and a separate folder storing links between those. As described here: https://bimagineering.blogspot.nl/2017/09/thoughts-about-git-for-ifc-3.html?m=1

This solves some of the problems:

Yes, drawback is the human readability...

mtveerman commented 7 years ago

How does ifcxml handle these aggregates by the way? Hierarchical?

jmirtsch commented 7 years ago

I think all software implementations of ifcxml I've seen generate flat xml file, not utilizing the ifc file hierarchy. I've added the revit export to the repo for the base file. My toolkit does generated the tree so you can collapse or expand branches (image here https://twitter.com/geometrygym/status/745376849547534336)

I've just pushed some commits with the implicit aggregation hierarchy. Certainly looks much better. I also improved the naming conventions for folders and some files.