diff --git a/askomics/libaskomics/SparqlQuery.py b/askomics/libaskomics/SparqlQuery.py index 7c1a9551..c05ed4a4 100644 --- a/askomics/libaskomics/SparqlQuery.py +++ b/askomics/libaskomics/SparqlQuery.py @@ -1385,14 +1385,14 @@ def build_query_from_json(self, preview=False, for_editor=False): attributes[attribute["linkedWith"]]["entity_id"], attributes[attribute["linkedWith"]]["label"] )) - if any([filter.filterSign == "=" and not filter.filterValue for filter in attribute.get('linkedFilters', [])]): + if any([filter['filterSign'] == "=" and not filter['filterValue'] for filter in attribute.get('linkedFilters', [])]): var_to_replace.append((obj, var_2)) else: for filter in attribute.get('linkedFilters', []): modifier_string = "" - if filter.filterValue: - modifier_string = " {} {}".format(filter.filterModifier, filter.filterValue) - filter_string = "FILTER ( {} {} {} ) .".format(obj, var_2, modifier_string) + if filter['filterValue']: + modifier_string = " {} {}".format(filter['filterModifier'], filter['filterValue']) + filter_string = "FILTER ( {} {} {} {} ) .".format(obj, filter['filterSign'], var_2, modifier_string) self.store_filter(filter_string, block_id, sblock_id, pblock_ids) if attribute["type"] == "date": @@ -1424,16 +1424,15 @@ def build_query_from_json(self, preview=False, for_editor=False): attributes[attribute["linkedWith"]]["entity_id"], attributes[attribute["linkedWith"]]["label"] )) - if any([filter.filterSign == "=" and not filter.filterValue for filter in attribute.get('linkedFilters', [])]): + if any([filter['filterSign'] == "=" and not filter['filterValue'] for filter in attribute.get('linkedFilters', [])]): var_to_replace.append((obj, var_2)) else: for filter in attribute.get('linkedFilters', []): modifier_string = "" - if filter.filterValue: - modifier_string = " {} {}".format(filter.filterModifier, filter.filterValue) - filter_string = "FILTER ( {} {} {} ) .".format(obj, var_2, modifier_string) + if filter['filterValue']: + modifier_string = " {} {}".format(filter['filterModifier'], filter['filterValue']) + filter_string = "FILTER ( {} {} {} {} ) .".format(obj, filter['filterSign'], var_2, modifier_string) self.store_filter(filter_string, block_id, sblock_id, pblock_ids) - # Category if attribute["type"] == "category": if attribute["visible"] or attribute["filterSelectedValues"] != [] or attribute["id"] in strands or attribute["id"] in linked_attributes: diff --git a/askomics/react/src/routes/query/attribute.jsx b/askomics/react/src/routes/query/attribute.jsx index 4d3ef878..1c30517d 100644 --- a/askomics/react/src/routes/query/attribute.jsx +++ b/askomics/react/src/routes/query/attribute.jsx @@ -63,7 +63,7 @@ export default class AttributeBox extends Component { renderLinker (type="") { let options = [] let optionDict = {} - let customParams + let content this.props.graph.nodes.map(node => { if (!node.suggested) { @@ -78,10 +78,10 @@ export default class AttributeBox extends Component { }) if (type == "numeric"){ - let content = this.renderNumericLinker(optionDict) + content = this.renderNumericLinker(optionDict) } if (type == "date"){ - let content = this.renderNumericLinker(optionDict, "date") + content = this.renderNumericLinker(optionDict, "date") } return (