|
@@ -1,8 +1,3 @@
|
|
|
-var jsonprova = {
|
|
|
- nome: "Nonmolto",
|
|
|
- cognome: "Furbo",
|
|
|
- descrizione: "Che ci volete fa'?"
|
|
|
-}
|
|
|
|
|
|
thisUrlParams = {};
|
|
|
window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
|
|
@@ -16,6 +11,8 @@ function prepareQueryURL(query){
|
|
|
return sparqlEndpoint + sparqlUrlParams;
|
|
|
}
|
|
|
|
|
|
+queryStringOutput = "";
|
|
|
+
|
|
|
function doJsonQuery(query){
|
|
|
|
|
|
queryURL = prepareQueryURL(query);
|
|
@@ -32,45 +29,96 @@ function doJsonQuery(query){
|
|
|
|
|
|
}
|
|
|
|
|
|
-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\
|
|
|
+prefixes = "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \
|
|
|
+PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \
|
|
|
+PREFIX crm: <http://www.cidoc-crm.org/cidoc-crm/> \
|
|
|
+PREFIX dat: <http://datini.archiviodistato.prato.it/la-ricerca/scheda/> \
|
|
|
+PREFIX mpp: <http://palazzopretorio.comune.prato.it/it/le-opere/alcuni-capolavori/> \
|
|
|
+PREFIX aut: <http://palazzopretorio.comune.prato.it/it/opere/autori/>"
|
|
|
+
|
|
|
+query1 = prefixes + " SELECT DISTINCT ?mittente ?destinatario ?data_partenza ?data_arrivo ?luogo_partenza ?luogo_arrivo \
|
|
|
WHERE {?subject crm:P128_carries <" + thisUrlParams.link + "> \
|
|
|
-GRAPH <http:
|
|
|
-?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\
|
|
|
+GRAPH <http:
|
|
|
+?send rdfs:subClassOf ?mov_ev ; \
|
|
|
+rdf:type crm:EL2_Send_Letter ; \
|
|
|
+crm:P4_has_time-span ?time_spanA; \
|
|
|
+crm:P27_moved_from ?placeA; \
|
|
|
+crm:P01_has_domain ?sender . \
|
|
|
\
|
|
|
-?time_spanA rdfs:label ?data_partenza .\n\
|
|
|
-?placeA rdfs:label ?luogo_partenza .\n\
|
|
|
-?sender crm:P02_has_range ?mittente .\n\
|
|
|
+?time_spanA rdfs:label ?data_partenza . \
|
|
|
+?placeA rdfs:label ?luogo_partenza . \
|
|
|
+?sender crm:P02_has_range ?mittente . \
|
|
|
\
|
|
|
-?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\
|
|
|
+?receive rdfs:subClassOf ?mov_ev; \
|
|
|
+rdf:type crm:EL3_Receive_Letter ; \
|
|
|
+crm:P4_has_time-span ?time_spanB; \
|
|
|
+crm:P26_moved_to ?placeB; \
|
|
|
+crm:P01_has_domain ?receiver . \
|
|
|
\
|
|
|
-?time_spanB rdfs:label ?data_arrivo .\n\
|
|
|
-?placeB rdfs:label ?luogo_arrivo .\n\
|
|
|
-?receiver crm:P02_has_range ?destinatario .\n\
|
|
|
+?time_spanB rdfs:label ?data_arrivo . \
|
|
|
+?placeB rdfs:label ?luogo_arrivo . \
|
|
|
+?receiver crm:P02_has_range ?destinatario . \
|
|
|
}"
|
|
|
|
|
|
-console.log("Query: " + query1);
|
|
|
+queryAreaLinguistica = prefixes + " SELECT DISTINCT ?lingua ?area_linguistica \
|
|
|
+WHERE {<" + thisUrlParams.link + "> crm:P72_has_language ?language . \
|
|
|
+?language crm:P3_has_note ?area ; \
|
|
|
+rdfs:label ?lingua . \
|
|
|
+?area rdfs:label ?area_linguistica \
|
|
|
+}"
|
|
|
|
|
|
-queryStringOutput = "";
|
|
|
|
|
|
-function tempfunc(val){
|
|
|
+queryDescrizione = prefixes + " SELECT DISTINCT ?descrizione \
|
|
|
+WHERE {<" + thisUrlParams.link + "> crm:P3_has_note ?description . \
|
|
|
+?description rdfs:label ?descrizione \
|
|
|
+}"
|
|
|
+
|
|
|
+queryTipo = prefixes + " SELECT DISTINCT ?tipologia \
|
|
|
+WHERE {<" + thisUrlParams.link + "> crm:P2_has_type ?type . \
|
|
|
+?type rdf:type crm:E55_Type; \
|
|
|
+rdfs:label ?tipologia . \
|
|
|
+}"
|
|
|
+
|
|
|
+querySiglaOVI = prefixes + " SELECT DISTINCT ?sigla_OVI \
|
|
|
+WHERE {<" + thisUrlParams.link + "> crm:P1_is_identified_by ?id . \
|
|
|
+?id rdf:type crm:E42_Identifier; \
|
|
|
+crm:P2_has_type ?type ; \
|
|
|
+rdfs:label ?sigla_OVI . \
|
|
|
+?type rdfs:label 'Sigla OVI'. \
|
|
|
+}"
|
|
|
+
|
|
|
+queryTitolo = prefixes + " SELECT DISTINCT ?titolo \
|
|
|
+WHERE {<" + thisUrlParams.link + "> crm:P1_is_identified_by ?title . \
|
|
|
+?title rdf:type crm:E35_Title; \
|
|
|
+rdfs:label ?titolo . \
|
|
|
+}"
|
|
|
+
|
|
|
+queryTestoLemmatizzato = prefixes + " SELECT DISTINCT ?testo_lemmatizzato \
|
|
|
+WHERE {<" + thisUrlParams.link + "> crm:P190_has_symbolic_content ?testo_lemmatizzato . \
|
|
|
+}"
|
|
|
+
|
|
|
+queryEdizione = prefixes + " SELECT DISTINCT ?edizione ?edizione_abbreviata \
|
|
|
+WHERE {?edition crm:P70_documents <" + thisUrlParams.link + "> ; \
|
|
|
+crm:P1_is_identified_by ?edition_id . \
|
|
|
+?edition_id rdfs:label ?edizione; \
|
|
|
+crm:P139_has_alternative_form ?ed_abbr . \
|
|
|
+?ed_abbr rdfs:label ?edizione_abbreviata \
|
|
|
+}"
|
|
|
+
|
|
|
+queryRaccolta = prefixes + " SELECT DISTINCT ?raccolta \
|
|
|
+WHERE {?racc crm:P148_has_component <" + thisUrlParams.link + "> ; \
|
|
|
+crm:P2_has_type ?racc_type ; \
|
|
|
+rdfs:label ?raccolta . \
|
|
|
+?racc_type rdfs:label 'Raccolta'. \
|
|
|
+}"
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+function stringifyResponse(val){
|
|
|
resultArray = val['results']['bindings'];
|
|
|
out = "";
|
|
|
for(i = 0; i < resultArray.length; i++){
|
|
|
out = out + JSON.stringify(resultArray[i])
|
|
|
}
|
|
|
- queryStringOutput = out;
|
|
|
-}
|
|
|
+ queryStringOutput = (queryStringOutput + out).replace("}{",",");
|
|
|
+}
|