$(document).ready(function () { //####################################### 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"], ["MPP - Autori MPP", "http://dev.restore.ovi.cnr.it:8890/mpp/authors"], ["OVI - Lettere", "http://dev.restore.ovi.cnr.it:8890/ovi/datini"], ["Luoghi", "http://dev.restore.ovi.cnr.it:8890/mpp/places"] ]; var graph_selector = document.getElementById("graph_selector"); let x = graphArray.length; for(var i=0; i'; } else { search_graph = '?g'; } var e = document.getElementById("entity_selector"); var entity = e.value; var search_entity = ""; if (entity != "") { search_entity = '<' + entity + '>'; } else { search_entity = '?type'; } //var query='SELECT DISTINCT ?nome WHERE { ?autore . ?autore ?nomeid. ?nomeid ?nome . FILTER regex(?nome, "'+ search_name +'") }' ; query = 'SELECT DISTINCT '+ search_graph +' AS ?graph ?link ?label ?entity ?object ?objLab WHERE { GRAPH '+ search_graph +' { ?link ?label ; '+ search_entity +' . ?label bif:contains "\'' + search_name + '\'" .} '+ search_entity +' ?entity . FILTER (langMatches( lang(?entity), "en" )) OPTIONAL {?link ?object } OPTIONAL {?link ?link_object . ?link_object ?objLab }} limit 100'; //query = 'select distinct ?nome ?link where {?link ?nome . ?nome bif:contains "'+ search_name +'"}' //query = 'select distinct ?nome where {?nome FILTER regex(?nome, "'+ search_name +'")}'; var autori_url = 'http://dev.restore.ovi.cnr.it:8890/sparql/?default-graph-uri=&query=' + encodeURIComponent(query) + '&output=json'; $.ajax({ url: autori_url + '&callback=?', dataType: "json", success: function (data) { autori_handle_json(data); }, error: function (e) {} }); } function autori_handle_json(json) { console.log(json); $('#wb_Shape1').text(""); $('#wb_Image1').text(""); var i = 0; $.each( json['results']['bindings'], function (index, value) { var autore = ""; /*Inserisci VALUE TIPOLOGIA*/ var tipo = ""; var button_type = ""; if (value.hasOwnProperty('object')) { if (value['object']['type'] == "literal") { tipo = value['object']['value']; } } if (value.hasOwnProperty('objLab')) { if (value['objLab']['type'] == "literal") { tipo = value['objLab']['value']; } } if (tipo == "lettera" || tipo == "Testo annotato OVI") { button_type += ''; } autore += /*INIZIO DIV*/ '' /*DA QUA AUTORE ->*/ + '
' + value['graph']['value'] + '
' + value['label']['value'] + '' + '
' + value['entity']['value'] + '' + button_type + /*DA QUI SCHEDA ->*/'' + '' + /*DA QUI CITAZIONE ->*/'' + '' + /*DA QUI HYPERLINK ->*/'' + '' + /*DA QUI LOD ->*/'' + '';/*FINE DIV*/ i++; /*onclick=copy__Text("' + value['link']['value'] + '")*/ $('#wb_Shape1').append(autore); }); if (i==0) { var message = '

Questa ricerca non ha prodotto risultati

'; $('#wb_Shape1').append(message); } } $('#ClipArt1').click(function () { testo = $('input#TextArea1').val(); autori_retrieveData(); search_name = ""; }); $('input#TextArea1').keypress(function(e) { var key = e.which; if (key == 13) // the enter key code { $('#ClipArt1').click(); return false; } }); //onlick hyperlink button $(document).on("click", ".hyp", function (ev) { var link = this.id; //alert(nome_autore); //$('#myModal').text(""); $("#myModal").empty(); $("#myModal").css("display", "block"); $('#myModal').append("