diff --git a/askomics/libaskomics/SparqlQuery.py b/askomics/libaskomics/SparqlQuery.py index 5a3c6a7b..ac8c36c5 100644 --- a/askomics/libaskomics/SparqlQuery.py +++ b/askomics/libaskomics/SparqlQuery.py @@ -1356,18 +1356,16 @@ def build_query_from_json(self, preview=False, for_editor=False): attributes[attribute["linkedWith"]]["entity_id"], attributes[attribute["linkedWith"]]["label"] )) - var_to_replace.append((obj, var_2)) - any([filter['filterSign'] == "=" and not filter['filterValue'] for filter in attribute.get('linkedFilters', [])]) if not (attribute.get('linkedNegative', False) or attribute.get('linkedFilterValue')): var_to_replace.append((obj, var_2)) else: - filter = "!=" if attribute.get('linkedNegative', False) else "=" + filter = "!" if attribute.get('linkedNegative', False) else "" regex_clause = var_2 if attribute.get('linkedFilterValue'): - regex_clause = "REGEX(REPLACE('{}', '\\$1', {}, 'i'))".format(attribute.get('linkedFilterValue'), var_2) - filter_string = "FILTER ( {} {} {} ) .".format(obj, filter, regex_clause) + regex_clause = "REGEX({}, REPLACE('{}', '\\\$1', {}), 'i')".format(obj, attribute.get('linkedFilterValue', "$1"), var_2) + filter_string = "FILTER ( {} {} ) .".format(filter, regex_clause) self.store_filter(filter_string, block_id, sblock_id, pblock_ids) # Numeric diff --git a/askomics/react/src/routes/query/attribute.jsx b/askomics/react/src/routes/query/attribute.jsx index 09c168b0..80c8dae2 100644 --- a/askomics/react/src/routes/query/attribute.jsx +++ b/askomics/react/src/routes/query/attribute.jsx @@ -67,6 +67,8 @@ export default class AttributeBox extends Component { let optionDict = {} let content + console.log("rendered") + this.props.graph.nodes.map(node => { if (!node.suggested) { options.push() @@ -80,16 +82,16 @@ export default class AttributeBox extends Component { }) if (this.props.attribute.type == 'text') { - box = this.renderTextLinker(optionDict) + content = this.renderTextLinker(optionDict) } if (this.props.attribute.type == 'decimal') { content = this.renderNumericLinker(optionDict) } if (this.props.attribute.type == 'category') { - box = this.renderBooleanLinker(optionDict) + content = this.renderBooleanLinker(optionDict) } if (this.props.attribute.type == 'boolean') { - box = this.renderBooleanLinker(optionDict) + content = this.renderBooleanLinker(optionDict) } if (this.props.attribute.type == 'date') { content = this.renderNumericLinker(optionDict, "date") @@ -190,7 +192,7 @@ export default class AttributeBox extends Component { input = () } - if (this.props.attribute.linkedWith) { + if (this.props.attribute.linked) { form = this.renderLinker() } else { form = (