cartella lib per le librerie esterne

This commit is contained in:
cesare 2022-10-10 10:08:39 +02:00
parent 3d5ba64760
commit a8c97f21af
2 changed files with 31 additions and 4 deletions

12
js/lib/peg-0.10.0.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -18,12 +18,18 @@ SELECT (?form AS ?IRIForma) (?Rappresentazione AS ?Forma) (?lm AS ?Lemma) (?text
?lent ontolex:lexicalForm ?form; ?lent ontolex:lexicalForm ?form;
ontolex:canonicalForm ?cf. ontolex:canonicalForm ?cf.
?cf ontolex:writtenRep ?lm. ?cf ontolex:writtenRep ?lm.
{?form <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> orl:FormaVerboVolgare;
orl:TipoDiatesiVerboVolgare orl:VerboVolgareAttivo.
}
{?form <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> orl:FormaVerboVolgare;
orl:TipoDiatesiVerboVolgare orl:VerboVolgareAttivo.
{ ?form <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> orl:FormaVerboVolgare; { ?form <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> orl:FormaVerboVolgare;
orl:TipoDiatesiVerboVolgare orl:VerboVolgareAttivo.} orl:TipoDiatesiVerboVolgare orl:VerboVolgareAttivo.}
UNION UNION
{ ?form <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> orl:FormaSostantivoVolgare; { ?form <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> orl:FormaSostantivoVolgare;
orl:TipoNumeroSostantivoVolgare orl:NumeroSingolareSostantivoVolgare. } orl:TipoNumeroSostantivoVolgare orl:NumeroSingolareSostantivoVolgare. }
} }
}
ORDER BY (?Cantica) (?Canto) (?NumVerso) ORDER BY (?Cantica) (?Canto) (?NumVerso)
LIMIT 50 LIMIT 50
` `
@ -154,7 +160,7 @@ var theguiQ=''
var multipleCondSpQuery='' var multipleCondSpQuery=''
var conditions=[] var conditions=[]
var filters=[] var filters=[]
var unionop='{"union": {"type": "union", "patterns":[]}, "bgp": {"type": "bgp", "triples":[]}}' var unionop='{"union": {"type": "union", "patterns":[]}, "bgp": {"type": "bgp", "triples":[]}, "group": {"type": "group", "patterns":[]}}'
function parseClause(op, tokens){ function parseClause(op, tokens){
@ -164,10 +170,17 @@ function parseClause(op, tokens){
//multipleCondSpQuery.where.at(-1).patterns.push(JSON.parse(unionop)['bgp']); //multipleCondSpQuery.where.at(-1).patterns.push(JSON.parse(unionop)['bgp']);
for (var mtoken in tokens){ for (var mtoken in tokens){
cond=theguiQ[tokens[mtoken]] cond=theguiQ[tokens[mtoken]]
//multipleCondSpQuery.where.at(-1).patterns.push(JSON.parse(unionop)['bgp']);
multipleCondSpQuery=buildClause(cond, multipleCondSpQuery, -1) multipleCondSpQuery=buildClause(cond, multipleCondSpQuery, -1)
}
} }
}
if (op.trim()=='AND'){
multipleCondSpQuery.where.push(JSON.parse(unionop)['group']);
for (var mtoken in tokens){
cond=theguiQ[tokens[mtoken]]
multipleCondSpQuery=buildClause(cond, multipleCondSpQuery, -1)
}
}
@ -196,16 +209,18 @@ function buildSPQuery(guiquery){
} }
function buildSQ(stquery) { function buildSQ(stquery) {
if(stquery['EsprLogica']!=null && stquery['EsprLogica'].length>1){ if(stquery['EsprLogica']!=null && stquery['EsprLogica'].length>1){
buildSPQuery (stquery) buildSPQuery (stquery)
return multipleCondSpQuery; return multipleCondSpQuery;
} }
var SparqlParser = sparqljs.Parser; var SparqlParser = sparqljs.Parser;
var parser = new SparqlParser(); var parser = new SparqlParser();
const parsedquery =parser.parse(ontoSparqlQuery); const parsedquery =parser.parse(ontoSparqlQuery);
const lf = document.getElementById("lemma_forma"); const lf = document.getElementById("lemma_forma");
mytestq=parser.parse(tq);
var ftxt = document.getElementById("queryText"); var ftxt = document.getElementById("queryText");
//Nick //Nick
if (ftxt==null){ if (ftxt==null){