minor changes
This commit is contained in:
parent
371ba234db
commit
1253b5001e
|
@ -124,10 +124,10 @@ const maptypes = {
|
|||
/*
|
||||
* regole di parsing per il filtro
|
||||
*/
|
||||
|
||||
|
||||
|
||||
const filterposition=`
|
||||
|
||||
const filterposition = `
|
||||
Filter = head:(interval? val?) {return head}
|
||||
|
||||
interval= limitinf? limitsup?
|
||||
|
@ -142,7 +142,7 @@ const maptypes = {
|
|||
_ "whitespace"= " "*`
|
||||
|
||||
//Filtro posizione
|
||||
var parserFiltroPosizione=peg.generate(filterposition);
|
||||
var parserFiltroPosizione = peg.generate(filterposition);
|
||||
|
||||
var orlprefix = 'https://dantenetwork.it/ontology/orl/current/'
|
||||
|
||||
|
@ -233,7 +233,7 @@ function getContextLastPosition(formaid, numversi = 3) {
|
|||
var listaforme = formeprima;
|
||||
|
||||
var limitv = Math.max((numversi), 3)
|
||||
|
||||
|
||||
var offset = parseInt(formaid);
|
||||
|
||||
if (parseInt(formaid) > 33373 && parseInt(formaid) < 66588) {
|
||||
|
@ -463,7 +463,7 @@ function buildSPQuery(guiquery) {
|
|||
multipleCondSpQuery = spqparser.parse(clausetargetquery);
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (theguiQ['unitaRicerca'] == 'periodo') {//Multiple Conditions
|
||||
multipleCondSpQuery = spqparser.parse(sentencetargetquery);
|
||||
/*bindConcatStatement = JSON.parse(sentencetarget_functionbind);
|
||||
|
@ -632,7 +632,7 @@ function buildSQ(stquery) {
|
|||
clausolaS = clause
|
||||
}
|
||||
//Simple query
|
||||
|
||||
|
||||
//filtroContestoJson = getFiltroContestoJson(JSON.parse(stquery[clausolaS]['contesto']))
|
||||
/*if (filtroContestoJson.length > 0) {
|
||||
for (tmpc of filtroContestoJson) {
|
||||
|
@ -833,8 +833,8 @@ function buildStatementClause(clause, parsedquery, whereind, theplace, token, op
|
|||
if (op == 'OR') {
|
||||
clausePosCoalesceStatement['expression']['args'].push(JSON.parse(tmppos))
|
||||
var orfilter = JSON.parse(clausepos_gr_filter.replaceAll("pos_", "pos" + idtokenor))
|
||||
|
||||
|
||||
|
||||
|
||||
if (orfilters.length == 0 || !orfilters.includes(JSON.stringify(orfilter))) {
|
||||
if (parsedquery['where'].at(-1).type == "filter") {
|
||||
var texp = JSON.parse(JSON.stringify(parsedquery['where'].at(-1).expression))
|
||||
|
@ -855,42 +855,32 @@ function buildStatementClause(clause, parsedquery, whereind, theplace, token, op
|
|||
parsedquery['variables'].push(JSON.parse(tmppos))
|
||||
var andfilter = clausepos_gr_filter.replaceAll("pos_", "pos" + token)
|
||||
//TEST
|
||||
if (document.querySelector('#Posizione_fr')!=null &&
|
||||
document.querySelector('#Posizione_fr').value.trim()!=''){
|
||||
var posrestr=document.querySelector('#Posizione_fr').value
|
||||
var pospar=parserFiltroPosizione.parse(posrestr.trim())
|
||||
if (pospar[1]!=null){
|
||||
andfilter=andfilter.replace('<=', '=')
|
||||
andfilter=andfilter.replace('clfr', 'clfr+'+(parseInt(pospar[1])-1))
|
||||
if (document.querySelector('#Posizione_fr') != null &&
|
||||
document.querySelector('#Posizione_fr').value.trim() != '') {
|
||||
var posrestr = document.querySelector('#Posizione_fr').value
|
||||
var pospar = []
|
||||
try {
|
||||
pospar = parserFiltroPosizione.parse(posrestr.trim())
|
||||
if (pospar[1] != null) {
|
||||
andfilter = andfilter.replace('<=', '=')
|
||||
andfilter = andfilter.replace('clfr', 'clfr+' + (parseInt(pospar[1]) - 1))
|
||||
}
|
||||
else{
|
||||
var inter=pospar[0]
|
||||
if (inter[0]!=null){
|
||||
andfilter=andfilter.replace('clfr', 'clfr+'+(parseInt(inter[0])-1))
|
||||
else {
|
||||
var inter = pospar[0]
|
||||
if (inter[0] != null) {
|
||||
andfilter = andfilter.replace('clfr', 'clfr+' + (parseInt(inter[0])))
|
||||
}
|
||||
if (inter[1]!=null){
|
||||
var newarg=`{
|
||||
"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)
|
||||
if (inter[1] != null) {
|
||||
andfilter = andfilter.replace('clto', 'clfr+' + (parseInt(inter[1])))
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
console.log(err)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
parsedquery['where'].push(JSON.parse(andfilter))
|
||||
|
||||
}
|
||||
|
@ -1376,7 +1366,7 @@ function buildMacroSyntType(sttmnt) {
|
|||
"predicate": {"termType":"NamedNode"},
|
||||
"object": {"termType": "NamedNode"}}`
|
||||
|
||||
|
||||
|
||||
var res = []
|
||||
|
||||
var obj = syntitprefix + (sttmnt.split(':')[1])
|
||||
|
@ -1395,7 +1385,7 @@ function buildMacroSyntType(sttmnt) {
|
|||
unionst['patterns'].push(grstmt)
|
||||
unionst['patterns'].push(statement)
|
||||
res.push(unionst)
|
||||
|
||||
|
||||
return res
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue