Skip to content

HAZOP2RDF [2021], Projektierung von Automatisierungssystemen

License

Notifications You must be signed in to change notification settings

dmytkost/HAZOP2RDF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

The project HAZOP2RDF is part of the course Projektierung von Automatisierungssystem. The main goal of the project is to transform the HAZOP data, which is stored in Excel format into RDF format and visa versa.

We implemented a command line interface (CLI) using ComplexCLI, which means CLI in CLI to combine all interfaces in a single interface.

How to install

Prerequisites

  • Git 2.30+
  • Python 3.8+
  • Apache Jena Fuseki 4.1+

Windows

  1. git clone https://github.com/DimakDev/HAZOP2RDF.git
  2. cd hazop
  3. python -m venv .\venv
  4. venv\Scripts\activate
  5. python -m pip install --upgrade pip
  6. python -m pip install .
  7. venv\Scripts\cli [cmd] See API section for commands to run
  8. pytest See Tests section for commands to run
  9. deactivate

macOS

  1. git clone https://github.com/DimakDev/HAZOP2RDF.git
  2. cd hazop
  3. python3 -m venv ./venv
  4. source venv/bin/activate
  5. pip install --upgrade pip
  6. pip install .
  7. cli [cmd] See API section for commands to run
  8. pytest See Tests section for commands to run
  9. deactivate

API

To see the list of available commands, run cli.

Usage: cli [OPTIONS] COMMAND [ARGS]...

  Welcome to HAZOP CLI!

Options:
  --help  Show this message and exit.

Commands:
  exporter  Exporter interface
  importer  Importer interface

Importer

This API is an entry point for reading Excel data and building RDF-Graphs.

Command: cli importer

Usage: cli cli [OPTIONS] COMMAND [ARGS]...

  Importer interface

Options:
  --help  Show this message and exit.

Commands:
  cmd-build-hazop-graphs  Build HAZOP graphs
  cmd-read-excel-data     Read excel data
  cmd-read-hazop-data     Read hazop data
  • cli importer cmd-read-excel-data - to see the list of available Excel binary data
  • cli importer cmd-read-hazop-data - to read the HAZOP data if its config is available
  • cli importer cmd-build-hazop-graphs - to build HAZOP graphs, save it locally and upload to Fuseki server, if the server is up

Exporter

This API exports RDF-Graphs to Excel either from local directory or from Fuseki server, if it is available.

Command: cli exporter

Usage: cli cli [OPTIONS] COMMAND [ARGS]...

  Exporter interface

Options:
  --help  Show this message and exit.

Commands:
  cmd-export-graphs-from-fuseki-server
                                  Export HAZOP graphs...
  cmd-export-graphs-from-local-directory
                                  Export HAZOP graphs...
  • cli exporter cmd-export-graphs-from-local-directory - to convert graphs from Turtle in Excel format and save it locally
  • cli exporter cmd-export-graphs-from-fuseki-server - to get graphs from Fuseki server, if the server is running, convert it to Excel format and save it locally

Tests

You can use the following commands to get quick results or customize the tests' configuration using pytest and pytest-cov flags:

  • pytest- to run quick test
  • pytest --cov=src --cov-report term-missing - to run a test with coverage report and missing statements
  • pytest --cov=src --cov-report html - to run a test with coverage report and missing statements in html format (by default open htmlcov/index.html to see the results)

About

HAZOP2RDF [2021], Projektierung von Automatisierungssystemen

Topics

Resources

License

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •