This application is a simple Flask web app with three main functionalities: (i) uploading a file containing experiment metadata, (ii) processing the uploaded metadata and transform the original data stored in certain location into its RDF representation, and storing the processed data into a text file which is (iii) then available for download.
-
Install Python 3
Ensure you have Python 3 installed on your system. -
Setup Virtual Environment (Optional but recommended)
python3 -m venv env source env/bin/activate
# On Windows, use:env\Scripts\activate
-
Clone the Repository
Clone the repository or copy the scripts into your project directory. -
Install All Required Libraries
pip install -r requirements.txt
- main.py: This is the main script that contains the Flask application and the endpoints for the REST APIs.
- templates/index.html: This file contains the HTML template for the home page, which includes a file uploader and buttons to trigger the process and store data functionalities.
- example_data: This folder contains a simple CSV data about alloy composition and its metadata representation in TRIG format (extended TTL).
- The metadata (trig) file consisting of three components: (i) DCAT part for accessing real data, (ii) mapping from original data into RDF representation - currently following RML specification - more about it can be seen at RML website, and (iii) EMMO ontology and instances, for completing the transformed RDF data.
- /upload_data (POST)
- Endpoint to upload a file from the local computer.
- The uploaded file is stored in the
uploads/
directory and the filename is added to a list of data to be processed.
- /process_data (GET)
- Endpoint to process the uploaded
*.trig
file containing the metadata about an experiment result. - The process will use the available metadata to transform the original data into its RDF representation.
- /store_data (GET)
- The processed data is stored in a text file and this file is then sent to the browser for download as a
*.ttl
.
- / (GET)
- The home page which provides a simple UI for the application.
- Navigate to the project directory in your terminal.
- Run the following command to start the Flask application:
python main.py
- Open a web browser and visit
http://127.0.0.1:5000/
to access the application.
Feel free to fork the project and make contributions.
This project is open-source and available under the MIT License.