|
@@ -66,7 +66,21 @@ crm:P27_moved_from ?place_from . \
|
|
|
owl:sameAs ?place . \
|
|
|
?place rdfs:label ?label ; \
|
|
|
crm:P168_place_is_defined_by ?coordinates . \
|
|
|
-} \
|
|
|
+} UNION { \
|
|
|
+ <" + thisUrlParams.link + "> crm:P100i_died_in ?uri_death . \
|
|
|
+ ?uri_death crm:P7_took_place_at ?uri_place . \
|
|
|
+ ?uri_place rdf:type crm:E53_Place ; \
|
|
|
+ owl:sameAs ?place . \
|
|
|
+ ?place rdfs:label ?label ; \
|
|
|
+ crm:P168_place_is_defined_by ?coordinates . \
|
|
|
+ } UNION { \
|
|
|
+ <" + thisUrlParams.link + "> crm:P98i_was_born ?uri_birth . \
|
|
|
+ ?uri_birth crm:P7_took_place_at ?uri_place . \
|
|
|
+ ?uri_place rdf:type crm:E53_Place ; \
|
|
|
+ owl:sameAs ?place . \
|
|
|
+ ?place rdfs:label ?label ; \
|
|
|
+ crm:P168_place_is_defined_by ?coordinates . \
|
|
|
+ } \
|
|
|
}"
|
|
|
|
|
|
queryInfo = prefixes + " SELECT DISTINCT ?graph ?label ?identifier ?name ?givenName ?familyName ?alias (GROUP_CONCAT(DISTINCT CONCAT(?variant, '| ', ?otherName) ; SEPARATOR = ';') AS ?variants) ?gender ?Birth_Date ?Birth_Place ?Death_Date ?Death_Place ?patronymic ?occupation (group_concat(distinct ?relative1 ;separator=', ') as ?relatives) ?qualification ?group \
|
|
@@ -121,6 +135,19 @@ OPTIONAL {?ev_move crm:P4_has_time-span ?uri_ts . \
|
|
|
?uri_ts rdfs:label ?time_span . } \
|
|
|
}"
|
|
|
|
|
|
+queryOtherDoc = prefixes + " SELECT DISTINCT ?document ?label ?id (group_concat(distinct ?time_span ;separator='-') as ?time_span) \
|
|
|
+WHERE {<" + thisUrlParams.link + "> rdf:type crm:E21_Person . \
|
|
|
+?creation crm:P67_refers_to <" + thisUrlParams.link + "> . \
|
|
|
+?document crm:P92i_was_brought_into_existence_by ?creation ; \
|
|
|
+rdfs:label ?label ; \
|
|
|
+crm:P1_is_identified_by ?uri_id . \
|
|
|
+?uri_id rdfs:label ?id ; \
|
|
|
+crm:P2_has_type 'Segnatura' . \
|
|
|
+OPTIONAL {?creation crm:P4_has_time-span ?uri_time_span . \
|
|
|
+?uri_time_span rdfs:label ?time_span . } \
|
|
|
+} \
|
|
|
+GROUP BY ?document ?label ?id "
|
|
|
+
|
|
|
queryOpere = prefixes + " SELECT DISTINCT ?subject ?label ?nct (group_concat(distinct ?time_span ;separator='-') as ?time_span) \
|
|
|
WHERE {?subject rdf:type crm:E22_Man-Made_Object ; \
|
|
|
rdfs:label ?label ; \
|
|
@@ -167,6 +194,8 @@ queryURL = prepareQueryURL(query);
|
|
|
|
|
|
queryNet = prepareQueryURL(queryNetwork);
|
|
|
|
|
|
+queryOt = prepareQueryURL(queryOtherDoc);
|
|
|
+
|
|
|
queryOA = prepareQueryURL(queryOpere);
|
|
|
|
|
|
query = prepareQueryURL(queryInfo);
|
|
@@ -223,6 +252,15 @@ responseOA = $.ajax({
|
|
|
error: function (e) {}
|
|
|
});
|
|
|
|
|
|
+responseOt = $.ajax({
|
|
|
+
|
|
|
+ url: queryOt,
|
|
|
+ dataType: "json",
|
|
|
+ success: function (data){
|
|
|
+ handle_Documents(data);
|
|
|
+ },
|
|
|
+ error: function (e) {}
|
|
|
+});
|
|
|
|
|
|
|
|
|
function handle_data(json) {
|
|
@@ -456,6 +494,7 @@ function handle_Letters(json) {
|
|
|
|
|
|
}
|
|
|
|
|
|
+
|
|
|
//POPULATE RECEIVE LETTERS BOX
|
|
|
|
|
|
for (var i=0; i<receive.length; i++) {
|
|
@@ -489,12 +528,12 @@ function handle_Letters(json) {
|
|
|
document.getElementById("letters_send").innerHTML = Send_Letters;
|
|
|
document.getElementById("letters_receive").innerHTML = Receive_Letters;
|
|
|
|
|
|
- if (i==0) {
|
|
|
+ if (send.length==0) {
|
|
|
var messaggio = "<p class='no-results'>Nessun risultato trovato</p>";
|
|
|
document.getElementById("letters_send").innerHTML = messaggio;
|
|
|
}
|
|
|
|
|
|
- if (j==0) {
|
|
|
+ if (receive.length==0) {
|
|
|
var messaggio = "<p class='no-results'>Nessun risultato trovato</p>";
|
|
|
document.getElementById("letters_receive").innerHTML = messaggio;
|
|
|
}
|
|
@@ -543,24 +582,64 @@ function handle_Artwork(json) {
|
|
|
'<a href="http://dev.restore.ovi.cnr.it/lodlive/?' + oa[i][0] + '" target="_blank"><button type="button" class="btn btn-default info" alt="LOD"><i class="fa fa-share-alt"></i><p class="btn-text">Lod</p></button></a></div></div>';
|
|
|
}
|
|
|
|
|
|
- /*if (receive[i][4] != "") {
|
|
|
- infObject_button += '<button type="button" id="' + receive[i][4] +
|
|
|
- '" class="lettera btn btn-default" alt="lettera" ><i class="fa fa-envelope"></i><p class="btn-text">Scheda Lettera</p></button>';
|
|
|
- } else {
|
|
|
- infObject_button += '<button type="button" id="' + receive[i][0] +
|
|
|
- '" class="object btn btn-default" alt="oggetto" title="' + receive[i][1] +
|
|
|
- '"><i class="fa fa-book"></i><p class="btn-text">Scheda Oggetto</p></button>';
|
|
|
+ document.getElementById("n_oa").innerHTML = oa.length;
|
|
|
+ document.getElementById("object_oa").innerHTML = Artworks;
|
|
|
+
|
|
|
+ if (oa.length==0) {
|
|
|
+ var messaggio = "<p class='no-results'>Nessun risultato trovato</p>";
|
|
|
+ document.getElementById("object_oa").innerHTML = messaggio;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+function handle_Documents(json) {
|
|
|
+
|
|
|
+ console.log(json);
|
|
|
+
|
|
|
+ const doc = [];
|
|
|
+
|
|
|
+ $.each(
|
|
|
+ json['results']['bindings'],
|
|
|
+ function (index, value) {
|
|
|
+ uri = value['document']['value'];
|
|
|
+ label = value['label']['value'];
|
|
|
+ id = value['id']['value'];
|
|
|
+ var data = "";
|
|
|
+
|
|
|
+ if (value.hasOwnProperty('time_span')) {
|
|
|
+ data = value['time_span']['value'];
|
|
|
+ }
|
|
|
+
|
|
|
+ doc.push([uri, label, id, data]);
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+ var Documents = "";
|
|
|
+
|
|
|
+ for (var i=0; i<doc.length; i++) {
|
|
|
+ var artwork = '<a href=' + doc[i][0] + ' target="_blank">' + doc[i][1] + '</a><br />Segnatura: ' + doc[i][2];
|
|
|
+ if (doc[i][3] != "") {
|
|
|
+ artwork = artwork + "<br />Data: " + doc[i][3];
|
|
|
}
|
|
|
|
|
|
- Receive_Letters += '<div class="row res"><div class="col-8"><p>'+ artwork +'</p></div>' +
|
|
|
- '<div class="col d-flex align-items-start justify-content-end">' + infObject_button +
|
|
|
- '<button type="button" id="' + receive[i][0] + '" class="cit btn btn-default" alt="scheda" title="Info"><i class="fa fa-quote-right"></i><p class="btn-text">Citazione</p></button>' +
|
|
|
- '<button type="button" id="' + receive[i][0] + '" class="hyp btn btn-default" alt="scheda" title="Info"><i class="fa fa-link"></i><p class="btn-text">Hyperlink</p></button>' +
|
|
|
- '<a href="http://dev.restore.ovi.cnr.it/lodlive/?' + receive[i][0] + '" target="_blank"><button type="button" class="btn btn-default info" alt="LOD"><i class="fa fa-share-alt"></i><p class="btn-text">Lod</p></button></a></div></div>';
|
|
|
- }*/
|
|
|
+ var object_button = '<button type="button" id="' + doc[i][0] +
|
|
|
+ '" class="object btn btn-default" alt="opera d\'arte" title="' + doc[i][1] +
|
|
|
+ '"><i class="fa fa-book"></i><p class="btn-text">Scheda Oggetto</p></button>';
|
|
|
|
|
|
- document.getElementById("n_oa").innerHTML = oa.length;
|
|
|
- document.getElementById("object_oa").innerHTML = Artworks;
|
|
|
+ Documents += '<div class="row res"><div class="col-8"><p>'+ artwork +'</p></div>' +
|
|
|
+ '<div class="col d-flex align-items-start justify-content-end">' + object_button +
|
|
|
+ '<button type="button" id="' + doc[i][0] + '" class="cit btn btn-default" alt="scheda" title="Info"><i class="fa fa-quote-right"></i><p class="btn-text">Citazione</p></button>' +
|
|
|
+ '<button type="button" id="' + doc[i][0] + '" class="hyp btn btn-default" alt="scheda" title="Info"><i class="fa fa-link"></i><p class="btn-text">Hyperlink</p></button>' +
|
|
|
+ '<a href="http://dev.restore.ovi.cnr.it/lodlive/?' + doc[i][0] + '" target="_blank"><button type="button" class="btn btn-default info" alt="LOD"><i class="fa fa-share-alt"></i><p class="btn-text">Lod</p></button></a></div></div>';
|
|
|
+ }
|
|
|
+
|
|
|
+ document.getElementById("n_ass").innerHTML = doc.length;
|
|
|
+ document.getElementById("other_documents").innerHTML = Documents;
|
|
|
+
|
|
|
+ if (doc.length==0) {
|
|
|
+ var messaggio = "<p class='no-results'>Nessun risultato trovato</p>";
|
|
|
+ document.getElementById("other_documents").innerHTML = messaggio;
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|
|
@@ -599,6 +678,12 @@ function handle_map(json) {
|
|
|
var latitude = lat/i;
|
|
|
var longitude = long/i;
|
|
|
|
|
|
+ if (locations.length > 0) {
|
|
|
+ $("#map_icon").css("display", "none");
|
|
|
+ } else {
|
|
|
+ $("#references_persona").css("display", "none");
|
|
|
+ }
|
|
|
+
|
|
|
document.getElementById("list_places_person").innerHTML = myPlaces;
|
|
|
|
|
|
|
|
@@ -704,7 +789,6 @@ function handle_network(json) {
|
|
|
sum += temp;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
|
|
|
|
|
|
document.getElementById("list_person_network").innerHTML = ArrayNames;
|
|
@@ -733,6 +817,7 @@ function handle_network(json) {
|
|
|
|
|
|
// append the svg object to the body of the page
|
|
|
var svg = d3.select("#myWordCloud").append("svg")
|
|
|
+ .attr("id", "wordcloudNetwork")
|
|
|
.attr("width", width + margin.left + margin.right)
|
|
|
.attr("height", height + margin.top + margin.bottom)
|
|
|
.append("g")
|
|
@@ -783,6 +868,13 @@ function handle_network(json) {
|
|
|
.attr('font-size', 1)
|
|
|
.remove();
|
|
|
}
|
|
|
+
|
|
|
+ if (words.length > 0) {
|
|
|
+ $("#users_icon").css("display", "none");
|
|
|
+ } else {
|
|
|
+ $("#wordcloudNetwork").css("display", "none");
|
|
|
+ $("#references_network").css("display", "none");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
$(document).on("click", ".luogo", function (ev) {
|