bug fixing
This commit is contained in:
parent
6a428b7230
commit
8268a419fa
|
@ -320,7 +320,7 @@ $(document).ready(function() {
|
|||
continue;
|
||||
}
|
||||
numeroRisultati = numeroRisultati + 1;
|
||||
//ultimaPosizione=await getFormaCntxtLastPosition(risultato, contextLength)
|
||||
|
||||
ultimaPosizione = getContextLastPosition(risultato, contextLength);
|
||||
}
|
||||
numeroContesti = numeroRisultati
|
||||
|
@ -354,7 +354,6 @@ $(document).ready(function() {
|
|||
}
|
||||
if (contaContesti > endcont)
|
||||
break;
|
||||
//ultimaPosizione=await getFormaCntxtLastPosition(risultato, contextLength)
|
||||
ultimaPosizione = getContextLastPosition(risultato, contextLength);
|
||||
}
|
||||
//ordino la lista dei risultati
|
||||
|
|
|
@ -38,13 +38,12 @@ console.log('datamgr init done')
|
|||
await db.registerFileBuffer('buffer.parquet', new Uint8Array(await res.arrayBuffer()));*/
|
||||
|
||||
const conn = await db.connect();
|
||||
|
||||
//CREATE TABLE commedia AS
|
||||
// SELECT * FROM "https://lida.dantenetwork.it/js/data/com.parquet";
|
||||
await conn.query(`
|
||||
CREATE TABLE riferimenti AS
|
||||
SELECT * FROM "https://lida.dantenetwork.it/js/data/riferimenti_5.parquet";
|
||||
CREATE TABLE commedia AS
|
||||
SELECT * FROM "https://lida.dantenetwork.it/js/data/com.parquet";
|
||||
|
||||
|
||||
`);
|
||||
|
||||
var table = await conn.query(`
|
||||
|
@ -79,11 +78,11 @@ const result4 = table1.toArray().map((row) => row.toJSON());
|
|||
rif_fonti = result4.map((x) => x['TiFo']);
|
||||
|
||||
//console.log(rif_fonti)
|
||||
var tableP = await conn.query(`
|
||||
/*var tableP = await conn.query(`
|
||||
select * from commedia limit 10;
|
||||
`);
|
||||
const result5 = tableP.toArray().map((row) => row.toJSON());
|
||||
console.log(result5)
|
||||
console.log(result5)*/
|
||||
|
||||
await conn.close();
|
||||
|
||||
|
@ -522,18 +521,19 @@ function filtroContesto(marray, cantica, op) {
|
|||
//Contesto per lista risultati
|
||||
|
||||
export async function getFormaCntxtLastPosition(formaid, numversi = 3) {
|
||||
const tconn = await db.connect();
|
||||
/*const tconn = await db.connect();
|
||||
var querycnt = "select * from commedia where index>=((select index from commedia where Position='" + formaid + "')-25) order by index limit 50"
|
||||
/*console.log(" " + formaid)*/
|
||||
console.log(" " + formaid)
|
||||
var rs = await tconn.query(querycnt)
|
||||
var result4 = rs.toArray().map((row) => row.toJSON());
|
||||
|
||||
|
||||
/*console.log(result4.at(-1)['Position'])
|
||||
console.log('-----------------------------------------')*/
|
||||
console.log(result4.at(-1)['Position'])
|
||||
console.log('-----------------------------------------')
|
||||
|
||||
|
||||
await tconn.close();
|
||||
return (result4.at(-1)['Position'])
|
||||
return (result4.at(-1)['Position'])*/
|
||||
return
|
||||
|
||||
}
|
||||
|
|
|
@ -403,7 +403,7 @@ function buildSPQuery(guiquery) {
|
|||
else
|
||||
multipleCondSpQuery = spqparser.parse(ontoSparqlQueryMultCond);
|
||||
var parser = peg.generate(hdnquerygrammar);
|
||||
var test = guiquery['EsprLogica'].join(" ");
|
||||
test = guiquery['EsprLogica'].join(" ");
|
||||
test = test.replaceAll("( ", "(")
|
||||
test = test.replaceAll(" )", ")")
|
||||
clauses = parser.parse(test);
|
||||
|
@ -449,14 +449,12 @@ function buildSQ(stquery) {
|
|||
clause = stquery['EsprLogica']
|
||||
|
||||
filtroContesto = getFiltroContestoJson(JSON.parse(stquery[clause[0]]['contesto']))
|
||||
|
||||
|
||||
//if (stquery[clause]['TipoClausola'] == 'Sintattico') {
|
||||
if (stquery[clause]['typeSyntax0'].trim()!='' && stquery[clause]['typeSyntax0'].trim()!='.+'){
|
||||
if (stquery[clause]['TipoClausola'] == 'Sintattico') {
|
||||
parsedquery = parser.parse(ontoSparqlQuerySynt);
|
||||
var tempsyntquery = buildSintacticClause(stquery[clause], parsedquery, 2)
|
||||
if (filtroContesto.length > 0) {
|
||||
for (tmpc of filtroContesto) {
|
||||
|
||||
tempsyntquery.where.splice(0, 0, tmpc)
|
||||
}
|
||||
}
|
||||
|
@ -850,11 +848,11 @@ function buildClause(clause, parsedquery, whereind) {
|
|||
//sctmp=JSON.parse(sottoCategorieSostantivi)
|
||||
sctmp = sottoCategorie[clause['typeGramm0'].trim()]
|
||||
sctk = Object.keys(sctmp)
|
||||
for (ke of sctk) {
|
||||
for (ke in sctk) {
|
||||
|
||||
keval = clause[ke]
|
||||
keval = clause[sctk[ke]]
|
||||
if (keval != null && keval != '') {
|
||||
sttmts = sctmp[ke]
|
||||
sttmts = sctmp[sctk[ke]]
|
||||
if (sttmts[keval] != null && (sttmts[keval].split(':')[1]) != null) {
|
||||
subcatstat = buildsubcategoryClause(sttmts[keval])
|
||||
if (whereind > -1)
|
||||
|
|
|
@ -62,7 +62,7 @@ PREFIX orl: <https://dantenetwork.it/ontology/orl/current/>
|
|||
PREFIX ontolex: <http://www.w3.org/ns/lemon/ontolex#>
|
||||
PREFIX olires: <https://dantenetwork.it/ontology/olires/current/>
|
||||
PREFIX syntit: <https://dantenetwork.it/ontology/syntit/current/>
|
||||
SELECT DISTINCT ?sentence ?clocc ?clfr ?clto ?clafunction ?clatype (?t_canto as ?Canto) (?t_cantica as ?Cantica)
|
||||
SELECT DISTINCT ?sentence ?clocc ?clfr ?clto ?clafunction ?clatype (?t_canto as ?Canto) (?t_cantica as ?Cantica) ?pos
|
||||
WHERE {
|
||||
FILTER regex(?Rappresentazione,"^persona$","i") . #remove if query_text==''
|
||||
FILTER langMatches(lang(?Rappresentazione),"it") #remove if query_text==''
|
||||
|
@ -71,6 +71,8 @@ WHERE {
|
|||
ontolex:canonicalForm ?cf. #remove if query_text==''
|
||||
?cf ontolex:writtenRep ?lm. #remove if query_text==''
|
||||
?fa olires:occurrenceOf ?cat . #remove if query_text==''
|
||||
?fa olires:OccursInRegion ?reg. #remove if query_text==''
|
||||
?reg olires:fragmentRegionFrom ?pos. #remove if query_text==''
|
||||
?clocc ecrm:P148_has_component ?fa . #remove if query_text==''
|
||||
?cl syntit:hasClauseType ?clatype;
|
||||
ecrm:P190_has_symbolic_content ?cltext;
|
||||
|
@ -969,6 +971,8 @@ function buildSintacticClause(clause, parsedquery, whereind) {
|
|||
//remove the filter for text CHANGE!
|
||||
parsedquery.where.splice(0, 1)
|
||||
parsedquery.where.splice(0, 1)
|
||||
parsedquery.where[0].triples.splice(7, 1)
|
||||
parsedquery.where[0].triples.splice(6, 1)
|
||||
parsedquery.where[0].triples.splice(5, 1)
|
||||
parsedquery.where[0].triples.splice(4, 1)
|
||||
parsedquery.where[0].triples.splice(3, 1)
|
||||
|
|
Loading…
Reference in New Issue