implementazione riferimenti proemio, progress
This commit is contained in:
parent
73657243e0
commit
90f92dec02
|
@ -883,7 +883,7 @@ $(document).ready(function() {
|
|||
/*
|
||||
*/
|
||||
var mresult = await getVersiConCitazioni(cantica, canto)
|
||||
|
||||
|
||||
commentsSQL = Object.groupBy(mresult, ({ VersoCitazione }) => VersoCitazione);
|
||||
|
||||
var tmpkeys = []
|
||||
|
|
|
@ -885,8 +885,9 @@ $(document).ready(function() {
|
|||
var tmpkeys = []
|
||||
|
||||
for (const ke in commentsSQL) {
|
||||
//console.log(ke.split('-')[0])
|
||||
|
||||
var t = ke.split('-')[0]
|
||||
|
||||
if (tmpkeys.indexOf(t) == -1)
|
||||
tmpkeys.push(t)
|
||||
else
|
||||
|
@ -894,8 +895,15 @@ $(document).ready(function() {
|
|||
var pio = $("#" + idCommento + t)
|
||||
if (pio.length)
|
||||
break;
|
||||
var elverso = $("#" + idverso + t)//$("li[value='"+t+"']")
|
||||
//console.log(elverso)
|
||||
if(t=='Proemio'){
|
||||
console.log(idminimap+' '+t)
|
||||
var elcanto=$("#" + idminimap)
|
||||
createProemioSpan(idCommento + t, elcanto, commentsSQL[ke].length)
|
||||
continue
|
||||
}
|
||||
|
||||
var elverso = $("#" + idverso + t)
|
||||
|
||||
createCommentSpan(idCommento + t, elverso, commentsSQL[ke].length)
|
||||
}
|
||||
|
||||
|
@ -983,8 +991,12 @@ $(document).ready(function() {
|
|||
} else {
|
||||
var commentiSP = " commento su "
|
||||
}
|
||||
//noteGroupCard.append('<h6 class="card-title m-2 text-warning">' + cantica + ", Canto " + canto + versi + "</h6>");
|
||||
rigaNota.append('<h6 class="card-title m-2 text-warning"><span class="badge badge-warning badge-pill mx-1">' + len + "</span>" + commentiSP + cantica + ", Canto " + canto + versi + "</h6>");
|
||||
if (versi.includes('Proemio')){
|
||||
rigaNota.append('<h6 class="card-title m-2 text-warning"><span class="badge badge-warning badge-pill mx-1">' + len + "</span>" + cantica + ", Canto " + canto + ", Proemio </h6>");
|
||||
|
||||
}
|
||||
else
|
||||
rigaNota.append('<h6 class="card-title m-2 text-warning"><span class="badge badge-warning badge-pill mx-1">' + len + "</span>" + commentiSP + cantica + ", Canto " + canto + versi + "</h6>");
|
||||
rigaNota.appendTo(commentHeader);
|
||||
buttons.appendTo(commentHeader);
|
||||
commentHeader.appendTo(noteGroupCard);
|
||||
|
@ -1501,7 +1513,7 @@ $(document).ready(function() {
|
|||
function manageQuery() {
|
||||
cleanSearchResult()
|
||||
//var esprlogica = []
|
||||
var jsonQuery = getJsonQuery()
|
||||
var jsonQuery = JSON.parse(JSON.stringify(getJsonQuery()))
|
||||
|
||||
if (jsonQuery['QueryAvanzata'] == 0)
|
||||
unitaRicerca = 'forma'
|
||||
|
@ -1715,6 +1727,18 @@ $(document).ready(function() {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
function createProemioSpan(idVerso, elementoverso, numberOfComments) {
|
||||
var spanoccorrenza = $('<button />')
|
||||
spanoccorrenza.attr('id', idVerso)
|
||||
//btn-sm btn-outline-secondary
|
||||
spanoccorrenza.attr('class', 'btn btn-sm btn-outline-primary showcomments bg-light border-0 rounded text-primary px-1 pt-1 pb-0 ml-1');
|
||||
|
||||
spanoccorrenza.append('Proemio')
|
||||
//spanoccorrenza.append(number)
|
||||
|
||||
spanoccorrenza.prependTo(elementoverso)
|
||||
}
|
||||
|
||||
function createCommentSpan(idVerso, elementoverso, numberOfComments) {
|
||||
var spanoccorrenza = $('<button />')
|
||||
|
|
|
@ -41,7 +41,7 @@ const conn = await db.connect();
|
|||
|
||||
await conn.query(`
|
||||
CREATE TABLE riferimenti AS
|
||||
SELECT * FROM "https://lida.dantenetwork.it/js/data/riferimenti_3.parquet";
|
||||
SELECT * FROM "https://lida.dantenetwork.it/js/data/riferimenti_4.parquet";
|
||||
CREATE TABLE commedia AS
|
||||
SELECT * FROM "https://lida.dantenetwork.it/js/data/com.parquet";
|
||||
|
||||
|
@ -142,7 +142,7 @@ export async function getVersiConCitazioni(canticapar = '', cantopar = '') {
|
|||
|
||||
var result4 = table.toArray().map((row) => row.toJSON());
|
||||
|
||||
|
||||
console.log(result4)
|
||||
await tconn.close();
|
||||
return result4
|
||||
|
||||
|
@ -304,8 +304,9 @@ export async function queryRiferimenti(filtro, cid) {
|
|||
}
|
||||
spanbadge.appendTo($nctags.filter('[name="' + cantica + 'Canto ' + canto + '"]'))
|
||||
for (const tmpvi of tmpv) {
|
||||
let myveid = '#' + cantica + '_Canto_' + canto + '_' + tmpvi.Verso.split('-')[0]
|
||||
//console.log(myveid)
|
||||
var myveid = '#' + cantica + '_Canto_' + canto + '_' + tmpvi.Verso.split('-')[0]
|
||||
|
||||
console.log(myveid)
|
||||
listaidversi.push(myveid)
|
||||
listaidcommenti.push(tmpvi.IdRiferimento)
|
||||
if (cid.includes(cantica) && numcid == canto){
|
||||
|
|
|
@ -41,7 +41,7 @@ const conn = await db.connect();
|
|||
|
||||
await conn.query(`
|
||||
CREATE TABLE riferimenti AS
|
||||
SELECT * FROM "https://lida.dantenetwork.it/js/data/riferimenti_3.parquet";
|
||||
SELECT * FROM "https://lida.dantenetwork.it/js/data/riferimenti_4.parquet";
|
||||
CREATE TABLE commedia AS
|
||||
SELECT * FROM "https://lida.dantenetwork.it/js/data/com.parquet";
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ PREFIX olires:<https://dantenetwork.it/ontology/olires/current/>
|
|||
PREFIX comm: <http://dantenetwork.it/data/commedia/>
|
||||
PREFIX syntit: <https://dantenetwork.it/ontology/syntit/current/>
|
||||
|
||||
SELECT (?t_canto as ?Canto) (?t_cantica as ?Cantica) ?clatype ?clafunction ?clfr ?clto ?cl ?sentence ?cltext ?pos ?clocc
|
||||
SELECT (?t_canto as ?Canto) (?t_cantica as ?Cantica) ?clatype ?clafunction ?clfr ?clto ?cl ?sentence ?cltext ?pos ?clocc ?nv
|
||||
WHERE {
|
||||
FILTER(REGEX(?Rappresentazione, "^buon$", "i")) .
|
||||
FILTER(LANGMATCHES(LANG(?Rappresentazione), "it"))
|
||||
|
@ -29,6 +29,8 @@ WHERE {
|
|||
?fa olires:occurrenceOf ?form;
|
||||
olires:OccursInRegion ?reg .
|
||||
?reg olires:fragmentRegionFrom ?pos .
|
||||
?ve olires:hasStructuralComponent ?fa;
|
||||
olires:hasNumber ?nv.
|
||||
}
|
||||
###end
|
||||
###condizioni sintattiche
|
||||
|
@ -108,7 +110,7 @@ WHERE {
|
|||
BIND(COALESCE(?pos1,-1) AS ?pos)
|
||||
}`
|
||||
|
||||
|
||||
|
||||
//Query per advanced search con obiettivo = 'Frase'
|
||||
const clausetargetquery = `
|
||||
PREFIX ecrm: <http://erlangen-crm.org/current/>
|
||||
|
@ -396,7 +398,7 @@ const sentencetarget_syntgroup = `{
|
|||
"object": {"termType": "Variable","value": "clatype"}},
|
||||
{"subject": {"termType": "Variable","value": "cl"},
|
||||
"predicate": {"termType": "NamedNode","value": "https://dantenetwork.it/ontology/syntit/current/hasClauseFunction"},
|
||||
"object": {"termType": "Variable","value": "clafunction"}},
|
||||
"object": {"termType": "Variable","value": "clafunction"}},
|
||||
{"subject": {"termType": "Variable","value": "claocc"},
|
||||
"predicate": {"termType": "NamedNode","value": "https://dantenetwork.it/ontology/olires/current/occurrenceOf"},
|
||||
"object": {"termType": "Variable","value": "cl"}},
|
||||
|
@ -507,6 +509,12 @@ const sentencetarget_morphgroup_short = `{"type": "group",
|
|||
{"subject": {"termType": "Variable","value": "cloccte"},
|
||||
"predicate": {"termType": "NamedNode","value": "https://dantenetwork.it/ontology/olires/current/occurrenceOf"},
|
||||
"object": {"termType": "Variable","value": "clg"}},
|
||||
{"subject": {"termType": "Variable","value": "verso"},
|
||||
"predicate": {"termType": "NamedNode","value": "https://dantenetwork.it/ontology/olires/current/hasStructuralComponent"},
|
||||
"object": {"termType": "Variable","value": "fa"}},
|
||||
{"subject": {"termType": "Variable","value": "verso"},
|
||||
"predicate": {"termType": "NamedNode","value": "https://dantenetwork.it/ontology/olires/current/hasNumber"},
|
||||
"object": {"termType": "Variable","value": "nv"}},
|
||||
{"subject": {"termType": "Variable","value": "reg"},
|
||||
"predicate": {"termType": "NamedNode","value": "https://dantenetwork.it/ontology/olires/current/fragmentRegionFrom"},
|
||||
"object": {"termType": "Variable","value": "pos"}},
|
||||
|
|
|
@ -440,6 +440,7 @@ function buildSPQuery(guiquery) {
|
|||
multipleCondSpQuery = spqparser.parse(clausetargetquery);
|
||||
|
||||
}
|
||||
|
||||
if (theguiQ['unitaRicerca'] == 'periodo') {//Multiple Conditions
|
||||
multipleCondSpQuery = spqparser.parse(sentencetargetquery);
|
||||
/*bindConcatStatement = JSON.parse(sentencetarget_functionbind);
|
||||
|
@ -596,16 +597,16 @@ function buildSQ(stquery) {
|
|||
clausolaS = clause
|
||||
}
|
||||
//Simple query
|
||||
|
||||
filtroContestoJson = getFiltroContestoJson(JSON.parse(stquery[clausolaS]['contesto']))
|
||||
if (filtroContestoJson.length > 0) {
|
||||
|
||||
//filtroContestoJson = getFiltroContestoJson(JSON.parse(stquery[clausolaS]['contesto']))
|
||||
/*if (filtroContestoJson.length > 0) {
|
||||
for (tmpc of filtroContestoJson) {
|
||||
//console.log(filtroContesto[0])
|
||||
parsedquery.where.splice(1, 0, tmpc)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}*/
|
||||
|
||||
if (stquery[clausolaS]['queryText'] != "" && stquery[clausolaS]['Attiva'] == 1) {
|
||||
searchtext = stquery[clausolaS]['queryText']
|
||||
|
@ -688,7 +689,7 @@ function buildStatementClause(clause, parsedquery, whereind, theplace, token, op
|
|||
else
|
||||
tmpgroup = JSON.parse(syntgroup)
|
||||
}
|
||||
if (clause['TipoClausola'] == "Grammaticale") {
|
||||
if (clause['TipoClausola'] == "Grammaticale" || clause['TipoClausola'] == "Clausola") {
|
||||
if (theguiQ['unitaRicerca'] == 'periodo' || theguiQ['unitaRicerca'] == 'frase' || theguiQ['unitaRicerca'] == 'verso') {
|
||||
tmpgroup = JSON.parse(sentencetarget_morphgroup_short)
|
||||
}
|
||||
|
@ -758,7 +759,8 @@ function buildStatementClause(clause, parsedquery, whereind, theplace, token, op
|
|||
tmpg = tmpg.replaceAll('"pos"', '"pos' + token + '"')
|
||||
tmpg = tmpg.replaceAll('"lm"', '"lm' + token + '"')
|
||||
tmpg = tmpg.replaceAll('"reg"', '"reg' + token + '"')
|
||||
|
||||
tmpg = tmpg.replaceAll('"verso"', '"verso' + token + '"')
|
||||
tmpg = tmpg.replaceAll('"nv"', '"nv' + token + '"')
|
||||
if (op == 'OR')
|
||||
tmpg = tmpg.replaceAll('"clg"', '"clg' + token + '"')
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue