Package: ifc-data-checker
IFC Data CheckerIFC Data Checker is a tool to validate rules on IFC models. To do so, the IFC Data Checker needs a rules file and an IFC model. The rules file has to match the rules specification in the report of the bachelor thesis of the IFC Data Checker. The IFC model need to be of version 2x3 or version 4.Installation:pipinstallifc-data-checkerOr clone this repository and install the dependenciespipinstall-rrequirements.txtAdd IfcOpenShell PythonTo run the IFC Data Checker, you need to install the python package IfcOpenShell. IT need to fit your machine environment regarding:the Python versionthe os (Windows, Linux , Mac)the os flavor (32bit or 64bit)To install IfcOpenShell, you need to do the following steps:Go toifcopenshell.org/pythonand download the matching IfcOpenShell. Use the latest IfcOpenShell version.Extract the downloaded file and paste theifcopenshellfolder to the directorysite-packagesof the python installation. The folder need to be calledifcopenshell.On Linux e.g./usr/local/lib/python3.8/site-packages/On Windows e.g. in the python installation folder and then\Lib\site-packages\If IfcOpenShell not matching your machine environment, then it will trow an exception like:ImportError:IfcOpenShellnotbuiltfor'windows\64bit\python3.8'Run the IFC Data Checkerpythonifc_data_checker./path/to/rules-file.yml./path/to/ifc-model.ifcGitHub Repository example:pythonifc_data_checker"./rulesfiles/PredefinedType for IfcWall.yml""./ifcfiles/Duplex-A.ifc"Usage:usage:ifc_data_checker[-h][--report-file][--no-rulesfile-validation]rulesifc

positionalarguments:rulesThepathtotherulesfile.ifcThepathtotheifcfile.

optionalarguments:-h,--helpshowthishelpmessageandexit--report-fileCreateavalidationreportfile,insteadofshowingthevalidationreportontheconsole.--no-rulesfile-validationDisablevalidationoftherulesfile.ContributeYou are invited to participate on the IFC Data Checker.Python Style GuideThe IFC Data Checker follows thePython Style Guide from GoogleThe source code documentation follows the Google Style.This examplehelps to follow the Google Style.Extend Constraint ComponentThe following 4 steps are to extend the IFC Data Checker for a new Constraint Component.StepAdd a new class in the Python moduleifc_data_checker/constraints.py. Use the following template and consider the comments.classNewConstraint(ConstraintComponent):"""Class description"""yaml_keys=tuple(["new"])"""Set the yaml keys for the new constraint"""def__init__(self,definition:dict,ifc_instance):"""Constructor"""super().__init__(definition,ifc_instance)self.potentially_new_attribute=Nonedefvalidate(self):"""Validates. The attribute self.validation_information need to be set."""defreport(self)->List[str]:"""Reports. Return a list of valiation results messages"""return[str(self.validation_information)]def__eq__(self,other):"""Equals all the attributes"""ifnotisinstance(other,NewConstraint):returnFalsereturn(self.definition==other.definitionandself.ifc_instance==other.ifc_instanceandself.validation_information==other.validation_informationandself.potentially_new_attribute==other.potentially_new_attribute)StepAdd the Name of the class in the yaml fileifc_data_checker/config.yml.constraints:-Constraint-SetGroup-AndGroup-OrGroup-NewConstraintStepWrite unit and integration tests for the new constraint component. To do so, add a new Python module undertests/constraints. This new test class should inherit fromtests.constraints.constraint_component_test.TestConstraintComponent.TestParameterValidation. After that, set the attributeconstraint_component_classanddefault_constraint_componenton the new test class.Now you are ready to implement the test cases. You can have a look at the existing test cases and write the test cases analogously.The new Python test module should be in the test report. For that, add the Python test module in the Python moduletests/suite.pyanalogously as the others.StepThe new constraint component need to add to therules.schema.json, to be an accepted constraint component. To do so add the JSON schema of the new constraint component in the JSON schema filerules.schema.jsonunder definitions -> constraint -> oneOf. Read theJSON schemaspecification to create an JSON Schema. Here is an example."definitions":{"constraint":{"oneOf":[â€¦{"type":"object","properties":{"new":{"type":"string"}},"required":["new"],"additionalItems":false},â€¦To extend an new path operator or an new constraint check, the steps are analogously to the steps of the constraint component.