jyrkioraskari / IFCtoLBD

IFCtoLBD converts IFC (Industry Foundation Classes STEP formatted files into the Linked Building Data ontologies.
Apache License 2.0
80 stars 21 forks source link

Some quantity values are floored #52

Closed maximelefrancois86 closed 1 year ago

maximelefrancois86 commented 1 year ago

Some quantity values are floored somewhere in the the Revit-to-IFC-to-LBD conversion.

Apologies if it's not related to IFC-to-LBD.

Documented as part of Isaac Fatokun, Arun Raveendran Nair, Thamer Mecharnia, Maxime Lefrançois, Victor Charpenay, Fabien Badeig and Antoine Zimmermann, (2023) "Modular Knowledge integration for Smart Building Digital Twins", LDAC 2023

Section 5.1, item 5_readSchedules.py, sub-item (iv).

To Reproduce

See https://github.com/maximelefrancois86/databat-kgc-revit for steps to reproduce the issue

Expected behavior

For example the following properties are floored:

inst:door_157d2b5c-4e5b-4b8f-a05f-b4076271c160
    props:volume_simple 0.0 ;
    props:width_simple 1.0 ;

We transform them as:

<door_157d2b5c-4e5b-4b8f-a05f-b4076271c160> a bot:Element, coswot:Door ;
    coswot:hasOverallHeightStableValue "2.440031 m"^^cdt:ucum ;
    coswot:hasOverallWidthStableValue "1.560697 m"^^cdt:ucum .

Versions

jyrkioraskari commented 1 year ago

May I see the generated IFC file? (rvt/MINES_TCE_DOE_2021.rvt was missing here: https://github.com/maximelefrancois86/databat-kgc-revit/tree/main/rvt)

If you provide me the IFC file, I can deep dive in the IFC STEP file and test and see manually where the data comes from.

jyrkioraskari commented 1 year ago

So, the IFC element with GUID: 0LVIjSJbjBZw1Vj0TYSS5W had: inst:door_157d2b5c-4e5b-4b8f-a05f-b4076271c160 props:width_simple "1"^^xsd:decimal ; props:volume_simple "0"^^xsd:decimal ;

In the EMSE_EF.ifc the element is specified in the following line:

2743344= IFCDOOR('0LVIjSJbjBZw1Vj0TYSS5W',#48,'Double vitr\X2\00E9\X0\e:Double vitr\X2\00E9\X0\e:858066',$,'Double vitr\X2\00E9\X0\e:Double vitr\X2\00E9\X0\e',#2743342,#2743332,'858066',2.44003103740285,1.56069713716399,.DOOR.,.DOUBLE_DOOR_SINGLE_SWING.,$);

Parsing it manually:

2743363= IFCRELDEFINESBYPROPERTIES('0LVIjSJbjBZw1VinDYSS5W',#48,$,$,(#2743344),#2743361);

#2743361= IFCPROPERTYSET('0LVIjSJbjBZw1ViXDYSS5W',#48,'Constraints',$,(#889913));

2743373= IFCRELDEFINESBYPROPERTIES('0LVIjSJbjBZw1VimLYSS5W',#48,$,$,(#2743344),#2743367);

#2743367= IFCPROPERTYSET('0LVIjSJbjBZw1ViWLYSS5W',#48,'Dimensions',$,(#2743355,#2743356,#2743357,#2743358));
   #2743355= IFCPROPERTYSINGLEVALUE('Area',$,IFCAREAMEASURE(3.80814945466591),$);
   #2743356= IFCPROPERTYSINGLEVALUE('Height',$,IFCLENGTHMEASURE(2.44003103740285),$);
   #2743357= IFCPROPERTYSINGLEVALUE('Volume',$,IFCVOLUMEMEASURE(0.0841432645576288),$);
   #2743358= IFCPROPERTYSINGLEVALUE('Width',$,IFCLENGTHMEASURE(1.56069713716399),$);

ifcOWL: inst:IfcPropertySingleValue_2743358 rdf:type ifc:IfcPropertySingleValue . inst:IfcPropertySingleValue_2743358 ifc:name_IfcProperty inst:IfcIdentifier_583006 .

inst:IfcPropertySingleValue_2743458 ifc:name_IfcProperty inst:IfcIdentifier_583006 . inst:IfcPropertySingleValue_2743458 ifc:nominalValue_IfcPropertySingleValue inst:IfcLengthMeasure_854818 .

inst:IfcLengthMeasure_854818 rdf:type ifc:IfcLengthMeasure . inst:IfcLengthMeasure_854818 express:hasDouble "1.56069713716399"^^xsd:double .

Code: value = ifcowl_model.createTypedLiteral(value.asLiteral().getDouble(), XSD.decimal.getURI().toString());

Property value 1 for [Width] was: 1.56069713716399^^http://www.w3.org/2001/XMLSchema#double Property value 2 for [Width] was: 1^^http://www.w3.org/2001/XMLSchema#decimal

Correction: value = ifcowl_model.createTypedLiteral(BigDecimal.valueOf(value.asLiteral().getDouble()), XSD.decimal.getURI().toString());

Property value 1 for [Width] was: 0.560031037402852^^http://www.w3.org/2001/XMLSchema#double Property value 2 for [Width] was: 0.560031037402852^^http://www.w3.org/2001/XMLSchema#decimal

Correct.

maximelefrancois86 commented 1 year ago

Thanks. Is this solved in a specific commit ? For example #bbf377fa7ba9f180fd96a74e6936c7cf4e84c7f6 ?