[wip, sparql] handle optional values draft orphan
authorSimon Chabot <simon.chabot@logilab.fr>
Wed, 24 Apr 2019 19:23:25 +0200
changeset 547 e3ca6034a3b4
unstable orphan: obsolete parent cfa85506a071
parent 546 cfa85506a071
[wip, sparql] handle optional values
nazca/utils/dataio.py
--- a/nazca/utils/dataio.py	Thu Mar 21 16:45:25 2019 +0100
+++ b/nazca/utils/dataio.py	Wed Apr 24 19:23:25 2019 +0200
@@ -147,7 +147,7 @@
     for raw in rawresults["results"]["bindings"]:
         data = []
         if not indexes:
-            data = [transform(raw[label]['value']) for label in labels]
+            data = [transform(raw.get(label, {'value': ''})['value']) for label in labels]
         else:
             for il, ind in enumerate(indexes):
                 if isinstance(ind, tuple):