|
@@ -135,6 +135,28 @@ OPTIONAL {?ev_move crm:P4_has_time-span ?uri_ts . \
|
|
|
?uri_ts rdfs:label ?time_span . } \
|
|
|
}"
|
|
|
|
|
|
+queryDocuments = prefixes + " SELECT DISTINCT ?role ?document ?label ?id (group_concat(distinct ?time_span ;separator='-') as ?time_span) \
|
|
|
+WHERE { \
|
|
|
+?document ?property ?event ; \
|
|
|
+crm:P1_is_identified_by ?uri_id ; \
|
|
|
+rdfs:label ?label . \
|
|
|
+?uri_id rdfs:label ?id ; \
|
|
|
+crm:P2_has_type 'Segnatura' . \
|
|
|
+OPTIONAL { \
|
|
|
+{?event crm:P4_has_time-span ?uri_time_span . \
|
|
|
+?uri_time_span rdfs:label ?time_span . \
|
|
|
+} UNION { \
|
|
|
+?sub_event rdfs:subClassOf ?event ; \
|
|
|
+crm:P4_has_time-span ?uri_time_span . \
|
|
|
+?uri_time_span rdfs:label ?time_span . } \
|
|
|
+} \
|
|
|
+?event crm:P01_has_domain ?domain . \
|
|
|
+?domain crm:P02_has_range <" + thisUrlParams.link + "> ; \
|
|
|
+crm:P14.1_in_the_role_of ?uri_role . \
|
|
|
+?uri_role rdfs:label ?role . \
|
|
|
+} \
|
|
|
+GROUP BY ?document ?label ?id ?role "
|
|
|
+
|
|
|
queryOtherDoc = prefixes + " SELECT DISTINCT ?document ?label ?id (group_concat(distinct ?time_span ;separator='-') as ?time_span) \
|
|
|
WHERE {<" + thisUrlParams.link + "> rdf:type crm:E21_Person . \
|
|
|
?creation crm:P67_refers_to <" + thisUrlParams.link + "> . \
|
|
@@ -194,6 +216,8 @@ queryURL = prepareQueryURL(query);
|
|
|
|
|
|
queryNet = prepareQueryURL(queryNetwork);
|
|
|
|
|
|
+queryDoc = prepareQueryURL(queryDocuments);
|
|
|
+
|
|
|
queryOt = prepareQueryURL(queryOtherDoc);
|
|
|
|
|
|
queryOA = prepareQueryURL(queryOpere);
|
|
@@ -256,6 +280,16 @@ responseOt = $.ajax({
|
|
|
|
|
|
url: queryOt,
|
|
|
dataType: "json",
|
|
|
+ success: function (data){
|
|
|
+ handle_Other_Documents(data);
|
|
|
+ },
|
|
|
+ error: function (e) {}
|
|
|
+});
|
|
|
+
|
|
|
+responseDoc = $.ajax({
|
|
|
+
|
|
|
+ url: queryDoc,
|
|
|
+ dataType: "json",
|
|
|
success: function (data){
|
|
|
handle_Documents(data);
|
|
|
},
|
|
@@ -596,6 +630,55 @@ function handle_Documents(json) {
|
|
|
|
|
|
console.log(json);
|
|
|
|
|
|
+ const docs = [];
|
|
|
+
|
|
|
+ $.each(
|
|
|
+ json['results']['bindings'],
|
|
|
+ function (index, value) {
|
|
|
+ uri = value['document']['value'];
|
|
|
+ label = value['label']['value'];
|
|
|
+ id = value['id']['value'];
|
|
|
+ ruolo = value['role']['value'];
|
|
|
+ var data = "";
|
|
|
+
|
|
|
+ if (value.hasOwnProperty('time_span')) {
|
|
|
+ data = value['time_span']['value'];
|
|
|
+ }
|
|
|
+
|
|
|
+ docs.push([uri, label, id, data, ruolo]);
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+ var Docs = "";
|
|
|
+
|
|
|
+ for (var i=0; i<docs.length; i++) {
|
|
|
+ var object = '<a href=' + docs[i][0] + ' target="_blank">' + docs[i][1] + '</a><br />Segnatura: ' + docs[i][2];
|
|
|
+ if (docs[i][3] != "") {
|
|
|
+ object = object + "<br />Data: " + docs[i][3];
|
|
|
+ }
|
|
|
+ object = object + "<br /><span class='PN'></span> nel ruolo di " + docs[i][4];
|
|
|
+
|
|
|
+ var object_button = '<button type="button" id="' + docs[i][0] +
|
|
|
+ '" class="object btn btn-default" alt="opera d\'arte" title="' + docs[i][1] +
|
|
|
+ '"><i class="fa fa-book"></i><p class="btn-text">Scheda Oggetto</p></button>';
|
|
|
+
|
|
|
+ Docs += '<div class="row res"><div class="col-8"><p>'+ object +'</p></div>' +
|
|
|
+ '<div class="col d-flex align-items-start justify-content-end">' + object_button +
|
|
|
+ '<button type="button" id="' + docs[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" id="' + docs[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/?' + docs[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_dc").innerHTML = docs.length;
|
|
|
+ document.getElementById("written_documents").innerHTML = Docs;
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+function handle_Other_Documents(json) {
|
|
|
+
|
|
|
+ console.log(json);
|
|
|
+
|
|
|
const doc = [];
|
|
|
|
|
|
$.each(
|
|
@@ -643,7 +726,6 @@ function handle_Documents(json) {
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
function handle_map(json) {
|
|
|
console.log(json);
|
|
|
|