managerQuery.js 53 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141
  1. var queryManager = {
  2. prefixes : {
  3. all : "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \
  4. PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \
  5. PREFIX crm: <http://www.cidoc-crm.org/cidoc-crm/> \
  6. PREFIX owl: <http://www.w3.org/2002/07/owl#> \
  7. PREFIX schema: <http://schema.org/> \
  8. PREFIX foaf: <http://xmlns.com/foaf/0.1/> \
  9. PREFIX person: <http://www.w3.org/ns/person#> \
  10. PREFIX time: <https://www.w3.org/TR/owl-time#> "
  11. },
  12. queryMMO: {
  13. queryLabel : " SELECT DISTINCT ?g AS ?graph ?subject ?label ?identifier \
  14. WHERE {<{GRAPH}> \
  15. GRAPH ?g {?subject rdf:type crm:E22_Man-Made_Object } \
  16. ?subject rdfs:label ?label . \
  17. ?subject crm:P1_is_identified_by ?uri_identifier . \
  18. ?uri_identifier rdfs:label ?identifier ; \
  19. crm:P2_has_type 'Segnatura' . \
  20. <{WORD}> \
  21. }",
  22. queryArte : " SELECT DISTINCT ?g AS ?graph ?subject ?label ?identifier ?type \
  23. WHERE { <{GRAPH}> \
  24. GRAPH ?g {?subject rdf:type crm:E22_Man-Made_Object } \
  25. ?subject rdfs:label ?label ; \
  26. crm:P2_has_type ?type ; \
  27. crm:P1_is_identified_by ?uri_identifier . \
  28. ?uri_identifier rdfs:label ?identifier . \
  29. <{WORD}> \
  30. FILTER (?type = \"Opera d'Arte\") \
  31. }",
  32. queryIdentificatore: " SELECT DISTINCT ?g AS ?graph ?subject ?label ?identifier \
  33. WHERE {<{GRAPH}> \
  34. GRAPH ?g {?subject rdf:type crm:E22_Man-Made_Object } \
  35. ?subject rdfs:label ?label . \
  36. ?subject crm:P1_is_identified_by ?uri_identifier . \
  37. ?uri_identifier rdfs:label ?identifier ; \
  38. crm:P2_has_type 'Segnatura' . \
  39. FILTER (CONTAINS(?identifier, '<{WORD}>')) \
  40. }"
  41. },
  42. queryINF: {
  43. queryContenuti1: " SELECT DISTINCT ?g AS ?graph ?Physical_Object ?subject ?label ?id (group_concat(distinct ?type ;separator=', ') as ?types) (SAMPLE(?object_Label) AS ?text) \
  44. WHERE { <{GRAPH}> \
  45. GRAPH ?g {?subject rdf:type crm:E73_Information_Object ; \
  46. rdfs:label ?label .} \
  47. OPTIONAL {?Physical_Object crm:P128_carries ?subject .} \
  48. OPTIONAL {?subject crm:P1_is_identified_by ?id_subject . \
  49. ?id_subject rdfs:label ?id ; \
  50. rdf:type crm:E42_Identifier . } \
  51. OPTIONAL {?subject crm:P2_has_type ?type . } \
  52. ?subject ?property ?object_Label . \
  53. <{WORD}> \
  54. }",
  55. queryContenuti2: " SELECT DISTINCT ?g AS ?graph ?Physical_Object ?subject ?label ?id (group_concat(distinct ?type ;separator=', ') as ?types) (SAMPLE(?object_Label) AS ?text) \
  56. WHERE { <{GRAPH}> \
  57. GRAPH ?g {?subject rdf:type crm:E73_Information_Object ; \
  58. rdfs:label ?label .} \
  59. OPTIONAL {?Physical_Object crm:P128_carries ?subject .} \
  60. OPTIONAL {?subject crm:P1_is_identified_by ?id_subject . \
  61. ?id_subject rdfs:label ?id ; \
  62. rdf:type crm:E42_Identifier . } \
  63. OPTIONAL {?subject crm:P2_has_type ?type . } \
  64. VALUES ?object_type {crm:E1_Entity crm:E1_CRM_Entity crm:E41_Appellation crm:E62_String} \
  65. ?subject ?property ?object . \
  66. ?object rdfs:label ?object_Label . \
  67. ?object rdf:type ?object_type . \
  68. <{WORD}> \
  69. FILTER NOT EXISTS { ?property rdfs:label 'label' } \
  70. }",
  71. queryContenuti3: " SELECT DISTINCT ?g AS ?graph ?Physical_Object ?subject ?label ?id (group_concat(distinct ?type ;separator=', ') as ?types) (SAMPLE(?object_Label) AS ?text) \
  72. WHERE {<{GRAPH}> \
  73. GRAPH ?g {?subject rdf:type crm:E73_Information_Object ; \
  74. rdfs:label ?label .} \
  75. OPTIONAL {?Physical_Object crm:P128_carries ?subject .} \
  76. OPTIONAL {?subject crm:P1_is_identified_by ?id_subject . \
  77. ?id_subject rdfs:label ?id ; \
  78. rdf:type crm:E42_Identifier . } \
  79. OPTIONAL {?subject crm:P2_has_type ?uri_type . \
  80. ?uri_type rdfs:label ?type . } \
  81. ?subject crm:P67_refers_to ?object_uri . \
  82. ?object_uri rdfs:label ?object_Label . \
  83. <{WORD}> \
  84. }"
  85. },
  86. queryPER: {
  87. queryNome: " SELECT DISTINCT ?g AS ?graph ?subject ?name \
  88. WHERE { <{GRAPH}> \
  89. GRAPH ?g { ?subject ?property ?object . } \
  90. ?subject rdf:type crm:E21_Person ; \
  91. foaf:name ?name . \
  92. ?name bif:contains <{WORD}> . \
  93. } ",
  94. queryNote: " SELECT DISTINCT ?g AS ?graph ?subject ?name ?note \
  95. WHERE {<{GRAPH}> \
  96. GRAPH ?g { ?subject ?property ?object . } \
  97. ?subject rdf:type crm:E21_Person ; \
  98. foaf:name ?name . \
  99. ?subject crm:P3_has_note ?note . \
  100. ?note bif:contains <{WORD}> . \
  101. }",
  102. queryOccupazione: " SELECT DISTINCT ?g AS ?graph ?subject ?name ?occupation \
  103. WHERE {<{GRAPH}> \
  104. GRAPH ?g { ?subject ?property ?object . } \
  105. ?subject rdf:type crm:E21_Person ; \
  106. foaf:name ?name . \
  107. ?subject schema:hasOccupation ?uri_occupation . \
  108. ?uri_occupation rdfs:label ?occupation . \
  109. ?occupation bif:contains <{WORD}> . \
  110. }"
  111. },
  112. queryLG: {
  113. queryLuoghi : " SELECT DISTINCT ?g AS ?graph ?subject ?label \
  114. WHERE {<{GRAPH}> \
  115. GRAPH ?g { ?subject ?property ?object } \
  116. ?subject rdfs:label ?label ; \
  117. rdf:type crm:E53_Place ; \
  118. crm:P168_place_is_defined_by ?coords . \
  119. ?label bif:contains <{WORD}> . \
  120. }"
  121. },
  122. queryRES: {
  123. queryExchange : " SELECT DISTINCT ?uri_document ?document ?time_span_from ?time_span_to ?uri_place_from ?place_from ?uri_place_to ?place_to \
  124. { \
  125. ?event_from rdfs:subClassOf ?event ; \
  126. rdf:type crm:EL2_Send_Letter . \
  127. ?event_to rdfs:subClassOf ?event ; \
  128. rdf:type crm:EL3_Receive_Letter . \
  129. \
  130. ?event_from crm:P01_has_domain ?pc_from . \
  131. ?pc_from crm:P02_has_range <{MITTENTE}> . \
  132. OPTIONAL {?event_from crm:P4_has_time-span ?uri_time_span_from . \
  133. ?uri_time_span_from rdfs:label ?time_span_from} \
  134. OPTIONAL {?event_from crm:P27_moved_from ?aspo_place_from . \
  135. ?aspo_place_from owl:sameAs ?uri_place_from . \
  136. ?uri_place_from rdfs:label ?place_from ; \
  137. crm:P168_place_is_defined_by ?coords_from} \
  138. \
  139. ?event_to crm:P01_has_domain ?pc_to . \
  140. ?pc_to crm:P02_has_range <{DESTINATARIO}> . \
  141. OPTIONAL {?event_to crm:P4_has_time-span ?uri_time_span_to . \
  142. ?uri_time_span_to rdfs:label ?time_span_to} \
  143. OPTIONAL {?event_to crm:P26_moved_to ?aspo_place_to . \
  144. ?aspo_place_to owl:sameAs ?uri_place_to . \
  145. ?uri_place_to rdfs:label ?place_to ; \
  146. crm:P168_place_is_defined_by ?coords_to} \
  147. \
  148. ?uri_document crm:P25i_moved_by ?event ; \
  149. rdfs:label ?document . \
  150. }",
  151. queryEsploraDocumenti : " SELECT DISTINCT ?document ?uri_document ?sigla ?time_span ?year ?month ?day ?text ?uri_infObj (group_concat(distinct ?type ;separator=', ') as ?types) \
  152. WHERE { \
  153. { ?uri_thing crm:P128_carries <{URI}> . \
  154. ?uri_infObj crm:P67_refers_to ?uri_thing . \
  155. } UNION { \
  156. ?uri_infObj crm:P67_refers_to <{URI}> . } \
  157. ?uri_document crm:P128_carries ?uri_infObj ; \
  158. rdfs:label ?document . \
  159. OPTIONAL {?uri_infObj crm:P2_has_type ?uri_type . \
  160. ?uri_type rdfs:label ?type . } \
  161. OPTIONAL {?uri_infObj crm:P190_has_symbolic_content ?text .} \
  162. GRAPH <http://dev.restore.ovi.cnr.it:8890/aspo/datini> {?uri_document crm:P25i_moved_by ?mov_ev .} \
  163. ?send rdfs:subClassOf ?mov_ev ; \
  164. rdf:type crm:EL2_Send_Letter . \
  165. OPTIONAL {?uri_infObj crm:P1_is_identified_by ?uri_sigla . \
  166. ?uri_sigla crm:P2_has_type ?sigla_type ; \
  167. rdfs:label ?sigla . \
  168. ?sigla_type rdfs:label 'Sigla OVI' .} \
  169. OPTIONAL {?send crm:P4_has_time-span ?uri_time_span . \
  170. ?uri_time_span rdfs:label ?time_span . \
  171. OPTIONAL {?uri_time_span time:year ?year } \
  172. OPTIONAL {?uri_time_span time:month ?month } \
  173. OPTIONAL {?uri_time_span time:day ?day } \
  174. } \
  175. } \
  176. ORDER BY ?year ?month ?day",
  177. queryTrovaIDlemma : "SELECT DISTINCT ?id \
  178. WHERE {?subject rdfs:label '<{LEMMA}>' ; \
  179. crm:P67_refers_to ?uri_sigla . \
  180. ?uri_sigla rdfs:label '<{SIGLA}>' . \
  181. ?subject crm:P1_is_identified_by ?uri_id . \
  182. ?uri_id rdfs:label ?id . }",
  183. queryTrovaSigla : " SELECT DISTINCT ?uri ?sigla ?text \
  184. WHERE { \
  185. ?uri crm:P1_is_identified_by ?uri_sigla ; \
  186. crm:P190_has_symbolic_content ?text . \
  187. ?uri_sigla rdfs:label ?sigla ; \
  188. crm:P2_has_type ?uri_sigla_type . \
  189. ?uri_sigla_type rdfs:label 'Sigla OVI' . \
  190. {?uri crm:P67_refers_to ?lem . \
  191. ?lem crm:P128_carries <{URI}>} \
  192. UNION \
  193. {?uri crm:P67_refers_to <{URI}> }} ",
  194. queryEsploraMappa : " SELECT DISTINCT ?uri_subject ?subject ?uri_place ?uri_infObj ?place ?coords ?time_span ?year ?month ?day ?text \
  195. WHERE { \
  196. { ?uri_thing crm:P128_carries <{URI}> . \
  197. ?uri_infObj crm:P67_refers_to ?uri_thing . \
  198. } UNION { \
  199. ?uri_infObj crm:P67_refers_to <{URI}> . } \
  200. ?uri_subject crm:P128_carries ?uri_infObj ; \
  201. rdfs:label ?subject . \
  202. ?uri_infObj crm:P190_has_symbolic_content ?text . \
  203. ?uri_subject crm:P25i_moved_by ?mov_ev . \
  204. ?send rdfs:subClassOf ?mov_ev ; \
  205. rdf:type crm:EL2_Send_Letter . \
  206. ?send crm:P4_has_time-span ?uri_time_span . \
  207. ?uri_time_span rdfs:label ?time_span . \
  208. ?uri_time_span time:year ?year . \
  209. OPTIONAL {?uri_time_span time:month ?month } \
  210. OPTIONAL {?uri_time_span time:day ?day } \
  211. ?send crm:P27_moved_from ?uri_placeNT . \
  212. ?uri_placeNT owl:sameAs ?uri_place . \
  213. ?uri_place rdfs:label ?place ; \
  214. crm:P168_place_is_defined_by ?coords . \
  215. } \
  216. ORDER BY ?year ?month ?day"
  217. },
  218. querySchedaPersona : {
  219. queryNetwork : " SELECT COUNT(?event1) AS ?count1 COUNT(?event2) AS ?count2 COUNT(?event3) AS ?count3 ?uri2 SAMPLE(?label2) AS ?text \
  220. WHERE { \
  221. {?event1 rdf:type crm:EL1_Exchange_Letters . \
  222. ?event_to rdfs:subClassOf ?event1; \
  223. rdf:type crm:EL2_Send_Letter ; \
  224. crm:P01_has_domain ?pc_to . \
  225. ?pc_to crm:P02_has_range ?uri . \
  226. ?uri rdfs:label ?label . \
  227. ?event_from rdfs:subClassOf ?event1; \
  228. rdf:type crm:EL3_Receive_Letter; \
  229. crm:P01_has_domain ?pc_from . \
  230. ?pc_from crm:P02_has_range ?uri2 . \
  231. ?uri2 rdfs:label ?label2 . \
  232. FILTER (?uri = <{URI}>) \
  233. } UNION { \
  234. ?event2 rdf:type crm:EL1_Exchange_Letters . \
  235. ?event_to rdfs:subClassOf ?event2; \
  236. rdf:type crm:EL3_Receive_Letter ; \
  237. crm:P01_has_domain ?pc_from . \
  238. ?pc_from crm:P02_has_range ?uri . \
  239. ?uri rdfs:label ?label . \
  240. ?event_from rdfs:subClassOf ?event2; \
  241. rdf:type crm:EL2_Send_Letter; \
  242. crm:P01_has_domain ?pc_to . \
  243. ?pc_to crm:P02_has_range ?uri2 . \
  244. ?uri2 rdfs:label ?label2 . \
  245. FILTER (?uri = <{URI}>) \
  246. } UNION { \
  247. ?pc crm:P02_has_range <{URI}> . \
  248. ?event3 crm:P01_has_domain ?pc . \
  249. ?event3 crm:P01_has_domain ?pc1 . \
  250. ?pc1 crm:P02_has_range ?uri2 . \
  251. ?uri2 rdfs:label ?label2 . \
  252. FILTER (?pc != ?pc1) \
  253. } \
  254. }",
  255. queryNetwork2 : " SELECT DISTINCT ?uri_person ?name \
  256. WHERE { \
  257. VALUES ?uri {<{URI}>} \
  258. ?pc crm:P02_has_range ?uri . \
  259. ?event crm:P01_has_domain ?pc . \
  260. ?event crm:P01_has_domain ?pc1 . \
  261. ?pc1 crm:P02_has_range ?uri_person . \
  262. ?uri_person rdfs:label ?name . \
  263. FILTER (?pc != ?pc1) \
  264. }",
  265. query : " SELECT DISTINCT ?place ?label ?tipo ?coordinates COUNT(?pc) AS ?count \
  266. WHERE { \
  267. VALUES ?uri {<{URI}>} \
  268. {?place rdfs:label ?label ; \
  269. crm:P168_place_is_defined_by ?coordinates . \
  270. ?place_from rdf:type crm:E53_Place ; \
  271. owl:sameAs ?place . \
  272. ?event_from crm:P01_has_domain ?pc ; \
  273. rdfs:label ?tipo ; \
  274. ?property ?place_from . \
  275. ?pc crm:P02_has_range ?uri . \
  276. } UNION { \
  277. ?uri crm:P100i_died_in ?uri_death . \
  278. ?uri_death crm:P7_took_place_at ?uri_place . \
  279. ?uri_place rdf:type crm:E53_Place ; \
  280. owl:sameAs ?place . \
  281. ?place rdfs:label ?label ; \
  282. crm:P168_place_is_defined_by ?coordinates . \
  283. } UNION { \
  284. ?uri crm:P98i_was_born ?uri_birth . \
  285. ?uri_birth crm:P7_took_place_at ?uri_place . \
  286. ?uri_place rdf:type crm:E53_Place ; \
  287. owl:sameAs ?place . \
  288. ?place rdfs:label ?label ; \
  289. crm:P168_place_is_defined_by ?coordinates . \
  290. } \
  291. UNION { \
  292. ?pc crm:P02_has_range ?uri . \
  293. ?uri_event crm:P01_has_domain ?pc; \
  294. crm:P7_took_place_at ?place ; \
  295. crm:P2_has_type ?uri_type . \
  296. ?uri_type rdfs:label ?tipo . \
  297. ?place rdf:type crm:E53_Place ; \
  298. rdfs:label ?label . \
  299. ?place crm:P168_place_is_defined_by ?coordinates .\
  300. } \
  301. }",
  302. queryInfo : " SELECT DISTINCT ?uri ?graph ?label ?identifier ?id_type ?name ?givenName ?familyName ?relative2 ?relative3 ?provenienza (GROUP_CONCAT(DISTINCT CONCAT(?variant, '| ', ?otherName) ; SEPARATOR = ';') AS ?variants) ?gender ?Birth_Date ?Birth_Place ?Death_Date ?Death_Place ?patronymic ?occupation ?qualification ?group \
  303. WHERE { \
  304. VALUES ?uri {<{URI}>} \
  305. GRAPH ?graph {?uri rdfs:label ?label} \
  306. ?uri foaf:name ?name . \
  307. OPTIONAL {?uri crm:P1_is_identified_by ?id . \
  308. ?id rdfs:label ?identifier ; \
  309. crm:P2_has_type ?id_type .} \
  310. OPTIONAL {?uri foaf:givenName ?givenName} \
  311. OPTIONAL {?uri foaf:familyName ?familyName} \
  312. OPTIONAL {?uri foaf:gender ?gender} \
  313. OPTIONAL {?uri person:patronymicName ?patronymic } \
  314. OPTIONAL {?uri crm:P74_has_current_or_former_residence ?uri_provenienza . \
  315. ?uri_provenienza crm:P2_has_type 'Provenienza'; \
  316. rdfs:label ?provenienza . } \
  317. OPTIONAL {?uri crm:P2_has_type ?uri_person_type . \
  318. ?uri_person_type rdfs:label ?person_type } \
  319. OPTIONAL {?uri schema:hasOccupation ?uriOccupation . \
  320. ?uriOccupation rdf:type schema:Occupation; \
  321. rdfs:label ?occupation } \
  322. OPTIONAL {?uri schema:honorificPrefix ?qualification} \
  323. OPTIONAL {?uri crm:P100i_died_in ?Death . \
  324. OPTIONAL {?Death crm:P4_has_time-span ?Death_TS . \
  325. ?Death_TS rdfs:label ?Death_Date . } \
  326. OPTIONAL {?Death crm:P7_took_place_at ?Place_D . \
  327. ?Place_D rdfs:label ?Death_Place } \
  328. } \
  329. OPTIONAL {?uri crm:P98i_was_born ?Birth . \
  330. OPTIONAL {?Birth crm:P4_has_time-span ?Birth_TS . \
  331. ?Birth_TS rdfs:label ?Birth_Date . } \
  332. OPTIONAL {?Birth crm:P7_took_place_at ?Place_B . \
  333. ?Place_B rdfs:label ?Birth_Place } \
  334. } \
  335. OPTIONAL {?uri crm:P107i_is_current_or_former_member_of ?uriGroup . \
  336. ?uriGroup rdfs:label ?group } \
  337. OPTIONAL {?uri schema:alternateName ?alias . } \
  338. OPTIONAL {?uri owl:sameAs ?variant . \
  339. ?variant foaf:name ?otherName . } \
  340. OPTIONAL {?relation2 crm:P141_assigned ?uri ; \
  341. crm:P42_assigned ?uri_rel_type2 . \
  342. ?uri_rel_type2 rdfs:label 'Avo di secondo grado' . \
  343. ?uri_relative2 crm:P141_assigned ?relation2; \
  344. rdfs:label ?relative2 .} \
  345. OPTIONAL {?relation3 crm:P141_assigned ?uri ; \
  346. crm:P42_assigned ?uri_rel_type3 . \
  347. ?uri_rel_type3 rdfs:label 'Avo di terzo grado' . \
  348. ?uri_relative3 crm:P141_assigned ?relation3; \
  349. rdfs:label ?relative3 .} \
  350. } \
  351. GROUP BY ?graph ?uri ?label ?identifier ?id_type ?name ?givenName ?familyName ?relative2 ?relative3 ?provenienza ?gender ?Birth_Date ?Birth_Place ?Death_Date ?Death_Place ?patronymic ?occupation ?qualification ?group \
  352. LIMIT 1 ",
  353. queryInfoGettatelli : " SELECT DISTINCT ?card ?uri_card \
  354. WHERE { \
  355. VALUES ?uri {<{URI}>} \
  356. ?documentation crm:P67_refers_to ?uri ; \
  357. crm:P141_assigned ?uri_card . \
  358. ?uri_card rdfs:label ?card . \
  359. } ",
  360. queryRelazioni : " SELECT DISTINCT ?relation_type ?note ?uri_person ?name ?givenName ?familyName ?patronymic ?provenienza \
  361. WHERE { \
  362. VALUES ?uri {<{URI}>} \
  363. ?uri crm:P141_assigned ?relation . \
  364. ?relation crm:P42_assigned ?uri_type ; \
  365. crm:P141_assigned ?uri_person . \
  366. ?uri_type rdfs:label ?relation_type . \
  367. OPTIONAL {?uri_type crm:P3_has_note ?note } \
  368. ?uri_person foaf:name ?name . \
  369. OPTIONAL {?uri_person foaf:givenName ?givenName} \
  370. OPTIONAL {?uri_person foaf:familyName ?familyName} \
  371. OPTIONAL {?uri_person person:patronymicName ?patronymic } \
  372. OPTIONAL {?uri_person crm:P74_has_current_or_former_residence ?uri_provenienza . \
  373. ?uri_provenienza crm:P2_has_type 'Provenienza'; \
  374. rdfs:label ?provenienza . } \
  375. } ",
  376. queryRelazioniInverse : " SELECT DISTINCT ?relation_type ?note ?uri_person SAMPLE(?name) AS ?name ?givenName ?familyName ?patronymic ?provenienza \
  377. WHERE { \
  378. VALUES ?uri {<{URI}>} \
  379. ?relation crm:P141_assigned ?uri; \
  380. crm:P42_assigned ?uri_type . \
  381. ?uri_person crm:P141_assigned ?relation . \
  382. ?uri_type rdfs:label ?relation_type . \
  383. OPTIONAL {?uri_type crm:P3_has_note ?note } \
  384. OPTIONAL {?uri_person foaf:name ?name } \
  385. OPTIONAL {?uri_person foaf:givenName ?givenName} \
  386. OPTIONAL {?uri_person foaf:familyName ?familyName} \
  387. OPTIONAL {?uri_person person:patronymicName ?patronymic } \
  388. OPTIONAL {?uri_person crm:P74_has_current_or_former_residence ?uri_provenienza . \
  389. ?uri_provenienza crm:P2_has_type 'Provenienza'; \
  390. rdfs:label ?provenienza . } \
  391. } ",
  392. queryLetters : " SELECT DISTINCT ?type ?segnatura ?document_uri ?document_name ?time_span ?InfObj \
  393. WHERE { \
  394. VALUES ?uri {<{URI}>} \
  395. {?pc crm:P02_has_range ?uri . \
  396. } UNION { \
  397. ?group crm:P107_has_current_or_former_member ?uri; \
  398. crm:P2_has_type 'Gruppo scrittura lettera' . \
  399. ?pc crm:P02_has_range ?group . \
  400. } \
  401. ?ev_move crm:P01_has_domain ?pc ; \
  402. rdfs:label ?type ; \
  403. rdfs:subClassOf ?event . \
  404. ?document_uri crm:P25i_moved_by ?event ; \
  405. rdfs:label ?document_name . \
  406. ?document_uri crm:P1_is_identified_by ?uriSegnatura . \
  407. ?uriSegnatura crm:P2_has_type 'Segnatura' ; \
  408. rdfs:label ?segnatura . \
  409. OPTIONAL {GRAPH <http://dev.restore.ovi.cnr.it:8890/ovi/datini> {?document_uri crm:P128_carries ?InfObj . \
  410. ?InfObj rdf:type crm:E73_Information_Object} }. \
  411. OPTIONAL {?ev_move crm:P4_has_time-span ?uri_ts . \
  412. ?uri_ts rdfs:label ?time_span . } \
  413. }",
  414. queryDocuments : " SELECT DISTINCT ?role ?document ?label ?id (group_concat(distinct ?time_span ;separator='-') as ?time_span) \
  415. WHERE { \
  416. ?document ?property ?event ; \
  417. crm:P1_is_identified_by ?uri_id ; \
  418. rdfs:label ?label . \
  419. ?uri_id rdfs:label ?id ; \
  420. crm:P2_has_type 'Segnatura' . \
  421. OPTIONAL { \
  422. {?event crm:P4_has_time-span ?uri_time_span . \
  423. ?uri_time_span rdfs:label ?time_span . \
  424. } UNION { \
  425. ?sub_event rdfs:subClassOf ?event ; \
  426. crm:P4_has_time-span ?uri_time_span . \
  427. ?uri_time_span rdfs:label ?time_span . } \
  428. } \
  429. ?event crm:P01_has_domain ?domain . \
  430. ?domain crm:P02_has_range <{URI}> ; \
  431. crm:P14.1_in_the_role_of ?uri_role . \
  432. ?uri_role rdfs:label ?role . \
  433. } \
  434. GROUP BY ?document ?label ?id ?role ",
  435. queryOtherDoc : " SELECT DISTINCT ?document ?label ?id (group_concat(distinct ?time_span ;separator='-') as ?time_span) \
  436. WHERE { \
  437. VALUES ?uri {<{URI}> } \
  438. {?domain crm:P02_has_range ?uri . \
  439. ?event crm:P01_has_domain ?domain . \
  440. ?document crm:P92i_was_brought_into_existence_by ?event ; \
  441. crm:P1_is_identified_by ?uri_id ; \
  442. rdfs:label ?label . \
  443. ?uri_id crm:P2_has_type 'Segnatura'; \
  444. rdfs:label ?id . \
  445. } UNION { \
  446. ?event crm:P67_refers_to ?uri . \
  447. ?document crm:P92i_was_brought_into_existence_by ?event ; \
  448. rdfs:label ?label ; \
  449. crm:P1_is_identified_by ?uri_id . \
  450. ?uri_id rdfs:label ?id ; \
  451. crm:P2_has_type 'Segnatura' . \
  452. } UNION { \
  453. ?event crm:P67_refers_to ?uri . \
  454. ?documentation crm:P67_refers_to ?uri ; \
  455. crm:P141_assigned ?card . \
  456. ?document crm:P46_is_composed_of ?card ; \
  457. rdfs:label ?label ; \
  458. crm:P1_is_identified_by ?uri_id . \
  459. ?uri_id rdfs:label ?id ; \
  460. crm:P2_has_type 'Segnatura' . \
  461. } \
  462. OPTIONAL {?event crm:P4_has_time-span ?uri_time_span . \
  463. ?uri_time_span rdfs:label ?time_span} \
  464. } ",
  465. queryOpere : " SELECT DISTINCT ?subject ?label ?nct (group_concat(distinct ?time_span ;separator='-') as ?time_span) \
  466. WHERE {?subject rdf:type crm:E22_Man-Made_Object ; \
  467. rdfs:label ?label ; \
  468. crm:P1_is_identified_by ?uri_nct . \
  469. ?uri_nct rdfs:label ?nct . \
  470. ?production crm:P108_has_produced ?subject . \
  471. OPTIONAL {?production crm:P4_has_time-span ?uri_time_span . \
  472. ?uri_time_span rdfs:label ?time_span } \
  473. ?pc crm:P01_has_domain ?production ; \
  474. crm:P02_has_range <{URI}> } \
  475. GROUP BY ?subject ?label ?nct ",
  476. queryGettatelliEv : " SELECT DISTINCT ?event_type ?time_span \
  477. WHERE { \
  478. VALUES ?uri {<{URI}>} \
  479. ?uri crm:P12i_was_present_at ?event . \
  480. ?event crm:P2_has_type ?uri_event_type ; \
  481. crm:P4_has_time-span ?uri_time_span . \
  482. ?uri_time_span rdfs:label ?time_span . \
  483. ?uri_event_type rdfs:label ?event_type . \
  484. } ",
  485. queryEventi : " SELECT DISTINCT ?event_type ?role ?uri_time_span ?year ?month ?day ?time_span ?place ?uri_place ?coords ?place2 ?uri_place2 ?coords2 ?place3 ?uri_place3 ?coords3 ?place4 ?uri_place4 ?coords4 ?document ?uri_document \
  486. WHERE { \
  487. VALUES ?uri {<{URI}>} \
  488. ?domain crm:P02_has_range ?uri ; \
  489. crm:P14.1_in_the_role_of ?uri_role . \
  490. ?uri_role rdfs:label ?role . \
  491. ?event crm:P01_has_domain ?domain ; \
  492. crm:P2_has_type ?uri_event_type . \
  493. ?uri_event_type rdfs:label ?event_type . \
  494. OPTIONAL {?event crm:P4_has_time-span ?uri_time_span . \
  495. ?uri_time_span rdfs:label ?time_span . \
  496. OPTIONAL {?uri_time_span time:year ?year .} \
  497. OPTIONAL {?uri_time_span time:month ?month .} \
  498. OPTIONAL {?uri_time_span time:day ?day .} \
  499. } \
  500. ?event crm:P7_took_place_at ?uri_location . \
  501. ?uri_location rdfs:label ?place . \
  502. OPTIONAL {?uri_place owl:sameAs ?uri_location . \
  503. ?uri_place crm:P168_place_is_defined_by ?coords } \
  504. OPTIONAL {?uri_location crm:P89_falls_within ?uri_place2 . \
  505. ?uri_place2 rdfs:label ?place2 . \
  506. OPTIONAL {?uri_place2 crm:P168_place_is_defined_by ?coords2 . } \
  507. OPTIONAL {?uri_place2 crm:P89_falls_within ?uri_place3 . \
  508. ?uri_place3 rdfs:label ?place3 . \
  509. OPTIONAL {?uri_place3 crm:P168_place_is_defined_by ?coords3 . \
  510. OPTIONAL {?uri_place3 crm:P89_falls_within ?uri_place4 . \
  511. ?uri_place4 rdfs:label ?place4 . \
  512. OPTIONAL {?uri_place4 crm:P168_place_is_defined_by ?coords4 .} \
  513. } \
  514. } \
  515. }} \
  516. ?document_info crm:P70_documents ?event . \
  517. ?uri_document crm:P128_carries ?document_info ; \
  518. rdfs:label ?document . \
  519. } \
  520. ORDER BY ?year ?month ?day ",
  521. queryCompagnia : " SELECT DISTINCT ?denomination ?occupation ?uri_sede ?uri_place ?sede \
  522. WHERE { \
  523. VALUES ?uri {<{URI}>} \
  524. ?uri rdf:type crm:E74_Group . \
  525. ?uri crm:P2_has_type ?denomination . \
  526. OPTIONAL {?uri schema:hasOccupation ?uri_Occupation . \
  527. ?uri_Occupation rdfs:label ?occupation .} \
  528. OPTIONAL {?uri crm:P74_has_current_or_former_residence ?uri_sede . \
  529. ?uri_sede rdfs:label ?sede . \
  530. OPTIONAL {?uri_sede owl:sameAs ?uri_place . \
  531. ?uri_place crm:P168_place_is_defined_by ?coords .} \
  532. } \
  533. }",
  534. queryContrassegni : " SELECT DISTINCT ?contrassegno ?image \
  535. WHERE { \
  536. VALUES ?uri {<{URI}>} \
  537. ?event crm:P141_assigned ?uri ; \
  538. crm:P140_assigned_attribute_to ?uri_contrassegno . \
  539. ?uri_contrassegno crm:P2_has_type 'Contrassegno'; \
  540. rdfs:label ?contrassegno . \
  541. ?uri_image crm:P138_represents ?uri_contrassegno ; \
  542. crm:P1_is_identified_by ?uri_id . \
  543. ?uri_id rdfs:label ?image . \
  544. } "
  545. },
  546. querySchedaOggetto : {
  547. queryInfo : " SELECT DISTINCT ?g AS ?graph ?uri ?label ?dimension ?consistency ?id ?sigla_registro (group_concat(distinct ?dimension ; separator='<br />') as ?dimensions) ?material (group_concat(distinct ?time_span ;separator='-') as ?time_span) ?location ?uri_owner ?owner ?uri_document ?document ?note \
  548. WHERE { \
  549. VALUES ?uri {<{URI}>} \
  550. GRAPH ?g { ?uri rdfs:label ?label } \
  551. OPTIONAL {?uri crm:P1_is_identified_by ?uri_id . \
  552. ?uri_id rdfs:label ?id ; \
  553. crm:P2_has_type 'Segnatura' .} \
  554. OPTIONAL { ?uri crm:P43_has_dimension ?uri_consistency . \
  555. ?uri_consistency crm:P2_has_type 'Consistenza carte' ; \
  556. rdfs:label ?consistency } \
  557. OPTIONAL { ?uri crm:P43_has_dimension ?uri_dimension . \
  558. ?uri_dimension crm:P2_has_type 'Dimensioni' ; \
  559. rdfs:label ?dimension } \
  560. OPTIONAL { ?uri crm:P139_has_alternative_form ?uri_registro . \
  561. ?uri_registro rdfs:label ?sigla_registro; \
  562. crm:P2_has_type 'Sigla registro' . } \
  563. OPTIONAL { ?uri crm:P45_consist_of ?uri_material . \
  564. ?uri_material rdfs:label ?material } \
  565. OPTIONAL { ?uri crm:P52_has_current_owner ?uri_owner . \
  566. ?uri_owner rdfs:label ?owner . } \
  567. OPTIONAL { ?uri crm:P54_has_current_permanent_location ?location } \
  568. OPTIONAL { ?uri crm:P3_has_note ?uri_note . \
  569. ?uri_note rdfs:label ?note } \
  570. OPTIONAL { ?uri crm:P92i_was_brought_into_existence_by ?creation . \
  571. ?creation crm:P4_has_time-span ?uri_time_span . \
  572. ?uri_time_span rdfs:label ?time_span . } \
  573. OPTIONAL {?uri_document crm:P46_is_composed_of ?uri ; \
  574. rdfs:label ?document .} \
  575. } ",
  576. queryContent : " SELECT DISTINCT ?g AS ?graph ?uri ?titolo ?tipo (group_concat(distinct ?ref ; separator='<br />') as ?ref) \
  577. WHERE { \
  578. VALUES ?object {<{URI}>} \
  579. ?object crm:P128_carries ?uri . \
  580. ?uri rdf:type crm:E73_Information_Object . \
  581. GRAPH ?g { ?uri rdfs:label ?label } \
  582. OPTIONAL {?uri crm:P1_is_identified_by ?uri_titolo . \
  583. ?uri_titolo rdfs:label ?titolo ; \
  584. rdf:type crm:E35_Title . } \
  585. OPTIONAL { ?uri crm:P2_has_type ?uri_tipo . \
  586. ?uri_tipo rdfs:label ?tipo . } \
  587. OPTIONAL { ?uri crm:P67_refers_to ?uri_ref . \
  588. ?uri_ref rdfs:label ?ref . } \
  589. FILTER NOT EXISTS {GRAPH <http://dev.restore.ovi.cnr.it:8890/ovi/datini> { ?uri rdfs:label ?label }}. \
  590. }",
  591. queryOviLetter : " SELECT DISTINCT ?otherId ?InfObj \
  592. WHERE { \
  593. VALUES ?uri {<{URI}>} \
  594. ?uri crm:P1_is_identified_by ?uri_id . \
  595. ?uri_id crm:P2_has_type 'Segnatura' ; \
  596. crm:P139_has_alternative_form ?other_id . \
  597. ?other_id crm:P2_has_type ?uri_type ; \
  598. rdfs:label ?otherId . \
  599. ?uri_type rdfs:label 'Segnatura OVI' . \
  600. OPTIONAL { ?uri crm:P128_carries ?InfObj . \
  601. GRAPH <http://dev.restore.ovi.cnr.it:8890/ovi/datini> {?InfObj rdf:type crm:E73_Information_Object } } \
  602. } ",
  603. queryPersone : " SELECT DISTINCT ?uri_person ?name (group_concat(distinct ?p_type ; separator=', ') as ?types) (group_concat(distinct ?person_note ; separator=', ') as ?types2) ?note \
  604. WHERE { \
  605. VALUES ?uri {<{URI}>} \
  606. { \
  607. ?document crm:P141_assigned ?uri ; \
  608. crm:P67_refers_to ?uri_person . \
  609. ?uri_person foaf:name ?name ; \
  610. crm:P2_has_type ?person_type . \
  611. ?person_type rdfs:label ?p_type . \
  612. } UNION { \
  613. ?uri crm:P92i_was_brought_into_existence_by ?creation . \
  614. ?creation crm:P67_refers_to ?uri_person . \
  615. ?uri_person foaf:name ?name ; \
  616. crm:P67.1_type ?person_type . \
  617. OPTIONAL {?uri_person crm:P3_has_note ?note } \
  618. ?person_type rdfs:label ?p_type . \
  619. } UNION { \
  620. OPTIONAL {?uri crm:P46_is_composed_of ?uri_paper . } \
  621. {?uri_paper crm:P128_carries ?uri_doc } \
  622. UNION \
  623. {?uri crm:P128_carries ?uri_doc } \
  624. ?uri_doc crm:P70_documents ?event ; \
  625. rdfs:label ?document . \
  626. ?uri_obj crm:P128_carries ?uri_doc . \
  627. ?uri_doc rdfs:label ?object . \
  628. ?event crm:P01_has_domain ?domain . \
  629. ?domain crm:P02_has_range ?uri_person ; \
  630. crm:P14.1_in_the_role_of ?uri_role . \
  631. ?uri_role rdfs:label ?p_type . \
  632. ?uri_person rdfs:label ?name . \
  633. OPTIONAL {?uri_person crm:P3_has_note ?uri_person_note . \
  634. ?uri_person_note rdfs:label ?person_note; \
  635. crm:P2_has_type 'Nota collegamento con gettatello' . } \
  636. } \
  637. }",
  638. queryAssocDocs : " SELECT DISTINCT ?card ?doc_type ?name_card \
  639. WHERE { \
  640. VALUES ?uri {<{URI}>} \
  641. ?uri crm:P46_is_composed_of ?card . \
  642. ?card rdfs:label ?name_card . \
  643. OPTIONAL {?card crm:P2_has_type ?doc_type } \
  644. OPTIONAL {?document crm:P141_assigned ?card ; \
  645. crm:P67_refers_to ?uri_person . \
  646. ?uri_person foaf:name ?name ; \
  647. crm:P2_has_type ?person_type . \
  648. ?person_type rdfs:label ?type . \
  649. } \
  650. }",
  651. queryContrassegni : " SELECT DISTINCT ?uri_contrassegno ?contrassegno \
  652. WHERE {VALUES ?uri {<{URI}>} \
  653. ?uri crm:P46_is_composed_of ?uri_paper . \
  654. ?uri_documentation crm:P141_assigned ?uri_paper ; \
  655. crm:P140_assigned_attribute_to ?uri_contrassegno . \
  656. ?uri_contrassegno rdfs:label ?contrassegno . \
  657. }",
  658. queryEventiGettatelli : " SELECT DISTINCT ?uri_obj ?object ?name_event ?event_type ?uri_person ?label ?role ?time_span ?uri_place ?place \
  659. WHERE {VALUES ?uri {<{URI}>} \
  660. OPTIONAL {?uri crm:P46_is_composed_of ?uri_paper . } \
  661. {?uri_paper crm:P128_carries ?uri_doc } \
  662. UNION \
  663. {?uri crm:P128_carries ?uri_doc } \
  664. ?uri_doc crm:P70_documents ?event ; \
  665. rdfs:label ?document . \
  666. ?uri_obj crm:P128_carries ?uri_doc . \
  667. ?uri_doc rdfs:label ?object . \
  668. ?event rdfs:label ?name_event . \
  669. ?event crm:P2_has_type ?uri_event_type . \
  670. ?uri_event_type rdfs:label ?event_type . \
  671. ?event crm:P01_has_domain ?domain . \
  672. ?domain crm:P02_has_range ?uri_person ; \
  673. crm:P14.1_in_the_role_of ?uri_role . \
  674. ?uri_role rdfs:label ?role . \
  675. ?uri_person rdfs:label ?label . \
  676. OPTIONAL {?event crm:P4_has_time-span ?uri_time_span . \
  677. ?uri_time_span rdfs:label ?time_span . } \
  678. OPTIONAL {?event crm:P7_took_place_at ?uri_location . \
  679. ?uri_place owl:sameAs ?uri_location ; \
  680. crm:P168_place_is_defined_by ?coords; \
  681. rdfs:label ?place . } \
  682. }",
  683. queryLuoghiGT : " SELECT DISTINCT ?uri_place ?place \
  684. WHERE {VALUES ?uri {<{URI}>} \
  685. OPTIONAL {?uri crm:P46_is_composed_of ?uri_paper . } \
  686. {?uri_paper crm:P128_carries ?uri_doc } \
  687. UNION \
  688. {?uri crm:P128_carries ?uri_doc } \
  689. ?uri_doc crm:P70_documents ?event . \
  690. ?event crm:P7_took_place_at ?uri_place . \
  691. ?uri_place crm:P168_place_is_defined_by ?coords; \
  692. rdfs:label ?place . \
  693. }",
  694. queryTree : " SELECT DISTINCT ?uri ?label ?uri_document ?document \
  695. WHERE {VALUES ?uri {<{URI}>} \
  696. ?uri rdfs:label ?label ; \
  697. crm:P46_is_composed_of ?uri_document . \
  698. ?uri_document rdfs:label ?document \
  699. }"
  700. },
  701. querySchedaLuogo : {
  702. query : " SELECT DISTINCT ?graph ?uri ?name_place ?coordinates {\
  703. GRAPH ?graph { VALUES ?uri { <{URI}> } \
  704. ?uri crm:P168_place_is_defined_by ?coordinates;\
  705. rdfs:label ?name_place .\
  706. }\
  707. }",
  708. queryRiferimenti : " SELECT DISTINCT ?references {\
  709. <{URI}> owl:sameAs ?references\
  710. }",
  711. queryToponimi : " SELECT DISTINCT ?toponimi {\
  712. <{URI}> crm:P1_is_identified_by ?uri_toponym .\
  713. ?uri_toponym rdfs:label ?toponimi\
  714. }",
  715. queryRicezione : " SELECT DISTINCT ?segnatura ?document_uri ?document_name ?time_span ?InfObj \
  716. WHERE { \
  717. <{URI}> owl:sameAs ?place . \
  718. ?event_to crm:P26_moved_to ?place ; \
  719. rdf:type crm:EL3_Receive_Letter ; \
  720. rdfs:subClassOf ?event . \
  721. ?document_uri crm:P25i_moved_by ?event ; \
  722. rdfs:label ?document_name . \
  723. ?document_uri crm:P1_is_identified_by ?uriSegnatura . \
  724. ?uriSegnatura crm:P2_has_type 'Segnatura' ; \
  725. rdfs:label ?segnatura . \
  726. OPTIONAL {GRAPH <http://dev.restore.ovi.cnr.it:8890/ovi/datini> {?document_uri crm:P128_carries ?InfObj . \
  727. ?InfObj rdf:type crm:E73_Information_Object} }. \
  728. OPTIONAL {?event_to crm:P4_has_time-span ?uri_ts . \
  729. ?uri_ts rdfs:label ?time_span . } \
  730. } ",
  731. queryInvio : " SELECT DISTINCT ?segnatura ?document_uri ?document_name ?time_span ?InfObj \
  732. WHERE { \
  733. <{URI}> owl:sameAs ?place . \
  734. ?event_to crm:P27_moved_from ?place ; \
  735. rdf:type crm:EL2_Send_Letter ; \
  736. rdfs:subClassOf ?event . \
  737. ?document_uri crm:P25i_moved_by ?event ; \
  738. rdfs:label ?document_name . \
  739. ?document_uri crm:P1_is_identified_by ?uriSegnatura . \
  740. ?uriSegnatura crm:P2_has_type 'Segnatura' ; \
  741. rdfs:label ?segnatura . \
  742. OPTIONAL {GRAPH <http://dev.restore.ovi.cnr.it:8890/ovi/datini> {?document_uri crm:P128_carries ?InfObj . \
  743. ?InfObj rdf:type crm:E73_Information_Object} }. \
  744. OPTIONAL {?event_to crm:P4_has_time-span ?uri_ts . \
  745. ?uri_ts rdfs:label ?time_span . } \
  746. }",
  747. queryCitazione : " SELECT DISTINCT ?segnatura ?document_uri ?document_name SAMPLE(?time_span) AS ?time_span ?InfObj \
  748. WHERE { \
  749. VALUES ?uri {<{URI}>} \
  750. {?uri crm:P1_is_identified_by ?toponym . \
  751. ?InfObj crm:P67_refers_to ?toponym . \
  752. ?document_uri crm:P128_carries ?InfObj ; \
  753. rdfs:label ?document_name . \
  754. OPTIONAL {?document_uri crm:P1_is_identified_by ?uriSegnatura . \
  755. ?uriSegnatura crm:P2_has_type 'Segnatura' ; \
  756. rdfs:label ?segnatura . } \
  757. OPTIONAL {?document_uri crm:P25i_moved_by ?event . \
  758. ?event_send rdfs:subClassOf ?event ; \
  759. rdf:type crm:EL2_Send_Letter ; \
  760. crm:P4_has_time-span ?uri_ts . \
  761. ?uri_ts rdfs:label ?time_span . } \
  762. } UNION { \
  763. ?event_gt crm:P7_took_place_at ?uri . \
  764. ?document_inf crm:P70_documents ?event_gt . \
  765. ?document_uri crm:P128_carries ?document_inf ; \
  766. crm:P1_is_identified_by ?uriSegnatura ; \
  767. rdfs:label ?document_name . \
  768. ?uriSegnatura rdfs:label ?segnatura . \
  769. } \
  770. } ",
  771. queryPersone : " SELECT DISTINCT ?role ?range SAMPLE(?name) AS ?label COUNT(?range) AS ?count \
  772. WHERE{ \
  773. VALUES ?uri {<{URI}>} \
  774. {?place owl:sameAs ?uri . \
  775. ?event_to crm:P26_moved_to ?place ; \
  776. rdf:type crm:EL3_Receive_Letter ; \
  777. crm:P01_has_domain ?domain . \
  778. ?domain crm:P02_has_range ?range ; \
  779. crm:P14.1_in_the_role_of ?uri_role . \
  780. ?uri_role rdfs:label ?role . \
  781. ?range rdfs:label ?lb ; \
  782. foaf:name ?name . \
  783. } UNION { \
  784. ?place owl:sameAs ?uri . \
  785. ?event_to crm:P27_moved_from ?place ; \
  786. rdf:type crm:EL2_Send_Letter ; \
  787. crm:P01_has_domain ?domain . \
  788. ?domain crm:P02_has_range ?range ; \
  789. crm:P14.1_in_the_role_of ?uri_role . \
  790. ?uri_role rdfs:label ?role . \
  791. ?range rdfs:label ?lb ; \
  792. foaf:name ?name . \
  793. } UNION { \
  794. ?event_gt crm:P7_took_place_at ?uri ; \
  795. crm:P01_has_domain ?domain . \
  796. ?domain crm:P02_has_range ?range ; \
  797. crm:P14.1_in_the_role_of ?uri_role . \
  798. ?uri_role rdfs:label ?role . \
  799. ?range rdfs:label ?name . \
  800. } \
  801. } GROUP BY ?role ?range \
  802. ORDER BY ?label",
  803. queryCount : " SELECT ?place ?label COUNT(?label) AS ?Count \
  804. WHERE{ \
  805. ?place_to owl:sameAs <{URI}> . \
  806. ?event_to crm:P26_moved_to ?place_to ; \
  807. rdf:type crm:EL3_Receive_Letter ; \
  808. rdfs:subClassOf ?event . \
  809. ?event_from rdfs:subClassOf ?event ; \
  810. rdf:type crm:EL2_Send_Letter ; \
  811. crm:P27_moved_from ?place . \
  812. ?place rdfs:label ?label \
  813. } \
  814. ORDER BY DESC (?Count)",
  815. queryCount2 : " SELECT ?place ?label COUNT(?label) AS ?Count \
  816. WHERE{ \
  817. ?place_from owl:sameAs <{URI}> . \
  818. ?event_from crm:P27_moved_from ?place_from ; \
  819. rdf:type crm:EL2_Send_Letter ; \
  820. rdfs:subClassOf ?event . \
  821. ?event_to rdfs:subClassOf ?event ; \
  822. rdf:type crm:EL2_Send_Letter ; \
  823. crm:P27_moved_from ?place . \
  824. ?place rdfs:label ?label . \
  825. } \
  826. ORDER BY DESC (?Count) "
  827. },
  828. querySchedaOpera : {
  829. queryInfo : " SELECT DISTINCT ?graph ?uri ?identifier ?label ?title ?uriType ?type ?uriOwner ?current_owner ?current_location ?subject (group_concat(distinct ?value ; separator='x') as ?dimensions) SAMPLE(?unit) AS ?unit (GROUP_CONCAT(DISTINCT CONCAT(?uriMaterial, '; ', ?material) ; SEPARATOR = '<br />') AS ?Materials) ?condition ?note \
  830. WHERE { \
  831. VALUES ?uri {<{URI}>} \
  832. GRAPH ?graph {?uri rdfs:label ?label} \
  833. OPTIONAL {?uri crm:P3_has_note ?note } \
  834. ?uri crm:P128_carries ?Inf_Obj . \
  835. OPTIONAL {?Inf_Obj crm:P1_is_identified_by ?uriTitle . \
  836. ?uriTitle rdf:type crm:E35_Title; \
  837. rdfs:label ?title } \
  838. OPTIONAL {?Inf_Obj crm:P2_has_type ?uriType . \
  839. ?uriType rdfs:label ?type } \
  840. OPTIONAL {?uri crm:P43_has_dimension ?uriDimension . \
  841. ?uriDimension crm:P90_has_value ?value; \
  842. crm:P91_has_unit ?uri_unit . \
  843. ?uri_unit rdfs:label ?unit } \
  844. OPTIONAL {?uri crm:P1_is_identified_by ?uriIdentifier . \
  845. ?uriIdentifier rdfs:label ?identifier } \
  846. OPTIONAL {?uri crm:P45_consists_of ?uriMaterial . \
  847. ?uriMaterial rdfs:label ?material } \
  848. OPTIONAL {?uri crm:P44_has_condition ?uriCondition . \
  849. ?uriCondition crm:P2_has_type ?condition} \
  850. OPTIONAL {?uri crm:P54_has_current_permanent_location ?current_location } \
  851. OPTIONAL {?uri crm:P62_depicts ?uriSubject . \
  852. ?uriSubject rdfs:label ?subject; \
  853. crm:P2_has_type 'Identificazione Iconografica' .} \
  854. OPTIONAL {?uri crm:P52_has_current_owner ?uriOwner . \
  855. ?uriOwner rdfs:label ?current_owner } \
  856. }",
  857. queryProduction : " SELECT DISTINCT (GROUP_CONCAT(DISTINCT CONCAT(?uriPerson, '; ', ?person, '; ', ?role) ; SEPARATOR = '<br />') AS ?Partecipants) (group_concat(distinct ?time_span ;separator='-') as ?time) (GROUP_CONCAT(DISTINCT CONCAT(?uriTecne, '; ', ?technique) ; SEPARATOR = '<br />') AS ?techniques) \
  858. WHERE { \
  859. VALUES ?uri {<{URI}>} \
  860. ?uri crm:P128_carries ?Information_Object . \
  861. ?Information_Object crm:P108i_was_produced_by ?Production . \
  862. OPTIONAL {?Production crm:P4_has_time-span ?uriTS ; \
  863. crm:P32_used_general_technique ?uriTecne . \
  864. ?uriTS rdfs:label ?time_span . \
  865. ?uriTecne rdfs:label ?technique} \
  866. OPTIONAL {?pc crm:P01_has_domain ?Production ; \
  867. crm:P02_has_range ?uriPerson ; \
  868. crm:P14.1_in_the_role_of ?uriRole . \
  869. ?uriPerson rdfs:label ?person . \
  870. ?uriRole rdfs:label ?role} \
  871. }"
  872. },
  873. queryTimeSpace : {
  874. querySpace : " SELECT DISTINCT ?uri_person ?person ?event ?uri_place ?place ?coords ?time_span ?year ?month ?day \
  875. WHERE {?uri_event rdfs:label ?event ; \
  876. crm:P01_has_domain ?pc ; \
  877. crm:P7_took_place_at ?uri_NTplace ; \
  878. crm:P4_has_time-span ?uri_time_span . \
  879. ?pc crm:P02_has_range ?uri_person . \
  880. ?uri_person rdfs:label ?person . \
  881. ?uri_place owl:sameAs ?uri_NTplace . \
  882. ?uri_place crm:P168_place_is_defined_by ?coords ; \
  883. rdfs:label ?place . \
  884. ?uri_time_span rdfs:label ?time_span ; \
  885. time:year ?year . \
  886. OPTIONAL {?uri_time_span time:month ?month} \
  887. OPTIONAL {?uri_time_span time:day ?day} \
  888. } ORDER BY ?year ?month ?day",
  889. queryTime1 : " SELECT DISTINCT ?event ?uri_place ?place ?coords ?time_span ?month ?day \
  890. WHERE {?uri_event rdfs:label ?event ; \
  891. crm:P01_has_domain ?pc ; \
  892. crm:P7_took_place_at ?uri_NTplace ; \
  893. crm:P4_has_time-span ?uri_time_span . \
  894. ?pc crm:P02_has_range ?uri_person . \
  895. ?uri_person rdfs:label ?person . \
  896. ?uri_place owl:sameAs ?uri_NTplace . \
  897. ?uri_place crm:P168_place_is_defined_by ?coords ; \
  898. rdfs:label ?place . \
  899. ?uri_time_span rdfs:label ?time_span ; \
  900. time:year {YEAR} . \
  901. OPTIONAL {?uri_time_span time:month ?month} \
  902. OPTIONAL {?uri_time_span time:day ?day} \
  903. } ORDER BY ?month ?day",
  904. queryTime2 : " SELECT DISTINCT ?uri_person ?person ?event ?uri_place ?place ?coords ?year ?month ?day \
  905. WHERE {?uri_event rdfs:label ?event ; \
  906. crm:P01_has_domain ?pc ; \
  907. crm:P7_took_place_at ?uri_NTplace ; \
  908. crm:P4_has_time-span ?uri_time_span . \
  909. ?pc crm:P02_has_range ?uri_person . \
  910. ?uri_person rdfs:label ?person . \
  911. ?uri_place owl:sameAs ?uri_NTplace . \
  912. ?uri_place crm:P168_place_is_defined_by ?coords ; \
  913. rdfs:label ?place . \
  914. ?uri_time_span rdfs:label '{DATE}' . \
  915. OPTIONAL {?uri_time_span time:year ?year} \
  916. OPTIONAL {?uri_time_span time:month ?month} \
  917. OPTIONAL {?uri_time_span time:day ?day} \
  918. } ORDER BY ?year ?month ?day",
  919. queryTimeLetters : " SELECT DISTINCT ?uri_subject ?subject ?uri_place ?place ?coords ?time_span ?year ?month ?day \
  920. WHERE {?uri_subject rdf:type crm:E22_Man-Made_Object ; \
  921. rdfs:label ?subject ; \
  922. crm:P25i_moved_by ?event1 . \
  923. ?send1 rdfs:subClassOf ?event1 ; \
  924. crm:P4_has_time-span ?uri_time_span . \
  925. ?uri_time_span rdfs:label ?time_span ; \
  926. time:year ?year ; \
  927. time:month ?month ; \
  928. time:day ?day . \
  929. ?uri_subject crm:P25i_moved_by ?event2 . \
  930. ?send2 rdfs:subClassOf ?event2 ; \
  931. crm:P27_moved_from ?uri_placeNT . \
  932. ?uri_place ?property ?uri_placeNT ; \
  933. rdfs:label ?place ; \
  934. crm:P168_place_is_defined_by ?coords \
  935. } ORDER BY ?year ?month ?day"
  936. },
  937. queryRicercaAvanzata : {
  938. queryOggetto : "SELECT DISTINCT ?graph AS ?g ?uri ?name ?identifier ?material ?owner ?type ?start_date ?end_date \
  939. WHERE {GRAPH ?graph {?uri rdf:type crm:E22_Man-Made_Object} \
  940. ?uri rdfs:label ?name . \
  941. OPTIONAL {?uri crm:P1_is_identified_by ?uri_identifier . \
  942. ?uri_identifier rdfs:label ?identifier . } \
  943. OPTIONAL {?uri crm:P45_consist_of ?uri_material . \
  944. ?uri_material rdfs:label ?material . } \
  945. OPTIONAL {?uri crm:P2_has_type ?uri_type . \
  946. ?uri_type rdfs:label ?type . } \
  947. OPTIONAL {?uri crm:P52_has_current_owner ?uri_owner . \
  948. ?uri_owner rdfs:label ?owner . } \
  949. OPTIONAL {?uri crm:P92i_was_brought_into_existence_by ?creationI . \
  950. ?creationI crm:P2_has_type 'Inizio'^^<http://www.w3.org/2001/XMLSchema#string> ; \
  951. crm:P4_has_time-span ?uri_time_spanI . \
  952. ?uri_time_spanI rdfs:label ?start_date . } \
  953. OPTIONAL {?uri crm:P92i_was_brought_into_existence_by ?creationF . \
  954. ?creationF crm:P2_has_type 'Fine'^^<http://www.w3.org/2001/XMLSchema#string> ; \
  955. crm:P4_has_time-span ?uri_time_spanF . \
  956. ?uri_time_spanF rdfs:label ?end_date . } \
  957. }",
  958. queryPersona : " SELECT DISTINCT ?graph AS ?g ?uri ?name ?givenName ?familyName ?patronymic ?provenienza ?alias ?otherName ?person_type ?occupation ?qualification ?Death_Date ?Death_Place ?Birth_TS ?Birth_Place \
  959. WHERE { \
  960. GRAPH ?graph {?uri rdfs:label ?label} \
  961. ?uri foaf:name ?name . \
  962. ?uri foaf:givenName ?givenName . \
  963. OPTIONAL {?uri foaf:familyName ?familyName} \
  964. OPTIONAL {?uri foaf:gender ?gender} \
  965. OPTIONAL {?uri person:patronymicName ?patronymic } \
  966. OPTIONAL {?uri crm:P74_has_current_or_former_residence ?uri_provenienza . \
  967. ?uri_provenienza crm:P2_has_type 'Provenienza'; \
  968. rdfs:label ?provenienza . } \
  969. OPTIONAL {?uri crm:P2_has_type ?uri_person_type . \
  970. ?uri_person_type rdfs:label ?person_type } \
  971. OPTIONAL {?uri schema:hasOccupation ?uriOccupation . \
  972. ?uriOccupation rdf:type schema:Occupation; \
  973. rdfs:label ?occupation } \
  974. OPTIONAL {?uri schema:honorificPrefix ?qualification} \
  975. OPTIONAL {?uri crm:P100i_died_in ?Death . \
  976. OPTIONAL {?Death crm:P4_has_time-span ?Death_TS . \
  977. ?Death_TS rdfs:label ?Death_Date . } \
  978. OPTIONAL {?Death crm:P7_took_place_at ?Place_D . \
  979. ?Place_D rdfs:label ?Death_Place } \
  980. } \
  981. OPTIONAL {?uri crm:P98i_was_born ?Birth . \
  982. OPTIONAL {?Birth crm:P4_has_time-span ?Birth_TS . \
  983. ?Birth_TS rdfs:label ?Birth_Date . } \
  984. OPTIONAL {?Birth crm:P7_took_place_at ?Place_B . \
  985. ?Place_B rdfs:label ?Birth_Place } \
  986. } \
  987. OPTIONAL {?uri schema:alternateName ?alias . } \
  988. OPTIONAL {?uri owl:sameAs ?variant . \
  989. ?variant foaf:name ?otherName . } \
  990. } ",
  991. queryOpera : " SELECT DISTINCT ?graph AS ?g ?uri ?name ?identifier ?material ?owner ?technique ?name_artist (group_concat(distinct ?subject ;separator=', ') as ?keywords) ?start_date ?end_date \
  992. WHERE {GRAPH ?graph {?uri rdf:type crm:E22_Man-Made_Object} \
  993. ?uri rdfs:label ?name ; \
  994. crm:P2_has_type 'Opera d\'Arte' . \
  995. OPTIONAL {?uri crm:P1_is_identified_by ?uri_identifier . \
  996. ?uri_identifier rdfs:label ?identifier . } \
  997. OPTIONAL {?uri crm:P45_consists_of ?uri_material . \
  998. ?uri_material rdfs:label ?material . } \
  999. OPTIONAL {?uri crm:P52_has_current_owner ?uri_owner . \
  1000. ?uri_owner rdfs:label ?owner . } \
  1001. ?production crm:P108_has_produced ?uri . \
  1002. OPTIONAL {?production crm:P32_used_general_technique ?uri_teche . \
  1003. ?uri_teche rdfs:label ?technique . } \
  1004. OPTIONAL {?pc crm:P01_has_domain ?production ; \
  1005. crm:P02_has_range ?uri_person . \
  1006. ?uri_person rdfs:label ?name_artist .} \
  1007. OPTIONAL {?uri crm:P62_depicts ?uri_subject . \
  1008. ?uri_subject rdfs:label ?subject . } \
  1009. OPTIONAL {?productionI crm:P108_has_produced ?uri ; \
  1010. crm:P2_has_type 'Inizio'^^<http://www.w3.org/2001/XMLSchema#string> ; \
  1011. crm:P4_has_time-span ?uri_time_spanI . \
  1012. ?uri_time_spanI rdfs:label ?start_date . } \
  1013. OPTIONAL {?productionF crm:P108_has_produced ?uri ; \
  1014. crm:P2_has_type 'Fine'^^<http://www.w3.org/2001/XMLSchema#string> ; \
  1015. crm:P4_has_time-span ?uri_time_spanF . \
  1016. ?uri_time_spanF rdfs:label ?end_date . } \
  1017. }",
  1018. queryLettere : " SELECT DISTINCT * \
  1019. WHERE { GRAPH ?graph {?uri rdf:type crm:E73_Information_Object} \
  1020. ?uri crm:P2_has_type ?uri_type . \
  1021. ?uri_type rdfs:label 'lettera' . \
  1022. ?uri crm:P72_has_language ?uri_language . \
  1023. ?uri_language rdfs:label ?language ; \
  1024. crm:P3_has_note ?uri_area . \
  1025. ?uri_area rdfs:label ?linguistic_area . \
  1026. ?uri_documentation crm:P70_documents ?uri ; \
  1027. crm:P1_is_identified_by ?uri_editionL . \
  1028. ?uri_editionL rdfs:label ?long_edition ; \
  1029. crm:P139_has_alternative_form ?uri_editionS . \
  1030. ?uri_editionS rdfs:label ?short_edition . \
  1031. ?uri_doc crm:P128_carries ?uri . \
  1032. GRAPH <http://dev.restore.ovi.cnr.it:8890/aspo/datini> {?uri_doc crm:P25i_moved_by ?event} \
  1033. ?send rdfs:subClassOf ?event ; \
  1034. rdf:type crm:EL2_Send_Letter . \
  1035. OPTIONAL {?send crm:P4_has_time-span ?uri_time_spanS. \
  1036. ?uri_time_spanS rdfs:label ?start_date . } \
  1037. OPTIONAL {?send crm:P27_moved_from ?uri_placeS . \
  1038. ?uri_placeS rdfs:label ?start_place } \
  1039. OPTIONAL {?send crm:P01_has_domain ?pcS . \
  1040. ?pcS crm:P02_has_range ?uri_sender . \
  1041. ?uri_sender rdfs:label ?mittente .} \
  1042. ?receive rdfs:subClassOf ?event ; \
  1043. rdf:type crm:EL3_Receive_Letter . \
  1044. OPTIONAL {?receive crm:P4_has_time-span ?uri_time_spanE . \
  1045. ?uri_time_spanE rdfs:label ?end_date . } \
  1046. OPTIONAL {?received crm:P26_moved_to ?uri_placeE . \
  1047. ?uri_placeE rdfs:label ?end_place } \
  1048. OPTIONAL {?receive crm:P01_has_domain ?pcR . \
  1049. ?pcR crm:P02_has_range ?uri_receiver . \
  1050. ?uri_receiver rdfs:label ?destinatario .} \
  1051. ?uri crm:P67_refers_to ?uri_lemma . \
  1052. ?uri_lemma rdfs:label ?lemma . \
  1053. }"
  1054. },
  1055. queryCustom : {
  1056. queryTipo : " SELECT DISTINCT ?subject ?label \
  1057. WHERE {GRAPH ?g {?subject rdf:type crm:E22_Man-Made_Object} \
  1058. ?subject crm:P2_has_type '{TYPE}' ; \
  1059. rdfs:label ?label . \
  1060. }",
  1061. queryOccupazione : "SELECT DISTINCT ?subject ?name ?id ?givenName ?familyName ?patronymic ?provenienza SAMPLE(?occupation) AS ?occupation \
  1062. WHERE {GRAPH ?g {?subject rdf:type crm:E21_Person} \
  1063. ?subject foaf:name ?name . \
  1064. OPTIONAL {?subject crm:P1_is_identified_by ?id . \
  1065. ?id rdfs:label ?identifier } \
  1066. OPTIONAL {?subject foaf:givenName ?givenName} \
  1067. OPTIONAL {?subject foaf:familyName ?familyName} \
  1068. OPTIONAL {?subject person:patronymicName ?patronymic } \
  1069. OPTIONAL {?subject crm:P74_has_current_or_former_residence ?uri_provenienza . \
  1070. ?uri_provenienza crm:P2_has_type 'Provenienza'; \
  1071. rdfs:label ?provenienza . } \
  1072. ?subject schema:hasOccupation ?uri_occupation . \
  1073. ?uri_occupation rdfs:label ?occupation . \
  1074. ?occupation bif:contains '\"{WORD}\"' \
  1075. }",
  1076. queryOpereGrafo : "SELECT DISTINCT ?subject ?label \
  1077. WHERE {GRAPH <{GRAPH}> {?subject rdf:type crm:E22_Man-Made_Object } \
  1078. ?subject rdfs:label ?label} "
  1079. }
  1080. };