Skip to content

Commit

Permalink
Test date management
Browse files Browse the repository at this point in the history
  • Loading branch information
mboudet committed May 12, 2023
1 parent ce44398 commit 2fde253
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion askomics/libaskomics/SparqlQuery.py
Expand Up @@ -1430,7 +1430,11 @@ def build_query_from_json(self, preview=False, for_editor=False):
for filter in attribute.get('linkedFilters', []):
modifier_string = ""
if filter['filterValue']:
modifier_string = " {} {}".format(filter['filterModifier'], filter['filterValue'])
# Issue with virtuoso: engine-specific syntax for now (convert days to seconds)
if self.settings.get('triplestore', 'triplestore') == "virtuoso":
modifier_string = " {} {}".format(filter['filterModifier'], 24*3600*int(filter['filterValue']))
else:
modifier_string = ' {} "P{}D"xsd:duration'.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
Expand Down

0 comments on commit 2fde253

Please sign in to comment.