123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349 |
- 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 = '<a title="Apri risorsa originale" href= "' + uri + '">' + identifier + '</a>';
- }
- if (uri_composed != "") {
- button_doc = '<button title="Apri risorsa di livello superiore" id="' + uri_composed + '" class="object btn btn-default" type="button" title="Bene culturale" > \
- <i class="fa fa-book" aria-hidden="true"> <p class="btn-text">Bene culturale</p></i></button>';
- }
- if (owner != "") {
- button_owner = '<a title="Vai al sito dell\'Istituto" href= "' + uri_owner + '">' + current_owner + '</a>';
- }
- var Buttons = '<button title="Apri risorsa originale" class="btn btn-default" type="button" onclick="schedaASPO(\'' + uri + '\')"> \
- <i class="fas fa-external-link-alt" aria-hidden="true"></i></button> \
- <button title="Citazione" type="button" value="object" id="' + uri + '" class="cit btn btn-default" alt="scheda" title="Citazione"><i class="fa fa-quote-right"></i></button> \
- <button title="Permalink" type="button" value="object" id="' + uri + '" class="hyp btn btn-default" alt="scheda" title="Hyperlink"><i class="fa fa-link"></i></button> \
- <a href="http://dev.restore.ovi.cnr.it/lodlive/?' + uri + '" target="_blank"><button type="button" title="Naviga il grafo" class="btn btn-default info" alt="LOD" title="LodLive"><i class="fa fa-share-alt"></i></button></a></div></div>';
- 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 = '<button type="button" id="' + uri +
- '" class="lettera btn btn-default" alt="lettera"><i class="fa fa-envelope"></i><p class="btn-text">Scheda Lettera</p></button>';
- }
-
- 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<people.length; i++) {
- var object = '<div class="col-8"><p><span id="' + people[i][0] + '" class="title_doc persona">'+ people[i][1] + '</span>';
- if (people[i][2] != "") {
- object = object + "<br />Citazione nel ruolo di: " + people[i][2];
- }
- if (people[i][3] != "") {
- object = object + "<br />Nota: " + people[i][3];
- }
- object = object + '</p></div>';
-
- Person += '<div class="row res">' + object +
- '<div class="col d-flex align-items-start justify-content-end"><button type="button" id="' + people[i][0] + '" class="persona btn btn-default" alt="persona" title="' +
- people[i][1] + '"><i class="fa fa-user"></i><p class="btn-text">Scheda Persona</p></button>' +
- '<button type="button" value="Persona" id="' + people[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 value="Persona" type="button" id="' + people[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/?' + people[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_pp").innerHTML = people.length;
- document.getElementById("cited_people").innerHTML = Person;
-
- if (people.length==0) {
- var messaggio = "<p class='no-results'>Questa ricerca non ha prodotto risultati</p>";
- 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; i<places.length; i++) {
- var object = '<div class="col-8"><p><span id="' + places[i][0] + '" class="title_doc luogo">'+ places[i][1] + '</span></p></div>';
-
- var object_button = '<button type="button" id="' + places[i][0] +
- '" class="luogo btn btn-default" alt="oggetto" title="' + places[i][1] +
- '"><i class="fa fa-map"></i><p class="btn-text">luogo</p></button>';
- Luoghi += '<div class="row res">'+ object +
- '<div class="col d-flex align-items-start justify-content-end">' + object_button +
- '<button type="button" value="luogo" id="' + places[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" value="luogo" id="' + places[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/?' + places[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_pl").innerHTML = places.length;
- document.getElementById("section_places").innerHTML = Luoghi;
- if (places.length==0) {
- var messaggio = "<p class='no-results'>Questa ricerca non ha prodotto risultati</p>";
- document.getElementById("section_places").innerHTML = messaggio;
- }
-
- }
- function createDivRelazione(type, id){
- htmlCode = '\
- <div class="row mb-2"> \
- <div class="col-sm-4"> \
- <span class="label"><RELATIONSHIP></span> \
- </div> \
- <div class="col record_box" id="<ID_RELATIONSHIP>"></div> \
- </div> \
- '.replace("<RELATIONSHIP>", type).replace("<ID_RELATIONSHIP>", id);
- return htmlCode;
- }
- function createColRelazione(text, link, tipo, fa, tab, decl) {
- htmlCode = '\
- <div class="row"> \
- <div class="col <CLASS>"><NAME></div> \
- <div class="col-auto"> \
- <button class="<TIPO> btn btn-default" type="button" id="<URI>">\
- <i class="<BUTTON>" aria-hidden="true">\
- <p class="btn-text"><TAB></p>\
- </i>\
- </button>\</div> \
- </div>\
- '.replace("<NAME>", text).replace("<URI>", link).replace("<TIPO>", tipo).replace("<BUTTON>", fa).replace("<TAB>", tab).replace("<CLASS>", decl);
- return htmlCode;
- }
|