Skip to content

Commit 3a80206

Browse files
authored
Merge pull request #210 from AKSW/feature/fixLoad
Fix LOAD for all the other import formats
2 parents 6259bfc + b96eea9 commit 3a80206

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

quit/tools/update.py

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -60,23 +60,19 @@ def evalLoad(ctx, u):
6060
raise UnSupportedQuery("For load queries we need a iriref for a target graph")
6161

6262
success = False
63-
loadedGraph = Graph()
64-
try:
65-
loadedGraph.load(u.iri, publicID=u.graphiri)
66-
success = True
67-
except:
68-
pass
69-
if not success:
70-
try:
71-
return loadedGraph.load(u.iri, format='n3')
72-
success = True
73-
except:
74-
pass
75-
if not success:
63+
loadedGraph = None
64+
exceptions = []
65+
formats = [None, 'n3', 'nt', 'turtle']
66+
for format in formats:
67+
loadedGraph = Graph()
7668
try:
77-
return loadedGraph.load(u.iri, format='nt')
69+
if not format:
70+
loadedGraph.load(u.iri)
71+
else:
72+
loadedGraph.load(u.iri, format=format)
7873
success = True
79-
except:
74+
break
75+
except Exception as e:
8076
pass
8177
if not success:
8278
raise Exception(

0 commit comments

Comments
 (0)