Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
situx committed Feb 6, 2025
1 parent 62c875c commit cb53159
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion tasks/processing/loadgraphtask.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,20 @@ def __init__(self, description, graphname, filenames, loadgraphdlg, dlg, maindlg
self.geojson = None
self.gutils=GraphUtils("")

@staticmethod
def fileNameToExtension(filename):
ext=filename[filename.rfind(".")+1:]
return ext


def run(self):
path = os.path.join(__location__, "../../tmp/graphcache/" + str(
str(self.filenames).replace("/", "_").replace("['", "").replace("']", "").replace(
"\\", "_").replace(":", "_")) + ".ttl")
self.graph = Graph()
if isinstance(self.filenames,str):
if os.path.isfile(path):
self.graph.parse(path)
self.graph.parse(path, format="ttl")
else:
self.graph=SPARQLUtils.loadGraph(self.filenames)
self.graph.serialize(path, format="ttl")
Expand Down
2 changes: 1 addition & 1 deletion util/sparqlutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ def loadGraph(graphuri,graph=None):
try:
if graphuri.startswith("http"):
QgsMessageLog.logMessage(" Data: " + str(graphuri) + "", MESSAGE_CATEGORY, Qgis.Info)
graph.parse(graphuri)
graph.parse(graphuri, format=graphuri[graphuri.rfind(".")+1:])
else:
filepath = graphuri.split(".")
graph.parse(graphuri, format=filepath[len(filepath) - 1])
Expand Down

0 comments on commit cb53159

Please sign in to comment.