modifica query

This commit is contained in:
cesare 2022-11-14 09:22:00 +01:00
parent e1de64fee1
commit 2cabc54522
3 changed files with 21 additions and 13 deletions

View File

@ -76,17 +76,13 @@
id="queryText" aria-describedby="sizing-addon2">
</div>
<div>&nbsp;</</div>
<button type="submit" class="btn btn-default f6" id='searchcomm'>Search</button>
<button type="submit" class="btn btn-default f6" id='cleanresult'>Reset</button>
</div>
<div class="sidebar-module">
<!-- <h4>Canti</h4>
<ol class="list-unstyled" id="listacanti">
</ol> -->
</div>
<!-- <div class="sidebar-module"> </div> -->
</div><!-- /.blog-sidebar -->

View File

@ -115,9 +115,17 @@ $(document).ready(function() {
executeQuerySearch(myquery)
});
//Reset
jQuery(document).delegate('#cleanresult', 'click', function(e) {
cleanSearchResult()
esprlogica=[]
$('#queryText').val("")
});
//Utility functions

View File

@ -111,6 +111,11 @@ var qVersiCantica=`
SELECT (?textver AS ?Verso) (?NumVerso AS ?NumeroVerso) (?t_canto AS ?Canto) (?t_cantica AS ?Cantica)
?textform ?pos
WHERE {
?cantica ecrm:P102_has_title ?t_cantica ;
olires:hasStructuralComponent ?canto.
?canto ecrm:P102_has_title ?t_canto;
olires:hasStructuralComponent ?ver.
?ver ecrm:P190_Has_Symbolic_Content ?textver;
olires:hasNumber ?NumVerso;
olires:hasStructuralComponent ?fa.
@ -121,11 +126,9 @@ var qVersiCantica=`
?form ontolex:writtenRep ?textform.
# ?reg olires:fragmentRegionFrom ?from;
# olires:fragmentRegionTo ?to .
?canto ecrm:P102_has_title ?t_canto;
olires:hasStructuralComponent ?ver.
?cantica ecrm:P102_has_title ?t_cantica ;
olires:hasStructuralComponent ?canto.
FILTER regex(?t_cantica,"Inferno","i") .
}`
@ -556,7 +559,8 @@ function buildClause(clause, parsedquery, whereind) {
}
if (clause['typeGramm0'] != null && clause['typeGramm0'] != "all")
if (whereind > -1)
parsedquery.where[whereind].triples.push(JSON.parse(data21)[clause['typeGramm0']]);
//parsedquery.where[whereind].triples.push(JSON.parse(data21)[clause['typeGramm0']]);
parsedquery.where[whereind].triples.splice(0, 0, JSON.parse(data21)[clause['typeGramm0']]);
else {
parsedquery.where.at(-1).patterns.push(JSON.parse(unionop)['bgp']);
parsedquery.where.at(-1).patterns.at(-1).triples.push(JSON.parse(data21)[clause['typeGramm0']]);