minor changes
This commit is contained in:
parent
371ba234db
commit
1253b5001e
|
@ -127,7 +127,7 @@ const maptypes = {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const filterposition=`
|
const filterposition = `
|
||||||
Filter = head:(interval? val?) {return head}
|
Filter = head:(interval? val?) {return head}
|
||||||
|
|
||||||
interval= limitinf? limitsup?
|
interval= limitinf? limitsup?
|
||||||
|
@ -142,7 +142,7 @@ const maptypes = {
|
||||||
_ "whitespace"= " "*`
|
_ "whitespace"= " "*`
|
||||||
|
|
||||||
//Filtro posizione
|
//Filtro posizione
|
||||||
var parserFiltroPosizione=peg.generate(filterposition);
|
var parserFiltroPosizione = peg.generate(filterposition);
|
||||||
|
|
||||||
var orlprefix = 'https://dantenetwork.it/ontology/orl/current/'
|
var orlprefix = 'https://dantenetwork.it/ontology/orl/current/'
|
||||||
|
|
||||||
|
@ -855,42 +855,32 @@ function buildStatementClause(clause, parsedquery, whereind, theplace, token, op
|
||||||
parsedquery['variables'].push(JSON.parse(tmppos))
|
parsedquery['variables'].push(JSON.parse(tmppos))
|
||||||
var andfilter = clausepos_gr_filter.replaceAll("pos_", "pos" + token)
|
var andfilter = clausepos_gr_filter.replaceAll("pos_", "pos" + token)
|
||||||
//TEST
|
//TEST
|
||||||
if (document.querySelector('#Posizione_fr')!=null &&
|
if (document.querySelector('#Posizione_fr') != null &&
|
||||||
document.querySelector('#Posizione_fr').value.trim()!=''){
|
document.querySelector('#Posizione_fr').value.trim() != '') {
|
||||||
var posrestr=document.querySelector('#Posizione_fr').value
|
var posrestr = document.querySelector('#Posizione_fr').value
|
||||||
var pospar=parserFiltroPosizione.parse(posrestr.trim())
|
var pospar = []
|
||||||
if (pospar[1]!=null){
|
try {
|
||||||
andfilter=andfilter.replace('<=', '=')
|
pospar = parserFiltroPosizione.parse(posrestr.trim())
|
||||||
andfilter=andfilter.replace('clfr', 'clfr+'+(parseInt(pospar[1])-1))
|
if (pospar[1] != null) {
|
||||||
|
andfilter = andfilter.replace('<=', '=')
|
||||||
|
andfilter = andfilter.replace('clfr', 'clfr+' + (parseInt(pospar[1]) - 1))
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
var inter=pospar[0]
|
var inter = pospar[0]
|
||||||
if (inter[0]!=null){
|
if (inter[0] != null) {
|
||||||
andfilter=andfilter.replace('clfr', 'clfr+'+(parseInt(inter[0])-1))
|
andfilter = andfilter.replace('clfr', 'clfr+' + (parseInt(inter[0])))
|
||||||
}
|
}
|
||||||
if (inter[1]!=null){
|
if (inter[1] != null) {
|
||||||
var newarg=`{
|
andfilter = andfilter.replace('clto', 'clfr+' + (parseInt(inter[1])))
|
||||||
"type": "operation",
|
|
||||||
"operator": ">",
|
|
||||||
"args": [
|
|
||||||
{
|
|
||||||
"termType": "Variable",
|
|
||||||
"value": "clfr"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"termType": "Variable",
|
|
||||||
"value": "pos_"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}`
|
|
||||||
newarg=newarg.replace("clfr", "clfr+"+parseInt(inter[1]))
|
|
||||||
var tmpij=JSON.parse(andfilter)
|
|
||||||
tmpij.expression.args.push(JSON.parse(newarg))
|
|
||||||
andfilter=JSON.stringify(tmpij)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.log(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
parsedquery['where'].push(JSON.parse(andfilter))
|
parsedquery['where'].push(JSON.parse(andfilter))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue