query sui riferimenti in progress
This commit is contained in:
parent
74e62b31b4
commit
abb74e65a0
|
@ -1,9 +1,10 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
import { getVersiConCitazioni, queryRiferimenti} from './dataMgr.js';
|
||||
import { getJsonQuery, emptyStructCard } from './script_5.0.js';
|
||||
import {resetGraphStr} from './syntgraph_5.0.js'
|
||||
import { getVersiConCitazioni, queryRiferimenti} from './dataMgr.js';
|
||||
|
||||
|
||||
export var resetResult;
|
||||
export var lsentid;
|
||||
|
@ -15,6 +16,8 @@ var vistaRiferimenti = true
|
|||
export var listaPeriodiRisultato;
|
||||
export var listaClausoleRisultato;
|
||||
export var numeroContesti;
|
||||
export var cantoDisplayed;
|
||||
const cantobadgeclass = 'badge badge-outline-warning badge-pill'
|
||||
const hdnNamespace = 'http://dantenetwork.it/data/commedia/'
|
||||
const syntitNamespace = 'https://dantenetwork.it/ontology/syntit/current/'
|
||||
|
||||
|
@ -31,7 +34,7 @@ $(document).ready(function() {
|
|||
}
|
||||
const dialogaltri = 'diaAltri'
|
||||
var listaClausoleRisultatoContesti = []
|
||||
const cantobadgeclass = 'badge badge-outline-warning badge-pill'
|
||||
|
||||
|
||||
const sparqlGenerator = sparqljs.Generator;
|
||||
const myEngine = new Comunica.QueryEngine();
|
||||
|
@ -52,7 +55,7 @@ $(document).ready(function() {
|
|||
const openSTag = "{"
|
||||
const closeSTag = "}"
|
||||
|
||||
var cantoDisplayed = "#InfernoCanto_1";
|
||||
cantoDisplayed = "#InfernoCanto_1";
|
||||
|
||||
var prevCantoDisplayed = "#InfernoCanto_1";
|
||||
var contextLength = 3;
|
||||
|
@ -656,6 +659,8 @@ $(document).ready(function() {
|
|||
|
||||
return (cantica + '_' + mcanto.split('_')[1])
|
||||
}
|
||||
|
||||
|
||||
|
||||
function loadPeriodo(idperiodo) {
|
||||
|
||||
|
@ -694,24 +699,6 @@ $(document).ready(function() {
|
|||
return false
|
||||
}
|
||||
|
||||
/*function loadFrase(idperiodo, funzionefrase) {
|
||||
|
||||
if (!isPeriodoInCanto(idperiodo, cantoDisplayed))
|
||||
return
|
||||
|
||||
$(cantoDisplayed).find(' .' + idperiodo).each(function() {
|
||||
var pstp = $(this).attr('class').split(" ")[1]
|
||||
|
||||
if (pstp.trim() == funzionefrase)
|
||||
$(this).css('color', colorssp(mapsynttypestopalette[pstp]));
|
||||
})
|
||||
|
||||
minim.contents().find(' .' + idperiodo).each(function() {
|
||||
var mpstp = $(this).attr('class').split(" ")[1]
|
||||
if (mpstp.trim() == funzionefrase)
|
||||
$(this).css('color', colorssp(mapsynttypestopalette[mpstp]));
|
||||
})
|
||||
}*/
|
||||
|
||||
function loadClausola(idperiodo, funzionefrase, fromn, ton) {
|
||||
|
||||
|
@ -897,6 +884,8 @@ $(document).ready(function() {
|
|||
if (canto.length == 1)
|
||||
canto = '0' + canto
|
||||
//commentsJson = getVersiConCitazioniJson(cantica, canto)
|
||||
|
||||
|
||||
var mresult =await getVersiConCitazioni(cantica, canto)
|
||||
|
||||
commentsSQL= Object.groupBy(mresult, ({ VersoCitazione }) => VersoCitazione);
|
||||
|
@ -1526,7 +1515,7 @@ $(document).ready(function() {
|
|||
else
|
||||
unitaRicerca = jsonQuery['unitaRicerca']
|
||||
if (unitaRicerca=='riferimenti'){
|
||||
queryRiferimenti(jsonQuery.Riferimento100)
|
||||
var mres=queryRiferimenti(jsonQuery.Riferimento100, cantoDisplayed)
|
||||
return
|
||||
}
|
||||
console.log("got json query, unita ricerca: " + unitaRicerca)
|
||||
|
@ -1632,17 +1621,6 @@ $(document).ready(function() {
|
|||
|
||||
|
||||
|
||||
//manage sentence and clauses
|
||||
|
||||
/* function showSentenceStructure(sentence) {
|
||||
|
||||
sid = '.' + sentence.toString()
|
||||
//console.log(sid)
|
||||
$(sid).addClass('text-info font-italic')
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
function resetSentenceStructure(sentence) {
|
||||
$(" ." + sentence).removeClass('text-info font-italic')
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
import * as duckdb from 'https://cdn.jsdelivr.net/npm/@duckdb/duckdb-wasm@1.29.0/+esm';
|
||||
|
||||
|
||||
//import * as arrow from 'https://cdn.skypack.dev/apache-arrow@9'
|
||||
|
||||
|
||||
|
@ -6,7 +8,7 @@ var rif_commentatori=[];
|
|||
var rif_autori=[];
|
||||
var rif_areetematiche=[];
|
||||
var rif_fonti=[];
|
||||
|
||||
const cantobadgeclassBis = 'badge badge-outline-warning badge-pill'
|
||||
|
||||
const JSDELIVR_BUNDLES = duckdb.getJsDelivrBundles();
|
||||
|
||||
|
@ -128,7 +130,7 @@ export async function getVersiConCitazioni(canticapar = '', cantopar = '') {
|
|||
return result4
|
||||
|
||||
}
|
||||
export async function queryRiferimenti(filtro){
|
||||
export async function queryRiferimenti(filtro, cid){
|
||||
if(filtro==null){
|
||||
return
|
||||
}
|
||||
|
@ -148,7 +150,11 @@ export async function queryRiferimenti(filtro){
|
|||
|
||||
await tconn.close();
|
||||
var resxcantica= Object.groupBy(result4, ({ Cantica }) => Cantica);
|
||||
|
||||
|
||||
var numcid=cid.split('_')[1]
|
||||
for (var cantica in resxcantica){
|
||||
var $nctags = $(' .navig-canto')
|
||||
console.log(resxcantica[cantica].length)
|
||||
var i=1;
|
||||
if (cantica=='Purgatorio')
|
||||
|
@ -160,9 +166,32 @@ export async function queryRiferimenti(filtro){
|
|||
spanbadgecantica.append(resxcantica[cantica].length)
|
||||
spanbadgecantica.appendTo($('#cantica' + i + '-badge'))
|
||||
console.log(spanbadgecantica)
|
||||
var tmp=resxcantica[cantica]
|
||||
var resxcanto= Object.groupBy(tmp, ({ Canto }) => Canto);
|
||||
for (var canto in resxcanto){
|
||||
var tmpv=resxcanto[canto]
|
||||
var spanbadge = $('<span />');
|
||||
spanbadge.attr('class', cantobadgeclassBis);
|
||||
spanbadge.append(resxcanto[canto].length)
|
||||
if (canto.startsWith('0')){
|
||||
canto= canto.replace('0', '')
|
||||
}
|
||||
spanbadge.appendTo($nctags.filter('[name="' + cantica + 'Canto ' + canto + '"]'))
|
||||
if (cid.includes(cantica) && numcid==canto){
|
||||
|
||||
|
||||
for (const tmpvi of tmpv){
|
||||
let myveid='#'+cantica+'_Canto_'+canto+'_'+tmpvi.Verso.split('-')[0]
|
||||
console.log(myveid)
|
||||
$(myveid).addClass("font-weight-bold mark ")
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
drawMinimap(cid, true)
|
||||
|
||||
}
|
||||
/*console.log(resxcantica)*/
|
||||
return
|
||||
return resxcantica
|
||||
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
import commarc from "https://hdnlab1.isti.cnr.it/d3search/node_modules/commarcdiag/index.js";*/
|
||||
import {Runtime, Library, Inspector} from "https://lida.dantenetwork.it/node_modules/commarcdiag/runtime.js";
|
||||
import commarc from "https://lida.dantenetwork.it/node_modules/commarcdiag/index.js";
|
||||
import {formaClass, lisid, lsentid, vistaPeriodi, listaPeriodiRisultato, listaClausoleRisultato} from "./browseMgr_5.0.js"
|
||||
import {formaClass, lisid, lsentid, vistaPeriodi, listaPeriodiRisultato, listaClausoleRisultato, cantoDisplayed} from "./browseMgr_5.0.js"
|
||||
import { fillStructCard, emptyStructCard } from "./script_5.0.js";
|
||||
|
||||
const iframe = document.getElementsByClassName("minimap__content");
|
||||
|
|
Loading…
Reference in New Issue