const choiceArray = [ ["Resource name", "Object, OA", "label"], ["Identifier", "Object, OA, Person, Letter, Place", "identifier"], ["Material", "Object, OA", "material"], ["Holding Institute", "Object, OA", "localization"], ["Technique", "OA", "technique"], ["Artist", "OA", "artist"], ["Subject", "OA", "subject"], ["Title", "Object, Inf", "title"], ["Type", "Object, Inf", "type"], ["First name", "Person", "givenName"], ["Surname", "Person", "familyName"], ["Birth place", "Person", "birthPlace"], ["Death place", "Person", "deathPlace"], ["Gender", "Person", "sex"], ["Birth date", "Person", "birthDate"], ["Death date", "Person", "deathDate"], ["Occupation", "Person", "occupation"], ["Qualification", "Person", "qualification"], ["Sender", "Letter", "sender"], ["Receiver", "Letter", "receiver"], ["Place of departure", "Letter", "startPlace"], ["Place of arrival", "Letter", "endPlace"], ["Departure date", "Letter", "startDate"], ["Arrival date", "Letter", "endDate"], ["Language", "Letter", "language"], ["Linguistic area", "Letter", "languageArea"], ["Edition", "Letter", "edition"], ["Date", "Object", "date"], ["Time", "OA", "date_OA"], ["Lemma", "Letter", "lemma"], ["Text", "Letter", "keyword"] ]; const typeArray = [ ["Object", "Object"], ["Letter", "Letter"], ["Artwork", "OA"], ["Person", "Person"] ]; const graphArray = [ ["ASPO - Datini", "http://147.213.76.182:8890/aspo/datini", "Object"], ["ASPO - Ospedale", "http://147.213.76.182:8890/aspo/ospedale", "Object"], ["ASPO - Marcovaldi", "http://147.213.76.182:8890/aspo/marcovaldi", "Object"], ["ASPO - Onomastica Gettatelli", "http://147.213.76.182:8890/aspo/gettatelli", "Person"], ["ASPO - Onomastica Datini", "http://147.213.76.182:8890/aspo/onomastica", "Person"], ["MPP – Onomastica Artisti", "http://147.213.76.182:8890/mpp/autori", "Person"], ["MPP - Collezione Martini", "http://147.213.76.182:8890/mpp/martini", "Artwork"], ["MPP - Opere provenienti dall’Ospedale", "http://147.213.76.182:8890/mpp/ospedale", "Artwork"], ["MPP – Iconografia Datini", "http://147.213.76.182:8890/mpp/datini", "Artwork"], ["OVI - Lettere", "http://147.213.76.182:8890/ovi/datini", "Letter"] ]; const objectArray = []; const personArray = []; const placeArray = []; const oaArray = []; const letterArray = []; $(document).ready(function () { //####################################### var type_selector = document.getElementById("type_selector"); var collection_selector = document.getElementById("collection_selector"); let x = typeArray.length; for(var i=0; i \ \ \ '; } else if (inputText == "Material"){ inp = ''; } else if (inputText == "Technique"){ inp = ''; } else if (inputText == "Type"){ inp = ''; } else if (inputText == "Date"){ var inp = '
Da
\
A
\
'; /*var inp = '
Da \
\
A \
';*/ } else if (inputText == "Time"){ var inp = '
Da
\
A
\
'; /*var inp = '
Da \
\
A \
';*/ } else if (inputText == "Departure date"){ var inp = '
Da \
\
A \
'; } else if (inputText == "Arrival date"){ var inp = '
Da \
\
A \
'; } else { inp = ''; } var sect = 'sect-' + String(numberId); var inDiv = document.getElementById(sect); inDiv.innerHTML = inp; console.log(selector); /*$('#inputchoiceSelector_' + numberId).val(inputText); $('#inputchoiceSelector_' + numberId).id(inputText);*/ }); } var val = 0; function addToList() { val = val+1; var sel = '
'; $('#drop-down-content').append(sel); var selector = 'choice_selector-' + val; //populateOptions(selector, choiceArray); } function addToListObject() { val = val+100; var sel = '
'; $('#drop-down-content-Object').append(sel); var selector = 'choice_selector-' + val; populateOptions(selector, objectArray); } function addToListOA() { val = val+200; var sel = '
'; $('#drop-down-content-OA').append(sel); var selector = 'choice_selector-' + val; populateOptions(selector, oaArray); } function addToListPerson() { val = val+300; var sel = '
'; $('#drop-down-content-Person').append(sel); var selector = 'choice_selector-' + val; populateOptions(selector, personArray); } function addToListLetter() { val = val+400; var sel = '
'; $('#drop-down-content-Letter').append(sel); var selector = 'choice_selector-' + val; populateOptions(selector, letterArray); } function addToListPlace() { val = val+500; var sel = '
\
'; $('#drop-down-content-Place').append(sel); var selector = 'choice_selector-' + val; populateOptions(selector, placeArray); } //Get parameters from select and input options to build the query function getParameters() { $('#Loader').css("display", "block"); $('#query_results').text(""); var cc = document.getElementById("type_selector").value; if (cc != "General") { const arr = []; const collection = document.getElementsByClassName("advanced-form-select"); for (let i = 0; i < collection.length; i++) { var x = collection[i].id; var t = document.getElementById(x); var e = t.options[t.selectedIndex].text; var numberId= x.split("-")[1] var inputId = "inputchoiceSelector_" + numberId; if (!!document.getElementById(inputId)) { var inputText = document.getElementById(inputId).value; var el = [e, inputText]; console.log([inputText, el]); arr.push(el); } } constructQuery(arr); } else { alert("Seleziona una categoria") } /*$('#query_results').append(arr); testo = $('input#writeText').val();*/ } function removeElement(id_element) { const element = document.getElementById(id_element); element.remove(); } //Build query with harvested parametes function constructQuery(params) { var g = document.getElementById("collection_selector"); var graph = g.value; var search_graph = "?g"; if (graph != "") { search_graph = '<' + graph + '>'; } var search_type = ""; var ct = document.getElementById("type_selector"); var choosen_type = ct.value; console.log(choosen_type); var search_identifier = ""; if (choosen_type == "Object") { search_type = "?subject rdf:type crm:E22_Man-Made_Object . "; search_identifier = "?subject crm:P1_is_identified_by ?uri_identifier . \ ?uri_identifier rdfs:label ?identifier ; \ crm:P2_has_type 'Segnatura' ."; } if (choosen_type == "Letter") { search_type = "?subject crm:P128_carries ?information_object . \ ?information_object crm:P2_has_type ?uri_letter . \ ?uri_letter rdfs:label 'lettera' ." search_identifier = "?subject crm:P1_is_identified_by ?uri_identifier . \ ?uri_identifier rdfs:label ?identifier ; \ crm:P2_has_type 'Segnatura' ."; } if (choosen_type == "OA") { search_identifier = "?subject crm:P1_is_identified_by ?uri_identifier . \ ?uri_identifier rdfs:label ?identifier ; \ crm:P2_has_type 'Codice univoco del bene (NCT)' ."; } if (choosen_type == "Person") { search_type = "?subject rdf:type crm:E21_Person . "; search_identifier = "?subject crm:P1_is_identified_by ?uri_identifier . \ ?uri_identifier rdfs:label ?identifier ."; } var label = ""; // var identificatore = ""; // var dimensione = ""; // var materia = ""; // var localizzazione = ""; // var tecnica = ""; // var artista = ""; // var soggetto = ""; // var titolo = ""; // var tipo = ""; // var note = ""; // var riferimenti = ""; // var nome_proprio = ""; // var nome_di_famiglia = ""; // var patronimico = ""; // var luogo_di_Nascita = ""; // var luogo_di_Morte = ""; // var genere = ""; // var data_di_Nascita = ""; // var data_di_Morte = ""; // var occupazione = ""; // var qualifica = ""; // var gruppi_di_appartenenza = ""; // var mittente = ""; // var destinatario = ""; // var luogo_di_Partenza = ""; // var luogo_di_Arrivo = ""; // var data_partenza_inizio = ""; // var data_partenza_fine = ""; var data_arrivo_inizio = ""; // var data_arrivo_fine = ""; var data_opera_inizio = ""; // var data_opera_fine = ""; // var lingua = ""; // var area_linguistica = ""; // var edizione = ""; // var lemma = ""; // var testo = ""; // var data = ""; // var start = ""; var finish = ""; var letter_event = ""; // var infObj = ""; // var id = ""; // var dm = ""; // var mt = ""; // var locl = ""; // var tec = ""; // var at = ""; // var sg = ""; // var tt = ""; // var tp = ""; // var nt = ""; // var rf = ""; // var np = ""; // var nf = ""; // var pt = ""; // var ln = ""; // var lm = ""; // var gr = ""; // var dn = ""; // var dts = ""; // var oc = ""; // var qf = ""; // var ga = ""; // var mit = ""; // var des = ""; // var lp = ""; // var la = ""; // var dp = ""; // var da = ""; // var lin = ""; // var alin = ""; // var ed = ""; // var lem = ""; // var ttx = ""; // var dt = ""; // var st = ""; var fn = ""; var dpi = ""; var dai = ""; var diop = ""; var dfop = ""; for (let i = 0; i < params.length; i++) { if(params[i][0] == "Resource name" && (params[i][1] != "")) { var toSearch = params[i][1].replace("'", " "); label = "?label bif:contains \"\' "+ toSearch + " \'\" . "; } if(params[i][0] == "Identifier" && (params[i][1] != "")) { id = " ?identifier"; identificatore = "FILTER (CONTAINS(?identifier, \'"+ params[i][1] +"\'))"; } if(params[i][0] == "Dimension" && (params[i][1] != "")) { dm = " ?dimension"; dimensione = "?subject crm:P43_has_dimension ?uri_dimension . \ ?uri_dimension rdfs:label ?dimension . \ ?dimension bif:contains \"\'"+ params[i][1] +"\'\" ." } if(params[i][0] == "Material" && (params[i][1] != "")) { mt = " ?material"; materia = "?subject crm:P45_consists_of ?uri_material . \ ?uri_material rdfs:label ?material . \ ?material bif:contains \"\'"+ params[i][1] +"\'\" ." } if(params[i][0] == "Holding institution" && (params[i][1] != "")) { locl = " ?location"; localizzazione = "?subject crm:P52_has_current_owner ?uri_location . \ ?uri_location rdfs:label ?location . \ ?location bif:contains \"\'"+ params[i][1] +"\'\" ." } if(params[i][0] == "Technique" && (params[i][1] != "")) { tec = " ?technique"; tecnica = "?event ?pp ?subject . \ ?event crm:P32_used_general_technique ?uri_technique . \ ?uri_technique rdfs:label ?technique . \ ?technique bif:contains \"\'"+ params[i][1] +"\'\" . " } if (params[i][0] == "Artist" && (params[i][1] != "")) { at = " ?artist"; artista = "?subject rdfs:label ?label . \ ?production crm:P108_has_produced ?subject . \ ?pc crm:P01_has_domain ?production . \ ?pc crm:P02_has_range ?range . \ ?range rdfs:label ?artist . \ ?artist bif:contains \"\'"+ params[i][1] +"\'\" ." } if (params[i][0] == "Subject" && (params[i][1] != "")) { sg = " ?depiction"; soggetto = "?subject crm:P62_depicts ?uri_depiction . \ ?uri_depiction rdfs:label ?depiction . \ ?depiction bif:contains \"\'"+ params[i][1] +"\'\" ." } if (params[i][0] == "Title" && (params[i][1] != "")) { tt = " ?title"; infObj = "?subject crm:P128_carries ?information_object ."; titolo = "?information_object crm:P1_is_identified_by ?uri_title . \ ?uri_title rdfs:label ?title . \ ?title bif:contains \"\'"+ params[i][1] +"\'\" ." } if (params[i][0] == "Type" && (params[i][1] != "")) { tp = " ?type"; infObj = "?subject crm:P128_carries ?information_object ."; tipo = "?information_object crm:P2_has_type ?uri_type . \ ?uri_type rdfs:label ?type . \ ?type bif:contains \"\'"+ params[i][1] +"\'\" ." } if (params[i][0] == "Note" && (params[i][1] != "")) { nt = " ?note"; note = "?subject crm:P3_has_note ?uri_note . \ ?uri_note rdfs:label ?note . \ ?note bif:contains \"\'"+ params[i][1] +"\'\" ."; } if (params[i][0] == "References" && (params[i][1] != "")) { rf = " ?ref"; riferimenti = "?subject crm:P67_refers_to ?uri_ref . \ ?uri_ref rdfs:label ?ref . \ ?ref bif:contains \"\'"+ params[i][1] +"\'\" . " } if (params[i][0] == "First name" && (params[i][1] != "")) { np = " ?givenName"; nome_proprio = "?subject foaf:givenName ?givenName . \ ?givenName bif:contains \"\'"+ params[i][1] +"\'\" . " } if (params[i][0] == "Surname" && (params[i][1] != "")) { nf = " ?familyName"; nome_di_famiglia = "?subject foaf:familyName ?familyName . \ ?familyName bif:contains \"\'"+ params[i][1] +"\'\" . " } if (params[i][0] == "Patronimyc" && (params[i][1] != "")) { pt = " ?patronymic"; patronimico = "?subject person:patronymicName ?patronymic . \ ?patronymic bif:contains \"\'"+ params[i][1] +"\'\" . " } if (params[i][0] == "Birth place" && (params[i][1] != "")) { ln = " ?birthPlace"; luogo_di_Nascita = "?subject crm:P98i_was_born ?Birth . \ ?Birth crm:P7_took_place_at ?uri_birthPlace . \ ?uri_birthPlace rdfs:label ?birthPlace . \ ?birthPlace bif:contains \""+ params[i][1] +"\" . " } if (params[i][0] == "Death place" && (params[i][1] != "")) { lm = " ?deathPlace"; luogo_di_Morte = "?subject crm:P100i_died_in ?Death . \ ?Death crm:P7_took_place_at ?uri_deathPlace . \ ?uri_deathPlace rdfs:label ?deathPlace \ ?deathPlace bif:contains \""+ params[i][1] +"\" . " } if (params[i][0] == "Gender" && (params[i][1] != "")) { gr = "?genere"; genere = "?subject foaf:gender ?genere . \ ?genere bif:contains \""+ params[i][1] +"\" . " } if (params[i][0] == "Birth date" && (params[i][1] != "")) { dn = " ?Birth_TS"; data_di_Nascita = "?subject crm:P98i_was_born ?Birth . \ ?Birth crm:P4_has_time-span ?Birth_TS . \ ?Birth_TS rdfs:label \""+ params[i][1] +"\" ." } if (params[i][0] == "Death date" && (params[i][1] != "")) { dts = " ?Death_TS"; data_di_Morte = "?subject crm:P100i_died_in ?Death . \ ?Death crm:P4_has_time-span ?Death_TS . \ ?Death_TS rdfs:label \""+ params[i][1] +"\" . " } if (params[i][0] == "Qualification" && (params[i][1] != "")) { qf = " ?qualification"; qualifica = "?subject schema:honorificPrefix ?qualification . \ ?qualification bif:contains \"\'"+ params[i][1] +"\'\" . " } if (params[i][0] == "Occupation" && (params[i][1] != "")) { oc = " ?occupation"; occupazione = "?subject schema:hasOccupation ?uriOccupation . \ ?uriOccupation rdf:type schema:Occupation; \ rdfs:label ?occupation . \ ?occupation bif:contains \"\'"+ params[i][1] +"\'\" . " } if (params[i][0] == "Groups" && (params[i][1] != "")) { ga = " ?group"; gruppi_di_appartenenza = "?subject crm:P107i_is_current_or_former_member_of ?uriGroup . \ ?uriGroup rdfs:label ?group . \ ?group bif:contains \"\'"+ params[i][1] +"\'\" . " } if (params[i][0] == "Sender" && (params[i][1] != "")) { mit = " ?mittente"; letter_event = "?subject crm:P25i_moved_by ?mov_ev . \ ?send rdfs:subClassOf ?mov_ev ; \ rdf:type crm:EL2_Send_Letter . \ ?receive rdfs:subClassOf ?mov_ev; \ rdf:type crm:EL3_Receive_Letter . "; mittente = "?send crm:P01_has_domain ?pcS . \ ?pcS crm:P02_has_range ?uriSender . \ ?uriSender rdfs:label ?mittente . \ ?mittente bif:contains \"\'"+ params[i][1] +"\'\" . " } if (params[i][0] == "Receiver" && (params[i][1] != "")) { des = " ?destinatario"; letter_event = "?subject crm:P25i_moved_by ?mov_ev . \ ?send rdfs:subClassOf ?mov_ev ; \ rdf:type crm:EL2_Send_Letter . \ ?receive rdfs:subClassOf ?mov_ev; \ rdf:type crm:EL3_Receive_Letter . "; destinatario = "?receive crm:P01_has_domain ?pcR . \ ?pcR crm:P02_has_range ?uriReceiver . \ ?uriReceiver rdfs:label ?destinatario . \ ?destinatario bif:contains \"\'"+ params[i][1] +"\'\" . " } if (params[i][0] == "Departure place" && (params[i][1] != "")) { lp = " ?luogo_partenza"; letter_event = "?subject crm:P25i_moved_by ?mov_ev . \ ?send rdfs:subClassOf ?mov_ev ; \ rdf:type crm:EL2_Send_Letter . \ ?receive rdfs:subClassOf ?mov_ev; \ rdf:type crm:EL3_Receive_Letter . "; luogo_di_Partenza = "?send crm:P27_moved_from ?uriLuogoPartenza . \ ?uriLuogoPartenza rdfs:label ?luogo_partenza . \ ?luogo_partenza bif:contains \"\'"+ params[i][1] +"\'\" . " } if (params[i][0] == "Arrival place" && (params[i][1] != "")) { la = " ?luogo_arrivo"; letter_event = "?subject crm:P25i_moved_by ?mov_ev . \ ?send rdfs:subClassOf ?mov_ev ; \ rdf:type crm:EL2_Send_Letter . \ ?receive rdfs:subClassOf ?mov_ev; \ rdf:type crm:EL3_Receive_Letter . "; luogo_di_Arrivo = "?receive crm:P26_moved_to ?uriLuogoArrivo . \ ?uriLuogoArrivo rdfs:label ?luogo_arrivo . \ ?luogo_arrivo bif:contains \"\'"+ params[i][1] +"\'\" . " } if (params[i][0] == "Departure date" && (params[i][1] != "")) { dp = " ?timeSpanSend"; letter_event = "?subject crm:P25i_moved_by ?mov_ev . \ ?send rdfs:subClassOf ?mov_ev ; \ rdf:type crm:EL2_Send_Letter . \ ?receive rdfs:subClassOf ?mov_ev; \ rdf:type crm:EL3_Receive_Letter . "; data_partenza = "?send crm:P4_has_time-span ?time_spanS . \ ?time_spanS rdfs:label ?timeSpanSend . \ ?timeSpanSend bif:contains \"\'"+ params[i][1] +"\'\" . " } if (params[i][0] == "Arrival date" && (params[i][1] != "")) { da = " ?timeSpanReceive"; letter_event = "?subject crm:P25i_moved_by ?mov_ev . \ ?send rdfs:subClassOf ?mov_ev ; \ rdf:type crm:EL2_Send_Letter . \ ?receive rdfs:subClassOf ?mov_ev; \ rdf:type crm:EL3_Receive_Letter . "; data_arrivo = "?receive crm:P4_has_time-span ?time_spanR . \ ?time_spanR rdfs:label ?timeSpanReceive .\ ?timeSpanReceive bif:contains \"\'"+ params[i][1] +"\'\" . " } if (params[i][0] == "Language" && (params[i][1] != "")) { lin = " ?lingua"; lingua = "?information_object crm:P72_has_language ?language . \ ?language rdfs:label ?lingua . \ ?lingua bif:contains \"\'"+ params[i][1] +"\'\" ." } if (params[i][0] == "Linguistic area" && (params[i][1] != "")) { alin = " ?area_linguistica"; area_linguistica = "?information_object crm:P72_has_language ?language . \ ?language crm:P3_has_note ?area . \ ?area rdfs:label ?area_linguistica .\ ?area_linguistica bif:contains \"\'"+ params[i][1] +"\'\" ." } if (params[i][0] == "Edition" && (params[i][1] != "")) { ed = " ?edizione"; edizione = "?edition crm:P70_documents ?information_object ; \ crm:P1_is_identified_by ?edition_id . \ ?edition_id rdfs:label ?edizione . \ ?edizione bif:contains \"\'"+ params[i][1] +"\'\" ." } if (params[i][0] == "Lemma" && (params[i][1] != "")) { lem = " ?lemma"; lemma = "?information_object crm:P67_refers_to ?link_lemma . \ ?link_lemma rdfs:label ?lemma. \ ?lemma bif:contains \"\'"+ params[i][1] +"\'\" ." } if (params[i][0] == "Text" && (params[i][1] != "")) { ttx = " ?testo"; testo = "?information_object crm:P190_has_symbolic_content ?testo . \ ?testo bif:contains \"\'"+ params[i][1] +"\'\" ." } if (params[i][0] == "Date" && (params[i][1] != "")) { dt = " ?date"; data = "?subject ?property ?event . \ ?event crm:P4_has_time-span ?uri_date . \ ?uri_date rdfs:label ?date . \ ?date bif:contains \"\'"+ params[i][1] +"\'\" ." } if (params[i][0] == "Da" && (params[i][1] != "")) { st = " ?start"; start = "?subject ?property ?event_start . \ ?event_start crm:P4_has_time-span ?uri_date_start . \ ?uri_date_start rdfs:label ?start ; \ time:hasBeginning ?date_start . \ FILTER (?date_start >= \""+ params[i][1] +"\"^^xsd:date)"; } if (params[i][0] == "A" && (params[i][1] != "")) { fn = " ?end"; finish = "?subject ?property ?event_end . \ ?event_end crm:P4_has_time-span ?uri_date_end . \ ?uri_date_end rdfs:label ?end ; \ time:hasEnd ?date_end . \ FILTER (?date_start <= \""+ params[i][1] +"\"^^xsd:date)"; } if (params[i][0] == "Data partenza inizio" && (params[i][1] != "")) { dpi = " ?send_date"; letter_event = "?subject crm:P25i_moved_by ?mov_ev . \ ?send rdfs:subClassOf ?mov_ev ; \ rdf:type crm:EL2_Send_Letter . \ ?receive rdfs:subClassOf ?mov_ev; \ rdf:type crm:EL3_Receive_Letter . "; data_partenza_inizio = "?send crm:P4_has_time-span ?uri_send_date . \ ?uri_send_date rdfs:label ?send_date ; \ time:hasBeginning ?time_send . \ FILTER (?time_send >= \""+ params[i][1] +"\"^^xsd:date"; } if (params[i][0] == "Data partenza fine" && (params[i][1] != "")) { data_partenza_fine = data_partenza_inizio + " && ?time_send <= \""+ params[i][1] +"\"^^xsd:date)"; } if (params[i][0] == "Data arrivo inizio" && (params[i][1] != "")) { dai = " ?receive_date"; letter_event = "?subject crm:P25i_moved_by ?mov_ev . \ ?send rdfs:subClassOf ?mov_ev ; \ rdf:type crm:EL2_Send_Letter . \ ?receive rdfs:subClassOf ?mov_ev; \ rdf:type crm:EL3_Receive_Letter . "; data_arrivo_inizio = "?receive crm:P4_has_time-span ?uri_receive_date . \ ?uri_receive_date rdfs:label ?receive_date ; \ time:hasEnd ?time_receive . \ FILTER (?time_receive >= \""+ params[i][1] +"\"^^xsd:date"; } if (params[i][0] == "Data arrivo fine" && (params[i][1] != "")) { data_arrivo_fine = data_arrivo_inizio + " && ?time_receive <= \""+ params[i][1] +"\"^^xsd:date)"; } if (params[i][0] == "Data inizio opera" && (params[i][1] != "")) { diop = " ?time_start"; data_opera_inizio = "?event_start ?pp ?subject ; \ crm:P2_has_type 'Inizio'^^ ; \ crm:P4_has_time-span ?uri_time_start . \ ?uri_time_start rdfs:label ?time_start; \ time:year ?date_start . \ FILTER (?date_start >= \""+ params[i][1] +"\"^^xsd:integer)"; } if (params[i][0] == "Data fine opera" && (params[i][1] != "")) { data_opera_fine = "FILTER (?date_start <= \""+ params[i][1] +"\"^^xsd:integer)"; } } prefixes = "PREFIX rdfs: \ PREFIX rdf: \ PREFIX crm: \ PREFIX owl: \ PREFIX schema: \ PREFIX foaf: \ PREFIX person: \ PREFIX time: " query = prefixes + " SELECT DISTINCT ?subject ?label ?identifier " + dm + mt + locl + tec + at + sg + tt + tp + nt + rf + np + nf + pt + ln + lm + gr + dn + dts + oc + qf + ga + mit + des + lp + la + dp + da + dpi + dai + diop + lin + alin + ed + lem + dt + st + ttx + " \ WHERE {GRAPH " + search_graph + " {?subject ?property ?object } \ ?subject rdfs:label ?label . " + search_identifier + infObj + letter_event + label + search_type + dimensione + materia + localizzazione + tecnica + artista + titolo + tipo + note + riferimenti + nome_proprio + nome_di_famiglia + patronimico + luogo_di_Nascita + luogo_di_Morte + genere + data_di_Nascita + data_di_Morte + qualifica + occupazione + gruppi_di_appartenenza + mittente + destinatario +luogo_di_Partenza + luogo_di_Arrivo + data_partenza_fine + data_arrivo_fine + data_opera_inizio + data_opera_fine + lingua + area_linguistica + edizione + lemma + data + identificatore + start + finish + testo + "}" var query_url = endpoint + '/?default-graph-uri=&query=' + encodeURIComponent(query) + '&output=json'; console.log(query); $.ajax({ url: query_url + '&callback=?', dataType: "json", success: function (data) { query_handle_json(data, choosen_type); }, error: function (e) {} }); } function query_handle_json(json, choosen_type) { console.log(json); var resulType = ""; if (choosen_type == "Object") { resulType = "object"; } if (choosen_type == "Letter") { resulType = "object"; } if (choosen_type == "OA") { resulType = "artwork"; } if (choosen_type == "Person") { resulType = "persona"; } $('#query_results').text(""); var i = 0; const first_row = []; $.each( json['head']['vars'], function (index, value) { first_row.push(value); }); var t_head = '
'; for (let k = 1; k < first_row.length; k++) { var param = renameCol(first_row[k]); t_head += '
' + param + '
'; } t_head += '
'; $('#query_results').append(t_head); $.each( json['results']['bindings'], function (index, value) { var object = ""; var link = value['subject']['value']; var label = value['label']['value']; object += '
'; if (value.hasOwnProperty('identifier')) { identifier = value['identifier']['value']; object += '
' + identifier + '
'; } if (value.hasOwnProperty('dimension')) { dimension = value['dimension']['value']; object += '
' + dimension + '
'; } if (value.hasOwnProperty('material')) { material = value['material']['value']; object += '
' + material + '
'; } if (value.hasOwnProperty('location')) { localization = value['location']['value']; object += '
' + localization + '
'; } if (value.hasOwnProperty('technique')) { technique = value['technique']['value']; object += '
' + technique + '
'; } if (value.hasOwnProperty('artist')) { artist = value['artist']['value']; object += '
' + artist + '
'; } if (value.hasOwnProperty('depiction')) { depiction = value['depiction']['value']; object += '
' + depiction + '
'; } if (value.hasOwnProperty('title')) { title = value['title']['value']; object += '
' + title + '
'; } if (value.hasOwnProperty('type')) { type = value['type']['value']; object += '
' + type + '
'; } if (value.hasOwnProperty('note')) { note = value['note']['value']; object += '
' + note + '
'; } if (value.hasOwnProperty('ref')) { ref = value['ref']['value']; object += '
' + ref + '
'; } if (value.hasOwnProperty('givenName')) { givenName = value['givenName']['value']; object += '
' + givenName + '
'; } if (value.hasOwnProperty('familyName')) { familyName = value['familyName']['value']; object += '
' + familyName + '
'; } if (value.hasOwnProperty('patronymic')) { patronymic = value['patronymic']['value']; object += '
' + patronymic + '
'; } if (value.hasOwnProperty('birthPlace')) { birthPlace = value['birthPlace']['value']; object += '
' + birthPlace + '
'; } if (value.hasOwnProperty('deathPlace')) { deathPlace = value['deathPlace']['value']; object += '
' + deathPlace + '
'; } if (value.hasOwnProperty('genere')) { genere = value['genere']['value']; object += '
' + genere + '
'; } if (value.hasOwnProperty('Birth_TS')) { Birth_TS = value['Birth_TS']['value']; object += '
' + Birth_TS + '
'; } if (value.hasOwnProperty('Death_TS')) { Death_TS = value['Death_TS']['value']; object += '
' + Death_TS + '
'; } if (value.hasOwnProperty('qualification')) { qualification = value['qualification']['value']; object += '
' + qualification + '
'; } if (value.hasOwnProperty('occupation')) { occupation = value['occupation']['value']; object += '
' + occupation + '
'; } if (value.hasOwnProperty('group')) { group = value['group']['value']; object += '
' + group + '
'; } if (value.hasOwnProperty('mittente')) { mittente = value['mittente']['value']; object += '
' + mittente + '
'; } if (value.hasOwnProperty('destinatario')) { destinatario = value['destinatario']['value']; object += '
' + destinatario + '
'; } if (value.hasOwnProperty('luogo_partenza')) { luogo_partenza = value['luogo_partenza']['value']; object += '
' + luogo_partenza + '
'; } if (value.hasOwnProperty('luogo_arrivo')) { luogo_arrivo = value['luogo_arrivo']['value']; object += '
' + luogo_arrivo + '
'; } if (value.hasOwnProperty('timeSpanSend')) { timeSpanSend = value['timeSpanSend']['value']; object += '
' + timeSpanSend + '
'; } if (value.hasOwnProperty('timeSpanReceive')) { timeSpanReceive = value['timeSpanReceive']['value']; object += '
' + timeSpanReceive + '
'; } if (value.hasOwnProperty('lingua')) { lingua = value['lingua']['value']; object += '
' + lingua + '
'; } if (value.hasOwnProperty('area_linguistica')) { area_linguistica = value['area_linguistica']['value']; object += '
' + area_linguistica + '
'; } if (value.hasOwnProperty('edizione')) { edizione = value['edizione']['value']; object += '
' + edizione + '
'; } if (value.hasOwnProperty('lemma')) { lemma = value['lemma']['value']; object += '
' + lemma + '
'; } if (value.hasOwnProperty('testo')) { testo = value['testo']['value']; object += '
' + testo + '
'; } if (value.hasOwnProperty('date')) { date = value['date']['value']; object += '
' + date + '
'; } if (value.hasOwnProperty('start')) { start = value['start']['value']; object += '
' + start + '
'; } if (value.hasOwnProperty('end')) { end = value['end']['value']; object += '
' + end + '
'; } if (value.hasOwnProperty('send_date')) { send_date = value['send_date']['value']; object += '
' + send_date + '
'; } if (value.hasOwnProperty('receive_date')) { receive_date = value['receive_date']['value']; object += '
' + receive_date + '
'; } if (value.hasOwnProperty('time_start')) { opera_start = value['time_start']['value']; object += '
' + opera_start + '
'; } object += '
'; i++; /*onclick=copy__Text("' + value['link']['value'] + '")*/ $('#query_results').append(object); }); if (i==0) { var message = '

Nessun risultato trovato

'; $('#query_results').append(message); } $('#Loader').css("display", "none"); document.getElementById("n_res").innerHTML = i; } function populateSelGraph(graphType) { let y = graphArray.length; collection_selector.innerHTML = ""; if (graphType != "General") { collection_selector.style.color = '#202122'; collection_selector.style.cursor = 'pointer'; collection_selector.style.backgroundColor = '#f8f9fa'; collection_selector.style.backgroundImage = 'linear-gradient(to top, #fff, #fff 33%)'; } else { collection_selector.style.color = '#a1a1a1'; collection_selector.style.cursor = 'not-allowed'; collection_selector.style.backgroundColor = '#eee'; collection_selector.style.backgroundImage = 'linear-gradient(to top, #ddd, #eee 33%)'; } var genOpt = document.createElement("option"); genOpt.value= ""; genOpt.innerHTML = "All"; collection_selector.add(genOpt); for(var i=0; i