Skip to content

Commit

Permalink
comment on CleanQuery
Browse files Browse the repository at this point in the history
  • Loading branch information
tfrancart committed Dec 10, 2024
1 parent 83ae1c1 commit 2120c6c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/sparnatural-form/components/CleanQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,15 @@ class CleanQuery {
let cleanQueryResult:ISparJson = JSON.parse(JSON.stringify(this.query));

// remove selected variables if onscreen display
// we remove variables from the SELECT clause
// further cleaning steps will remove the corresponding criteria from the WHERE clause if they are optional,
// and they have no value, and they are no more in the SELECT clause
cleanQueryResult = this.removeUnusedVariablesFromSelect(cleanQueryResult, "onscreen");

// re-list the variables used in result set
// re-list the variables used in the result set, after the previous filtering step
let variablesUsedInResultSet:string[] = this.getVariablesUsedInResultSet(cleanQueryResult);

// clean the branches (= the WHERE clause)
cleanQueryResult.branches = this.cleanBranches(
cleanQueryResult.branches,
variablesUsedInResultSet
Expand Down

0 comments on commit 2120c6c

Please sign in to comment.