Skip to content

Commit

Permalink
Configure GraphEndpoint to parse turtle
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryan Bartley committed Apr 25, 2022
1 parent aa525c4 commit 83afcc0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tyto/endpoint/endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,10 @@ def is_loaded(self):
return bool(self.graph)

def load(self):
self.graph.parse(self.path)
if self.path.split('.')[-1] == 'ttl':
self.graph.parse(self.path, format='ttl')
else:
self.graph.parse(self.path)

def query(self, ontology, sparql, err_msg):
sparql_final = sparql.format(from_clause='') # Because only one ontology per file, delete the from clause
Expand Down

0 comments on commit 83afcc0

Please sign in to comment.