diff --git a/js/browseMgr.js b/js/browseMgr.js index f40d075..2cdd7ed 100644 --- a/js/browseMgr.js +++ b/js/browseMgr.js @@ -1831,10 +1831,22 @@ function emphResults(){ //execute query async function executeQuerySearch(query) { - seachbBindingsStream = await myEngine.queryBindings(query, { sources: [{ type: 'sparql', value: sparqlEndpoint },], }); - //console.log(query) + + alert(query) - //$("#loader").fadeIn(300); + $("#loader").fadeIn(300); + //$("#searchcomm2").prop("disabled", true); + //$("#searchcomm2").html(' Searching...'); + try { + seachbBindingsStream = await myEngine.queryBindings(query, { sources: [{ type: 'sparql', value: sparqlEndpoint },], }); + } + catch (err) { + $("#loader").fadeOut(300); + //$("#searchcomm2").prop("disabled", false); + //$("#searchcomm2").html(' Search'); + console.log(err.message); + }; + try { var result = new Set() var resultClauses = new Set() @@ -1884,6 +1896,9 @@ function emphResults(){ resultsInCantica.push(cantica); resultsInCanto.push(cantica + canto) } + if(unitaRicerca!='frase' && pos==-1){ + unitaRicerca='frase' + } resultClauses.add(sentenceid + "-" +clfrom+'-'+clto+"-"+clfunction.trim().replace('ordinateClause','').replace('MainClause', 'Ma')+'-'+cantica+'-'+canto+'-'+clocc) resultSentences.add(sentenceid) @@ -1991,7 +2006,9 @@ function emphResults(){ console.log('badge end...') //calcolo numero dei contesti countResultContexts() - //$("#loader").fadeOut(300); + $("#loader").fadeOut(300); + //$("#searchcomm2").prop("disabled", false); + //$("#searchcomm2").html(' Search'); }); queryExecuted = true; @@ -2001,6 +2018,8 @@ function emphResults(){ } catch (err) { //$("#loader").fadeOut(300); + $("#searchcomm2").prop("disabled", false); + $("#searchcomm2").html(' Search'); console.log(err.message); }; diff --git a/js/utils.js b/js/utils.js index 3fcd437..57fdcf3 100644 --- a/js/utils.js +++ b/js/utils.js @@ -127,9 +127,10 @@ WHERE { ?frag olires:fragmentRegionFrom ?clfr ; olires:fragmentRegionTo ?clto . - ?frag olires:fragmentRegionFrom ?pos. + #?frag olires:fragmentRegionFrom ?pos. } ###condizioni sintattiche end + BIND(COALESCE(?pos1,-1) AS ?pos) }` @@ -1660,7 +1661,7 @@ var morphgroup = `{"type": "group", "object": {"termType": "Variable", "value": "reg"}}, {"subject": {"termType": "Variable","value": "reg"}, "predicate": {"termType": "NamedNode","value": "https://dantenetwork.it/ontology/olires/current/fragmentRegionFrom"}, - "object": {"termType": "Variable","value": "pos"}} + "object": {"termType": "Variable","value": "pos1"}} ] } ]