Alessia hai 1 ano
pai
achega
c83a963c37
Modificáronse 8 ficheiros con 1576 adicións e 56 borrados
  1. 1 0
      css/advanced-search.css
  2. 165 24
      js/advanced_search.js
  3. 883 0
      js/advanced_searchBK.js
  4. 111 17
      js/people.js
  5. 144 13
      js/query/managerQuery.js
  6. 1 1
      lettera.html
  7. 2 1
      ricerca_avanzata.html
  8. 269 0
      ricerca_avanzataBK.html

+ 1 - 0
css/advanced-search.css

@@ -141,6 +141,7 @@
   display: table;
   font-size: .875em;
   border-collapse: collapse;
+  width: 100%;
 }
 
 #query_results .row {

+ 165 - 24
js/advanced_search.js

@@ -44,7 +44,6 @@ const graphArray = [
 	["ASPO - Ospedale", "http://dev.restore.ovi.cnr.it:8890/aspo/ospedale"],
 	["ASPO - Marcovaldi", "http://dev.restore.ovi.cnr.it:8890/aspo/marcovaldi"],
 	["ASPO - Gettatelli", "http://dev.restore.ovi.cnr.it:8890/aspo/gettatelli"],
-	["ASPO - Autori ASPO", "http://dev.restore.ovi.cnr.it:8890/aspo/actors"],
 	["MPP - Collezione Martini", "http://dev.restore.ovi.cnr.it:8890/mpp/martini"],
 	["MPP - Collezione Ospedale", "http://dev.restore.ovi.cnr.it:8890/mpp/ospedale"],
 	["MPP - Collezione Datini", "http://dev.restore.ovi.cnr.it:8890/mpp/datini"],
@@ -107,8 +106,10 @@ $(document).ready(function () {
 		}
 
 	$("#type_selector").change(function(){
+		var selOpt = "";
         $(this).find("option:selected").each(function(){
             var optionValue = $(this).attr("value");
+			selOpt = optionValue;
             if(optionValue){
                 $(".box").not("." + optionValue).hide();
                 $("." + optionValue).show();
@@ -116,6 +117,19 @@ $(document).ready(function () {
                 $(".box").hide();
             }
         });
+		$( ".container_choice" ).remove();
+		if (selOpt == "Object") {
+			addToListObject();
+		}
+		if (selOpt == "OA") {
+			addToListOA();
+		}
+		if (selOpt == "Person") {
+			addToListPerson();
+		}
+		if (selOpt == "Letter") {
+			addToListLetter();
+		}	
     }).change();
 
     /*$('[name=sel-parent]').on('change', function() {
@@ -266,17 +280,29 @@ function constructQuery(params) {
 
 	console.log(choosen_type);
 
+	var search_identifier = "";
+
 	if (choosen_type == "Object") {
 		search_type = "?subject rdf:type crm:E22_Man-Made_Object . ";
+		search_identifier = "?subject crm:P1_is_identified_by ?uri_identifier . \
+		?uri_identifier rdfs:label ?identifier ; \
+		crm:P2_has_type 'Segnatura' .";
+	}
+	if (choosen_type == "Letter") {
+		search_identifier = "?subject crm:P1_is_identified_by ?uri_identifier . \
+		?uri_identifier rdfs:label ?identifier ; \
+		crm:P2_has_type 'Segnatura' .";
+	}
+	if (choosen_type == "OA") {
+		search_identifier = "?subject crm:P1_is_identified_by ?uri_identifier . \
+		?uri_identifier rdfs:label ?identifier ; \
+		crm:P2_has_type 'Codice univoco del bene (NCT)' .";
 	}
-	/*if (choosen_type == "Person") {
+	if (choosen_type == "Person") {
 		search_type = "?subject rdf:type crm:E21_Person . ";
+		search_identifier = "?subject crm:P1_is_identified_by ?uri_identifier . \
+		?uri_identifier rdfs:label ?identifier .";
 	}
-	if (choosen_type == "Place") {
-		search_type = "?subject rdf:type crm:E53_Place . ";
-	}*/
-
-	//Letter, OA, Person, Place
 
 	var label = ""; //
 	var identificatore = ""; //
@@ -319,7 +345,7 @@ function constructQuery(params) {
 	var id = ""; //
 	var dm = ""; //
 	var mt = ""; //
-	var loc = ""; //
+	var locl = ""; //
 	var tec = ""; //
 	var at = ""; //
 	var sg = ""; //
@@ -358,9 +384,7 @@ function constructQuery(params) {
 		if(params[i][0] == "Identificatore" && (params[i][1] != "")) {
 			id = " ?identifier";
 
-			identificatore = "?subject crm:P1_is_identified_by ?uri_identifier . \
-			?uri_identifier rdfs:label ?identifier . \
-			?identifier bif:contains \"\'"+ params[i][1] +"\'\" . ";
+			identificatore = "FILTER (CONTAINS(?identifier, \'"+ params[i][1] +"\'))";
 		}
 		if(params[i][0] == "Dimensione" && (params[i][1] != "")) {
 			dm = " ?dimension";
@@ -377,9 +401,9 @@ function constructQuery(params) {
 			?material bif:contains \"\'"+ params[i][1] +"\'\" ."
 		}
 		if(params[i][0] == "Istituto di conservazione" && (params[i][1] != "")) {
-			loc = " ?location";
+			locl = " ?location";
 
-			localizzazione = "?subject crm:P54_has_current_permanent_location ?uri_location . \
+			localizzazione = "?subject crm:P52_has_current_owner ?uri_location . \
 			?uri_location rdfs:label ?location . \
 			?location bif:contains \"\'"+ params[i][1] +"\'\" ."
 		}
@@ -664,17 +688,17 @@ function constructQuery(params) {
 	PREFIX foaf: <http://xmlns.com/foaf/0.1/> \
 	PREFIX person: <http://www.w3.org/ns/person#>"
 
-	query = prefixes + " SELECT DISTINCT ?subject ?label" + id + dm + mt + loc + tec + at
+	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 + antr + topo + dt + " \
 	WHERE {GRAPH " + search_graph + " {?subject ?property ?object } \
 	?subject rdfs:label ?label . " 
-	+ infObj + letter_event + label + search_type + identificatore + dimensione + materia + localizzazione + tecnica 
+	+ 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 
-	+ area_linguistica + edizione + toponimo + antroponimo + data + "}"
+	+ area_linguistica + edizione + toponimo + antroponimo + data + identificatore + "}"
 
 	var query_url = 'http://dev.restore.ovi.cnr.it:8890/sparql/?default-graph-uri=&query=' + encodeURIComponent(query) + '&output=json';
 
@@ -685,16 +709,31 @@ function constructQuery(params) {
 			url: query_url + '&callback=?',
 			dataType: "json",
 			success: function (data) {
-				query_handle_json(data);
+				query_handle_json(data, choosen_type);
 			},
 			error: function (e) {}
 		});
 
 }
 
-function query_handle_json(json) {
+function query_handle_json(json, choosen_type) {
+
+		console.log(json); 
+
+		var resulType = "";
 
-	console.log(json); 
+		if (choosen_type == "Object") {
+			resulType = "object";
+		}
+		if (choosen_type == "Letter") {
+			resulType = "object";
+		}
+		if (choosen_type == "OA") {
+			resulType = "artwork";
+		}
+		if (choosen_type == "Person") {
+			resulType = "persona";
+		}
 
 		$('#query_results').text("");
 
@@ -710,8 +749,9 @@ function query_handle_json(json) {
 
 		var t_head = '<div class="row t_head">';
 
-		for (let k = 0; k < first_row.length; k++) {
-			t_head += '<div class="col-auto">' + first_row[k] + '</div>';
+		for (let k = 1; k < first_row.length; k++) {
+			var param = renameCol(first_row[k]);
+			t_head += '<div class="col-auto">' + param + '</div>';
 		}
 
 		t_head += '</div>';
@@ -727,7 +767,7 @@ function query_handle_json(json) {
 				var link = value['subject']['value'];
 				var label = value['label']['value'];
 
-				object += '<div class="row"><div class="col-auto">' + link + '</div><div class="col-auto">' + label + '</div>';
+				object += '<div class="row"><div id="' + link + '" class="col-auto link ' + resulType + '">' + label + '</div>';
 
 				if (value.hasOwnProperty('identifier')) {
 		          identifier = value['identifier']['value'];
@@ -742,8 +782,8 @@ function query_handle_json(json) {
 		          object += '<div class="col-auto">' + material + '</div>';
 		        }
 		        if (value.hasOwnProperty('location')) {
-		          location = value['location']['value'];
-		          object += '<div class="col-auto">' + location + '</div>';
+		          localization = value['location']['value'];
+		          object += '<div class="col-auto">' + localization + '</div>';
 		        }
 		        if (value.hasOwnProperty('technique')) {
 		          technique = value['technique']['value'];
@@ -880,4 +920,105 @@ function query_handle_json(json) {
 			var message = '<p>Nessun risultato trovato</p>';
 			$('#query_results').append(message);
 		}
+
+		document.getElementById("n_res").innerHTML = i;
+}
+
+function renameCol(param) {
+	if (param == "label") {
+		return ("Denominazione");
+	} 
+	else if (param == "identifier") {
+		return ("Identificatore");
+	}
+	else if (param == "dimension") {
+		return ("Dimensioni");
+	}
+	else if (param == "material") {
+		return ("Materiale");
+	} 
+	else if (param == "location") {
+		return ("Istituto di conservazione");
+	}
+	else if (param == "technique") {
+		return ("Tecnica");
+	}
+	else if (param == "artist") {
+		return ("Artista");
+	}
+	else if (param == "depiction") {
+		return ("Soggetto");
+	}
+	else if (param == "title") {
+		return ("Titolo");
+	}
+	else if (param == "type") {
+		return ("Tipologia");
+	}
+	else if (param == "note") {
+		return ("Note");
+	}
+	else if (param == "ref") {
+		return ("Riferimenti");
+	}
+	else if (param == "givenName") {
+		return ("Nome proprio");
+	}
+	else if (param == "familyName") {
+		return ("Cognome");
+	}
+	else if (param == "birthPlace") {
+		return ("Luogo di Nascita");
+	}
+	else if (param == "deathPlace") {
+		return ("Luogo di morte");
+	}
+	else if (param == "genere") {
+		return ("Genere");
+	}
+	else if (param == "Birth_TS") {
+		return ("Data di nascita");
+	}
+	else if (param == "Death_TS") {
+		return ("Data di morte");
+	}
+	else if (param == "qualification") {
+		return ("Qualifica");
+	}
+	else if (param == "occupation") {
+		return ("Occupazione");
+	}
+	else if (param == "mittente") {
+		return ("Mittente");
+	}
+	else if (param == "destinatario") {
+		return ("Destinatario");
+	}
+	else if (param == "luogo_partenza") {
+		return ("Luogo di partenza");
+	}
+	else if (param == "luogo_arrivo") {
+		return ("Luogo di arrivo");
+	}
+	else if (param == "timeSpanSend") {
+		return ("Data partenza");
+	}
+	else if (param == "timeSpanReceive") {
+		return ("Data arrivo");
+	}
+	else if (param == "area_linguistica") {
+		return ("Area linguistica");
+	}
+	else if (param == "edizione") {
+		return ("Edizione");
+	}
+	else if (param == "lemma") {
+		return ("Lemma");
+	}
+	else if (param == "date") {
+		return ("Data");
+	}
+	 else {
+		return (param);
+	}
 }

+ 883 - 0
js/advanced_searchBK.js

@@ -0,0 +1,883 @@
+const choiceArray = [
+	["Nome risorsa", "Object, OA, Person, Letter, Place", "label"],
+	["Identificatore", "Object, OA, Person, Letter, Place", "identifier"], 
+	["Materia", "Object, OA", "material"],
+	["Istituto di conservazione", "Object, OA", "localization"],
+	["Tecnica", "OA", "technique"],
+	["Artista", "OA", "artist"],
+	["Soggetto", "OA", "subject"],
+	["Titolo", "Object, Inf", "title"],
+	["Tipo di risorsa", "Object, Inf", "type"],
+	["Nome proprio", "Person", "givenName"],
+	["Nome di famiglia", "Person", "familyName"],
+	["Luogo di Nascita", "Person", "birthPlace"],
+	["Luogo di Morte", "Person", "deathPlace"],
+	["Genere", "Person", "sex"],
+	["Data di Nascita", "Person", "birthDate"],
+	["Data di Morte", "Person", "deathDate"],
+	["Occupazione", "Person", "occupation"],
+	["Qualifica", "Person", "qualification"],
+	["Mittente", "Letter", "sender"],
+	["Destinatario", "Letter", "receiver"],
+	["Luogo di Partenza", "Letter", "startPlace"],
+	["Luogo di Arrivo", "Letter", "endPlace"],
+	["Data partenza", "Letter", "startDate"],
+	["Data arrivo", "Letter", "endDate"],
+	["Lingua", "Letter", "language"],
+	["Area linguistica", "Letter", "languageArea"],
+	["Edizione", "Letter", "edition"],
+	["Antroponimo", "Letter", "antroponym"],
+	["Toponimo", "Letter", "toponym"],
+	["Data", "Object, OA", "date"]
+	];
+
+const typeArray = [
+	["Oggetto", "Object"], 
+	["Lettera", "Letter"],
+	["Opera d'Arte", "OA"],
+	["Persona", "Person"],
+	["Luogo", "Place"]
+	];
+
+const graphArray = [
+	["ASPO - Datini", "http://dev.restore.ovi.cnr.it:8890/aspo/datini"], 
+	["ASPO - Ospedale", "http://dev.restore.ovi.cnr.it:8890/aspo/ospedale"],
+	["ASPO - Marcovaldi", "http://dev.restore.ovi.cnr.it:8890/aspo/marcovaldi"],
+	["ASPO - Gettatelli", "http://dev.restore.ovi.cnr.it:8890/aspo/gettatelli"],
+	["ASPO - Autori ASPO", "http://dev.restore.ovi.cnr.it:8890/aspo/actors"],
+	["MPP - Collezione Martini", "http://dev.restore.ovi.cnr.it:8890/mpp/martini"],
+	["MPP - Collezione Ospedale", "http://dev.restore.ovi.cnr.it:8890/mpp/ospedale"],
+	["MPP - Collezione Datini", "http://dev.restore.ovi.cnr.it:8890/mpp/datini"],
+	["OVI - Lettere", "http://dev.restore.ovi.cnr.it:8890/ovi/datini"]
+	];
+
+const objectArray = [];
+const personArray = [];
+const placeArray = [];
+const oaArray = [];
+const letterArray = [];
+
+$(document).ready(function () {
+	//#######################################
+
+	var type_selector = document.getElementById("type_selector");
+	var collection_selector = document.getElementById("collection_selector");
+
+	let x = typeArray.length;
+
+	for(var i=0; i<x; i++) {
+		   var opt = document.createElement("option");
+		   opt.value= typeArray[i][1];
+		   opt.innerHTML = typeArray[i][0]; // whatever property it has
+
+		   // then append it to the select element
+		   type_selector.add(opt);
+		}
+
+	let y = graphArray.length;
+
+	for(var i=0; i<y; i++) {
+		   var opt = document.createElement("option");
+		   opt.value= graphArray[i][1];
+		   opt.innerHTML = graphArray[i][0]; // whatever property it has
+
+		   // then append it to the select element
+		   collection_selector.add(opt);
+		}
+
+	let z = choiceArray.length;
+
+	for(var i=0; i<z; i++) {
+			var cat = choiceArray[i][1];
+			if (cat.includes("Object")) {
+				objectArray.push(choiceArray[i]);
+			}
+			if (cat.includes("OA")) {
+				oaArray.push(choiceArray[i]);
+			}
+			if (cat.includes("Person")) {
+				personArray.push(choiceArray[i]);
+			}
+			if (cat.includes("Letter")) {
+				letterArray.push(choiceArray[i]);
+			}
+			if (cat.includes("Place")) {
+				placeArray.push(choiceArray[i]);
+			}
+		}
+
+	$("#type_selector").change(function(){
+        $(this).find("option:selected").each(function(){
+            var optionValue = $(this).attr("value");
+            if(optionValue){
+                $(".box").not("." + optionValue).hide();
+                $("." + optionValue).show();
+            } else{
+                $(".box").hide();
+            }
+        });
+    }).change();
+
+    /*$('[name=sel-parent]').on('change', function() {
+	   $(this).attr("id", 'example' + $(this).name());
+	});*/
+
+	addToList();
+
+});
+
+
+function populateOptions(selector, myArray) {
+
+	var choice_selector = document.getElementById(selector);
+
+	let k = myArray.length;
+
+	for(var i=0; i<k; i++) {
+		   var opt = document.createElement("option");
+		   opt.value= myArray[i][1];
+		   opt.innerHTML = myArray[i][0]; // whatever property it has
+
+		   // then append it to the select element
+		   choice_selector.add(opt);
+		}
+
+	$('#' + selector).on( "change", function() {
+		
+		var numberId= selector.split("-")[1]
+		var inputText=  $( this ).find(":selected").text();
+		/*$('#inputchoiceSelector_' +  numberId).val(inputText);
+		$('#inputchoiceSelector_' +  numberId).id(inputText);*/
+	});
+}
+
+var val = 0;
+
+function addToList() {
+	val = val+1;
+	var sel = '<div id="box_' + val + '" class="container_choice"><div class="remove"><a onclick="removeElement(\'box_' + val + '\')"><i class="fa fa-trash" aria-hidden="true"></i></a></div><div class="choice_box"><select id ="choice_selector-' + val + '" value=' + val + ' name="sel-parent" class="advanced-form-select form-control" aria-label="Default select example"> \
+			  <option selected value="0">Scegli un\'opzione</option> \
+			  <input type="text" id="inputchoiceSelector_'+ val +'" class="selected_option form-control" placeholder="Enter search terms" aria-label="Enter search terms" aria-describedby="button-addon2"> \
+			</select></div></div>';
+	$('#drop-down-content').append(sel);
+	var selector = 'choice_selector-' + val;
+	populateOptions(selector, choiceArray);
+}
+
+function addToListObject() {
+	val = val+100;
+	var sel = '<div id="box_' + val + '" class="container_choice"><div class="remove"><a onclick="removeElement(\'box_' + val + '\')"><i class="fa fa-trash" aria-hidden="true"></i></a></div><div class="choice_box"><select id ="choice_selector-' + val + '" value=' + val + ' name="sel-parent" class="advanced-form-select form-control" aria-label="Default select example"> \
+			  <option selected value="0">Scegli un\'opzione</option> \
+			  <input type="text" id="inputchoiceSelector_'+ val +'" class="selected_option form-control" placeholder="Enter search terms" aria-label="Enter search terms" aria-describedby="button-addon2"> \
+			</select></div></div>';
+	$('#drop-down-content-Object').append(sel);
+	var selector = 'choice_selector-' + val;
+	populateOptions(selector, objectArray);
+}
+
+function addToListOA() {
+	val = val+200;
+	var sel = '<div id="box_' + val + '" class="container_choice"><div class="remove"><a onclick="removeElement(\'box_' + val + '\')"><i class="fa fa-trash" aria-hidden="true"></i></a></div><div class="choice_box"><select id ="choice_selector-' + val + '" value=' + val + ' name="sel-parent" class="advanced-form-select form-control" aria-label="Default select example"> \
+			  <option selected value="0">Scegli un\'opzione</option> \
+			  <input type="text" id="inputchoiceSelector_'+ val +'" class="selected_option form-control" placeholder="Enter search terms" aria-label="Enter search terms" aria-describedby="button-addon2"> \
+			</select></div></div>';
+	$('#drop-down-content-OA').append(sel);
+	var selector = 'choice_selector-' + val;
+	populateOptions(selector, oaArray);
+}
+
+function addToListPerson() {
+	val = val+300;
+	var sel = '<div id="box_' + val + '" class="container_choice"><div class="remove"><a onclick="removeElement(\'box_' + val + '\')"><i class="fa fa-trash" aria-hidden="true"></i></a></div><div class="choice_box"><select id ="choice_selector-' + val + '" value=' + val + ' name="sel-parent" class="advanced-form-select form-control" aria-label="Default select example"> \
+			  <option selected value="0">Scegli un\'opzione</option> \
+			  <input type="text" id="inputchoiceSelector_'+ val +'" class="selected_option form-control" placeholder="Enter search terms" aria-label="Enter search terms" aria-describedby="button-addon2"> \
+			</select></div></div>';
+	$('#drop-down-content-Person').append(sel);
+	var selector = 'choice_selector-' + val;
+	populateOptions(selector, personArray);
+}
+
+function addToListLetter() {
+	val = val+400;
+	var sel = '<div id="box_' + val + '" class="container_choice"><div class="remove"><a onclick="removeElement(\'box_' + val + '\')"><i class="fa fa-trash" aria-hidden="true"></i></a></div><div class="choice_box"><select id ="choice_selector-' + val + '" value=' + val + ' name="sel-parent" class="advanced-form-select form-control" aria-label="Default select example"> \
+			  <option selected value="0">Scegli un\'opzione</option> \
+			  <input type="text" id="inputchoiceSelector_'+ val +'" class="selected_option form-control" placeholder="Enter search terms" aria-label="Enter search terms" aria-describedby="button-addon2"> \
+			</select></div></div>';
+	$('#drop-down-content-Letter').append(sel);
+	var selector = 'choice_selector-' + val;
+	populateOptions(selector, letterArray);
+}
+
+function addToListPlace() {
+	val = val+500;
+	var sel = '<div id="box_' + val + '" class="container_choice"><div class="remove"><a onclick="removeElement(\'box_' + val + '\')"><i class="fa fa-trash" aria-hidden="true"></i></a></div><div class="choice_box"><select id ="choice_selector-' + val + '" value=' + val + ' name="sel-parent" class="advanced-form-select form-control" aria-label="Default select example"> \
+			  <option selected value="0">Scegli un\'opzione</option> \
+			  <input type="text" id="inputchoiceSelector_'+ val +'" class="selected_option form-control" placeholder="Enter search terms" aria-label="Enter search terms" aria-describedby="button-addon2"> \
+			</select></div></div>';
+	$('#drop-down-content-Place').append(sel);
+	var selector = 'choice_selector-' + val;
+	populateOptions(selector, placeArray);
+}
+
+
+//Get parameters from select and input options to build the query
+function getParameters() {
+	const arr = [];
+	const collection = document.getElementsByClassName("advanced-form-select");
+	for (let i = 0; i < collection.length; i++) {
+	  var x = collection[i].id;
+	  var t = document.getElementById(x);
+	  var e = t.options[t.selectedIndex].text;
+	  var numberId= x.split("-")[1]
+	  var inputId = "inputchoiceSelector_" + numberId;
+	  var inputText = document.getElementById(inputId).value;
+	  var el = [e, inputText];
+	  arr.push(el);
+	}
+
+	constructQuery(arr);
+	/*$('#query_results').append(arr);
+	testo = $('input#writeText').val();*/
+}
+
+function removeElement(id_element) {
+  const element = document.getElementById(id_element);
+
+  element.remove();
+}
+
+
+//Build query with harvested parametes
+function constructQuery(params) {
+
+	var g = document.getElementById("collection_selector");
+	var graph = g.value;
+
+	var search_graph = "?g";
+
+	if (graph != "") {
+		search_graph = '<' + graph + '>';
+	} 
+
+	var search_type = "";
+
+	var ct = document.getElementById("type_selector");
+	var choosen_type = ct.value;
+
+	console.log(choosen_type);
+
+	if (choosen_type == "Object") {
+		search_type = "?subject rdf:type crm:E22_Man-Made_Object . ";
+	}
+	/*if (choosen_type == "Person") {
+		search_type = "?subject rdf:type crm:E21_Person . ";
+	}
+	if (choosen_type == "Place") {
+		search_type = "?subject rdf:type crm:E53_Place . ";
+	}*/
+
+	//Letter, OA, Person, Place
+
+	var label = ""; //
+	var identificatore = ""; //
+	var dimensione = ""; //
+	var materia = ""; //
+	var localizzazione = ""; //
+	var tecnica = ""; //
+	var artista = ""; //
+	var soggetto = ""; //
+	var titolo = ""; //
+	var tipo = ""; //
+	var note = ""; //
+	var riferimenti = ""; //
+	var nome_proprio = ""; //
+	var nome_di_famiglia = ""; //
+	var patronimico = ""; //
+	var luogo_di_Nascita = ""; //
+	var luogo_di_Morte = ""; //
+	var genere = ""; //
+	var data_di_Nascita = ""; //
+	var data_di_Morte = ""; //
+	var occupazione = ""; //
+	var qualifica = ""; //
+	var gruppi_di_appartenenza = ""; //
+	var mittente = ""; //
+	var destinatario = ""; //
+	var luogo_di_Partenza = ""; //
+	var luogo_di_Arrivo = ""; //
+	var data_partenza = ""; //
+	var data_arrivo = ""; //
+	var lingua = ""; //
+	var area_linguistica = ""; //
+	var edizione = ""; //
+	var antroponimo = ""; //
+	var toponimo = ""; //
+	var data = ""; //
+	var letter_event = ""; //
+	var infObj = ""; //
+
+	var id = ""; //
+	var dm = ""; //
+	var mt = ""; //
+	var loc = ""; //
+	var tec = ""; //
+	var at = ""; //
+	var sg = ""; //
+	var tt = ""; //
+	var tp = ""; //
+	var nt = ""; //
+	var rf = ""; //
+	var np = ""; //
+	var nf = ""; //
+	var pt = ""; //
+	var ln = ""; //
+	var lm = ""; //
+	var gr = ""; //
+	var dn = ""; //
+	var dts = ""; //
+	var oc = ""; //
+	var qf = ""; //
+	var ga = ""; //
+	var mit = ""; //
+	var des = ""; //
+	var lp = ""; //
+	var la = ""; //
+	var dp = ""; //
+	var da = ""; //
+	var lin = ""; //
+	var alin = ""; //
+	var ed = ""; //
+	var antr = ""; //
+	var topo = ""; //
+	var dt = ""; //
+
+	for (let i = 0; i < params.length; i++) {
+		if(params[i][0] == "Nome risorsa" && (params[i][1] != "")) {
+			label = "?label bif:contains \"\' "+ params[i][1] + " \'\" . ";
+		}
+		if(params[i][0] == "Identificatore" && (params[i][1] != "")) {
+			id = " ?identifier";
+
+			identificatore = "?subject crm:P1_is_identified_by ?uri_identifier . \
+			?uri_identifier rdfs:label ?identifier . \
+			?identifier bif:contains \"\'"+ params[i][1] +"\'\" . ";
+		}
+		if(params[i][0] == "Dimensione" && (params[i][1] != "")) {
+			dm = " ?dimension";
+
+			dimensione = "?subject crm:P43_has_dimension ?uri_dimension . \
+			?uri_dimension rdfs:label ?dimension . \
+			?dimension bif:contains \"\'"+ params[i][1] +"\'\" ."
+		}
+		if(params[i][0] == "Materia" && (params[i][1] != "")) {
+			mt = " ?material";
+
+			materia = "?subject crm:P45_consists_of ?uri_material . \
+			?uri_material rdfs:label ?material . \
+			?material bif:contains \"\'"+ params[i][1] +"\'\" ."
+		}
+		if(params[i][0] == "Istituto di conservazione" && (params[i][1] != "")) {
+			loc = " ?location";
+
+			localizzazione = "?subject crm:P54_has_current_permanent_location ?uri_location . \
+			?uri_location rdfs:label ?location . \
+			?location bif:contains \"\'"+ params[i][1] +"\'\" ."
+		}
+		if(params[i][0] == "Tecnica" && (params[i][1] != "")) {
+			tec = " ?technique";
+
+			tecnica = "?subject ?property ?event . \
+			?event crm:P32_used_general_technique ?uri_technique . \
+			?uri_technique rdfs:label ?technique . \
+			?technique bif:contains \"\'"+ params[i][1] +"\'\" . "
+		}
+		if (params[i][0] == "Artista" && (params[i][1] != "")) {
+			at = " ?artist";
+
+			artista = "?subject rdfs:label ?label .	\
+			?production crm:P108_has_produced ?subject . \
+			?pc crm:P01_has_domain ?production . \
+			?pc crm:P02_has_range ?range . \
+			?range rdfs:label ?artist . \
+			?artist bif:contains \"\'"+ params[i][1] +"\'\" ."
+		}
+		if (params[i][0] == "Soggetto" && (params[i][1] != "")) {
+			sg = " ?depiction";
+
+			soggetto = "?subject crm:P62_depicts ?uri_depiction . \
+			?uri_depiction rdfs:label ?depiction . \
+			?depiction bif:contains \"\'"+ params[i][1] +"\'\" ."
+		}
+		if (params[i][0] == "Titolo" && (params[i][1] != "")) {
+			tt = " ?title";
+
+			infObj = "?subject crm:P128_carries ?information_object .";
+
+			titolo = "?information_object crm:P1_is_identified_by ?uri_title . \
+			?uri_title rdfs:label ?title . \
+			?title bif:contains \"\'"+ params[i][1] +"\'\" ."
+		}
+		if (params[i][0] == "Tipo di risorsa" && (params[i][1] != "")) {
+			tp = " ?type";
+
+			infObj = "?subject crm:P128_carries ?information_object .";
+
+			tipo = "?information_object crm:P2_has_type ?uri_type . \
+			?uri_type rdfs:label ?type . \
+			?type bif:contains \"\'"+ params[i][1] +"\'\" ."
+		}
+		if (params[i][0] == "Note" && (params[i][1] != "")) {
+			nt = " ?note";
+
+			note = "?subject crm:P3_has_note ?uri_note . \
+			?uri_note rdfs:label ?note . \
+			?note bif:contains \"\'"+ params[i][1] +"\'\" .";
+		}
+		if (params[i][0] == "Riferimenti" && (params[i][1] != "")) {
+			rf = " ?ref";
+
+			riferimenti = "?subject crm:P67_refers_to ?uri_ref . \
+			?uri_ref rdfs:label ?ref . \
+			?ref bif:contains \"\'"+ params[i][1] +"\'\" . "
+		}
+		if (params[i][0] == "Nome proprio" && (params[i][1] != "")) {
+			np = " ?givenName";
+
+			nome_proprio = "?subject foaf:givenName ?givenName . \
+			?givenName bif:contains \"\'"+ params[i][1] +"\'\" . "
+		}
+		if (params[i][0] == "Nome di famiglia" && (params[i][1] != "")) {
+			nf = " ?familyName";
+
+			nome_di_famiglia = "?subject foaf:familyName ?familyName . \
+			?familyName bif:contains \"\'"+ params[i][1] +"\'\" . "
+		}
+		if (params[i][0] == "Patronimico" && (params[i][1] != "")) {
+			pt = " ?patronymic";
+
+			patronimico = "?subject person:patronymicName ?patronymic . \
+			?patronymic bif:contains \"\'"+ params[i][1] +"\'\" . "
+		}
+		if (params[i][0] == "Luogo di Nascita" && (params[i][1] != "")) {
+			ln = " ?birthPlace";
+
+			luogo_di_Nascita = "?subject crm:P98i_was_born ?Birth . \
+			?Birth crm:P7_took_place_at ?uri_birthPlace . \
+			?uri_birthPlace rdfs:label ?birthPlace . \
+			?birthPlace bif:contains \""+ params[i][1] +"\" . "
+		}
+		if (params[i][0] == "Luogo di Morte" && (params[i][1] != "")) {
+			lm = " ?deathPlace";
+
+			luogo_di_Morte = "?subject crm:P100i_died_in ?Death . \
+			?Death crm:P7_took_place_at ?uri_deathPlace . \
+			?uri_deathPlace rdfs:label ?deathPlace \
+			?deathPlace bif:contains \""+ params[i][1] +"\" .	"
+		}
+		if (params[i][0] == "Genere" && (params[i][1] != "")) {
+			gr = "?genere";
+
+			genere = "?subject foaf:gender ?genere . \
+			?genere bif:contains \""+ params[i][1] +"\" . "
+		}
+		if (params[i][0] == "Data di Nascita" && (params[i][1] != "")) {
+			dn = " ?Birth_TS";
+
+			data_di_Nascita = "?subject crm:P98i_was_born ?Birth . 	\
+			?Birth crm:P4_has_time-span ?Birth_TS . \
+			?Birth_TS rdfs:label \""+ params[i][1] +"\" ."
+		}
+		if (params[i][0] == "Data di Morte" && (params[i][1] != "")) {
+			dts = " ?Death_TS";
+
+			data_di_Morte = "?subject crm:P100i_died_in ?Death . \
+			?Death crm:P4_has_time-span ?Death_TS . \
+			?Death_TS rdfs:label \""+ params[i][1] +"\" . "
+		}
+		if (params[i][0] == "Qualifica" && (params[i][1] != "")) {
+			qf = " ?qualification";
+
+			qualifica = "?subject schema:honorificPrefix ?qualification . \
+			?qualification bif:contains \"\'"+ params[i][1] +"\'\" . "
+		}
+		if (params[i][0] == "Occupazione" && (params[i][1] != "")) {
+			oc = " ?occupation";
+
+			occupazione = "?subject schema:hasOccupation ?uriOccupation . \
+			?uriOccupation rdf:type schema:Occupation; \
+			rdfs:label ?occupation . \
+			?occupation bif:contains \"\'"+ params[i][1] +"\'\" . "
+		}
+		if (params[i][0] == "Gruppi di appartenenza" && (params[i][1] != "")) {
+			ga = " ?group";
+
+			gruppi_di_appartenenza = "?subject crm:P107i_is_current_or_former_member_of ?uriGroup . \
+			?uriGroup rdfs:label ?group . \
+			?group bif:contains \"\'"+ params[i][1] +"\'\" . "
+		}
+		if (params[i][0] == "Mittente" && (params[i][1] != "")) {
+			mit = " ?mittente";
+
+			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 . ";
+
+			mittente = "?send crm:P01_has_domain ?pcS . \
+			?pcS crm:P02_has_range ?uriSender . \
+			?uriSender rdfs:label ?mittente . \
+			?mittente bif:contains \"\'"+ params[i][1] +"\'\" .	 "
+		}
+		if (params[i][0] == "Destinatario" && (params[i][1] != "")) {
+			des = " ?destinatario";
+
+			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 . ";
+
+			destinatario = "?receive crm:P01_has_domain ?pcR . \
+			?pcR crm:P02_has_range ?uriReceiver . \
+			?uriReceiver rdfs:label ?destinatario . \
+			?destinatario bif:contains \"\'"+ params[i][1] +"\'\" .	"
+		}
+		if (params[i][0] == "Luogo di Partenza" && (params[i][1] != "")) {
+			lp = " ?luogo_partenza";
+
+			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 . ";
+
+			luogo_di_Partenza = "?send crm:P27_moved_from ?uriLuogoPartenza . \
+			?uriLuogoPartenza rdfs:label ?luogo_partenza . \
+			?luogo_partenza bif:contains \"\'"+ params[i][1] +"\'\" . "
+		}
+		if (params[i][0] == "Luogo di Arrivo" && (params[i][1] != "")) {
+			la = " ?luogo_arrivo";
+
+			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 . ";
+
+			luogo_di_Arrivo = "?receive crm:P26_moved_to ?uriLuogoArrivo . \
+			?uriLuogoArrivo rdfs:label ?luogo_arrivo . \
+			?luogo_arrivo bif:contains \"\'"+ params[i][1] +"\'\" . "
+		}
+		if (params[i][0] == "Data partenza" && (params[i][1] != "")) {
+			dp = " ?timeSpanSend";
+
+			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 = "?send crm:P4_has_time-span ?time_spanS . \
+			?time_spanS rdfs:label ?timeSpanSend . \
+			?timeSpanSend bif:contains \"\'"+ params[i][1] +"\'\" . "
+		}
+		if (params[i][0] == "Data arrivo" && (params[i][1] != "")) {
+			da = " ?timeSpanReceive";
+
+			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 = "?receive crm:P4_has_time-span ?time_spanR . \
+			?time_spanR rdfs:label ?timeSpanReceive .\
+			?timeSpanReceive bif:contains \"\'"+ params[i][1] +"\'\" . "
+		}
+		if (params[i][0] == "Lingua" && (params[i][1] != "")) {
+			lin = " ?lingua";
+
+			infObj = "?subject crm:P128_carries ?information_object .";
+
+			lingua = "?information_object crm:P72_has_language ?language . \
+			?language rdfs:label ?lingua . \
+			?lingua bif:contains \"\'"+ params[i][1] +"\'\" ."
+		}
+		if (params[i][0] == "Area linguistica" && (params[i][1] != "")) {
+			alin = " ?area_linguistica";
+
+			infObj = "?subject crm:P128_carries ?information_object .";
+
+			area_linguistica = "?information_object crm:P72_has_language ?language . \
+			?language crm:P3_has_note ?area . \
+			?area rdfs:label ?area_linguistica .\
+			?area_linguistica bif:contains \"\'"+ params[i][1] +"\'\" ."
+		}
+		if (params[i][0] == "Edizione" && (params[i][1] != "")) {
+			ed = " ?edizione";
+
+			infObj = "?subject crm:P128_carries ?information_object .";
+
+			edizione = "?edition crm:P70_documents ?information_object ; \
+			crm:P1_is_identified_by ?edition_id . \
+			?edition_id rdfs:label ?edizione . \
+			?edizione bif:contains \"\'"+ params[i][1] +"\'\" ."
+		}
+		if (params[i][0] == "Toponimo" && (params[i][1] != "")) {
+			topo = " ?toponimo";
+
+			infObj = "?subject crm:P128_carries ?information_object .";
+
+			toponimo = "?information_object crm:P67_refers_to ?link_toponimo . \
+			?link_toponimo rdfs:label ?toponimo ; \
+			crm:P2_has_type 'Toponimo' . \
+			?toponimo bif:contains \"\'"+ params[i][1] +"\'\" ."
+		}
+		if (params[i][0] == "Antroponimo" && (params[i][1] != "")) {
+			antr = " ?antroponimo";
+
+			infObj = "?subject crm:P128_carries ?information_object .";
+
+			antroponimo = "?information_object crm:P67_refers_to ?link_antroponimo . \
+			?link_antroponimo rdfs:label ?antroponimo; \
+			crm:P2_has_type 'Antroponimo' . \
+			?antroponimo bif:contains \"\'"+ params[i][1] +"\'\" ."
+		}
+		if (params[i][0] == "Data" && (params[i][1] != "")) {
+			dt = " ?date";
+
+			data = "?subject ?property ?event . \
+			?event crm:P4_has_time-span ?uri_date . \
+			?uri_date rdfs:label ?date . \
+			?date bif:contains \"\'"+ params[i][1] +"\'\" ."
+		}
+
+	}
+
+
+	prefixes = "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \
+	PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \
+	PREFIX crm: <http://www.cidoc-crm.org/cidoc-crm/> \
+	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#>"
+
+	query = prefixes + " SELECT DISTINCT ?subject ?label" + id + dm + mt + loc + 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 + antr + topo + dt + " \
+	WHERE {GRAPH " + search_graph + " {?subject ?property ?object } \
+	?subject rdfs:label ?label . " 
+	+ infObj + letter_event + label + search_type + identificatore + 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 
+	+ area_linguistica + edizione + toponimo + antroponimo + data + "}"
+
+	var query_url = 'http://dev.restore.ovi.cnr.it:8890/sparql/?default-graph-uri=&query=' + encodeURIComponent(query) + '&output=json';
+
+	console.log(query);
+
+	$.ajax({
+
+			url: query_url + '&callback=?',
+			dataType: "json",
+			success: function (data) {
+				query_handle_json(data);
+			},
+			error: function (e) {}
+		});
+
+}
+
+function query_handle_json(json) {
+
+	console.log(json); 
+
+		$('#query_results').text("");
+
+		var i = 0;
+
+		const first_row = [];
+
+		$.each(
+			json['head']['vars'],
+			function (index, value) {
+				first_row.push(value);
+		});
+
+		var t_head = '<div class="row t_head">';
+
+		for (let k = 0; k < first_row.length; k++) {
+			t_head += '<div class="col-auto">' + first_row[k] + '</div>';
+		}
+
+		t_head += '</div>';
+
+
+		$('#query_results').append(t_head);
+
+		$.each(
+			json['results']['bindings'],
+			function (index, value) {
+				var object = ""; 
+
+				var link = value['subject']['value'];
+				var label = value['label']['value'];
+
+				object += '<div class="row"><div class="col-auto">' + link + '</div><div class="col-auto">' + label + '</div>';
+
+				if (value.hasOwnProperty('identifier')) {
+		          identifier = value['identifier']['value'];
+		          object += '<div class="col-auto">' + identifier + '</div>';
+		        }
+		        if (value.hasOwnProperty('dimension')) {
+		          dimension = value['dimension']['value'];
+		          object += '<div class="col-auto">' + dimension + '</div>';
+		        }
+		        if (value.hasOwnProperty('material')) {
+		          material = value['material']['value'];
+		          object += '<div class="col-auto">' + material + '</div>';
+		        }
+		        if (value.hasOwnProperty('location')) {
+		          location = value['location']['value'];
+		          object += '<div class="col-auto">' + location + '</div>';
+		        }
+		        if (value.hasOwnProperty('technique')) {
+		          technique = value['technique']['value'];
+		          object += '<div class="col-auto">' + technique + '</div>';
+		        }
+		        if (value.hasOwnProperty('artist')) {
+		          artist = value['artist']['value'];
+		          object += '<div class="col-auto">' + artist + '</div>';
+		        }
+		        if (value.hasOwnProperty('depiction')) {
+		          depiction = value['depiction']['value'];
+		          object += '<div class="col-auto">' + depiction + '</div>';
+		        }
+		        if (value.hasOwnProperty('title')) {
+		          title = value['title']['value'];
+		          object += '<div class="col-auto">' + title + '</div>';
+		        }
+		        if (value.hasOwnProperty('type')) {
+		          type = value['type']['value'];
+		          object += '<div class="col-auto">' + type + '</div>';
+		        }
+		        if (value.hasOwnProperty('note')) {
+		          note = value['note']['value'];
+		          object += '<div class="col-auto">' + note + '</div>';
+		        }
+		        if (value.hasOwnProperty('ref')) {
+		          ref = value['ref']['value'];
+		          object += '<div class="col-auto">' + ref + '</div>';
+		        }
+		        if (value.hasOwnProperty('givenName')) {
+		          givenName = value['givenName']['value'];
+		          object += '<div class="col-auto">' + givenName + '</div>';
+		        }
+		        if (value.hasOwnProperty('familyName')) {
+		          familyName = value['familyName']['value'];
+		          object += '<div class="col-auto">' + familyName + '</div>';
+		        }
+		        if (value.hasOwnProperty('patronymic')) {
+		          patronymic = value['patronymic']['value'];
+		          object += '<div class="col-auto">' + patronymic + '</div>';
+		        }
+		        if (value.hasOwnProperty('birthPlace')) {
+		          birthPlace = value['birthPlace']['value'];
+		          object += '<div class="col-auto">' + birthPlace + '</div>';
+		        }
+		        if (value.hasOwnProperty('deathPlace')) {
+		          deathPlace = value['deathPlace']['value'];
+		          object += '<div class="col-auto">' + deathPlace + '</div>';
+		        }
+		        if (value.hasOwnProperty('genere')) {
+		          genere = value['genere']['value'];
+		          object += '<div class="col-auto">' + genere + '</div>';
+		        }
+		        if (value.hasOwnProperty('Birth_TS')) {
+		          Birth_TS = value['Birth_TS']['value'];
+		          object += '<div class="col-auto">' + Birth_TS + '</div>';
+		        }
+		        if (value.hasOwnProperty('Death_TS')) {
+		          Death_TS = value['Death_TS']['value'];
+		          object += '<div class="col-auto">' + Death_TS + '</div>';
+		        }
+		        if (value.hasOwnProperty('qualification')) {
+		          qualification = value['qualification']['value'];
+		          object += '<div class="col-auto">' + qualification + '</div>';
+		        }
+		        if (value.hasOwnProperty('occupation')) {
+		          occupation = value['occupation']['value'];
+		          object += '<div class="col-auto">' + occupation + '</div>';
+		        }
+		        if (value.hasOwnProperty('group')) {
+		          group = value['group']['value'];
+		          object += '<div class="col-auto">' + group + '</div>';
+		        }
+		        if (value.hasOwnProperty('mittente')) {
+		          mittente = value['mittente']['value'];
+		          object += '<div class="col-auto">' + mittente + '</div>';
+		        }
+		        if (value.hasOwnProperty('destinatario')) {
+		          destinatario = value['destinatario']['value'];
+		          object += '<div class="col-auto">' + destinatario + '</div>';
+		        }
+		        if (value.hasOwnProperty('luogo_partenza')) {
+		          luogo_partenza = value['luogo_partenza']['value'];
+		          object += '<div class="col-auto">' + luogo_partenza + '</div>';
+		        }
+		        if (value.hasOwnProperty('luogo_arrivo')) {
+		          luogo_arrivo = value['luogo_arrivo']['value'];
+		          object += '<div class="col-auto">' + luogo_arrivo + '</div>';
+		        }
+		        if (value.hasOwnProperty('timeSpanSend')) {
+		          timeSpanSend = value['timeSpanSend']['value'];
+		          object += '<div class="col-auto">' + timeSpanSend + '</div>';
+		        }
+		        if (value.hasOwnProperty('timeSpanReceive')) {
+		          timeSpanReceive = value['timeSpanReceive']['value'];
+		          object += '<div class="col-auto">' + timeSpanReceive + '</div>';
+		        }
+		        if (value.hasOwnProperty('lingua')) {
+		          lingua = value['lingua']['value'];
+		          object += '<div class="col-auto">' + lingua + '</div>';
+		        }
+		        if (value.hasOwnProperty('area_linguistica')) {
+		          area_linguistica = value['area_linguistica']['value'];
+		          object += '<div class="col-auto">' + area_linguistica + '</div>';
+		        }
+		        if (value.hasOwnProperty('edizione')) {
+		          edizione = value['edizione']['value'];
+		          object += '<div class="col-auto">' + edizione + '</div>';
+		        }
+		        if (value.hasOwnProperty('toponimo')) {
+		          toponimo = value['toponimo']['value'];
+		          object += '<div class="col-auto">' + toponimo + '</div>';
+		        }
+		        if (value.hasOwnProperty('antroponimo')) {
+		          antroponimo = value['antroponimo']['value'];
+		          object += '<div class="col-auto">' + antroponimo + '</div>';
+		        }
+		        if (value.hasOwnProperty('date')) {
+		          date = value['date']['value'];
+		          object += '<div class="col-auto">' + date + '</div>';
+		        } 
+
+		        object += '</div>';
+
+				i++;
+
+				/*onclick=copy__Text("' + value['link']['value'] + '")*/
+				$('#query_results').append(object);
+				
+
+			});
+
+		if (i==0) {
+			var message = '<p>Nessun risultato trovato</p>';
+			$('#query_results').append(message);
+		}
+}

+ 111 - 17
js/people.js

@@ -547,7 +547,8 @@ function createColRelazione(text, link) {
 
 function handle_Events(json) {
 
-  const events = [];
+  let events = {};
+  var i = 0;
 
   $.each(
     json['results']['bindings'],
@@ -557,22 +558,71 @@ function handle_Events(json) {
       var uri_document = value['uri_document']['value'];
       var document = value['document']['value'];
       var time_span = "";
-      var uri_place = "";
-      var place = "";
+      var uri_place1 = "";
+      var uri_place2 = "";
+      var uri_place3 = "";
+      var uri_place4 = "";
+      var place1 = "";
+      var place2 = "";
+      var place3 = "";
+      var place4 = "";
+      var coords1 = "";
+      var coords2 = "";
+      var coords3 = "";
+      var coords4 = "";
+      
 
       if (value.hasOwnProperty('time_span')) {
         time_span = value['time_span']['value'];
       }
       if (value.hasOwnProperty('uri_place')) {
-        uri_place = value['uri_place']['value'];
+        uri_place1 = value['uri_place']['value'];
+      }
+      if (value.hasOwnProperty('coords')) {
+        coords1 = value['coords']['value'];
       } 
       if (value.hasOwnProperty('place')) {
-        place = value['place']['value'];
-        place = titleCase(place);
+        place1 = value['place']['value'];
+        place1 = titleCase(place1);
       } 
 
-      const cells = [event_type, role, time_span, uri_place, place, uri_document, document];    
-      events.push(cells); 
+      if (value.hasOwnProperty('uri_place2')) {
+        uri_place2 = value['uri_place2']['value'];
+      }
+      if (value.hasOwnProperty('coords2')) {
+        coords2 = value['coords2']['value'];
+      } 
+      if (value.hasOwnProperty('place2')) {
+        place2 = value['place2']['value'];
+        place2 = titleCase(place2);
+      } 
+
+      if (value.hasOwnProperty('uri_place3')) {
+        uri_place3 = value['uri_place3']['value'];
+      }
+      if (value.hasOwnProperty('coords3')) {
+        coords3 = value['coords3']['value'];
+      } 
+      if (value.hasOwnProperty('place3')) {
+        place3 = value['place3']['value'];
+        place3 = titleCase(place3);
+      } 
+
+      if (value.hasOwnProperty('uri_place4')) {
+        uri_place4 = value['uri_place4']['value'];
+      }
+      if (value.hasOwnProperty('coords4')) {
+        coords4 = value['coords4']['value'];
+      } 
+      if (value.hasOwnProperty('place4')) {
+        place4 = value['place4']['value'];
+        place4 = titleCase(place4);
+      } 
+
+      let cells = {"evento": event_type, "ruolo": role, "data": time_span, "uri_documento": uri_document, "documento": document, "uri_luogo1": uri_place1, "luogo1": place1, "coords1": coords1, "uri_luogo2": uri_place2, "luogo2": place2, "coords2": coords2, "uri_luogo3": uri_place3, "luogo3": place3, "coords3": coords3, "uri_luogo4": uri_place4, "luogo4": place4, "coords4": coords4};    
+      events[i] = cells;
+      
+      i++;
 
   });
 
@@ -580,25 +630,69 @@ function handle_Events(json) {
   '<th class="col-2">Evento</th>' +
   '<th class="col-2">Ruolo</th>' +
   '<th class="col-2">Data</th>' +
-  '<th class="col-2">Luogo</th>' +
-  '<th class="col-4">Documento</th>' +
+  '<th class="col-3">Luogo</th>' +
+  '<th class="col-3">Documento</th>' +
   '</tr></thead>';
 
   var EventsTable = thead;
   EventsTable += '<tbody>';
 
-  for (var i=0; i<events.length; i++) {
+  console.log(events);
+
+  for (i in events) {
+
+    console.log(events);
+
+    var sniPlace = "";
+    var sniPlace1 = "";
+    var sniPlace2 = "";
+    var sniPlace3 = "";
+    var sniPlace4 = "";
+    if (events[i]['coords1'] != "") {
+        sniPlace1 = '<span id="' + events[i]['uri_luogo1'] + '" class="luogo link">' + events[i]['luogo1'] + '</span>';
+    } else {
+      sniPlace1 = events[i]['luogo1'];
+    }
+    if (events[i]['coords2'] != "") {
+      sniPlace2 = '<span id="' + events[i]['uri_luogo2'] + '" class="luogo link">' + events[i]['luogo2'] + '</span>';
+    } else {
+      sniPlace2 = events[i]['luogo2'];
+    }
+    if (events[i]['coords3'] != "") {
+      sniPlace3 = '<span id="' + events[i]['uri_luogo3'] + '" class="luogo link">' + events[i]['luogo3'] + '</span>';
+    } else {
+      sniPlace3 = events[i]['luogo3'];
+    }
+    if (events[i]['coords4'] != "") {
+      sniPlace4 = '<span id="' + events[i]['uri_luogo4'] + '" class="luogo link">' + events[i]['luogo4'] + '</span>';
+    } else {
+      sniPlace4 = events[i]['luogo4'];
+    }
+
+    if (sniPlace1 != "") {
+      sniPlace = sniPlace1;
+    }
+    if (sniPlace2 != "") {
+      sniPlace = sniPlace + " &#60; " + sniPlace2;
+    }
+    if (sniPlace3 != "") {
+      sniPlace = sniPlace + " &#60; " + sniPlace3;
+    }
+    if (sniPlace4 != "") {
+      sniPlace = sniPlace + " &#60; " + sniPlace4;
+    }
+
     EventsTable += '<tr class="res">' +
-    '<th class="col-2">' + events[i][0] + '</th>' +
-    '<th class="col-2">' + events[i][1] + '</th>' +
-    '<th class="col-2">' + events[i][2] + '</th>' +
-    '<th id="' + events[i][3] + '" class="col-2 luogo link">' + events[i][4] + '</th>' +
-    '<th id="' + events[i][5] + '" class="col-4 object link">' + events[i][6] + '</th>' +
+    '<th class="col-2">' + events[i]['evento'] + '</th>' +
+    '<th class="col-2">' + events[i]['ruolo'] + '</th>' +
+    '<th class="col-2">' + events[i]['data'] + '</th>' +
+    '<th class="col-3">' + sniPlace + '</th>' +
+    '<th id="' + events[i]['uri_documento'] + '" class="col-3 object link">' + events[i]['documento'] + '</th>' +
     '</tr>';
   }
   EventsTable += '</tbody>';
 
-  if (events.length != 0) {
+  if (Object.keys(events).length != 0) {
     document.getElementById("res_events").innerHTML = EventsTable;
   } else {
     var eventIcon = "<div id='map_icon' class='no_info_icon'> \

+ 144 - 13
js/query/managerQuery.js

@@ -201,22 +201,19 @@ var queryManager = {
         ?uri_subject crm:P128_carries ?uri_infObj ; \
         rdfs:label ?subject .  \
         ?uri_infObj crm:P190_has_symbolic_content ?text . \
-        ?uri_subject crm:P25i_moved_by ?mov_ev1 . \
-        ?send1 rdfs:subClassOf ?mov_ev1 ; \
+        ?uri_subject crm:P25i_moved_by ?mov_ev . \
+        ?send rdfs:subClassOf ?mov_ev ; \
         rdf:type crm:EL2_Send_Letter . \
-        ?send1 crm:P4_has_time-span ?uri_time_span . \
+        ?send crm:P4_has_time-span ?uri_time_span . \
         ?uri_time_span rdfs:label ?time_span . \
         ?uri_time_span time:year ?year . \
         OPTIONAL {?uri_time_span time:month ?month } \
         OPTIONAL {?uri_time_span time:day ?day } \
-        ?uri_subject crm:P25i_moved_by ?mov_ev2 . \
-        ?send2 rdfs:subClassOf ?mov_ev2 ; \
-        rdf:type crm:EL2_Send_Letter ; \
-        crm:P27_moved_from ?uri_placeNT . \
-        ?uri_place owl:sameAs ?uri_placeNT ; \
-        rdfs:label ?place ; \
+        ?send crm:P27_moved_from ?uri_placeNT . \
+        ?uri_placeNT owl:sameAs ?uri_place . \
+        ?uri_place rdfs:label ?place ; \
         crm:P168_place_is_defined_by ?coords . \
-        } \
+        }  \
         ORDER BY ?year ?month ?day"
 
     },
@@ -501,7 +498,7 @@ var queryManager = {
             ?uri_event_type rdfs:label ?event_type . \
             } ",
 
-            queryEventi : " SELECT DISTINCT ?event_type ?role ?uri_time_span ?year ?month ?day ?time_span ?place ?uri_place ?document ?uri_document \
+            queryEventi : " SELECT DISTINCT ?event_type ?role ?uri_time_span ?year ?month ?day ?time_span ?place ?uri_place ?coords ?place2 ?uri_place2 ?coords2 ?place3 ?uri_place3 ?coords3 ?place4 ?uri_place4 ?coords4 ?document ?uri_document \
             WHERE { \
             VALUES ?uri {<{URI}>} \
             ?domain crm:P02_has_range ?uri ; \
@@ -516,10 +513,22 @@ var queryManager = {
             OPTIONAL {?uri_time_span time:month ?month .} \
             OPTIONAL {?uri_time_span time:day ?day .} \
             } \
-            OPTIONAL {?event crm:P7_took_place_at ?uri_location . \
+            ?event crm:P7_took_place_at ?uri_location . \
             ?uri_location rdfs:label ?place . \
             OPTIONAL {?uri_place owl:sameAs ?uri_location . \
-            ?uri_place crm:P168_place_is_defined_by ?coords }} \
+            ?uri_place crm:P168_place_is_defined_by ?coords } \
+            OPTIONAL {?uri_location crm:P89_falls_within ?uri_place2 . \
+            ?uri_place2 rdfs:label ?place2 . \
+            OPTIONAL {?uri_place2 crm:P168_place_is_defined_by ?coords2 . } \
+            OPTIONAL {?uri_place2 crm:P89_falls_within ?uri_place3 . \
+            ?uri_place3 rdfs:label ?place3 . \
+            OPTIONAL {?uri_place3 crm:P168_place_is_defined_by ?coords3 . \
+            OPTIONAL {?uri_place3 crm:P89_falls_within ?uri_place4 . \
+            ?uri_place4 rdfs:label ?place4 . \
+            OPTIONAL {?uri_place4 crm:P168_place_is_defined_by ?coords4 .} \
+            } \
+            } \
+            }} \
             ?document_info crm:P70_documents ?event . \
             ?uri_document crm:P128_carries ?document_info ; \
             rdfs:label ?document . \
@@ -961,6 +970,128 @@ var queryManager = {
             rdfs:label ?place ; \
             crm:P168_place_is_defined_by ?coords \
             } ORDER BY ?year ?month ?day"
+    },
+
+    queryRicercaAvanzata : {
+        queryOggetto : "SELECT DISTINCT ?graph AS ?g ?uri ?name ?identifier ?material ?owner ?type ?start_date ?end_date \
+        WHERE {GRAPH ?graph {?uri rdf:type crm:E22_Man-Made_Object} \
+        ?uri rdfs:label ?name . \
+        OPTIONAL {?uri crm:P1_is_identified_by ?uri_identifier . \
+        ?uri_identifier rdfs:label ?identifier . } \
+        OPTIONAL {?uri crm:P45_consist_of ?uri_material . \
+        ?uri_material rdfs:label ?material . } \
+        OPTIONAL {?uri crm:P2_has_type ?uri_type . \
+        ?uri_type rdfs:label ?type . } \
+        OPTIONAL {?uri crm:P52_has_current_owner ?uri_owner . \
+        ?uri_owner rdfs:label ?owner . } \
+        OPTIONAL {?uri crm:P92i_was_brought_into_existence_by ?creationI . \
+        ?creationI crm:P2_has_type 'Inizio'^^<http://www.w3.org/2001/XMLSchema#string> ; \
+        crm:P4_has_time-span ?uri_time_spanI . \
+        ?uri_time_spanI rdfs:label ?start_date . } \
+        OPTIONAL {?uri crm:P92i_was_brought_into_existence_by ?creationF . \
+        ?creationF crm:P2_has_type 'Fine'^^<http://www.w3.org/2001/XMLSchema#string> ; \
+        crm:P4_has_time-span ?uri_time_spanF . \
+        ?uri_time_spanF rdfs:label ?end_date . } \
+        }",
+
+        queryPersona : " SELECT DISTINCT ?graph AS ?g ?uri ?name ?givenName ?familyName ?patronymic ?provenienza ?alias ?otherName ?person_type ?occupation ?qualification ?Death_Date ?Death_Place ?Birth_TS ?Birth_Place \
+        WHERE { \
+        GRAPH ?graph {?uri rdfs:label ?label} \
+        ?uri foaf:name ?name . \
+        ?uri foaf:givenName ?givenName . \
+        OPTIONAL {?uri foaf:familyName ?familyName} \
+        OPTIONAL {?uri foaf:gender ?gender} \
+        OPTIONAL {?uri person:patronymicName ?patronymic } \
+        OPTIONAL {?uri crm:P74_has_current_or_former_residence ?uri_provenienza . \
+        ?uri_provenienza crm:P2_has_type 'Provenienza'; \
+        rdfs:label ?provenienza . } \
+        OPTIONAL {?uri crm:P2_has_type ?uri_person_type . \
+        ?uri_person_type rdfs:label ?person_type } \
+        OPTIONAL {?uri schema:hasOccupation ?uriOccupation . \
+        ?uriOccupation rdf:type schema:Occupation; \
+        rdfs:label ?occupation } \
+        OPTIONAL {?uri schema:honorificPrefix ?qualification} \
+        OPTIONAL {?uri crm:P100i_died_in ?Death . \
+        OPTIONAL {?Death crm:P4_has_time-span ?Death_TS . \
+        ?Death_TS rdfs:label ?Death_Date . } \
+        OPTIONAL {?Death crm:P7_took_place_at ?Place_D . \
+        ?Place_D rdfs:label ?Death_Place } \
+        } \
+        OPTIONAL {?uri crm:P98i_was_born ?Birth . \
+        OPTIONAL {?Birth crm:P4_has_time-span ?Birth_TS . \
+        ?Birth_TS rdfs:label ?Birth_Date . } \
+        OPTIONAL {?Birth crm:P7_took_place_at ?Place_B . \
+        ?Place_B rdfs:label ?Birth_Place } \
+        } \
+        OPTIONAL {?uri schema:alternateName ?alias . } \
+        OPTIONAL {?uri owl:sameAs ?variant . \
+        ?variant foaf:name ?otherName . }  \
+        } ",
+
+        queryOpera : " SELECT DISTINCT ?graph AS ?g ?uri ?name ?identifier ?material ?owner ?technique ?name_artist (group_concat(distinct ?subject ;separator=', ') as ?keywords) ?start_date ?end_date \
+        WHERE {GRAPH ?graph {?uri rdf:type crm:E22_Man-Made_Object} \
+        ?uri rdfs:label ?name ; \
+        crm:P2_has_type 'Opera d\'Arte' . \
+        OPTIONAL {?uri crm:P1_is_identified_by ?uri_identifier . \
+        ?uri_identifier rdfs:label ?identifier . } \
+        OPTIONAL {?uri crm:P45_consists_of ?uri_material . \
+        ?uri_material rdfs:label ?material . } \
+        OPTIONAL {?uri crm:P52_has_current_owner ?uri_owner . \
+        ?uri_owner rdfs:label ?owner . } \
+        ?production crm:P108_has_produced ?uri . \
+        OPTIONAL {?production crm:P32_used_general_technique ?uri_teche . \
+        ?uri_teche rdfs:label ?technique . } \
+        OPTIONAL {?pc crm:P01_has_domain ?production ; \
+        crm:P02_has_range ?uri_person . \
+        ?uri_person rdfs:label ?name_artist .} \
+        OPTIONAL {?uri crm:P62_depicts ?uri_subject . \
+        ?uri_subject rdfs:label ?subject . } \
+        OPTIONAL {?productionI crm:P108_has_produced ?uri ; \
+        crm:P2_has_type 'Inizio'^^<http://www.w3.org/2001/XMLSchema#string> ; \
+        crm:P4_has_time-span ?uri_time_spanI . \
+        ?uri_time_spanI rdfs:label ?start_date . } \
+        OPTIONAL {?productionF crm:P108_has_produced ?uri ; \
+        crm:P2_has_type 'Fine'^^<http://www.w3.org/2001/XMLSchema#string> ; \
+        crm:P4_has_time-span ?uri_time_spanF . \
+        ?uri_time_spanF rdfs:label ?end_date . } \
+        }",
+
+        queryLettere : " SELECT DISTINCT * \
+        WHERE { GRAPH ?graph {?uri rdf:type crm:E73_Information_Object} \
+        ?uri crm:P2_has_type ?uri_type . \
+        ?uri_type rdfs:label 'lettera' . \
+        ?uri crm:P72_has_language ?uri_language . \
+        ?uri_language rdfs:label ?language ; \
+        crm:P3_has_note ?uri_area . \
+        ?uri_area rdfs:label ?linguistic_area . \
+        ?uri_documentation crm:P70_documents ?uri ; \
+        crm:P1_is_identified_by ?uri_editionL . \
+        ?uri_editionL rdfs:label ?long_edition ; \
+        crm:P139_has_alternative_form ?uri_editionS . \
+        ?uri_editionS rdfs:label ?short_edition . \
+        ?uri_doc crm:P128_carries ?uri . \
+        GRAPH <http://dev.restore.ovi.cnr.it:8890/aspo/datini> {?uri_doc crm:P25i_moved_by ?event} \
+        ?send rdfs:subClassOf ?event ; \
+        rdf:type crm:EL2_Send_Letter . \
+        OPTIONAL {?send crm:P4_has_time-span ?uri_time_spanS. \
+        ?uri_time_spanS rdfs:label ?start_date . } \
+        OPTIONAL {?send crm:P27_moved_from ?uri_placeS . \
+        ?uri_placeS rdfs:label ?start_place } \
+        OPTIONAL {?send crm:P01_has_domain ?pcS . \
+        ?pcS crm:P02_has_range ?uri_sender . \
+        ?uri_sender rdfs:label ?mittente .} \
+        ?receive rdfs:subClassOf ?event ; \
+        rdf:type crm:EL3_Receive_Letter . \
+        OPTIONAL {?receive crm:P4_has_time-span ?uri_time_spanE . \
+        ?uri_time_spanE rdfs:label ?end_date . } \
+        OPTIONAL {?received crm:P26_moved_to ?uri_placeE . \
+        ?uri_placeE rdfs:label ?end_place } \
+        OPTIONAL {?receive crm:P01_has_domain ?pcR . \
+        ?pcR crm:P02_has_range ?uri_receiver . \
+        ?uri_receiver rdfs:label ?destinatario .} \
+        ?uri crm:P67_refers_to ?uri_lemma . \
+        ?uri_lemma rdfs:label ?lemma . \
+        }"
     }
 };
 

+ 1 - 1
lettera.html

@@ -293,7 +293,7 @@
 												<h3>Lemmi</h3>
 											</div>
 											<div class="res-events-table-container" id="lemmi_container">
-												<table class="inner_results">
+												<table class="inner_results" style="width:100%;">
 													<thead id="lem_thead" class="def_res">
 														<tr>
 															<th class="col-4">Lemma</th>

+ 2 - 1
ricerca_avanzata.html

@@ -190,7 +190,7 @@
 			<div class="container">
 				<div class="section-small">
 					<div id="box_results">
-						<h2>Risultati</h2>
+						<h2><span id="n_res"></span> Risultati</h2>
 						<div class="query-results-container">
 							<div id="query_results"></div>
 						</div>
@@ -262,6 +262,7 @@
 	</footer>
 
 	<!-- Bootstrap core JavaScript -->
+	<script src="js/utilities.js"></script>
 	<script src="vendor/jquery/jquery.min.js"></script>
 	<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
 </body>

+ 269 - 0
ricerca_avanzataBK.html

@@ -0,0 +1,269 @@
+<!doctype html>
+<html>
+
+<head>
+	<meta charset="utf-8">
+	<title>Restore - Ricerca avanzata</title>
+
+	<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
+	<link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet">
+	<link href="vendor/simple-line-icons/css/simple-line-icons.css" rel="stylesheet" type="text/css">
+	<link href="https://fonts.googleapis.com/css?family=Lato:300,400,700,300italic,400italic,700italic" rel="stylesheet" type="text/css">
+
+	<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
+	<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.2.1.min.js"></script>
+
+	<link href="css/landing-page.css" rel="stylesheet">
+	<link href="css/advanced-search.css" rel="stylesheet">
+	<link href="css/styles.min.css" rel="stylesheet">
+
+	<script src="js\advanced_search.js"></script>
+</head>
+
+<body>
+	<header class="sticky-top">
+		<nav class="navbar navbar-expand-lg navbar-light bg-white">
+			<div class="container-fluid">
+				<div class="navbar-brand">
+					<img src="img/Logo.png" width="100" alt="Restore" />
+				</div>
+				<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
+					<span class="navbar-toggler-icon"></span>
+				</button>
+				<div class="collapse navbar-collapse justify-content-end" id="navbarNavDropdown">
+					<ul class="navbar-nav">
+						<li class="nav-item">
+							<a class="nav-link" href="index.html">Home</a>
+						</li>
+						<li class="nav-item">
+							<a class="nav-link" href="http://restore.ovi.cnr.it/">Progetto</a>
+						</li>
+						<li class="nav-item active">
+							<a class="nav-link" href="ricerca.html">Ricerca</a>
+						</li>
+						<!--<li class="nav-item">
+							<a class="nav-link" href="#">Indici</a>
+						</li>
+						<li class="nav-item">
+							<a class="nav-link" href="#">Percorsi</a>
+						</li>-->
+						<li class="nav-item">
+							<a class="nav-link" href="standard.html">Standard</a>
+						</li>
+						<li class="nav-item dropdown">
+							<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Sparql</a>
+							<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
+								<a class="dropdown-item" href="http://dev.restore.ovi.cnr.it:8890/sparql/">Endpoint Sparql</a>
+								<a class="dropdown-item" href="sparql.html">Query</a>
+							</div>
+						</li>
+						<!--<li class="nav-item">
+							<a class="nav-link" href="download.html">Download</a>
+						</li>-->
+						<li class="nav-item dropdown">
+							<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink1" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Collegamenti esterni</a>
+							<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink1">
+								<a class="dropdown-item" href="http://ckan.restore.ovi.cnr.it/" target="_blank">CKAN</a>
+								<a class="dropdown-item" href="http://dev.restore.ovi.cnr.it/lodlive/" target="_blank">LOD</a>
+							</div>
+						</li>
+					</ul>
+				</div>
+			</div>
+		</nav>
+	</header>
+
+	<main>
+		<section id="advanced_search_intro">
+			<div class="container">
+				<div class="section-small">
+					<h1>Ricerca avanzata</h1>
+					<p>Questa è l'interfaccia per la ricerca avanzata, dedicata a coloro i quali hanno già familiarità con i dataset del progetto e desiderano cercare una risorsa specifica. 
+						Per utilizzare al meglio la ricerca avanzata:
+						<ul>
+							<li>Compila sempre almeno un parametro</li>
+							<li>Per restringere i parametri tra cui scegliere seleziona una categoria di risorsa dall'apposito menù a tendina</li>
+							<li>Per selezionare le risorse in base alla fonte originale seleziona una collezione dall'apposito menù a tendina</li>
+						</ul>
+						La ricerca avanzata simula un costruttore di query. Si può selezionare un numero a scelta di parametri, allo stesso 
+						tempo più parametri si selezionano più la ricerca verrà raffinata rispetto ai risultati.
+					</p>
+				</div>
+			</div>
+		</section>
+
+		<section id="advanced_search" class="masthead text-center">
+			<div class="overlay"></div>
+			<div id="advanced_search-options" class="container">
+				<div id="question">
+					<p><b>Cosa stai cercando?</b></p>
+				</div>
+				<div class="container-fluid">
+					<div class="row main-search-container">
+						<div class="col">
+							<select id="type_selector" class="category-form-select form-control" aria-label="Tutte le Categorie">
+								<option selected value="General">Tutte le Categorie</option>
+							</select>
+						</div>
+						<div class="col">
+							<select id="collection_selector" class="collection-form-select form-control" aria-label="Tutte le Collezioni">
+								<option selected value="">Tutte le Collezioni</option>
+							</select>
+						</div>
+						<div class="col-auto">
+							<div id="wb_ClipArt1">
+								<button class="btn btn-outline-light" onclick="getParameters()" type="button" id="ClipArt1" style="height:100%;">
+									<i class="fa fa-search mr-2" aria-hidden="true"></i>
+									Esegui la query
+								</button>
+							</div>
+						</div>
+					</div>
+					<div class="mt-3">
+						<div id="search-option-area">
+							<div id="search-option-general" class="box General">
+								<div id="drop-down-content"></div>
+								<div>
+									<button type="button" id="aggiungi" class="btn btn-link add" onclick="addToList()">
+										<i class="fa fa-plus mr-2" aria-hidden="true"></i>
+										Aggiungi parametro
+									</button>
+								</div>
+							</div>
+
+							<div id="search-option-person" class="box Person">
+								<div id="drop-down-content-Person"></div>
+								<div>
+									<button type="button" id="aggiungi" class="btn btn-link add" onclick="addToListPerson()">
+										<i class="fa fa-plus mr-2" aria-hidden="true"></i>
+										Aggiungi parametro
+									</button>
+								</div>
+							</div>
+
+							<div id="search-option-OA" class="box OA">
+								<div id="drop-down-content-OA"></div>
+								<div>
+									<button type="button" id="aggiungi" class="btn btn-link add" onclick="addToListOA()">
+										<i class="fa fa-plus mr-2" aria-hidden="true"></i>
+										Aggiungi parametro
+									</button>
+								</div>
+							</div>
+
+							<div id="search-option-letter" class="box Letter">
+								<div id="drop-down-content-Letter"></div>
+								<div>
+									<button type="button" id="aggiungi" class="btn btn-link add" onclick="addToListLetter()">
+										<i class="fa fa-plus mr-2" aria-hidden="true"></i>
+										Aggiungi parametro
+									</button>
+								</div>
+							</div>
+
+							<div id="search-option-object" class="box Object">
+								<div id="drop-down-content-Object"></div>
+								<div>
+									<button type="button" id="aggiungi" class="btn btn-link add" onclick="addToListObject()">
+										<i class="fa fa-plus mr-2" aria-hidden="true"></i>
+										Aggiungi parametro
+									</button>
+								</div>
+							</div>
+
+							<div id="search-option-place" class="box Place">
+								<div id="drop-down-content-place"></div>
+								<div>
+									<button type="button" id="aggiungi" class="btn btn-link add" onclick="addToListPlace()">
+										<i class="fa fa-plus mr-2" aria-hidden="true"></i>
+										Aggiungi parametro
+									</button>
+								</div>
+							</div>
+						</div>
+					</div>
+				</div>
+			</div>
+		</section>
+
+		<section>
+			<div class="container">
+				<div class="section-small">
+					<div id="box_results">
+						<h2>Risultati</h2>
+						<div class="query-results-container">
+							<div id="query_results"></div>
+						</div>
+					</div>
+				</div>
+			</div>
+		</section>
+	</main>
+
+	<footer id="footer" class="footer">
+		<div class="container">
+			<div class="row">
+				<div class="col-lg-7 h-100 text-center text-lg-left my-auto">
+					<ul class="list-inline mb-2">
+						<li class="list-inline-item">
+							<a href="#">About</a>
+						</li>
+						<li class="list-inline-item">&sdot;</li>
+						<li class="list-inline-item">
+							<a href="#">Contact</a>
+						</li>
+						<li class="list-inline-item">&sdot;</li>
+						<li class="list-inline-item">
+							<a href="#">Terms of Use</a>
+						</li>
+						<li class="list-inline-item">&sdot;</li>
+						<li class="list-inline-item">
+							<a href="#">Privacy Policy</a>
+						</li>
+					</ul>
+					<p class="small mb-4 mb-lg-0">&copy; RESTORE 2021. All Rights Reserved.</p>
+				</div>
+				<div class="col-lg-5 h-100 text-center my-auto">
+					<ul class="partner-list list-inline mb-0">
+						<li class="list-inline-item mr-3">
+							<a href="#">
+								<img class="img-logo" src="img/CNR.png" />
+							</a>
+						</li>
+						<li class="list-inline-item mr-3">
+							<a href="#">
+								<img class="img-logo" src="img/RegioneToscana.jpg" />
+							</a>
+						</li>
+						<li class="list-inline-item mr-3">
+							<a href="#">
+								<img class="img-logo" src="img/European-Union.png" />
+							</a>
+						</li>
+						<li class="list-inline-item mr-3">
+							<a href="#">
+								<img class="img-logo" src="img/RepubblicaItaliana.png" />
+							</a>
+						</li>
+						<li class="list-inline-item mr-3">
+							<a href="#">
+								<img class="img-logo" src="img/POR-FSE-Regione-Toscana.png" />
+							</a>
+						</li>
+						<li class="list-inline-item">
+							<a href="#">
+								<img class="img-logo" src="img/GiovaniSi.png" />
+							</a>
+						</li>
+					</ul>
+				</div>
+			</div>
+		</div>
+	</footer>
+
+	<!-- Bootstrap core JavaScript -->
+	<script src="vendor/jquery/jquery.min.js"></script>
+	<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
+</body>
+
+</html>