query con versi, in progress
This commit is contained in:
parent
0ce4064238
commit
da3f41afa2
|
@ -113,6 +113,31 @@ WHERE {
|
||||||
}`
|
}`
|
||||||
|
|
||||||
|
|
||||||
|
//Query per advanced search con obiettivo = 'Verso'
|
||||||
|
const versotargetquery = `
|
||||||
|
PREFIX ecrm: <https://erlangen-crm.org/current/>
|
||||||
|
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
|
||||||
|
PREFIX olires: <https://dantenetwork.it/ontology/olires/current/>
|
||||||
|
PREFIX syntit: <https://dantenetwork.it/ontology/syntit/current/>
|
||||||
|
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
|
||||||
|
PREFIX lemon: <http://lemon-model.net/lemon#>
|
||||||
|
PREFIX orl: <https://dantenetwork.it/ontology/orl/current/>
|
||||||
|
PREFIX ontolex: <http://www.w3.org/ns/lemon/ontolex#>
|
||||||
|
prefix tresont: <https://itserr.it/tresont/current/>
|
||||||
|
|
||||||
|
SELECT distinct (?t_canto AS ?Canto) (?t_cantica AS ?Cantica) ?sentence ?clfr ?clto ?clafunction ?clt ?pos WHERE {
|
||||||
|
|
||||||
|
?verso olires:OccursInRegion ?regver.
|
||||||
|
?regver olires:fragmentRegionFrom ?clfr;
|
||||||
|
olires:fragmentRegionTo ?clto.
|
||||||
|
?canto olires:hasStructuralComponent ?verso;
|
||||||
|
ecrm:P102_has_title ?t_canto;
|
||||||
|
olires:hasNumber ?num.
|
||||||
|
?cantica ecrm:P102_has_title ?t_cantica;
|
||||||
|
olires:hasStructuralComponent ?canto.
|
||||||
|
|
||||||
|
}`
|
||||||
|
|
||||||
//Query per advanced search con obiettivo = 'Frase'
|
//Query per advanced search con obiettivo = 'Frase'
|
||||||
const clausetargetquery = `
|
const clausetargetquery = `
|
||||||
PREFIX ecrm: <https://erlangen-crm.org/current/>
|
PREFIX ecrm: <https://erlangen-crm.org/current/>
|
||||||
|
@ -245,6 +270,16 @@ const clausepos_gr_filter=`
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
const formapos_verso_filter=`
|
||||||
|
{
|
||||||
|
"type": "filter",
|
||||||
|
"expression": {
|
||||||
|
"type": "operation",
|
||||||
|
"operator": "=",
|
||||||
|
"args": []
|
||||||
|
}
|
||||||
|
}`
|
||||||
|
|
||||||
const formapos_frase_filter=`
|
const formapos_frase_filter=`
|
||||||
{
|
{
|
||||||
"type": "filter",
|
"type": "filter",
|
||||||
|
|
|
@ -455,6 +455,7 @@ var clauseTypeBindConcatStatement = ''
|
||||||
var clausePosCoalesceStatement = ''
|
var clausePosCoalesceStatement = ''
|
||||||
var occBindConcatStatement = ''
|
var occBindConcatStatement = ''
|
||||||
var posBindConcatStatement = ''
|
var posBindConcatStatement = ''
|
||||||
|
var filterVerso=''
|
||||||
|
|
||||||
var conditions = []
|
var conditions = []
|
||||||
var filters = []
|
var filters = []
|
||||||
|
@ -518,18 +519,22 @@ function buildSPQuery(guiquery) {
|
||||||
bindConcatStatement = JSON.parse(sentencetarget_functionbind);
|
bindConcatStatement = JSON.parse(sentencetarget_functionbind);
|
||||||
occBindConcatStatement = JSON.parse(sentencetarget_occbind);
|
occBindConcatStatement = JSON.parse(sentencetarget_occbind);
|
||||||
posBindConcatStatement = JSON.parse(sentencetarget_posbind);
|
posBindConcatStatement = JSON.parse(sentencetarget_posbind);
|
||||||
|
filterVerso=JSON.parse(formapos_verso_filter);
|
||||||
|
|
||||||
//clausePosCoalesceStatement = JSON.parse(clausetarget_coalesce);
|
//clausePosCoalesceStatement = JSON.parse(clausetarget_coalesce);
|
||||||
|
|
||||||
if (theguiQ['unitaRicerca'] == 'frase' || theguiQ['unitaRicerca'] == 'verso') {
|
if (theguiQ['unitaRicerca'] == 'verso') {
|
||||||
multipleCondSpQuery = spqparser.parse(clausetargetquery);
|
multipleCondSpQuery = spqparser.parse(versotargetquery);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (theguiQ['unitaRicerca'] == 'frase') {
|
||||||
|
multipleCondSpQuery = spqparser.parse(clausetargetquery);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if (theguiQ['unitaRicerca'] == 'periodo') {//Multiple Conditions
|
if (theguiQ['unitaRicerca'] == 'periodo') {//Multiple Conditions
|
||||||
multipleCondSpQuery = spqparser.parse(sentencetargetquery);
|
multipleCondSpQuery = spqparser.parse(sentencetargetquery);
|
||||||
/*bindConcatStatement = JSON.parse(sentencetarget_functionbind);
|
|
||||||
occBindConcatStatement = JSON.parse(sentencetarget_occbind);
|
|
||||||
posBindConcatStatement = JSON.parse(sentencetarget_posbind);*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -560,6 +565,10 @@ function buildSPQuery(guiquery) {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
/*if (theguiQ['unitaRicerca'] == 'verso'){
|
||||||
|
if(filterVerso.expression.args.length>1)
|
||||||
|
multipleCondSpQuery.where.push(filterVerso)
|
||||||
|
}*/
|
||||||
|
|
||||||
}
|
}
|
||||||
//preprocess multiple conditions query
|
//preprocess multiple conditions query
|
||||||
|
@ -856,8 +865,17 @@ function buildStatementClause(clause, parsedquery, whereind, theplace, token, op
|
||||||
tmpg = tmpg.replaceAll('"seqpos"', '"seqpos' + token + '"')
|
tmpg = tmpg.replaceAll('"seqpos"', '"seqpos' + token + '"')
|
||||||
tmpg = tmpg.replaceAll('"lm"', '"lm' + token + '"')
|
tmpg = tmpg.replaceAll('"lm"', '"lm' + token + '"')
|
||||||
tmpg = tmpg.replaceAll('"reg"', '"reg' + token + '"')
|
tmpg = tmpg.replaceAll('"reg"', '"reg' + token + '"')
|
||||||
tmpg = tmpg.replaceAll('"verso"', '"verso' + token + '"')
|
|
||||||
tmpg = tmpg.replaceAll('"nv"', '"nv' + token + '"')
|
if (theguiQ['unitaRicerca'] != 'verso'){
|
||||||
|
tmpg = tmpg.replaceAll('"verso"', '"verso' + token + '"')
|
||||||
|
tmpg = tmpg.replaceAll('"nv"', '"nv' + token + '"')
|
||||||
|
}
|
||||||
|
|
||||||
|
if (theguiQ['unitaRicerca'] == 'verso' && token >1){
|
||||||
|
tmpg = tmpg.replaceAll('"sentence"', '"sentence' + token + '"')
|
||||||
|
tmpg = tmpg.replaceAll('"clg"', '"cl' + token + '"')
|
||||||
|
}
|
||||||
|
|
||||||
if (op == 'OR')
|
if (op == 'OR')
|
||||||
tmpg = tmpg.replaceAll('"clg"', '"clg' + token + '"')
|
tmpg = tmpg.replaceAll('"clg"', '"clg' + token + '"')
|
||||||
else
|
else
|
||||||
|
@ -874,7 +892,9 @@ function buildStatementClause(clause, parsedquery, whereind, theplace, token, op
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}`
|
}`
|
||||||
|
|
||||||
|
var tmpopverso=`{"termType": "Variable", "value": "nv`+token +`"}`
|
||||||
|
filterVerso.expression.args.push(JSON.parse(tmpopverso))
|
||||||
if (theguiQ['unitaRicerca'] == 'periodo') {
|
if (theguiQ['unitaRicerca'] == 'periodo') {
|
||||||
posBindConcatStatement['expression']['args'].push(JSON.parse(tmppos))
|
posBindConcatStatement['expression']['args'].push(JSON.parse(tmppos))
|
||||||
tmppos = `{"termType": "Literal",
|
tmppos = `{"termType": "Literal",
|
||||||
|
@ -899,7 +919,7 @@ function buildStatementClause(clause, parsedquery, whereind, theplace, token, op
|
||||||
|
|
||||||
if (orfilters.length == 0 || !orfilters.includes(JSON.stringify(orfilter))) {
|
if (orfilters.length == 0 || !orfilters.includes(JSON.stringify(orfilter))) {
|
||||||
if (parsedquery['where'].at(-1).type == "filter") {
|
if (parsedquery['where'].at(-1).type == "filter") {
|
||||||
var texp = JSON.parse(JSON.stringify(parsedquery['where'].at(-1).expression))
|
var texp = formapos_frase_filterJSON.parse(JSON.stringify(parsedquery['where'].at(-1).expression))
|
||||||
var targs = []
|
var targs = []
|
||||||
targs.push(texp)
|
targs.push(texp)
|
||||||
targs.push(JSON.parse(JSON.stringify(orfilter.expression)))
|
targs.push(JSON.parse(JSON.stringify(orfilter.expression)))
|
||||||
|
@ -1497,7 +1517,7 @@ function resetGraphStruct() {
|
||||||
//var matches = listaClausoleRisultato.filter(s => s.includes(sentence[i].classList[0]));
|
//var matches = listaClausoleRisultato.filter(s => s.includes(sentence[i].classList[0]));
|
||||||
sentence[i].classList.remove('font-italic');
|
sentence[i].classList.remove('font-italic');
|
||||||
if (!vistaPeriodi && !listaPeriodiRisultato.includes(tmpsent)
|
if (!vistaPeriodi && !listaPeriodiRisultato.includes(tmpsent)
|
||||||
&& listaClausoleRisultato.filter(cl => cl.split('-')[0] == tmpsent).length == 0)
|
&& listaClausoleRisultato.flter(cl => cl.split('-')[0] == tmpsent).length == 0)
|
||||||
sentence[i].style.removeProperty('color');
|
sentence[i].style.removeProperty('color');
|
||||||
|
|
||||||
sentence[i].classList.remove('font-weight-normal');
|
sentence[i].classList.remove('font-weight-normal');
|
||||||
|
|
Loading…
Reference in New Issue