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)
|
var mresult = await getVersiConCitazioni(cantica, canto)
|
||||||
|
|
||||||
commentsSQL = Object.groupBy(mresult, ({ VersoCitazione }) => VersoCitazione);
|
commentsSQL = Object.groupBy(mresult, ({ VersoCitazione }) => VersoCitazione);
|
||||||
|
|
||||||
var tmpkeys = []
|
var tmpkeys = []
|
||||||
|
|
|
||||||
|
|
@ -885,8 +885,9 @@ $(document).ready(function() {
|
||||||
var tmpkeys = []
|
var tmpkeys = []
|
||||||
|
|
||||||
for (const ke in commentsSQL) {
|
for (const ke in commentsSQL) {
|
||||||
//console.log(ke.split('-')[0])
|
|
||||||
var t = ke.split('-')[0]
|
var t = ke.split('-')[0]
|
||||||
|
|
||||||
if (tmpkeys.indexOf(t) == -1)
|
if (tmpkeys.indexOf(t) == -1)
|
||||||
tmpkeys.push(t)
|
tmpkeys.push(t)
|
||||||
else
|
else
|
||||||
|
|
@ -894,8 +895,15 @@ $(document).ready(function() {
|
||||||
var pio = $("#" + idCommento + t)
|
var pio = $("#" + idCommento + t)
|
||||||
if (pio.length)
|
if (pio.length)
|
||||||
break;
|
break;
|
||||||
var elverso = $("#" + idverso + t)//$("li[value='"+t+"']")
|
if(t=='Proemio'){
|
||||||
//console.log(elverso)
|
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)
|
createCommentSpan(idCommento + t, elverso, commentsSQL[ke].length)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -983,8 +991,12 @@ $(document).ready(function() {
|
||||||
} else {
|
} else {
|
||||||
var commentiSP = " commento su "
|
var commentiSP = " commento su "
|
||||||
}
|
}
|
||||||
//noteGroupCard.append('<h6 class="card-title m-2 text-warning">' + 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>" + commentiSP + 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>" + 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);
|
rigaNota.appendTo(commentHeader);
|
||||||
buttons.appendTo(commentHeader);
|
buttons.appendTo(commentHeader);
|
||||||
commentHeader.appendTo(noteGroupCard);
|
commentHeader.appendTo(noteGroupCard);
|
||||||
|
|
@ -1501,7 +1513,7 @@ $(document).ready(function() {
|
||||||
function manageQuery() {
|
function manageQuery() {
|
||||||
cleanSearchResult()
|
cleanSearchResult()
|
||||||
//var esprlogica = []
|
//var esprlogica = []
|
||||||
var jsonQuery = getJsonQuery()
|
var jsonQuery = JSON.parse(JSON.stringify(getJsonQuery()))
|
||||||
|
|
||||||
if (jsonQuery['QueryAvanzata'] == 0)
|
if (jsonQuery['QueryAvanzata'] == 0)
|
||||||
unitaRicerca = 'forma'
|
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) {
|
function createCommentSpan(idVerso, elementoverso, numberOfComments) {
|
||||||
var spanoccorrenza = $('<button />')
|
var spanoccorrenza = $('<button />')
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ const conn = await db.connect();
|
||||||
|
|
||||||
await conn.query(`
|
await conn.query(`
|
||||||
CREATE TABLE riferimenti AS
|
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
|
CREATE TABLE commedia AS
|
||||||
SELECT * FROM "https://lida.dantenetwork.it/js/data/com.parquet";
|
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());
|
var result4 = table.toArray().map((row) => row.toJSON());
|
||||||
|
|
||||||
|
console.log(result4)
|
||||||
await tconn.close();
|
await tconn.close();
|
||||||
return result4
|
return result4
|
||||||
|
|
||||||
|
|
@ -304,8 +304,9 @@ export async function queryRiferimenti(filtro, cid) {
|
||||||
}
|
}
|
||||||
spanbadge.appendTo($nctags.filter('[name="' + cantica + 'Canto ' + canto + '"]'))
|
spanbadge.appendTo($nctags.filter('[name="' + cantica + 'Canto ' + canto + '"]'))
|
||||||
for (const tmpvi of tmpv) {
|
for (const tmpvi of tmpv) {
|
||||||
let myveid = '#' + cantica + '_Canto_' + canto + '_' + tmpvi.Verso.split('-')[0]
|
var myveid = '#' + cantica + '_Canto_' + canto + '_' + tmpvi.Verso.split('-')[0]
|
||||||
//console.log(myveid)
|
|
||||||
|
console.log(myveid)
|
||||||
listaidversi.push(myveid)
|
listaidversi.push(myveid)
|
||||||
listaidcommenti.push(tmpvi.IdRiferimento)
|
listaidcommenti.push(tmpvi.IdRiferimento)
|
||||||
if (cid.includes(cantica) && numcid == canto){
|
if (cid.includes(cantica) && numcid == canto){
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ const conn = await db.connect();
|
||||||
|
|
||||||
await conn.query(`
|
await conn.query(`
|
||||||
CREATE TABLE riferimenti AS
|
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
|
CREATE TABLE commedia AS
|
||||||
SELECT * FROM "https://lida.dantenetwork.it/js/data/com.parquet";
|
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 comm: <http://dantenetwork.it/data/commedia/>
|
||||||
PREFIX syntit: <https://dantenetwork.it/ontology/syntit/current/>
|
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 {
|
WHERE {
|
||||||
FILTER(REGEX(?Rappresentazione, "^buon$", "i")) .
|
FILTER(REGEX(?Rappresentazione, "^buon$", "i")) .
|
||||||
FILTER(LANGMATCHES(LANG(?Rappresentazione), "it"))
|
FILTER(LANGMATCHES(LANG(?Rappresentazione), "it"))
|
||||||
|
|
@ -29,6 +29,8 @@ WHERE {
|
||||||
?fa olires:occurrenceOf ?form;
|
?fa olires:occurrenceOf ?form;
|
||||||
olires:OccursInRegion ?reg .
|
olires:OccursInRegion ?reg .
|
||||||
?reg olires:fragmentRegionFrom ?pos .
|
?reg olires:fragmentRegionFrom ?pos .
|
||||||
|
?ve olires:hasStructuralComponent ?fa;
|
||||||
|
olires:hasNumber ?nv.
|
||||||
}
|
}
|
||||||
###end
|
###end
|
||||||
###condizioni sintattiche
|
###condizioni sintattiche
|
||||||
|
|
@ -108,7 +110,7 @@ WHERE {
|
||||||
BIND(COALESCE(?pos1,-1) AS ?pos)
|
BIND(COALESCE(?pos1,-1) AS ?pos)
|
||||||
}`
|
}`
|
||||||
|
|
||||||
|
|
||||||
//Query per advanced search con obiettivo = 'Frase'
|
//Query per advanced search con obiettivo = 'Frase'
|
||||||
const clausetargetquery = `
|
const clausetargetquery = `
|
||||||
PREFIX ecrm: <http://erlangen-crm.org/current/>
|
PREFIX ecrm: <http://erlangen-crm.org/current/>
|
||||||
|
|
@ -396,7 +398,7 @@ const sentencetarget_syntgroup = `{
|
||||||
"object": {"termType": "Variable","value": "clatype"}},
|
"object": {"termType": "Variable","value": "clatype"}},
|
||||||
{"subject": {"termType": "Variable","value": "cl"},
|
{"subject": {"termType": "Variable","value": "cl"},
|
||||||
"predicate": {"termType": "NamedNode","value": "https://dantenetwork.it/ontology/syntit/current/hasClauseFunction"},
|
"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"},
|
{"subject": {"termType": "Variable","value": "claocc"},
|
||||||
"predicate": {"termType": "NamedNode","value": "https://dantenetwork.it/ontology/olires/current/occurrenceOf"},
|
"predicate": {"termType": "NamedNode","value": "https://dantenetwork.it/ontology/olires/current/occurrenceOf"},
|
||||||
"object": {"termType": "Variable","value": "cl"}},
|
"object": {"termType": "Variable","value": "cl"}},
|
||||||
|
|
@ -507,6 +509,12 @@ const sentencetarget_morphgroup_short = `{"type": "group",
|
||||||
{"subject": {"termType": "Variable","value": "cloccte"},
|
{"subject": {"termType": "Variable","value": "cloccte"},
|
||||||
"predicate": {"termType": "NamedNode","value": "https://dantenetwork.it/ontology/olires/current/occurrenceOf"},
|
"predicate": {"termType": "NamedNode","value": "https://dantenetwork.it/ontology/olires/current/occurrenceOf"},
|
||||||
"object": {"termType": "Variable","value": "clg"}},
|
"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"},
|
{"subject": {"termType": "Variable","value": "reg"},
|
||||||
"predicate": {"termType": "NamedNode","value": "https://dantenetwork.it/ontology/olires/current/fragmentRegionFrom"},
|
"predicate": {"termType": "NamedNode","value": "https://dantenetwork.it/ontology/olires/current/fragmentRegionFrom"},
|
||||||
"object": {"termType": "Variable","value": "pos"}},
|
"object": {"termType": "Variable","value": "pos"}},
|
||||||
|
|
|
||||||
|
|
@ -440,6 +440,7 @@ function buildSPQuery(guiquery) {
|
||||||
multipleCondSpQuery = spqparser.parse(clausetargetquery);
|
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);
|
/*bindConcatStatement = JSON.parse(sentencetarget_functionbind);
|
||||||
|
|
@ -596,16 +597,16 @@ function buildSQ(stquery) {
|
||||||
clausolaS = clause
|
clausolaS = clause
|
||||||
}
|
}
|
||||||
//Simple query
|
//Simple query
|
||||||
|
|
||||||
filtroContestoJson = getFiltroContestoJson(JSON.parse(stquery[clausolaS]['contesto']))
|
//filtroContestoJson = getFiltroContestoJson(JSON.parse(stquery[clausolaS]['contesto']))
|
||||||
if (filtroContestoJson.length > 0) {
|
/*if (filtroContestoJson.length > 0) {
|
||||||
for (tmpc of filtroContestoJson) {
|
for (tmpc of filtroContestoJson) {
|
||||||
//console.log(filtroContesto[0])
|
//console.log(filtroContesto[0])
|
||||||
parsedquery.where.splice(1, 0, tmpc)
|
parsedquery.where.splice(1, 0, tmpc)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}*/
|
||||||
|
|
||||||
if (stquery[clausolaS]['queryText'] != "" && stquery[clausolaS]['Attiva'] == 1) {
|
if (stquery[clausolaS]['queryText'] != "" && stquery[clausolaS]['Attiva'] == 1) {
|
||||||
searchtext = stquery[clausolaS]['queryText']
|
searchtext = stquery[clausolaS]['queryText']
|
||||||
|
|
@ -688,7 +689,7 @@ function buildStatementClause(clause, parsedquery, whereind, theplace, token, op
|
||||||
else
|
else
|
||||||
tmpgroup = JSON.parse(syntgroup)
|
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') {
|
if (theguiQ['unitaRicerca'] == 'periodo' || theguiQ['unitaRicerca'] == 'frase' || theguiQ['unitaRicerca'] == 'verso') {
|
||||||
tmpgroup = JSON.parse(sentencetarget_morphgroup_short)
|
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('"pos"', '"pos' + 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 (op == 'OR')
|
if (op == 'OR')
|
||||||
tmpg = tmpg.replaceAll('"clg"', '"clg' + token + '"')
|
tmpg = tmpg.replaceAll('"clg"', '"clg' + token + '"')
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue