query OR con condizioni miste

This commit is contained in:
cesare 2024-05-10 10:49:33 +02:00
parent 4c750da11b
commit a615669d6d
2 changed files with 26 additions and 6 deletions

View File

@ -1831,10 +1831,22 @@ function emphResults(){
//execute query //execute query
async function executeQuerySearch(query) { async function executeQuerySearch(query) {
seachbBindingsStream = await myEngine.queryBindings(query, { sources: [{ type: 'sparql', value: sparqlEndpoint },], });
//console.log(query)
alert(query) alert(query)
//$("#loader").fadeIn(300); $("#loader").fadeIn(300);
//$("#searchcomm2").prop("disabled", true);
//$("#searchcomm2").html('<span class="spinner-grow spinner-grow-sm" role="status" aria-hidden="true"></span> Searching...');
try {
seachbBindingsStream = await myEngine.queryBindings(query, { sources: [{ type: 'sparql', value: sparqlEndpoint },], });
}
catch (err) {
$("#loader").fadeOut(300);
//$("#searchcomm2").prop("disabled", false);
//$("#searchcomm2").html('<span class="" role="status" aria-hidden="true"></span> Search');
console.log(err.message);
};
try { try {
var result = new Set() var result = new Set()
var resultClauses = new Set() var resultClauses = new Set()
@ -1884,6 +1896,9 @@ function emphResults(){
resultsInCantica.push(cantica); resultsInCantica.push(cantica);
resultsInCanto.push(cantica + canto) 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) resultClauses.add(sentenceid + "-" +clfrom+'-'+clto+"-"+clfunction.trim().replace('ordinateClause','').replace('MainClause', 'Ma')+'-'+cantica+'-'+canto+'-'+clocc)
resultSentences.add(sentenceid) resultSentences.add(sentenceid)
@ -1991,7 +2006,9 @@ function emphResults(){
console.log('badge end...') console.log('badge end...')
//calcolo numero dei contesti //calcolo numero dei contesti
countResultContexts() countResultContexts()
//$("#loader").fadeOut(300); $("#loader").fadeOut(300);
//$("#searchcomm2").prop("disabled", false);
//$("#searchcomm2").html('<span class="" role="status" aria-hidden="true"></span> Search');
}); });
queryExecuted = true; queryExecuted = true;
@ -2001,6 +2018,8 @@ function emphResults(){
} }
catch (err) { catch (err) {
//$("#loader").fadeOut(300); //$("#loader").fadeOut(300);
$("#searchcomm2").prop("disabled", false);
$("#searchcomm2").html('<span class="" role="status" aria-hidden="true"></span> Search');
console.log(err.message); console.log(err.message);
}; };

View File

@ -127,9 +127,10 @@ WHERE {
?frag olires:fragmentRegionFrom ?clfr ; ?frag olires:fragmentRegionFrom ?clfr ;
olires:fragmentRegionTo ?clto . olires:fragmentRegionTo ?clto .
?frag olires:fragmentRegionFrom ?pos. #?frag olires:fragmentRegionFrom ?pos.
} }
###condizioni sintattiche end ###condizioni sintattiche end
BIND(COALESCE(?pos1,-1) AS ?pos)
}` }`
@ -1660,7 +1661,7 @@ var morphgroup = `{"type": "group",
"object": {"termType": "Variable", "value": "reg"}}, "object": {"termType": "Variable", "value": "reg"}},
{"subject": {"termType": "Variable","value": "reg"}, {"subject": {"termType": "Variable","value": "reg"},
"predicate": {"termType": "NamedNode","value": "https://dantenetwork.it/ontology/olires/current/fragmentRegionFrom"}, "predicate": {"termType": "NamedNode","value": "https://dantenetwork.it/ontology/olires/current/fragmentRegionFrom"},
"object": {"termType": "Variable","value": "pos"}} "object": {"termType": "Variable","value": "pos1"}}
] ]
} }
] ]