Giter Site home page Giter Site logo

demo_luxembourg's Introduction

OntoTrans Demo App

Overview

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.

Setup and Installation

  1. Install Python 3
    Ensure you have Python 3 installed on your system.

  2. Setup Virtual Environment (Optional but recommended)
    python3 -m venv env source env/bin/activate # On Windows, use: env\Scripts\activate

  3. Clone the Repository
    Clone the repository or copy the scripts into your project directory.

  4. Install All Required Libraries
    pip install -r requirements.txt

Project Structure

  • 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.

The main.py script defines the following routes:

  1. /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.
  1. /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.
  1. /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.
  1. / (GET)
  • The home page which provides a simple UI for the application.

Running the Application

  1. Navigate to the project directory in your terminal.
  2. Run the following command to start the Flask application:
    python main.py
  3. Open a web browser and visit http://127.0.0.1:5000/ to access the application.

Contributing

Feel free to fork the project and make contributions.

License

This project is open-source and available under the MIT License.

demo_luxembourg's People

Contributors

fekaputra avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.