|
@@ -106,17 +106,10 @@ OPTIONAL { ?uri crm:P128_carries ?InfObj . \
|
|
|
GRAPH <http://dev.restore.ovi.cnr.it:8890/ovi/datini> {?InfObj rdf:type crm:E73_Information_Object } } \
|
|
|
} "
|
|
|
|
|
|
-queryPersone = prefixes + " SELECT DISTINCT ?uri_person ?name ?p_type ?note \
|
|
|
+queryPersone = prefixes + " SELECT DISTINCT ?uri_person ?name (group_concat(distinct ?p_type ; separator=', ') as ?types) ?note \
|
|
|
WHERE { \
|
|
|
VALUES ?uri {<" + thisUrlParams.link + ">} \
|
|
|
-{?uri crm:P46_is_composed_of ?card . \
|
|
|
-?card crm:P2_has_type 'Scheda anagrafica' . \
|
|
|
-?document crm:P141_assigned ?card ; \
|
|
|
-crm:P67_refers_to ?uri_person . \
|
|
|
-?uri_person foaf:name ?name ; \
|
|
|
-crm:P2_has_type ?person_type . \
|
|
|
-?person_type rdfs:label ?p_type . \
|
|
|
-} UNION { \
|
|
|
+{ \
|
|
|
?document crm:P141_assigned ?uri ; \
|
|
|
crm:P67_refers_to ?uri_person . \
|
|
|
?uri_person foaf:name ?name ; \
|
|
@@ -129,6 +122,20 @@ crm:P2_has_type ?person_type . \
|
|
|
crm:P67.1_type ?person_type . \
|
|
|
OPTIONAL {?uri_person crm:P3_has_note ?note } \
|
|
|
?person_type rdfs:label ?p_type . \
|
|
|
+} UNION { \
|
|
|
+OPTIONAL {?uri crm:P46_is_composed_of ?uri_paper . } \
|
|
|
+{?uri_paper crm:P128_carries ?uri_doc } \
|
|
|
+UNION \
|
|
|
+{?uri crm:P128_carries ?uri_doc } \
|
|
|
+?uri_doc crm:P70_documents ?event ; \
|
|
|
+rdfs:label ?document . \
|
|
|
+?uri_obj crm:P128_carries ?uri_doc . \
|
|
|
+?uri_doc rdfs:label ?object . \
|
|
|
+?event crm:P01_has_domain ?domain . \
|
|
|
+?domain crm:P02_has_range ?uri_person ; \
|
|
|
+crm:P14.1_in_the_role_of ?uri_role . \
|
|
|
+?uri_role rdfs:label ?p_type . \
|
|
|
+?uri_person rdfs:label ?name . \
|
|
|
} \
|
|
|
}"
|
|
|
|
|
@@ -180,6 +187,19 @@ crm:P168_place_is_defined_by ?coords; \
|
|
|
rdfs:label ?place . } \
|
|
|
}"
|
|
|
|
|
|
+queryLuoghiGT = prefixes + " SELECT DISTINCT ?uri_place ?place \
|
|
|
+WHERE {VALUES ?uri {<" + thisUrlParams.link + ">} \
|
|
|
+OPTIONAL {?uri crm:P46_is_composed_of ?uri_paper . } \
|
|
|
+{?uri_paper crm:P128_carries ?uri_doc } \
|
|
|
+UNION \
|
|
|
+{?uri crm:P128_carries ?uri_doc } \
|
|
|
+?uri_doc crm:P70_documents ?event . \
|
|
|
+?event crm:P7_took_place_at ?uri_location . \
|
|
|
+?uri_place owl:sameAs ?uri_location ; \
|
|
|
+crm:P168_place_is_defined_by ?coords; \
|
|
|
+rdfs:label ?place . \
|
|
|
+}"
|
|
|
+
|
|
|
queryURL = prepareQueryURL(queryInfo);
|
|
|
|
|
|
queryINF = prepareQueryURL(queryContent);
|
|
@@ -192,6 +212,7 @@ queryDOC = prepareQueryURL(queryAssocDocs);
|
|
|
|
|
|
queryCON = prepareQueryURL(queryContrassegni);
|
|
|
|
|
|
+queryLG = prepareQueryURL(queryLuoghiGT);
|
|
|
|
|
|
|
|
|
response = $.ajax({
|
|
@@ -234,12 +255,12 @@ response_people = $.ajax({
|
|
|
error: function (e) {}
|
|
|
});
|
|
|
|
|
|
-response_contrassegni = $.ajax({
|
|
|
+response_luoghi = $.ajax({
|
|
|
|
|
|
- url: queryCON,
|
|
|
+ url: queryLG,
|
|
|
dataType: "json",
|
|
|
success: function (data){
|
|
|
- handle_contrassegni(data);
|
|
|
+ handle_luoghiDocumento(data);
|
|
|
},
|
|
|
error: function (e) {}
|
|
|
});
|
|
@@ -652,8 +673,10 @@ function handle_citedPeople(json) {
|
|
|
var tipo = "";
|
|
|
var nota = "";
|
|
|
|
|
|
- if (value.hasOwnProperty('p_type')) {
|
|
|
- tipo = value['p_type']['value'];
|
|
|
+ if (value.hasOwnProperty('types')) {
|
|
|
+ if (value['types']['value'] != "") {
|
|
|
+ tipo = value['types']['value'];
|
|
|
+ }
|
|
|
}
|
|
|
if (value.hasOwnProperty('note')) {
|
|
|
nota = value['note']['value'];
|
|
@@ -668,7 +691,7 @@ function handle_citedPeople(json) {
|
|
|
for (var i=0; i<people.length; i++) {
|
|
|
var object = '<div class="col-8"><p><span id="' + people[i][0] + '" class="title_doc persona">'+ people[i][1] + '</span>';
|
|
|
if (people[i][2] != "") {
|
|
|
- object = object + "<br />Ruolo: " + people[i][2];
|
|
|
+ object = object + "<br />Citazione nel ruolo di: " + people[i][2];
|
|
|
}
|
|
|
if (people[i][3] != "") {
|
|
|
object = object + "<br />Nota: " + people[i][3];
|
|
@@ -696,44 +719,44 @@ function handle_citedPeople(json) {
|
|
|
|
|
|
}
|
|
|
|
|
|
-function handle_contrassegni(json) {
|
|
|
+function handle_luoghiDocumento(json) {
|
|
|
|
|
|
console.log(json);
|
|
|
|
|
|
- const cons = [];
|
|
|
+ const places = [];
|
|
|
|
|
|
$.each(
|
|
|
json['results']['bindings'],
|
|
|
function (index, value) {
|
|
|
- var uri = value['uri_contrassegno']['value'];
|
|
|
- var label = value['contrassegno']['value'];
|
|
|
+ var uri = value['uri_place']['value'];
|
|
|
+ var label = value['place']['value'];
|
|
|
|
|
|
- cons.push([uri, label]);
|
|
|
+ places.push([uri, label]);
|
|
|
|
|
|
});
|
|
|
|
|
|
- var Marks = "";
|
|
|
+ var Luoghi = "";
|
|
|
|
|
|
- for (var i=0; i<cons.length; i++) {
|
|
|
- var object = '<div class="col-8"><p><span id="' + cons[i][0] + '" class="title_doc object">'+ cons[i][1] + '</span></p></div>';
|
|
|
+ for (var i=0; i<places.length; i++) {
|
|
|
+ var object = '<div class="col-8"><p><span id="' + places[i][0] + '" class="title_doc luogo">'+ places[i][1] + '</span></p></div>';
|
|
|
|
|
|
- var object_button = '<button type="button" id="' + cons[i][0] +
|
|
|
- '" class="object btn btn-default" alt="oggetto" title="' + cons[i][1] +
|
|
|
- '"><i class="fa fa-book"></i><p class="btn-text">Scheda Oggetto</p></button>';
|
|
|
+ var object_button = '<button type="button" id="' + places[i][0] +
|
|
|
+ '" class="luogo btn btn-default" alt="oggetto" title="' + places[i][1] +
|
|
|
+ '"><i class="fa fa-map"></i><p class="btn-text">luogo</p></button>';
|
|
|
|
|
|
- Marks += '<div class="row res">'+ object +
|
|
|
+ Luoghi += '<div class="row res">'+ object +
|
|
|
'<div class="col d-flex align-items-start justify-content-end">' + object_button +
|
|
|
- '<button type="button" value="object" id="' + cons[i][0] + '" class="cit btn btn-default" alt="scheda" title="Info"><i class="fa fa-quote-right"></i><p class="btn-text">Citazione</p></button>' +
|
|
|
- '<button type="button" value="object" id="' + cons[i][0] + '" class="hyp btn btn-default" alt="scheda" title="Info"><i class="fa fa-link"></i><p class="btn-text">Hyperlink</p></button>' +
|
|
|
- '<a href="http://dev.restore.ovi.cnr.it/lodlive/?' + cons[i][0] + '" target="_blank"><button type="button" class="btn btn-default info" alt="LOD"><i class="fa fa-share-alt"></i><p class="btn-text">Lod</p></button></a></div></div>';
|
|
|
+ '<button type="button" value="luogo" id="' + places[i][0] + '" class="cit btn btn-default" alt="scheda" title="Info"><i class="fa fa-quote-right"></i><p class="btn-text">Citazione</p></button>' +
|
|
|
+ '<button type="button" value="luogo" id="' + places[i][0] + '" class="hyp btn btn-default" alt="scheda" title="Info"><i class="fa fa-link"></i><p class="btn-text">Hyperlink</p></button>' +
|
|
|
+ '<a href="http://dev.restore.ovi.cnr.it/lodlive/?' + places[i][0] + '" target="_blank"><button type="button" class="btn btn-default info" alt="LOD"><i class="fa fa-share-alt"></i><p class="btn-text">Lod</p></button></a></div></div>';
|
|
|
}
|
|
|
|
|
|
- document.getElementById("n_sec").innerHTML = cons.length;
|
|
|
- document.getElementById("section_documents").innerHTML = Marks;
|
|
|
+ document.getElementById("n_pl").innerHTML = places.length;
|
|
|
+ document.getElementById("section_places").innerHTML = Luoghi;
|
|
|
|
|
|
- if (cons.length==0) {
|
|
|
+ if (places.length==0) {
|
|
|
var messaggio = "<p class='no-results'>Nessun risultato trovato</p>";
|
|
|
- document.getElementById("section_documents").innerHTML = messaggio;
|
|
|
+ document.getElementById("section_places").innerHTML = messaggio;
|
|
|
}
|
|
|
|
|
|
}
|