|
@@ -27,6 +27,7 @@ const choiceArray = [
|
|
|
["Area linguistica", "Letter", "languageArea"],
|
|
|
["Edizione", "Letter", "edition"],
|
|
|
["Data", "Object", "date"],
|
|
|
+ ["Date", "OA", "date_OA"],
|
|
|
["Lemma", "Letter", "lemma"],
|
|
|
["Testo libero", "Letter", "keyword"]
|
|
|
];
|
|
@@ -185,15 +186,45 @@ function populateOptions(selector, myArray) {
|
|
|
<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"> \
|
|
|
+ var inp = '<div style="display:flex;"><div id="box_' + numberId + '_a" class="container_choice"><div class="choice_box">Da <select style="display:none;" 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"> \
|
|
|
+ <div id="box_' + numberId + '_b" class="container_choice"><div class="choice_box">A <select style="display:none;" 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>';
|
|
|
- }
|
|
|
+ </select></div></div></div>';
|
|
|
+ }
|
|
|
+ else if (inputText == "Date"){
|
|
|
+ var inp = '<div style="display:flex;"><div id="box_' + numberId + '_a" class="container_choice"><div class="choice_box">Da <select style="display:none;" 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">Data inizio opera</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">A <select style="display:none;" 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">Data fine opera</option> \
|
|
|
+ <input type="date" id="inputchoiceSelector_'+ numberId +'_b" name="end" value="1900-12-31"> \
|
|
|
+ </select></div></div></div>';
|
|
|
+ }
|
|
|
+ else if (inputText == "Data partenza"){
|
|
|
+ var inp = '<div style="display:flex;"><div id="box_' + numberId + '_a" class="container_choice"><div class="choice_box">Da <select style="display:none;" 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">Data partenza inizio</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">A <select style="display:none;" 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">Data partenza fine</option> \
|
|
|
+ <input type="date" id="inputchoiceSelector_'+ numberId +'_b" name="end" value="1900-12-31"> \
|
|
|
+ </select></div></div></div>';
|
|
|
+ }
|
|
|
+ else if (inputText == "Data arrivo"){
|
|
|
+ var inp = '<div style="display:flex;"><div id="box_' + numberId + '_a" class="container_choice"><div class="choice_box">Da <select style="display:none;" 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">Data arrivo inizio</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">A <select style="display:none;" 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">Data arrivo fine</option> \
|
|
|
+ <input type="date" id="inputchoiceSelector_'+ numberId +'_b" name="end" value="1900-12-31"> \
|
|
|
+ </select></div></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">';
|
|
|
|
|
@@ -220,7 +251,7 @@ function addToList() {
|
|
|
</select><div id="sect-' + val + '"></div></div></div>';
|
|
|
$('#drop-down-content').append(sel);
|
|
|
var selector = 'choice_selector-' + val;
|
|
|
- populateOptions(selector, choiceArray);
|
|
|
+ //populateOptions(selector, choiceArray);
|
|
|
}
|
|
|
|
|
|
function addToListObject() {
|
|
@@ -385,8 +416,12 @@ function constructQuery(params) {
|
|
|
var destinatario = ""; //
|
|
|
var luogo_di_Partenza = ""; //
|
|
|
var luogo_di_Arrivo = ""; //
|
|
|
- var data_partenza = ""; //
|
|
|
- var data_arrivo = ""; //
|
|
|
+ var data_partenza_inizio = ""; //
|
|
|
+ var data_partenza_fine = "";
|
|
|
+ var data_arrivo_inizio = ""; //
|
|
|
+ var data_arrivo_fine = "";
|
|
|
+ var data_opera_inizio = ""; //
|
|
|
+ var data_opera_fine = ""; //
|
|
|
var lingua = ""; //
|
|
|
var area_linguistica = ""; //
|
|
|
var edizione = ""; //
|
|
@@ -434,6 +469,10 @@ function constructQuery(params) {
|
|
|
var dt = ""; //
|
|
|
var st = "";
|
|
|
var fn = "";
|
|
|
+ var dpi = "";
|
|
|
+ var dai = "";
|
|
|
+ var diop = "";
|
|
|
+ var dfop = "";
|
|
|
|
|
|
for (let i = 0; i < params.length; i++) {
|
|
|
if(params[i][0] == "Nome risorsa" && (params[i][1] != "")) {
|
|
@@ -726,18 +765,68 @@ function constructQuery(params) {
|
|
|
|
|
|
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)";
|
|
|
+ ?uri_date_start rdfs:label ?start ; \
|
|
|
+ time:hasBeginning ?date_start . \
|
|
|
+ FILTER (?date_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)";
|
|
|
+ ?uri_date_end rdfs:label ?end ; \
|
|
|
+ time:hasEnd ?date_end . \
|
|
|
+ FILTER (?date_end <= \""+ params[i][1] +"\"^^xsd:date)";
|
|
|
+ }
|
|
|
+ if (params[i][0] == "Data partenza inizio" && (params[i][1] != "")) {
|
|
|
+ dpi = " ?send_date";
|
|
|
+
|
|
|
+ letter_event = "?subject crm:P25i_moved_by ?mov_ev . \
|
|
|
+ ?send rdfs:subClassOf ?mov_ev ; \
|
|
|
+ rdf:type crm:EL2_Send_Letter . \
|
|
|
+ ?receive rdfs:subClassOf ?mov_ev; \
|
|
|
+ rdf:type crm:EL3_Receive_Letter . ";
|
|
|
+
|
|
|
+ data_partenza_inizio = "?send crm:P4_has_time-span ?uri_send_date . \
|
|
|
+ ?uri_send_date rdfs:label ?send_date ; \
|
|
|
+ time:hasBeginning ?time_send . \
|
|
|
+ FILTER (?time_send >= \""+ params[i][1] +"\"^^xsd:date";
|
|
|
+ }
|
|
|
+ if (params[i][0] == "Data partenza fine" && (params[i][1] != "")) {
|
|
|
+
|
|
|
+ data_partenza_fine = data_partenza_inizio + " && ?time_send <= \""+ params[i][1] +"\"^^xsd:date)";
|
|
|
+ }
|
|
|
+ if (params[i][0] == "Data arrivo inizio" && (params[i][1] != "")) {
|
|
|
+ dai = " ?receive_date";
|
|
|
+
|
|
|
+ letter_event = "?subject crm:P25i_moved_by ?mov_ev . \
|
|
|
+ ?send rdfs:subClassOf ?mov_ev ; \
|
|
|
+ rdf:type crm:EL2_Send_Letter . \
|
|
|
+ ?receive rdfs:subClassOf ?mov_ev; \
|
|
|
+ rdf:type crm:EL3_Receive_Letter . ";
|
|
|
+
|
|
|
+ data_arrivo_inizio = "?receive crm:P4_has_time-span ?uri_receive_date . \
|
|
|
+ ?uri_receive_date rdfs:label ?receive_date ; \
|
|
|
+ time:hasEnd ?time_receive . \
|
|
|
+ FILTER (?time_receive >= \""+ params[i][1] +"\"^^xsd:date";
|
|
|
+ }
|
|
|
+ if (params[i][0] == "Data arrivo fine" && (params[i][1] != "")) {
|
|
|
+
|
|
|
+ data_arrivo_fine = data_arrivo_inizio + " && ?time_receive <= \""+ params[i][1] +"\"^^xsd:date)";
|
|
|
+ }
|
|
|
+ if (params[i][0] == "Data inizio opera" && (params[i][1] != "")) {
|
|
|
+ diop = " ?time_start";
|
|
|
+
|
|
|
+ data_opera_inizio = "?event_start ?pp ?subject ; \
|
|
|
+ crm:P4_has_time-span ?uri_time_start . \
|
|
|
+ ?uri_time_start rdfs:label ?time_start; \
|
|
|
+ time:hasBeginning ?date_start ; \
|
|
|
+ time:hasEnd ?date_end . \
|
|
|
+ FILTER (?date_start >= \""+ params[i][1] +"\"^^xsd:date)";
|
|
|
+ }
|
|
|
+ if (params[i][0] == "Data fine opera" && (params[i][1] != "")) {
|
|
|
+
|
|
|
+ data_opera_fine = "FILTER (?date_end <= \""+ params[i][1] +"\"^^xsd:date)";
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -754,14 +843,14 @@ function constructQuery(params) {
|
|
|
|
|
|
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 + st + fn + ttx + " \
|
|
|
+ + des + lp + la + dp + da + dpi + dai + diop + 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
|
|
|
+ artista + titolo + tipo + note + riferimenti + nome_proprio + nome_di_famiglia
|
|
|
+ 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
|
|
|
+ +luogo_di_Partenza + luogo_di_Arrivo + data_partenza_fine + data_arrivo_fine + data_opera_inizio + data_opera_fine + lingua
|
|
|
+ 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';
|
|
@@ -976,6 +1065,18 @@ function query_handle_json(json, choosen_type) {
|
|
|
if (value.hasOwnProperty('end')) {
|
|
|
end = value['end']['value'];
|
|
|
object += '<div class="col-auto">' + end + '</div>';
|
|
|
+ }
|
|
|
+ if (value.hasOwnProperty('send_date')) {
|
|
|
+ send_date = value['send_date']['value'];
|
|
|
+ object += '<div class="col-auto">' + send_date + '</div>';
|
|
|
+ }
|
|
|
+ if (value.hasOwnProperty('receive_date')) {
|
|
|
+ receive_date = value['receive_date']['value'];
|
|
|
+ object += '<div class="col-auto">' + receive_date + '</div>';
|
|
|
+ }
|
|
|
+ if (value.hasOwnProperty('time_start')) {
|
|
|
+ opera_start = value['time_start']['value'];
|
|
|
+ object += '<div class="col-auto">' + opera_start + '</div>';
|
|
|
}
|
|
|
|
|
|
object += '</div>';
|
|
@@ -1134,6 +1235,15 @@ function renameCol(param) {
|
|
|
}
|
|
|
else if (param == "end") {
|
|
|
return ("Estremo temporale superiore");
|
|
|
+ }
|
|
|
+ else if (param == "send_date") {
|
|
|
+ return ("Data partenza");
|
|
|
+ }
|
|
|
+ else if (param == "receive_date") {
|
|
|
+ return ("Data arrivo");
|
|
|
+ }
|
|
|
+ else if (param == "time_start") {
|
|
|
+ return ("Data");
|
|
|
}
|
|
|
else {
|
|
|
return (param);
|