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;
ontolex:canonicalForm ?cf.
?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;
orl:TipoDiatesiVerboVolgare orl:VerboVolgareAttivo.}
UNION
{ ?form <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> orl:FormaSostantivoVolgare;
orl:TipoNumeroSostantivoVolgare orl:NumeroSingolareSostantivoVolgare. }
}
}
ORDER BY (?Cantica) (?Canto) (?NumVerso)
LIMIT 50
`
@ -154,7 +160,7 @@ var theguiQ=''
var multipleCondSpQuery=''
var conditions=[]
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){
@ -164,10 +170,17 @@ function parseClause(op, tokens){
//multipleCondSpQuery.where.at(-1).patterns.push(JSON.parse(unionop)['bgp']);
for (var mtoken in tokens){
cond=theguiQ[tokens[mtoken]]
//multipleCondSpQuery.where.at(-1).patterns.push(JSON.parse(unionop)['bgp']);
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) {
if(stquery['EsprLogica']!=null && stquery['EsprLogica'].length>1){
buildSPQuery (stquery)
return multipleCondSpQuery;
}
var SparqlParser = sparqljs.Parser;
var parser = new SparqlParser();
const parsedquery =parser.parse(ontoSparqlQuery);
const lf = document.getElementById("lemma_forma");
mytestq=parser.parse(tq);
var ftxt = document.getElementById("queryText");
//Nick
if (ftxt==null){