managerQuery.js 52 KB

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