Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mboudet committed May 10, 2023
1 parent ddcc5a8 commit ce44398
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
17 changes: 8 additions & 9 deletions askomics/libaskomics/SparqlQuery.py
Expand Up @@ -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":
Expand Down Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions askomics/react/src/routes/query/attribute.jsx
Expand Up @@ -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) {
Expand All @@ -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 (
Expand Down

0 comments on commit ce44398

Please sign in to comment.