From 83afcc055c569b93095c55e361a553c42e5739e0 Mon Sep 17 00:00:00 2001 From: Bryan Bartley Date: Mon, 25 Apr 2022 09:28:11 -0700 Subject: [PATCH] Configure GraphEndpoint to parse turtle --- tyto/endpoint/endpoint.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tyto/endpoint/endpoint.py b/tyto/endpoint/endpoint.py index a1bf08b..d86335e 100644 --- a/tyto/endpoint/endpoint.py +++ b/tyto/endpoint/endpoint.py @@ -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