Skip to content

Commit

Permalink
fix(gravsearch): cleanse gravsearch date query (#681)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdelez committed Mar 15, 2022
1 parent a7d2098 commit a0f34ce
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -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';
Expand Down

0 comments on commit a0f34ce

Please sign in to comment.