Merge branch 'master' of https://gitea-s2i2s.isti.cnr.it/concordia/LiDa_Search.git
This commit is contained in:
commit
be515a90f2
|
@ -1312,6 +1312,7 @@
|
|||
<hr>
|
||||
|
||||
<!-- submit event listener -->
|
||||
<!--
|
||||
<script type="module">
|
||||
import {Runtime, Inspector} from "https://cdn.jsdelivr.net/npm/@observablehq/runtime@4/dist/runtime.js";
|
||||
import notebook from "https://api.observablehq.com/@cesare/d3search/2.js?v=3&api_key=a05c55ad119cc37428496af43d692d30cbc35546";
|
||||
|
@ -1348,10 +1349,11 @@ main.redefine("completeq", gimmespqfromjson(mform));
|
|||
</script>
|
||||
|
||||
|
||||
|
||||
-->
|
||||
<!-- partial
|
||||
<script src="./script.js"></script>
|
||||
-->
|
||||
<!--
|
||||
<script type="module">
|
||||
|
||||
import {Runtime, Inspector} from "https://cdn.jsdelivr.net/npm/@observablehq/runtime@4/dist/runtime.js";
|
||||
|
@ -1374,6 +1376,7 @@ const main = runtime.module(notebook, name => {
|
|||
main.redefine("querytxt", writesearchValue(mform));
|
||||
|
||||
</script>
|
||||
-->
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
|
@ -535,6 +535,7 @@ $(document).ready(function() {
|
|||
jQuery(document).delegate('#grammarbutton', 'click', function(e) {
|
||||
|
||||
alert('Update not yet implemented, in progress...')
|
||||
const sparqlGenerator = sparqljs.Generator;
|
||||
var size = Object.keys(condizioniFiltro).length;
|
||||
if (size == 0){
|
||||
var clausola = $("#searchValue").val()
|
||||
|
@ -542,8 +543,11 @@ $(document).ready(function() {
|
|||
if (clausola == "" || clausola == ' '){
|
||||
return false
|
||||
}
|
||||
alert (clausola);
|
||||
|
||||
condizioniFiltro['filtro-1'] = "query="+clausola;
|
||||
spquery=buildSQ(condizioniFiltro)
|
||||
alert (new sparqlGenerator().stringify(spquery));
|
||||
condizioniFiltro = {}
|
||||
}
|
||||
// condizioniFiltro contiene le condizioni nella forma "clausola=valore"
|
||||
return true
|
||||
|
|
32
js/utils.js
32
js/utils.js
|
@ -103,15 +103,18 @@ function buildSQ(stquery) {
|
|||
var parser = new SparqlParser();
|
||||
const parsedquery =parser.parse(ontoSparqlQuery);
|
||||
const lf = document.getElementById("lemma_forma");
|
||||
const ftxt = document.getElementById("queryText");
|
||||
var ftxt = document.getElementById("queryText");
|
||||
//Nick
|
||||
if (ftxt==null){
|
||||
ftxt = document.getElementById("searchValue");
|
||||
}
|
||||
|
||||
|
||||
if (stquery['EsprLogica']!='' && stquery['EsprLogica'].length==1){
|
||||
if (stquery['EsprLogica']!=null && stquery['EsprLogica']!='' && stquery['EsprLogica'].length==1){
|
||||
clause=stquery['EsprLogica']
|
||||
|
||||
myquery=buildClause(stquery[clause], parsedquery)
|
||||
//const sparqlGenerator = sparqljs.Generator;
|
||||
//alert (new sparqlGenerator().stringify(myquery))
|
||||
|
||||
return (myquery)
|
||||
}
|
||||
|
||||
|
@ -130,23 +133,6 @@ function buildSQ(stquery) {
|
|||
parsedquery.where.splice(1, 1)
|
||||
}
|
||||
|
||||
//categorie grammaticali
|
||||
/*
|
||||
mycg=document.getElementById("grammtypes1")
|
||||
if (mycg !=null && mycg.value != "all"){
|
||||
parsedquery.where[0].triples.push(JSON.parse(data21)[mycg.value]);
|
||||
//test per sottocategorie
|
||||
lst_sc=JSON.parse(sottoCategorie)[mycg.value]
|
||||
for (msc in lst_sc){
|
||||
ename=lst_sc[msc].split(',')[0]
|
||||
esize=lst_sc[msc].split(',')[1]
|
||||
tmp=document.getElementById("cla1"+ename)
|
||||
if (tmp!=null && esize=='2' && tmp.querySelector('input[name="cla1'+ename.trim()+'"]:checked')!=null){
|
||||
//alert (tmp.querySelector('input[name="cla1'+ename.trim()+'"]:checked').value)
|
||||
}
|
||||
|
||||
}
|
||||
}*/
|
||||
|
||||
return (parsedquery)
|
||||
|
||||
|
@ -242,7 +228,7 @@ var sottoCategorie = {
|
|||
"Genere lemma": {"Lemma femminile": "TipoGenereLemmaSostantivoVolgare:GenereFemminileLemmaSostantivoVolgare", "Lemma maschile": "TipoGenereLemmaSostantivoVolgare:GenereMaschileLemmaSostantivoVolgare"},
|
||||
"Genere forma": {"Forma femminile": "TipoGenereSostantivoVolgare:GenereFemminileSostantivoVolgare", "Forma maschile": "TipoGenereSostantivoVolgare:GenereMaschileSostantivoVolgare"},
|
||||
"Numero": {"Singolare": "TipoNumeroSostantivoVolgare:NumeroSingolareSostantivoVolgare", "Plurale": "TipoNumeroSostantivoVolgare:NumeroPluraleSostantivoVolgare"},
|
||||
"riflpers": {"In locuzione": "SostantivoVolgareInLocuzione:SostantivoVolgareInLocuzione"},
|
||||
"riflpers": {"In locuzione": "SostantivoVolgareInLocuzione:Lv_lv"},
|
||||
"Declinazione sostantivo": {"Prima declinazione": "TipoDeclinazioneSostantivoVolgare:PrimaDeclinazioneSostantivoVolgare", "Seconda declinazione": "TipoDeclinazioneSostantivoVolgare:SecondaDeclinazioneSostantivoVolgare",
|
||||
"Terza declinazione": "TipoDeclinazioneSostantivoVolgare:TerzaDeclinazioneSostantivoVolgare"}
|
||||
},
|
||||
|
@ -308,7 +294,7 @@ sottoCategorieSostantivi=`{
|
|||
"Genere lemma": {"Lemma femminile": "TipoGenereLemmaSostantivoVolgare:GenereFemminileLemmaSostantivoVolgare", "Lemma maschile": "TipoGenereLemmaSostantivoVolgare:GenereMaschileLemmaSostantivoVolgare"},
|
||||
"Genere forma": {"Forma femminile": "TipoGenereSostantivoVolgare:GenereFemminileSostantivoVolgare", "Forma maschile": "TipoGenereSostantivoVolgare:GenereMaschileSostantivoVolgare"},
|
||||
"Numero": {"Singolare": "TipoNumeroSostantivoVolgare:NumeroSingolareSostantivoVolgare", "Plurale": "TipoNumeroSostantivoVolgare:NumeroPluraleSostantivoVolgare"},
|
||||
"riflpers": {"In locuzione": "SostantivoVolgareInLocuzione:SostantivoVolgareInLocuzione"},
|
||||
"riflpers": {"In locuzione": "SostantivoVolgareInLocuzione:Lv_lv"},
|
||||
"Declinazione sostantivo": {"Prima declinazione": "TipoDeclinazioneSostantivoVolgare:PrimaDeclinazioneSostantivoVolgare", "Seconda declinazione": "TipoDeclinazioneSostantivoVolgare:SecondaDeclinazioneSostantivoVolgare",
|
||||
"Terza declinazione": "TipoDeclinazioneSostantivoVolgare:TerzaDeclinazioneSostantivoVolgare"}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue