Skip to content

Commit

Permalink
Check TBOX_PATH endswith for media_type
Browse files Browse the repository at this point in the history
  • Loading branch information
epoz committed Feb 28, 2024
1 parent 693f155 commit 06f47fd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/app/lode.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,14 @@ def load_tbox():
F.write(r.content)
od = OntDoc(F.name)
globals()["TBOX_HTML"] = od.make_html()

if TBOX_PATH.endswith(".ttl"):
media_type = "text/turtle"
else:
media_type = "application/n-triples"

TBOX = px.Store()
TBOX.load(
io.BytesIO(r.content), "application/n-triples"
) # Only supporting n-triples, what to do when the TBox is turtle?
TBOX.load(io.BytesIO(r.content), media_type)
globals()["TBOX"] = TBOX
except:
# Bit wide, swallowing all the errors, but we do not want a mis-configured TBOX stopping proceedings
Expand Down

0 comments on commit 06f47fd

Please sign in to comment.