Skip to content

Commit

Permalink
also fix unselected link
Browse files Browse the repository at this point in the history
  • Loading branch information
mboudet committed Jun 9, 2023
1 parent f6f6362 commit dbc949b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions askomics/libaskomics/SparqlQuery.py
Expand Up @@ -1235,7 +1235,7 @@ def build_query_from_json(self, preview=False, for_editor=False):
"entity_label": attribute["entityLabel"],
"entity_id": attribute["nodeId"]
}
if attribute["linked"]:
if attribute["linked"] and attribute["linkedWith"]:
linked_attributes.extend((attribute["id"], attribute["linkedWith"]))

# Browse attributes
Expand Down Expand Up @@ -1279,7 +1279,7 @@ def build_query_from_json(self, preview=False, for_editor=False):
else:
self.store_value("VALUES {} {{ {} }} .".format(subject, filter_value), block_id, sblock_id, pblock_ids)

if attribute["linked"]:
if attribute["linked"] and attribute["linkedWith"]:
var_2 = self.format_sparql_variable("{}{}_uri".format(
attributes[attribute["linkedWith"]]["entity_label"],
attributes[attribute["linkedWith"]]["entity_id"]
Expand Down Expand Up @@ -1315,7 +1315,7 @@ def build_query_from_json(self, preview=False, for_editor=False):

if uri_val_list:
self.store_value("VALUES {} {{ {} }}".format(value_var, ' '.join(uri_val_list)), block_id, sblock_id, pblock_ids)
if attribute["linked"]:
if attribute["linked"] and attribute["linkedWith"]:
var_2 = self.format_sparql_variable("{}{}_{}".format(
attributes[attribute["linkedWith"]]["entity_label"],
attributes[attribute["linkedWith"]]["entity_id"],
Expand Down Expand Up @@ -1360,7 +1360,7 @@ def build_query_from_json(self, preview=False, for_editor=False):
self.store_filter("FILTER (str({}) != '{}') .".format(obj, attribute["filterValue"]), block_id, sblock_id, pblock_ids)
else:
self.store_value("VALUES {} {{ '{}' }} .".format(obj, attribute["filterValue"]), block_id, sblock_id, pblock_ids)
if attribute["linked"]:
if attribute["linked"] and attribute["linkedWith"]:
var_2 = self.format_sparql_variable("{}{}_{}".format(
attributes[attribute["linkedWith"]]["entity_label"],
attributes[attribute["linkedWith"]]["entity_id"],
Expand Down Expand Up @@ -1403,7 +1403,7 @@ def build_query_from_json(self, preview=False, for_editor=False):
else:
filter_string = "FILTER ( {} {} {} ) .".format(obj, filtr["filterSign"], filtr["filterValue"])
self.store_filter(filter_string, block_id, sblock_id, pblock_ids)
if attribute["linked"]:
if attribute["linked"] and attribute["linkedWith"]:
var_2 = self.format_sparql_variable("{}{}_{}".format(
attributes[attribute["linkedWith"]]["entity_label"],
attributes[attribute["linkedWith"]]["entity_id"],
Expand Down Expand Up @@ -1442,7 +1442,7 @@ def build_query_from_json(self, preview=False, for_editor=False):
else:
filter_string = "FILTER ( {} {} '{}'^^xsd:date ) .".format(obj, filtr["filterSign"], val)
self.store_filter(filter_string, block_id, sblock_id, pblock_ids)
if attribute["linked"]:
if attribute["linked"] and attribute["linkedWith"]:
var_2 = self.format_sparql_variable("{}{}_{}".format(
attributes[attribute["linkedWith"]]["entity_label"],
attributes[attribute["linkedWith"]]["entity_id"],
Expand Down Expand Up @@ -1542,7 +1542,7 @@ def build_query_from_json(self, preview=False, for_editor=False):
else:
self.store_value("VALUES {} {{ {} }}".format(value_var, ' '.join(uri_val_list)), block_id, sblock_id, pblock_ids)

if attribute["linked"]:
if attribute["linked"] and attribute["linkedWith"]:
var_2 = self.format_sparql_variable("{}{}_{}Category".format(
attributes[attribute["linkedWith"]]["entity_label"],
attributes[attribute["linkedWith"]]["entity_id"],
Expand Down

0 comments on commit dbc949b

Please sign in to comment.