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