Just a little question. I mean, JSON is so good in the Web developing. So I try to ask you which APP or software can revert IFC to JSON.
When you use "IFC" it means that you talk about IFC Schema (or IFC Spec) which bSI says they provide a JSON format too, but I've never checked to find that is it available? And correct? or not?
When you use "Ifc or .ifc" then it's about the file format and there're few solutions to convert .ifc to .json especially there're two things you have care about:
So, converting semantics to .json directly is possible and useful, but Geometry/Topology you have to have a json-based geometries/typologies methodology/technnologgy, for instance, glTF/WebGL
I don't know, but maybe xBIM could do what you (and I) want
@Jesusbill do you use JSON-based method in the viewer you develop?
I saw you use Three.js and also Vue.js which are good choices
@shanmama - buildingSMART has had a few research initiatives to represent IFC data in JSON syntax. However, as of today, there is not yet an official IFC JSON syntax agreement - there are many ways to represent the IFC data and nobody has yet standardised it. That said, I am aware that it is on the buildingSMART roadmap. I will ask to see whether or not they will make their roadmap publicly available.
That said, if you want to get a bit of data for a specific usecase which happens to be in JSON format, you can do this with IfcOpenShell, or the Blender Python console, or xBIM. It requires writing a bit of code, though.
The IFC-to-Code_Aster project by @Jesusbill relies on converting IFC data from STEP syntax to JSON data, but it only converts a small subset related to structural analysis. This may or may not be suitable for your use. It uses IfcOpenShell.
@Moult I didn't know IfcOpenShell supports JSON, IfcConvert just listed XML
Hope soon bSI does it.
First of all they need to find what's the way the want to go? They have chosen UML as a language, however they have to choose which Data Modeling is suitable for IFC too
@ReD_CoDE @shanmama As Dion said we are using ifcopenshell to extract a JSON file. But I wouldn't say that this means that IFC supports JSON. Forr all I know, I could even save the same data in an excel file with pyopenxl, it does not mean that IFC supports XLS.
JSON is like a txt file, one can use it to create his own data schema to use in his workflow and this would entail looking into the ifc files and extracting and writing the info you want in the schema you want. Of course this will break the chain of interoperability, if you want to go back to ifc from your JSON you will have to write the new ifc file yourself.
@Jesusbill Hope bSI develops IFC schema based on JSON too, however, it seems that it takes time, until 2021
I think the best choice for IFC format to other schemas/formats is SQL and SQLite which inherently support JSON too
Which caused IfcSharp (https://github.com/IfcSharp) movement
I saw today a post in LinkedIn about ISO 23386.
"The ISO 23386 standard is now published. It is a big step forward the common description and management of properties and groups of properties into #dictionaries for #BIM."
@Jesusbill @ReD_CoDE @Moult
Wow！I've been busy in the last few days, I didn't see a few discussions in time.
You know, whether it is .ifc or .ifcxml documents, there is a lot of duplicate information. Recently I developed a software for compressing .json files. We all know that the conversion of .json and .xml is very easy (many websites can convert it online), so I actually developed an indirect .ifcxml file compression tool.
So, I raised the issue of converting .ifc to .json last week. Because my compressed object is a .json file.
In the next step, I plan to optimize for .xml (or specifically .ifcxml). At that time, I hope you can give me suggestions! Thank you again!
@shanmama As Dion @Moult told me a couple of days ago, IfcOpenShell can parse IFC to JSON
However, it's better Dion talks about it and its pros and cons and limitations
Ifc2Json, Ifc2SQL, ifc2SQLite, and Ifc2CSV are three things that I think are really important in OpenBIM environment today for many usecases
@shanmama - what do you mean by there is a lot of duplicate information in .ifc/ifcxml files?
Also, IfcOpenShell now has a little bit of code which does IFC to and from CSV, if anybody is interested :) You can export a subset of IFC elements along with a list of properties, and then re-import that after changing the CSV file. See: https://github.com/IfcOpenShell/IfcOpenShell/tree/v0.6.0/src/ifccsv
@Moult I don't see anything about JSON? It means that we have to convert IFC to CSV then to JSON?
Some paper said duplicate information. Maybe you can search "IFC Compressor" by Google. I found 2 papers to do it.
@ReD_CoDE - that link I provided was about IFC and CSV, not with JSON. They are separate utilities.
@shanmama - it is possible (and sometimes likely) that a vendor can implement an IFC exporter that creates IFC data which contains duplicate non-rooted elements. This can lead to "duplicates" in the IFC file. If a vendor does this, it is their fault for not keeping their IFC data clean. Tools like Solibri's Optimiser simply removes these duplicate non-rooted elements. This does not mean that IFC contains "a lot of duplicate" information, it simply means that the vendor has done a poor job of writing their exporter.
OK I see. Now I developed an compression tool to compress those poor .ifcxml doc.
@Moult I found this view is very interesting: "If a vendor does this, it is their fault for not keeping their IFC data clean. " I want to
cite this view in my newest paper, so which paper or book can I cite as reference?
I'm not sure what paper or book can be cited. I am simply talking from experience.
I just did a test: a 60mb Revit model with 919,707 lines of IFC code. Once STEP identifiers are removed, a unique sort will reveal duplicate non-rooted elements (rooted elements will always be maintained, so only completely duplicate non-rooted elements will be removed).
The results are that from 919,707 lines of code we end up with 718,430 lines of IFC code. This is a reduction of 22% of the filesize. If Revit had developed their export tool with better element recycling, we would have smaller models.
Note that this is the bare minimum by which we can have a smaller model. There are many other ways to decrease a model's size, but this is just the most basic way.
OK. I want to cite your point of view in my own research paper. Can I set your website as a reference? As you know, it is very important to express the views of others clearly in academic writing.
More than happy :)
Just to let you know, you can of course reference his site but you can also reference him directly, something like:
Moult, D. 2020. Personal communication