|
@@ -47,14 +47,19 @@ PREFIX schema: <http://schema.org/> \
|
|
|
PREFIX foaf: <http://xmlns.com/foaf/0.1/> \
|
|
|
PREFIX person: <http://www.w3.org/ns/person#>"
|
|
|
|
|
|
-queryInfo = prefixes + " SELECT DISTINCT ?g AS ?graph ?uri ?label ?id (group_concat(distinct ?dimension ; separator='<br />') as ?dimensions) ?material ?location ?note \
|
|
|
+queryInfo = prefixes + " SELECT DISTINCT ?g AS ?graph ?uri ?label ?dimension ?consistency ?id (group_concat(distinct ?dimension ; separator='<br />') as ?dimensions) ?material ?location ?note \
|
|
|
WHERE { \
|
|
|
VALUES ?uri {<" + thisUrlParams.link + ">} \
|
|
|
GRAPH ?g { ?uri rdfs:label ?label } \
|
|
|
OPTIONAL {?uri crm:P1_is_identified_by ?uri_id . \
|
|
|
-?uri_id rdfs:label ?id } \
|
|
|
+?uri_id rdfs:label ?id ; \
|
|
|
+crm:P2_has_type 'Segnatura' .} \
|
|
|
+OPTIONAL { ?uri crm:P43_has_dimension ?uri_consistency . \
|
|
|
+?uri_consistency crm:P2_has_type 'Consistenza carte' ; \
|
|
|
+rdfs:label ?consistency } \
|
|
|
OPTIONAL { ?uri crm:P43_has_dimension ?uri_dimension . \
|
|
|
-?uri_dimension rdfs:label ?dimension } \
|
|
|
+?uri_dimension crm:P2_has_type 'Dimensioni' ; \
|
|
|
+rdfs:label ?dimension } \
|
|
|
OPTIONAL { ?uri crm:P45_consist_of ?uri_material . \
|
|
|
?uri_material rdfs:label ?material } \
|
|
|
OPTIONAL { ?uri crm:P54_has_current_permanent_location ?uri_location . \
|
|
@@ -63,24 +68,42 @@ OPTIONAL { ?uri crm:P3_has_note ?uri_note . \
|
|
|
?uri_note rdfs:label ?note } \
|
|
|
} "
|
|
|
|
|
|
-queryContent = prefixes + " SELECT DISTINCT ?g AS ?graph ?uri ?titolo ?tipo ?ref \
|
|
|
+queryContent = prefixes + " SELECT DISTINCT ?g AS ?graph ?uri ?titolo ?tipo (group_concat(distinct ?ref ; separator='<br />') as ?ref) \
|
|
|
WHERE { \
|
|
|
VALUES ?object {<" + thisUrlParams.link + ">} \
|
|
|
?object crm:P128_carries ?uri . \
|
|
|
+?uri rdf:type crm:E73_Information_Object . \
|
|
|
GRAPH ?g { ?uri rdfs:label ?label } \
|
|
|
OPTIONAL {?uri crm:P1_is_identified_by ?uri_titolo . \
|
|
|
-?uri_titolo rdfs:label ?titolo . } \
|
|
|
+?uri_titolo rdfs:label ?titolo ; \
|
|
|
+rdf:type crm:E35_Title . } \
|
|
|
OPTIONAL { ?uri crm:P2_has_type ?uri_tipo . \
|
|
|
?uri_tipo rdfs:label ?tipo . } \
|
|
|
OPTIONAL { ?uri crm:P67_refers_to ?uri_ref . \
|
|
|
?uri_ref rdfs:label ?ref . } \
|
|
|
+FILTER NOT EXISTS {GRAPH <http://dev.restore.ovi.cnr.it:8890/ovi/datini> { ?uri rdfs:label ?label }}. \
|
|
|
}"
|
|
|
|
|
|
+queryOviLetter = prefixes + " SELECT DISTINCT ?otherId ?InfObj \
|
|
|
+WHERE { \
|
|
|
+VALUES ?uri {<" + thisUrlParams.link + ">} \
|
|
|
+?uri crm:P1_is_identified_by ?uri_id . \
|
|
|
+?uri_id crm:P2_has_type 'Segnatura' ; \
|
|
|
+crm:P139_has_alternative_form ?other_id . \
|
|
|
+?other_id crm:P2_has_type ?uri_type ; \
|
|
|
+rdfs:label ?otherId . \
|
|
|
+?uri_type rdfs:label 'Segnatura OVI' . \
|
|
|
+OPTIONAL { ?uri crm:P128_carries ?InfObj . \
|
|
|
+GRAPH <http://dev.restore.ovi.cnr.it:8890/ovi/datini> {?InfObj rdf:type crm:E73_Information_Object } } \
|
|
|
+} "
|
|
|
+
|
|
|
|
|
|
queryURL = prepareQueryURL(queryInfo);
|
|
|
|
|
|
queryINF = prepareQueryURL(queryContent);
|
|
|
|
|
|
+queryOVI = prepareQueryURL(queryOviLetter);
|
|
|
+
|
|
|
|
|
|
response = $.ajax({
|
|
|
|
|
@@ -102,6 +125,16 @@ response_info = $.ajax({
|
|
|
error: function (e) {}
|
|
|
});
|
|
|
|
|
|
+response_info = $.ajax({
|
|
|
+
|
|
|
+ url: queryOVI,
|
|
|
+ dataType: "json",
|
|
|
+ success: function (data){
|
|
|
+ handle_oviLetter(data);
|
|
|
+ },
|
|
|
+ error: function (e) {}
|
|
|
+});
|
|
|
+
|
|
|
|
|
|
function handle_objectData(json) {
|
|
|
|
|
@@ -112,22 +145,28 @@ function handle_objectData(json) {
|
|
|
function (index, value) {
|
|
|
var graph = value['graph']['value'];
|
|
|
var label = value['label']['value'];
|
|
|
+ var uri = value['uri']['value'];
|
|
|
var identifier = "";
|
|
|
var dimensions = "";
|
|
|
+ var consistence = "";
|
|
|
var materials = "";
|
|
|
var current_location = "";
|
|
|
var description = "";
|
|
|
+ var button_ext = "";
|
|
|
+
|
|
|
+ var dataset = get_graph_name(graph);
|
|
|
|
|
|
-
|
|
|
if (value.hasOwnProperty('id')) {
|
|
|
$("#ID").css("display", "flex");
|
|
|
identifier = value['id']['value'];
|
|
|
}
|
|
|
- if (value.hasOwnProperty('dimensions')) {
|
|
|
- if (value['dimensions']['value'] != "") {
|
|
|
- $("#consistenza").css("display", "flex");
|
|
|
+ if (value.hasOwnProperty('dimension')) {
|
|
|
+ $("#dimensione").css("display", "flex");
|
|
|
dimensions = value['dimensions']['value'];
|
|
|
- }
|
|
|
+ }
|
|
|
+ if (value.hasOwnProperty('consistency')) {
|
|
|
+ $("#consistenza").css("display", "flex");
|
|
|
+ consistence = value['consistency']['value'];
|
|
|
}
|
|
|
if (value.hasOwnProperty('condition')) {
|
|
|
$("#STCC").css("display", "flex");
|
|
@@ -145,14 +184,20 @@ function handle_objectData(json) {
|
|
|
$("#notes").css("display", "flex");
|
|
|
description = value['note']['value'];
|
|
|
}
|
|
|
-
|
|
|
|
|
|
- document.getElementById("grafo").innerHTML = graph;
|
|
|
+ if (identifier != "") {
|
|
|
+ button_ext = '<button class="btn btn-default" type="button" onclick="schedaASPO(\'' + uri + '\')"> \
|
|
|
+ <i class="fa fa-link" aria-hidden="true"> <p class="btn-text">Link</p></i></button>';
|
|
|
+ }
|
|
|
+
|
|
|
+ document.getElementById("grafo").innerHTML = dataset;
|
|
|
document.getElementById("nome_oggetto").innerHTML = label;
|
|
|
document.getElementById("identifier").innerHTML = identifier;
|
|
|
+ document.getElementById("btn_identifier").innerHTML = button_ext;
|
|
|
document.getElementById("location").innerHTML = current_location;
|
|
|
document.getElementById("nota").innerHTML = description;
|
|
|
document.getElementById("dimensions").innerHTML = dimensions;
|
|
|
+ document.getElementById("consistence").innerHTML = consistence;
|
|
|
document.getElementById("materials").innerHTML = materials;
|
|
|
|
|
|
|
|
@@ -160,6 +205,22 @@ function handle_objectData(json) {
|
|
|
|
|
|
}
|
|
|
|
|
|
+function get_graph_name(graph) {
|
|
|
+ var dataset = "Scheda Oggetto";
|
|
|
+
|
|
|
+ if (graph == "http://dev.restore.ovi.cnr.it:8890/aspo/ospedale") {
|
|
|
+ dataset = dataset + " / Ospedale";
|
|
|
+ } else if (graph == "http://dev.restore.ovi.cnr.it:8890/aspo/datini") {
|
|
|
+ dataset = dataset + " / Datini";
|
|
|
+ } else if (graph == "http://dev.restore.ovi.cnr.it:8890/aspo/marcovaldi") {
|
|
|
+ dataset = dataset + " / Marcovaldi";
|
|
|
+ } else if (graph == "http://dev.restore.ovi.cnr.it:8890/aspo/gettatelli") {
|
|
|
+ dataset = dataset + " / Gettatelli";
|
|
|
+ } else {
|
|
|
+ dataset = dataset;
|
|
|
+ }
|
|
|
+ return dataset;
|
|
|
+}
|
|
|
|
|
|
function handle_objectInfo(json) {
|
|
|
|
|
@@ -182,12 +243,14 @@ function handle_objectInfo(json) {
|
|
|
$("#tipo").css("display", "flex");
|
|
|
type = value['tipo']['value'];
|
|
|
}
|
|
|
+
|
|
|
if (value.hasOwnProperty('ref')) {
|
|
|
- $("#argomento").css("display", "flex");
|
|
|
- subject = value['ref']['value'];
|
|
|
+ if (value['ref']['value'] != "") {
|
|
|
+ $("#argomento").css("display", "flex");
|
|
|
+ subject = value['ref']['value'];
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
-
|
|
|
document.getElementById("title").innerHTML = title;
|
|
|
document.getElementById("type").innerHTML = type;
|
|
|
document.getElementById("subject").innerHTML = subject;
|
|
@@ -197,6 +260,46 @@ function handle_objectInfo(json) {
|
|
|
|
|
|
}
|
|
|
|
|
|
+function handle_oviLetter(json) {
|
|
|
+
|
|
|
+ console.log(json['results']['bindings']);
|
|
|
+
|
|
|
+ $.each(
|
|
|
+ json['results']['bindings'],
|
|
|
+ function (index, value) {
|
|
|
+
|
|
|
+ var other_id = "";
|
|
|
+ var uri = "";
|
|
|
+ var button_letter = "";
|
|
|
+
|
|
|
+ if (value.hasOwnProperty('otherId')) {
|
|
|
+ $("#IDbis").css("display", "flex");
|
|
|
+ other_id = value['otherId']['value'];
|
|
|
+ }
|
|
|
+ if (value.hasOwnProperty('InfObj')) {
|
|
|
+ uri = value['InfObj']['value'];
|
|
|
+ }
|
|
|
+
|
|
|
+ if (uri != "") {
|
|
|
+ button_letter = '<button type="button" id="' + uri +
|
|
|
+ '" class="lettera btn btn-default" alt="lettera"><i class="fa fa-envelope"></i><p class="btn-text">Scheda Lettera</p></button>';
|
|
|
+ }
|
|
|
+
|
|
|
+ document.getElementById("other_identifier").innerHTML = other_id;
|
|
|
+ document.getElementById("btn_other_identifier").innerHTML = button_letter;
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+$(document).on("click", ".lettera", function (ev) {
|
|
|
+
|
|
|
+ var link = this.id;
|
|
|
+ //alert(nome_autore);
|
|
|
+ //$('#myModal').text("");
|
|
|
+ window.open("lettera.html?link="+this.id);
|
|
|
+
|
|
|
+ });
|
|
|
|
|
|
$(document).on("click", ".luogo", function (ev) {
|
|
|
|
|
@@ -217,3 +320,7 @@ $(document).on("click", ".persona", function (ev) {
|
|
|
|
|
|
|
|
|
});
|
|
|
+
|
|
|
+ function schedaASPO(info){
|
|
|
+ window.open(info);
|
|
|
+ }
|