diff --git a/pygeoapi_plugins/provider/sparql.py b/pygeoapi_plugins/provider/sparql.py index ed12db6..3c823f1 100644 --- a/pygeoapi_plugins/provider/sparql.py +++ b/pygeoapi_plugins/provider/sparql.py @@ -292,11 +292,11 @@ def _clean_result(self, result): if not v_: continue - if not isinstance(v_, list): + if not isinstance(v_, list) and v_: ret[_id][k] = [v_] # If the current value is not already in the list, append it - if v_ not in [item['value'] for item in ret[_id][k]]: + if v_ not in [item['value'] for item in ret[_id][k]] and v_: ret[_id][k].append(v_) return ret @@ -411,8 +411,10 @@ def parse(value: str) -> list: otherwise the original string. """ if '|' in value: + LOGGER.debug('Splitting value by "|"') return value.split('|') elif ', ' in value: + LOGGER.debug('Splitting value by ", "') return value.split(', ') else: return value @@ -432,6 +434,7 @@ def combine_lists(dict_data: dict): # Ensure all lists have the same length length = len(dict_data[keys[0]]) if not all(len(dict_data[key]) == length for key in keys) and len(keys > 1): + LOGGER.debug('Returning un-mondified data') return dict_data # Combine the items into a list of dictionaries