Skip to content
Permalink
Browse files
fix(gravsearch): cleanse gravsearch date query (#681)
  • Loading branch information
mdelez committed Mar 15, 2022
1 parent a7d2098 commit a0f34ce12ae0098a3b24e8e78e9d01ec98511a06
Showing 1 changed file with 3 additions and 1 deletion.
@@ -205,7 +205,9 @@ ${statement}
restriction += `FILTER <${ComparisonOperatorConstants.MatchFunction}>(${object}, ${propWithVal.valueLiteral.value.toSparql()})`;
} else if (propWithVal.property.objectType === Constants.DateValue) {
// handle date property
restriction = `FILTER(knora-api:toSimpleDate(${object}) ${propWithVal.valueLiteral.comparisonOperator.type} ${propWithVal.valueLiteral.value.toSparql()})`;
// cleanse date value
const dateValue = propWithVal.valueLiteral.value.toSparql().replace(/-undefined/g, '');
restriction = `FILTER(knora-api:toSimpleDate(${object}) ${propWithVal.valueLiteral.comparisonOperator.type} ${dateValue})`;
} else if (propWithVal.property.objectType === Constants.ListValue) {
// handle list node
restriction = `${object} <${this.complexTypeToProp[propWithVal.property.objectType]}> ${propWithVal.valueLiteral.value.toSparql()}` + '\n';

0 comments on commit a0f34ce

Please sign in to comment.