cartella lib per le librerie esterne
This commit is contained in:
parent
3d5ba64760
commit
a8c97f21af
File diff suppressed because one or more lines are too long
21
js/utils.js
21
js/utils.js
|
@ -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){
|
||||
|
@ -162,12 +168,19 @@ function parseClause(op, tokens){
|
|||
if (op.trim()=='OR'){
|
||||
multipleCondSpQuery.where.push(JSON.parse(unionop)['union']);
|
||||
//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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -197,15 +210,17 @@ 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){
|
||||
|
|
Loading…
Reference in New Issue