-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
40 lines (33 loc) · 1.38 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import json
import subprocess
from services.execute_query_service import execute_query
from flask import Flask, render_template, request
app = Flask("app")
@app.route('/')
def home():
return render_template('index.html')
@app.route("/sparql", methods=['GET'])
def get_query():
args = request.args
query = args.get('query')
try:
graph = args.get('url')
if "http" not in graph:
graph = None
except:
graph = None
print(graph)
results = execute_query(query, graph)
return results
if __name__ == '__main__':
banner = """
_____ _____ _____ _____ _____ __ _____ _ _ _ _____ _
| __|| _ || _ || __ || || | | __| ___ _| | ___ ___ ___ | |_ ___ _| | | __| ___ ___ |_| ___ ___
|__ || __|| || -|| | || |__ | __|| -_|| . || -_|| _|| .'|| _|| -_|| . | | __|| || . || || || -_|
|_____||__| |__|__||__|__||__ _||_____| |__| |___||___||___||_| |__,||_| |___||___| |_____||_|_||_ ||_||_|_||___|
|__| |___| v0.1.0
© Ontology Engineering Group at Universidad Politéctnica de Madrid
Authors: Salvador González Gerpe
"""
print(banner)
app.run(debug=True, host="0.0.0.0", port=5005)