|
@@ -164,7 +164,7 @@ function populateOptions(selector, myArray) {
|
|
|
</select>';
|
|
|
} else if (inputText == "Materia"){
|
|
|
inp = '<select class="advanced-form-select form-control" id="inputchoiceSelector_'+ numberId +'"> \
|
|
|
- <option>Pittura a tempera</option> \
|
|
|
+ <option>Tempera</option> \
|
|
|
<option>Tavola</option> \
|
|
|
<option>Stucco</option> \
|
|
|
<option>Rame</option> \
|
|
@@ -173,7 +173,7 @@ function populateOptions(selector, myArray) {
|
|
|
</select>';
|
|
|
} else if (inputText == "Tecnica"){
|
|
|
inp = '<select class="advanced-form-select form-control" id="inputchoiceSelector_'+ numberId +'"> \
|
|
|
- <option>Pittura</option> \
|
|
|
+ <option>Pittura a olio</option> \
|
|
|
<option>Doratura</option> \
|
|
|
</select>';
|
|
|
} else if (inputText == "Tipo di risorsa"){
|
|
@@ -184,6 +184,15 @@ function populateOptions(selector, myArray) {
|
|
|
<option>Libro</option> \
|
|
|
<option>Documenti diversi</option> \
|
|
|
</select>';
|
|
|
+ } else if (inputText == "Data"){
|
|
|
+ var inp = '<div id="box_' + numberId + 'a" class="container_choice"><div class="choice_box"><select id ="choice_selector-' + numberId + '_a" value=' + numberId + '_a" name="sel-parent" class="advanced-form-select form-control" aria-label="Default select example"> \
|
|
|
+ <option selected value="0">Da</option> \
|
|
|
+ <input type="date" id="inputchoiceSelector_'+ numberId +'_a" name="start" value="1300-01-01"> \
|
|
|
+ </select></div></div> \
|
|
|
+ <div id="box_' + numberId + '_b" class="container_choice"><div class="choice_box"><select id ="choice_selector-' + numberId + '_b" value=' + numberId + '_b" name="sel-parent" class="advanced-form-select form-control" aria-label="Default select example"> \
|
|
|
+ <option selected value="0">A</option> \
|
|
|
+ <input type="date" id="inputchoiceSelector_'+ numberId +'_b" name="end" value="1900-12-31"> \
|
|
|
+ </select></div></div>';
|
|
|
}
|
|
|
else {
|
|
|
inp = '<input type="text" id="inputchoiceSelector_'+ numberId +'" class="selected_option form-control" placeholder="Enter search terms" aria-label="Enter search terms" aria-describedby="button-addon2">';
|
|
@@ -268,6 +277,7 @@ function addToListPlace() {
|
|
|
|
|
|
//Get parameters from select and input options to build the query
|
|
|
function getParameters() {
|
|
|
+ $('#Loader').css("display", "block");
|
|
|
var cc = document.getElementById("type_selector").value;
|
|
|
if (cc != "General") {
|
|
|
const arr = [];
|
|
@@ -383,6 +393,8 @@ function constructQuery(params) {
|
|
|
var lemma = ""; //
|
|
|
var testo = ""; //
|
|
|
var data = ""; //
|
|
|
+ var start = "";
|
|
|
+ var finish = "";
|
|
|
var letter_event = ""; //
|
|
|
var infObj = ""; //
|
|
|
|
|
@@ -420,6 +432,8 @@ function constructQuery(params) {
|
|
|
var lem = ""; //
|
|
|
var ttx = ""; //
|
|
|
var dt = ""; //
|
|
|
+ var st = "";
|
|
|
+ var fn = "";
|
|
|
|
|
|
for (let i = 0; i < params.length; i++) {
|
|
|
if(params[i][0] == "Nome risorsa" && (params[i][1] != "")) {
|
|
@@ -707,6 +721,24 @@ function constructQuery(params) {
|
|
|
?uri_date rdfs:label ?date . \
|
|
|
?date bif:contains \"\'"+ params[i][1] +"\'\" ."
|
|
|
}
|
|
|
+ if (params[i][0] == "Da" && (params[i][1] != "")) {
|
|
|
+ st = " ?start";
|
|
|
+
|
|
|
+ start = "?subject ?property ?event_start . \
|
|
|
+ ?event_start crm:P4_has_time-span ?uri_date_start . \
|
|
|
+ ?uri_date_start rdfs:label ?date_start ; \
|
|
|
+ time:hasBeginning ?start . \
|
|
|
+ FILTER (?start >= \""+ params[i][1] +"\"^^xsd:date)";
|
|
|
+ }
|
|
|
+ if (params[i][0] == "A" && (params[i][1] != "")) {
|
|
|
+ fn = " ?end";
|
|
|
+
|
|
|
+ finish = "?subject ?property ?event_end . \
|
|
|
+ ?event_end crm:P4_has_time-span ?uri_date_end . \
|
|
|
+ ?uri_date_end rdfs:label ?date_end ; \
|
|
|
+ time:hasEnd ?end . \
|
|
|
+ FILTER (?end <= \""+ params[i][1] +"\"^^xsd:date)";
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|
|
@@ -717,11 +749,12 @@ function constructQuery(params) {
|
|
|
PREFIX owl: <http://www.w3.org/2002/07/owl#> \
|
|
|
PREFIX schema: <http://schema.org/> \
|
|
|
PREFIX foaf: <http://xmlns.com/foaf/0.1/> \
|
|
|
- PREFIX person: <http://www.w3.org/ns/person#>"
|
|
|
+ PREFIX person: <http://www.w3.org/ns/person#> \
|
|
|
+ PREFIX time: <https://www.w3.org/TR/owl-time#>"
|
|
|
|
|
|
query = prefixes + " SELECT DISTINCT ?subject ?label ?identifier " + dm + mt + locl + tec + at
|
|
|
+ sg + tt + tp + nt + rf + np + nf + pt + ln + lm + gr + dn + dts + oc + qf + ga + mit
|
|
|
- + des + lp + la + dp + da + lin + alin + ed + lem + dt + ttx + " \
|
|
|
+ + des + lp + la + dp + da + lin + alin + ed + lem + dt + st + fn + ttx + " \
|
|
|
WHERE {GRAPH " + search_graph + " {?subject ?property ?object } \
|
|
|
?subject rdfs:label ?label . "
|
|
|
+ search_identifier + infObj + letter_event + label + search_type + dimensione + materia + localizzazione + tecnica
|
|
@@ -729,7 +762,7 @@ function constructQuery(params) {
|
|
|
+ patronimico + luogo_di_Nascita + luogo_di_Morte + genere + data_di_Nascita
|
|
|
+ data_di_Morte + qualifica + occupazione + gruppi_di_appartenenza + mittente + destinatario
|
|
|
+luogo_di_Partenza + luogo_di_Arrivo + data_partenza + data_arrivo + lingua
|
|
|
- + area_linguistica + edizione + lemma + data + identificatore + testo + "}"
|
|
|
+ + area_linguistica + edizione + lemma + data + identificatore + start + finish + testo + "}"
|
|
|
|
|
|
var query_url = 'http://dev.restore.ovi.cnr.it:8890/sparql/?default-graph-uri=&query=' + encodeURIComponent(query) + '&output=json';
|
|
|
|
|
@@ -936,6 +969,14 @@ function query_handle_json(json, choosen_type) {
|
|
|
date = value['date']['value'];
|
|
|
object += '<div class="col-auto">' + date + '</div>';
|
|
|
}
|
|
|
+ if (value.hasOwnProperty('start')) {
|
|
|
+ start = value['start']['value'];
|
|
|
+ object += '<div class="col-auto">' + start + '</div>';
|
|
|
+ }
|
|
|
+ if (value.hasOwnProperty('end')) {
|
|
|
+ end = value['end']['value'];
|
|
|
+ object += '<div class="col-auto">' + end + '</div>';
|
|
|
+ }
|
|
|
|
|
|
object += '</div>';
|
|
|
|
|
@@ -952,6 +993,8 @@ function query_handle_json(json, choosen_type) {
|
|
|
$('#query_results').append(message);
|
|
|
}
|
|
|
|
|
|
+ $('#Loader').css("display", "none");
|
|
|
+
|
|
|
document.getElementById("n_res").innerHTML = i;
|
|
|
}
|
|
|
|
|
@@ -1085,6 +1128,12 @@ function renameCol(param) {
|
|
|
}
|
|
|
else if (param == "date") {
|
|
|
return ("Data");
|
|
|
+ }
|
|
|
+ else if (param == "start") {
|
|
|
+ return ("Estremo temporale inferiore");
|
|
|
+ }
|
|
|
+ else if (param == "end") {
|
|
|
+ return ("Estremo temporale superiore");
|
|
|
}
|
|
|
else {
|
|
|
return (param);
|