ifcJSON icon indicating copy to clipboard operation
ifcJSON copied to clipboard

simplification of header

Open janbrouwer opened this issue 5 years ago • 4 comments

Until now I have been creating (optional) headers for IFCJSON files like this:

{
    "header": {
        "file_description": {
            "description": "ViewDefinition [CoordinationView]",
            "implementation_level": "2;1"
        },
        "file_name": {
            "name": "7m900_tue_hello_wall_with_door.json",
            "time_stamp": "2020-05-30T09:18:25",
            "author": "",
            "organization": "",
            "preprocessor_version": "IFC-manager for SketchUp (3.0.1)",
            "originating_system": "SketchUp Pro 2018 (18.0.16975)",
            "authorization": ""
        },
        "file_schema": "IFC2X3"
    },
    "data": [
        {
            "type": "IfcProject",

I propose to change it to something like this:

{
    "type": "ifcjson",
    "file_description": {
        "description": "ViewDefinition [CoordinationView]",
        "implementation_level": "2;1"
    },
    "file_name": {
        "name": "7m900_tue_hello_wall_with_door.json",
        "time_stamp": "2020-05-30T09:09:10",
        "author": "",
        "organization": "",
        "preprocessor_version": "IFC-manager for SketchUp (3.0.1)",
        "originating_system": "SketchUp Pro 2018 (18.0.16975)",
        "authorization": ""
    },
    "file_schema": "IFC2X3",
    "data": [
        {
            "type": "IfcProject",

Where I added a main "type", and flattened the "header" section. That main type could be mandatory because it tells a parser that it can expect "ifcjson" data. The STEP style file_description, file_name and file_schema could also be further flattened or simplyfied by stripping the "file_".

janbrouwer avatar May 30 '20 07:05 janbrouwer

I am still not a big fan of the header, as I think that it is content that belongs in a file system, not inside a file.

That being said, if we indeed keep the header, your suggested changes look good, and it is fine to include them. I would additionally:

  • remove "file_" prefixes
  • opt for camelCase everywhere, instead of the underscore_case
  • aim to keep removing empty attributes (e.g. author, organisation).
  • abandon IFC2x3 examples

pipauwel avatar May 30 '20 10:05 pipauwel

I am still not a big fan of the header, as I think that it is content that belongs in a file system, not inside a file.

That being said, if we indeed keep the header, your suggested changes look good, and it is fine to include them.

I think it's a good idea to minimize header information as much as possible and like to replace the explicit "header" part with some file-describing meta-data. And make this information optional. I do agree that filename should be part of the filesystem and not of the file header, because you want to be able to change that afterwards completely. But I do think we need a formal method to describe:

  • what version of the IFC base schema the file claims to adhere to.
  • what version of IFC JSON the file claims to adhere to.
  • declare that the data is IFC JSON (and not for example GeoJSON).
  • see when the file is created, because the file-system infromation mostly gets messed up on transfers and modifications. And with less importance I would like to be able to set:
  • preprocessorVersion
  • originatingSystem To be able to see what application is responsible for generating the data.

I would additionally:

  • remove "file_" prefixes

agreed

  • opt for camelCase everywhere, instead of the underscore_case

agreed

  • aim to keep removing empty attributes (e.g. author, organisation).

agreed

  • abandon IFC2x3 examples

agreed, but that essentially rules out sketchup for generating any IFC JSON data for the time being.

janbrouwer avatar May 30 '20 15:05 janbrouwer

Proposal for exchange of IFC JSON for a complete model (for snippets, just the contents of "data"):

{
    "type": "ifcjson",
    "schema": "IFC4",
    "description": "ViewDefinition [CoordinationView]",
    "timeStamp": "2020-05-30T09:09:10",
    "preprocessorVersion": "IFC-manager for SketchUp (3.0.1)",
    "originatingSystem": "SketchUp Pro 2018 (18.0.16975)",
    "data": [
        {
            "type": "IfcProject",

janbrouwer avatar May 30 '20 15:05 janbrouwer

+++ fully agree

pipauwel avatar May 31 '20 15:05 pipauwel