12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- var jsonprova = {
- nome: "Nonmolto",
- cognome: "Furbo",
- descrizione: "Che ci volete fa'?"
- }
- thisUrlParams = {};
- window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
- thisUrlParams[key] = value;
- });
- console.log('URL get params: ', thisUrlParams);
- function prepareQueryURL(query){
- sparqlEndpoint = 'http://dev.restore.ovi.cnr.it:8890/sparql/';
- sparqlUrlParams = '?default-graph-uri=&query=' + encodeURIComponent(query) + '&output=json&callback=?';
- return sparqlEndpoint + sparqlUrlParams;
- }
- function doJsonQuery(query){
- queryURL = prepareQueryURL(query);
- response = $.ajax({//OGGETTO
- url: queryURL,
- dataType: "json",
- success: function (data){},
- error: function (e) {}
- });
- return response;
- }
- query1 = "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n\
- PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n\
- PREFIX crm: <http://www.cidoc-crm.org/cidoc-crm/>\n\
- PREFIX dat: <http://datini.archiviodistato.prato.it/la-ricerca/scheda/>\n\
- PREFIX mpp: <http://palazzopretorio.comune.prato.it/it/le-opere/alcuni-capolavori/>\n\
- PREFIX aut: <http://palazzopretorio.comune.prato.it/it/opere/autori/>\n\
- SELECT DISTINCT ?mittente ?destinatario ?data_partenza ?data_arrivo ?luogo_partenza ?luogo_arrivo\n\
- WHERE {?subject crm:P128_carries <" + thisUrlParams.link + "> \
- GRAPH <http://dev.restore.ovi.cnr.it:8890/ovi/datini/ex> {?subject crm:P25i_moved_by ?mov_ev .}\n\
- ?send rdfs:subClassOf ?mov_ev ;\n\
- rdf:type crm:EL2_Send_Letter ;\n\
- crm:P4_has_time-span ?time_spanA;\n\
- crm:P27_moved_from ?placeA;\n\
- crm:P01_has_domain ?sender .\n\
- \
- ?time_spanA rdfs:label ?data_partenza .\n\
- ?placeA rdfs:label ?luogo_partenza .\n\
- ?sender crm:P02_has_range ?mittente .\n\
- \
- ?receive rdfs:subClassOf ?mov_ev;\n\
- rdf:type crm:EL3_Receive_Letter ;\n\
- crm:P4_has_time-span ?time_spanB;\n\
- crm:P26_moved_to ?placeB;\n\
- crm:P01_has_domain ?receiver .\n\
- \
- ?time_spanB rdfs:label ?data_arrivo .\n\
- ?placeB rdfs:label ?luogo_arrivo .\n\
- ?receiver crm:P02_has_range ?destinatario .\n\
- }"
- console.log("Query: " + query1);
- queryStringOutput = "";
- function tempfunc(val){
- resultArray = val['results']['bindings'];
- out = "";
- for(i = 0; i < resultArray.length; i++){
- out = out + JSON.stringify(resultArray[i])
- }
- queryStringOutput = out;
- }
|