$(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"] ]; 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 WHERE { GRAPH '+ search_graph +' { ?link ?label ; '+ search_entity +' . ?label bif:contains "'+ search_name +'" .} '+ search_entity +' ?entity . FILTER (langMatches( lang(?entity), "en" )) }'; //query = 'select distinct ?nome ?link where {?link ?nome . ?nome bif:contains "'+ search_name +'"}' //query = 'select distinct ?nome where {?nome FILTER regex(?nome, "'+ search_name +'")}'; entity = ''; graph = ''; 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(""); $.each( json['results']['bindings'], function (index, value) { var autore = ""; autore += /*INIZIO DIV*/ '' /*DA QUA AUTORE ->*/ + '
' + value['graph']['value'] + '
' + value['label']['value'] + '' + '
' + value['entity']['value'] + '' + /*DA QUI SCHEDA ->*/'' + '' + /*DA QUI CITAZIONE ->*/'' + '' + /*DA QUI HYPERLINK ->*/'' + '' + /*DA QUI LOD ->*/'' + '';/*FINE DIV*/ $('#wb_Shape1').append(autore); }); } $('#ClipArt1').click(function () { testo = $('textarea#TextArea1').val(); autori_retrieveData(); search_name = ""; }); //VISUALIZZAZIONI DATI DELL'AUTORE //FUNZIONE LETTURA LUNGHEZZA FILE JSON /* function objLength(obj){ var i=0; for (var x in obj){ if(obj.hasOwnProperty(x)){ i++; } } return i; } */ //####################################### });