- The Rule Formalisation Tool (RFT) enables expert users in the field of building codes and regulations to provide, in collaboration with a RASE expert, graph versions of the regulations formalised in a machine-processable rules language for automated compliance checking (ACC) purposes.
- The tool has been developed as a one of the task of WP2 of the Automated Compliance Checks for Construction, Renovation or Demolition Works ACCORD project, funded by the Horizon Europe programme which aims to digitise permitting processes.
The tool is available at: Link
- The tool aims to be a key piece to facilitate the digitization process of building codes and regulations under a standardized approach (data, language, terminology, etc.) useful and applicable for all AECO industries so that the compliance can become a more streamlined and efficient process.
- In this context, the tool is intended to produce machine-readable documents containing a semantic formalisation of the rules from original building codes and regulatory documents in PDF format in order to help provide automation in the processes of checking regulations on designs in (IFC/CityGML formats) by authorities.
- The output generated by the tool must be useful and applicable so that the whole AECO industry can benefit from this automation.
- The tool should help converting regulatory documents into a structured format available in a centralized repository. Algorithms, software applications, and governance users within institutions can access this repository of semantic rule definitions in order to easily search, analyze, and understand their definitions.
- The Rule Formalisation Tool provides the necessary interfaces and functionalities to allow expert users in the field of building codes and regulations to carry out all the steps defined in the rule formalisation methodology to generate the expected semantic machine-readable documents.
The formalization process si based on 4 stages: creation, annotation, validation, and publication, through the following steps:
Users can define one or more projects within the tool. To create a project, users must define the following fields:
- The name of the project.
- The URL of the regulation (for example, the URL of the original public official website).
- The publication date (this may be the date of its official publication or can also be the date of a new version of the graph due to errors or other amendments for example).
- A short code (can be some kind of abbreviation, code name of the regulation, or a classification category for example).
- The scope (International, National, Regional, and Municipal).
- The Country where the regulation applies (in case of National, Regional, or Municipal).
- Regulation language.
- Measure system (Metric or Imperial).
- A summary or description about the regulation
Since most regulations are available in PDF format, this step involves uploading the regulation document in this format.
There are 2 options to carry out the process:
- Manually by tagging the regulation text according to the RASE method and generating the rules in BCRL.
- Automcatically, through a solution based on Natural Language Processing (NLP).
By choosing the manual option, the tool provides a view of the document like those shown by most PDF viewers. So, the user starts the process with a familiar view of the document, where text justification and line content are maintained to provide the same view as in traditional PDF viewers, as far as possible. As the user begins to select parts of the text, applying the RASE method, the original formatting is replaced by the new RASE formatting.
From a text tagged according to the RASE method, the next step is to validate the BCRL expressions in terms of correctness in the definition. BCRL is a language developed within the ACCORD project with a grammar generated with Another Tool for Language Recognition (ANTLR) for building compliance checking purposes. The tool has been designed to accept definitions in BCRL that comply with its grammar. However, it may happen that authors provide an expression incorrectly. For example, the expression of a rule may indicate that a property value must be higher than a specific reference value when in reality the text is indicating that this value should be lower (e.g., “:Width < 1500” instead of “:Width > 1500”).
When the user clicks on the validation button, the tool transforms the tagged RASE file into an AEC3PO instance as a graph represented in JSON-LD format. The graph will be published and uploaded into the rule database, a semantic triple store (Ontotext graphDB).
The graphs are uniquely identified in the database by their URIs which is composed of the following parts:
- Base URI: This part is common for all the graphs to be uploaded to the rule database. However, this part can be modified in the user settings interface in case a user wants to connect to a different rule database.
- Country Code: country code where the regulation applies (e.g., FI). It could also be the code for the continent (e.g., EU if it is a regulation that applies at a European level).
- Classification: a short text that identifies the regulation in some way. Its purpose is to differentiate one regulation from another in the same country, or even when they are of the same type.
- Language: the ISO language code in which the regulation is specified (e.g., en-GB). The same regulation may be drafted in different languages.
- Publication date: the date on which the graph is published expressed according to ISO 8601 standard.
URI pattern for regulation graphs:
https://graphdb.accordproject.eu/resource/aec3po/${country}/${classification}/${language}/${date}
The tool integrates the following elements and concepts:
- RASE Method: is a mark-up method allowing subject matter experts to expose the implied logic within the documents. The mark-up renders normative, definitive and descriptive text documents machine-interpretable.
- NLP methods: deep learning Natural Language Processing (NLP) can be applied to the corpora of building codes and regulations for extracting rule entities / axioms and, this way, to decrease the manual work of rule interpretation from building codes.
- AEC3PO ontology: developed as part of the ACCORD project, it captures all aspects of building compliance and building permitting in Architecture, Engineering, and Construction (AEC), it allows the modelling of aspects such as building codes, regulations, and standards, compliance and permitting processes and documentation, and compliance and permitting actors.
The tool is a symfony web app that requires a MySQL database. To install the tool in a Linux computer, follow these steps:
Install and set up your database server, then create a new database for the RFT tool. Make a note of the database name, user, and password for use in configuring RFT’s environment variables.
sudo apt-get install -y mysql-server sudo mysql_secure_installation # Follow the prompts to secure MySQL
sudo mysql -u root -p
CREATE DATABASE symfony_app; CREATE USER 'symfony_user'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON symfony_app.* TO 'symfony_user'@'localhost'; FLUSH PRIVILEGES; EXIT;
sudo apt-get update
sudo apt-get install -y php8.3 php8.3-cli php8.3-pdo-mysql php8.3-intl
echo "upload_max_filesize = 20M" | sudo tee /etc/php/8.3/cli/conf.d/uploads.ini echo "post_max_size = 100M" | sudo tee -a /etc/php/8.3/cli/conf.d/uploads.ini
sudo apt-get install -y openjdk-17-jdk
sudo apt-get install -y python3.11 python3.11-venv python3.11-dev python3-pip libpoppler-cpp-dev
pip3 install python-poppler --break-system-packages sudo apt-get install -y poppler-utils
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php composer-setup.php --install-dir=/usr/local/bin --filename=composer rm composer-setup.php
composer install
Create a .env.local file or configure the existing .env file with the necessary database and app settings for example: DATABASE_URL='mysql://:@localhost:3306/accord'
php bin/console doctrine:migrations:migrate
php bin/console cache:clear php bin/console cache:warmup
sudo chown -R www-data:www-data var/cache var/log