var link = thisUrlParams.link;
prefixes = queryManager['prefixes']['all'];
queryURL = prefixes + (queryManager['querySchedaOggetto']['queryInfo']).replace('{URI}', link);
doJsonQuery(queryURL).done(function(data) { handle_objectData(data); });
queryINF = prefixes + (queryManager['querySchedaOggetto']['queryContent']).replace('{URI}', link);
doJsonQuery(queryINF).done(function(data) { handle_objectInfo(data); });
queryOVI = prefixes + (queryManager['querySchedaOggetto']['queryOviLetter']).replace('{URI}', link);
doJsonQuery(queryOVI).done(function(data) { handle_oviLetter(data); });
queryPERS = prefixes + (queryManager['querySchedaOggetto']['queryPersone']).replace('{URI}', link);
doJsonQuery(queryPERS).done(function(data) { handle_citedPeople(data); });
queryLG = prefixes + (queryManager['querySchedaOggetto']['queryLuoghiGT']).replace('{URI}', link);
doJsonQuery(queryLG).done(function(data) { handle_luoghiDocumento(data); });
function handle_objectData(json) {
console.log(json['results']['bindings']);
$.each(
json['results']['bindings'],
function (index, value) {
var graph = value['graph']['value'];
var label = value['label']['value'];
var uri = value['uri']['value'];
var siglaRegistro = "";
var identifier = "";
var dimensions = "";
var consistence = "";
var materials = "";
var description = "";
var button_ext = "";
var button_owner = "";
var current_owner = "";
var uri_owner = "";
var dates = "";
var uri_composed = "";
var composed = "";
var button_doc = "";
var dataset = get_graph_name(graph);
if (value.hasOwnProperty('id')) {
$("#ID").css("display", "flex");
identifier = value['id']['value'];
}
if (value.hasOwnProperty('dimension')) {
$("#dimensione").css("display", "flex");
dimensions = value['dimensions']['value'];
}
if (value.hasOwnProperty('consistency')) {
$("#consistenza").css("display", "flex");
consistence = value['consistency']['value'];
}
if (value.hasOwnProperty('sigla_registro')) {
$("#IDreg").css("display", "flex");
siglaRegistro = value['sigla_registro']['value'];
}
if (value.hasOwnProperty('condition')) {
$("#STCC").css("display", "flex");
condition = value['condition']['value'];
}
if (value.hasOwnProperty('material')) {
$("#materia").css("display", "flex");
materials = value['material']['value'];
}
if (value.hasOwnProperty('uri_owner')) {
$("#current_owner").css("display", "flex");
current_owner = value['owner']['value'];
uri_owner = value['uri_owner']['value'];
}
if (value.hasOwnProperty('time_span')) {
if (value['time_span']['value'] != ""){
$("#time_span_object").css("display", "flex");
dates = value['time_span']['value'];
}
}
if (value.hasOwnProperty('note')) {
$("#notes").css("display", "flex");
description = value['note']['value'];
}
if (value.hasOwnProperty('uri_document')) {
uri_composed = value['uri_document']['value'];
}
if (value.hasOwnProperty('document')) {
$("#composed").css("display", "flex");
composed = value['document']['value'];
}
if (identifier != "") {
button_ext = '' + identifier + '';
}
if (uri_composed != "") {
button_doc = '';
}
if (owner != "") {
button_owner = '' + current_owner + '';
}
var Buttons = ' \
\
\
';
document.getElementById("grafo").innerHTML = dataset;
document.getElementById("nome_oggetto").innerHTML = label;
document.getElementById("identifier").innerHTML = button_ext;
document.getElementById("nota").innerHTML = description;
document.getElementById("sigla_registro").innerHTML = siglaRegistro;
document.getElementById("dimensions").innerHTML = dimensions;
document.getElementById("materials").innerHTML = materials;
document.getElementById("consistence").innerHTML = consistence;
document.getElementById("owner").innerHTML = button_owner;
document.getElementById("timeSpan").innerHTML = dates;
document.getElementById("superDoc").innerHTML = composed;
document.getElementById("btn_superDoc").innerHTML = button_doc;
document.getElementById("link_buttons").innerHTML = Buttons;
});
}
function get_graph_name(graph) {
var dataset = "Scheda Oggetto";
if (graph == "http://dev.restore.ovi.cnr.it:8890/aspo/ospedale") {
dataset = dataset + " / Ospedale";
} else if (graph == "http://dev.restore.ovi.cnr.it:8890/aspo/datini") {
dataset = dataset + " / Datini";
} else if (graph == "http://dev.restore.ovi.cnr.it:8890/aspo/marcovaldi") {
dataset = dataset + " / Marcovaldi";
} else if (graph == "http://dev.restore.ovi.cnr.it:8890/aspo/gettatelli") {
dataset = dataset + " / Gettatelli";
} else {
dataset = dataset;
}
return dataset;
}
function handle_objectInfo(json) {
console.log(json['results']['bindings']);
$.each(
json['results']['bindings'],
function (index, value) {
var title = "";
var type = "";
var subject = "";
if (value.hasOwnProperty('titolo')) {
$("#titolo").css("display", "flex");
title = value['titolo']['value'];
}
if (value.hasOwnProperty('tipo')) {
$("#tipo").css("display", "flex");
type = value['tipo']['value'];
}
if (value.hasOwnProperty('ref')) {
if (value['ref']['value'] != "") {
$("#argomento").css("display", "flex");
subject = value['ref']['value'];
}
}
document.getElementById("title").innerHTML = title;
document.getElementById("type").innerHTML = type;
document.getElementById("subject").innerHTML = subject;
});
}
function handle_oviLetter(json) {
console.log(json['results']['bindings']);
$.each(
json['results']['bindings'],
function (index, value) {
var other_id = "";
var uri = "";
var button_letter = "";
if (value.hasOwnProperty('otherId')) {
$("#IDbis").css("display", "flex");
other_id = value['otherId']['value'];
}
if (value.hasOwnProperty('InfObj')) {
uri = value['InfObj']['value'];
}
if (uri != "") {
button_letter = '';
}
document.getElementById("other_identifier").innerHTML = other_id;
document.getElementById("btn_other_identifier").innerHTML = button_letter;
});
}
function handle_citedPeople(json) {
console.log(json);
const people = [];
$.each(
json['results']['bindings'],
function (index, value) {
var uri = value['uri_person']['value'];
var name = value['name']['value'];
var tipo = "";
var nota = "";
if (value.hasOwnProperty('types')) {
if (value['types']['value'] != "") {
tipo = value['types']['value'];
}
}
if (value.hasOwnProperty('note')) {
nota = value['note']['value'];
}
people.push([uri, name, tipo, nota]);
});
var Person = "";
for (var i=0; i
Citazione nel ruolo di: " + people[i][2];
}
if (people[i][3] != "") {
object = object + "
Nota: " + people[i][3];
}
object = object + '
Questa ricerca non ha prodotto risultati
"; document.getElementById("cited_people").innerHTML = messaggio; } } function handle_luoghiDocumento(json) { console.log(json); const places = []; $.each( json['results']['bindings'], function (index, value) { var uri = value['uri_place']['value']; var label = value['place']['value']; places.push([uri, label]); }); var Luoghi = ""; for (var i=0; iQuesta ricerca non ha prodotto risultati
"; document.getElementById("section_places").innerHTML = messaggio; } } function createDivRelazione(type, id){ htmlCode = '\