bug fixed

This commit is contained in:
cesare 2022-10-13 18:35:57 +02:00
parent bd10a56719
commit 2d9e9a9e3d
1 changed files with 11 additions and 6 deletions

View File

@ -118,6 +118,7 @@ WHERE {
//Togliere LIMIT in prod //Togliere LIMIT in prod
orlprefix = 'http://dantenetwork.it/ontology/ORL/' orlprefix = 'http://dantenetwork.it/ontology/ORL/'
var stringInSparql= false;
function writesparqlquery(query) { function writesparqlquery(query) {
return (query); return (query);
@ -233,10 +234,12 @@ function buildSPQuery(guiquery) {
} }
function buildSQ(stquery) { function buildSQ(stquery) {
stringInSparql= false;
var SparqlParser = sparqljs.Parser; var SparqlParser = sparqljs.Parser;
var parser = new SparqlParser(); var parser = new SparqlParser();
@ -274,6 +277,7 @@ function buildSQ(stquery) {
strval = clause['query'].trim().slice(0, -1) strval = clause['query'].trim().slice(0, -1)
multipleCondSpQuery.where[1].expression.args[1].value = strval; multipleCondSpQuery.where[1].expression.args[1].value = strval;
if (clause['lemma_forma'] != null && clause['lemma_forma'] == 'lemma') if (clause['lemma_forma'] != null && clause['lemma_forma'] == 'lemma')
multipleCondSpQuery.where[1].expression.args[0].value = "lm"; multipleCondSpQuery.where[1].expression.args[0].value = "lm";
} }
@ -294,7 +298,6 @@ function buildSQ(stquery) {
clause = stquery['EsprLogica'] clause = stquery['EsprLogica']
myquery = buildClause(stquery[clause], parsedquery, 0) myquery = buildClause(stquery[clause], parsedquery, 0)
return (myquery) return (myquery)
} }
@ -363,6 +366,11 @@ function buildClauseNick(clause, parsedquery) {
} }
function buildJsonClause(clause, parsedquery, whereind, theplace) { function buildJsonClause(clause, parsedquery, whereind, theplace) {
//Nick
if (clause['categoria'] != null){
clause['typeGramm0']=clause['categoria'];
clause['queryText']=clause['query']
}
if (clause['queryText']!=null && clause['queryText'].trim() != "") { if (clause['queryText']!=null && clause['queryText'].trim() != "") {
if (clause['queryText'].trim().slice(-1) !== '*') if (clause['queryText'].trim().slice(-1) !== '*')
@ -378,10 +386,7 @@ function buildJsonClause(clause, parsedquery, whereind, theplace) {
if (parsedquery.where[1].type == 'filter' && parsedquery.where[1].expression.args[0].value == 'Rappresentazione') if (parsedquery.where[1].type == 'filter' && parsedquery.where[1].expression.args[0].value == 'Rappresentazione')
parsedquery.where.splice(1, 1) parsedquery.where.splice(1, 1)
} }
//Nick
if (clause['categoria'] != null){
clause['typeGramm0']=clause['categoria'];
}
if (clause['typeGramm0'] != null && clause['typeGramm0'] != "all") if (clause['typeGramm0'] != null && clause['typeGramm0'] != "all")
if (whereind > -1) if (whereind > -1)
parsedquery.where[whereind].triples.push(JSON.parse(data21)[clause['typeGramm0']]); parsedquery.where[whereind].triples.push(JSON.parse(data21)[clause['typeGramm0']]);