123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195 |
- var link = thisUrlParams.link;
- prefixes = queryManager['prefixes']['all'];
- queryURL = prefixes + (queryManager['querySchedaOpera']['queryInfo']).replace('{URI}', link);
- doJsonQuery(queryURL).done(function(data) { handle_OAdata(data); });
- queryPro = prefixes + (queryManager['querySchedaOpera']['queryProduction']).replace('{URI}', link);
- doJsonQuery(queryPro).done(function(data) { handle_Production(data); });
- function handle_OAdata(json) {
- console.log(json['results']['bindings']);
- $.each(
- json['results']['bindings'],
- function (index, value) {
- var graph = value['graph']['value'];
- var label = value['label']['value'];
- var title = "";
- var type = "";
- var current_owner = "";
- var current_location = "";
- var subject = "";
- var dimensions = "";
- var materials = "";
- var condition = "";
- var note = "";
- var identifier = "";
- var unit = "";
- var dataset = get_dataset_name(graph);
-
- if (value.hasOwnProperty('title')) {
- $("#SGTT").css("display", "flex");
- title = value['title']['value'];
- }
- if (value.hasOwnProperty('identifier')) {
- $("#NCT").css("display", "flex");
- identifier = value['identifier']['value'];
- }
- if (value.hasOwnProperty('type')) {
- $("#OGTD").css("display", "flex");
- type = "<div class='d-flex'><div class='mr-3'>" +
- value['type']['value'] + "</div><div class='d-flex ml-auto'><div class='mr-3'><a class='btn-icon' target='_blank' href='" +
- value['uriType']['value'] + "'><i class='fa fa-bullseye' aria-hidden='true'></i><p class='btn-text'>AAT</p></a></div></div></div></div>";
- }
- if (value.hasOwnProperty('current_owner')) {
- $("#LDCN").css("display", "flex");
- current_owner = "<div class='d-flex'><div class='mr-3'>" +
- value['current_owner']['value'] + "</div><div class='d-flex ml-auto'><div class='mr-3'><a class='btn-icon' target='_blank' href='" +
- value['uriOwner']['value'] + "'><i class='fas fa-external-link-alt' aria-hidden='true'></i><p class='btn-text'>LINK</p></a></div></div></div></div>";
- }
- if (value.hasOwnProperty('current_location')) {
- $("#LDCS").css("display", "flex");
- current_location = value['current_location']['value'];
- }
- if (value.hasOwnProperty('unit')) {
- unit = value['unit']['value'];
- }
- if (value.hasOwnProperty('subject')) {
- $("#SGTI").css("display", "flex");
- subject = value['subject']['value'];
- }
- if (value.hasOwnProperty('dimensions')) {
- if (value['dimensions']['value'] != "") {
- $("#MIS").css("display", "flex");
- dimensions = value['dimensions']['value'];
- }
- }
- if (value.hasOwnProperty('condition')) {
- $("#STCC").css("display", "flex");
- condition = value['condition']['value'];
- }
- if (value.hasOwnProperty('note')) {
- $("#NSC").css("display", "flex");
- note = value['note']['value'];
- }
- if (value.hasOwnProperty('Materials')) {
- if (value['Materials']['value'] != "") {
- $("#MTC").css("display", "flex");
- mm = value['Materials']['value'];
- mat = mm.split("<br />");
- for (i in mat) {
- slice = mat[i].split("; ");
- /*materials += "<a href='" + slice[0] + "'>" + slice[1] + "</a><br />";*/
- materials += "<div class='d-flex'><div class='mr-3'>" +
- slice[1] + "</div><div class='d-flex ml-auto'><div class='mr-3'><a class='btn-icon' target='_blank' href='" +
- slice[0] + "'><i class='fa fa-bullseye' aria-hidden='true'></i><p class='btn-text'>AAT</p></a></div></div></div></div>";
- }
- }
- }
- document.getElementById("grafo").innerHTML = dataset;
- document.getElementById("nome_oggetto").innerHTML = label;
- /*document.getElementById("title").innerHTML = title;*/
- document.getElementById("identifier").innerHTML = identifier;
- document.getElementById("type").innerHTML = type;
- document.getElementById("owner").innerHTML = current_owner;
- /*document.getElementById("location").innerHTML = current_location;*/
- document.getElementById("subject").innerHTML = subject;
- document.getElementById("dimensions").innerHTML = dimensions + unit;
- document.getElementById("materials").innerHTML = materials;
- document.getElementById("condition").innerHTML = condition;
- document.getElementById("description").innerHTML = note;
-
- });
-
- }
- function get_dataset_name(graph) {
- var string = "Scheda Opera d'Arte";
- if (graph == "http://dev.restore.ovi.cnr.it:8890/mpp/martini") {
- string = string + " / Collezione Martini";
- }
- else if (graph == "http://dev.restore.ovi.cnr.it:8890/mpp/ospedale") {
- string = string + " / Collezione Ospedale";
- }
- else if (graph == "http://dev.restore.ovi.cnr.it:8890/mpp/datini") {
- string = string + " / Collezione Datini";
- }
- else {
- string = string;
- }
- return (string);
- }
- function handle_Production(json) {
- console.log(json['results']['bindings']);
- $.each(
- json['results']['bindings'],
- function (index, value) {
- var partecipants = "";
- var teche = "";
- var time = "";
- var client = "";
- var artist = "";
- var artist_name = "";
-
- if (value.hasOwnProperty('techniques')) {
- if (value['techniques']['value'] != "") {
- $("#MTC").css("display", "flex");
- tt = value['techniques']['value'];
- tec = tt.split("<br />");
- for (i in tec) {
- slice = tec[i].split("; ");
- /*teche += "<a href='" + slice[0] + "'>" + slice[1] + "</a><br />";*/
- teche += "<div class='d-flex'><div class='mr-3'>" +
- slice[1] + "</div><div class='d-flex ml-auto'><div class='mr-3'><a class='btn-icon' target='_blank' href='" +
- slice[0] + "'><i class='fa fa-bullseye' aria-hidden='true'></i><p class='btn-text'>AAT</p></a></div></div></div></div>";
- }
- }
- }
- if (value.hasOwnProperty('Partecipants')) {
- pp = value['Partecipants']['value'];
- people = pp.split("<br />");
- for (i in people) {
- slice = people[i].split("; ");
- if (slice[2] == "Committente") {
- $("#CMM").css("display", "flex");
- client += slice[1];
- } else {
- $("#AUT").css("display", "flex");
- artist_name += slice[1];
- artist += "<div class='d-flex'><div class='mr-3'>" +
- slice[1] + "</div><div class='d-flex ml-auto'><div class='mr-3'><a class='btn-icon' target='_blank' href='" +
- slice[0] + "'><i class='fas fa-external-link-alt' aria-hidden='true'></i><p class='btn-text'>LINK</p></a></div><div class='persona btn-icon' style='cursor:pointer' id='" +
- slice[0] + "'><i class='fa fa-user'></i><p class='btn-text'>SCHEDA<br />PERSONA</p></div></div></div></div>";
- }
- }
- }
-
- if (value.hasOwnProperty('time')) {
- time = value['time']['value'];
- }
-
-
- document.getElementById("technique").innerHTML = teche;
- document.getElementById("time").innerHTML = time;
- /*document.getElementById("artist_name").innerHTML = artist_name;*/
- document.getElementById("artist").innerHTML = artist;
- document.getElementById("client").innerHTML = client;
-
- });
-
- }
|