polifonia-project / pattern-explorations-backend

Backend flask server for pattern exploration as part of WP5.6

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

component-id type name description work-package project resource release-date release-number licence contributors related-components bibliography links funder credits
pattern-explorations-backend
WebApplication
Pattern Exploration Backend
A server that requests and processes data from the [Patterns Knowledge Graph](https://github.com/polifonia-project/patterns-knowledge-graph) on behalf of the [Pattern Exploration GUI](https://github.com/polifonia-project/pattern-exploration-gui).
WP5
polifonia-project
23/02/2024
v1.0.0
GNU_GPL_v3
James McDermott <https://github.com/jmmcd>
reuses
pattern-exploration-gui
patterns-knowledge-graph
publication
Polifonia Deliverable 5.6
name url grant-agreement
Horizon 2020 Framework Programme
This project has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement N. 101004746.

Python Flask Server for Patterns UI using the Blazegraph KG

A Python Flask server providing APIs used by the Pattens UI frontend. It is connected to the FONN SPARQL endpoint for the Patterns and Tunes knowledge graphs.

This software forms part of Polifonia Deliverable D5.6.

Prerequisites

Ensure you have Python and pip installed on your machine. I'd recommend using a environment manager like miniconda to keep everything sane.

Installing Dependencies

Clone the repository, navigate to the project folder and install the dependencies from requirements.txt.

git clone git@github.com:polifonia-project/pattern-explorations-backend.git
cd pattern-explorations-backend
pip install -r requirements.txt

Application Code

The main application code is in app.py, and the SPARQL queries are generated using a query factory in query_factory.py. The file fuzzy_search.py contains properties and methods related to the fuzzy tune title search feature.

Running the Server

Start the Flask server with:

python app.py

The server runs on localhost port 5000 by default.

requirements.txt

The required libraries are listed in requirements.txt:

Flask==2.3.2
Flask_Cors==3.0.10
Requests==2.31.0
fuzzywuzzy~=0.18.0
singleton-decorator
python-Levenshtein

About

Backend flask server for pattern exploration as part of WP5.6


Languages

Language:Python 100.0%