aboutsummaryrefslogtreecommitdiff
path: root/gn3/db/rdf/wiki.py
diff options
context:
space:
mode:
Diffstat (limited to 'gn3/db/rdf/wiki.py')
-rw-r--r--gn3/db/rdf/wiki.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/gn3/db/rdf/wiki.py b/gn3/db/rdf/wiki.py
index f082096..03945ec 100644
--- a/gn3/db/rdf/wiki.py
+++ b/gn3/db/rdf/wiki.py
@@ -111,7 +111,7 @@ CONSTRUCT {
symbol=symbol,
)
results = query_frame_and_compact(query, WIKI_CONTEXT, sparql_uri)
- data = [__sanitize_result(result) for result in results.get("data")]
+ data = [__sanitize_result(result) for result in results.get("data", {})]
# See note above in the doc-string
results["data"] = sorted(data, key=lambda d: d["created"])
if not data:
@@ -169,7 +169,7 @@ CONSTRUCT {
"""
).substitute(prefix=RDF_PREFIXES, comment_id=comment_id)
results = query_frame_and_compact(query, WIKI_CONTEXT, sparql_uri)
- data = [__sanitize_result(result) for result in results.get("data")]
+ data = [__sanitize_result(result) for result in results.get("data", {})]
# See note above in the doc-string
results["data"] = sorted(data, key=lambda d: d["version"], reverse=True)
return results