|
12 | 12 |
|
13 | 13 | sparql_url = 'http://fuseki:3030/n4o' |
14 | 14 | def lido2rdf_url(): return f'http://converter:5000/convert' |
15 | | -def importer_url(coll): return f'http://importer:5020/collection/import/{coll}' |
| 15 | +def importer_url(coll): return f'http://importer:5020/collection/{coll}/load' |
16 | 16 |
|
17 | 17 |
|
18 | 18 | app = Flask(__name__, template_folder='templates', static_folder='static', static_url_path='/assets') |
@@ -83,7 +83,7 @@ def home(): |
83 | 83 | collection = 'default' |
84 | 84 | if user := find_user(username): |
85 | 85 | collection = user['collection'] or 'default' |
86 | | - data_dir = './data/' |
| 86 | + data_dir = './admin_data/' |
87 | 87 | with open(data_dir+user['samplefile'], 'r') as f: |
88 | 88 | user['profile_data'] = f.read() |
89 | 89 | return render_template('index.html', collection=collection, user=jsonify(user).json) |
@@ -127,9 +127,10 @@ def import_ttl(): |
127 | 127 | ''''Import TTL data into the RDF store''' |
128 | 128 | if coll := request.json.get('coll_index'): |
129 | 129 | if data := request.json['data']: |
130 | | - with open(f'./stage/inbox/{coll}/out.ttl', 'w') as f: |
131 | | - f.write(data) |
132 | | - return requests.post(importer_url(coll)).text |
| 130 | + fn = f'import_{coll}.ttl' |
| 131 | + with open(f'./data/{fn}', 'w') as f: f.write(data) |
| 132 | + res =requests.post(f'http://importer:5020/collection/{coll}/receive?from={fn}') |
| 133 | + return requests.post(f'http://importer:5020/collection/{coll}/load').text, res.status_code |
133 | 134 | return jsonify(message='No data or collection index provided') |
134 | 135 |
|
135 | 136 |
|
|
0 commit comments