Commit f8a2e7dd authored by zg2916's avatar zg2916

Reading from confg

parent 5557fcd4
......@@ -18,6 +18,4 @@ services:
SPARQL_UPDATE: "false"
DEFAULT_GRAPH: "https://www.w3id.org/sora/"
volumes:
- ./data/virtuoso:/data
ports:
- "8890:8890"
\ No newline at end of file
- ./data/virtuoso:/data
\ No newline at end of file
from flask import Flask, abort, request
from project.vocabulary.sora import vocabulary_bp
from project.resources.gesispanel_browser import gesispanel_bp
from flask_bootstrap import Bootstrap
from flask_sslify import SSLify
import logging as log
import yaml
import os
log.basicConfig(level=log.INFO)
......@@ -12,11 +12,17 @@ hdlr = log.FileHandler('log.log')
formatter = log.Formatter('%(asctime)s %(levelname)s %(message)s')
hdlr.setFormatter(formatter)
app_config = yaml.load(open(f'{os.getcwd()}/sora_resources.conf'))
app = Flask(__name__)
#SSLify(app)
app.logger.addHandler(hdlr)
app.secret_key = os.urandom(24)
from project.vocabulary.sora import vocabulary_bp
from project.resources.gesispanel_browser import gesispanel_bp
app.register_blueprint(vocabulary_bp, url_prefix="/vocabulary")
app.register_blueprint(gesispanel_bp, url_prefix="/gesispanel")
......
......@@ -5,6 +5,7 @@ import json
from SPARQLWrapper import SPARQLWrapper, XML, TURTLE
import logging as log
from project.tools.htmlresults import HTMLSerializer, HTMLResultSerializer
from project import app_config
register('html', Serializer, 'project.tools.htmlresults', 'HTMLSerializer')
log.basicConfig(level=log.INFO)
......@@ -63,7 +64,7 @@ html_template_map = {
## TODO: Read from a config file
BASE = "https://w3id.org/sora/resource/gesispanel/{0}/{1}"
SPARQL = SPARQLWrapper("http://aifb-ls3-vm7.aifb.kit.edu:8893/sparql")
SPARQL = SPARQLWrapper(app_config['gesis_panel']['sparql'])
sora_ns = Namespace("https://w3id.org/sora/resource/gesispanel/")
......
version: 1
gesis_panel:
sparql: http://aifb-ls3-vm7.aifb.kit.edu:8893/sparql
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment