managerQuery.js 55 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166
  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 ?uri ?uri_image ?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. ?uri rdf:type crm:E22_Man-Made_Object . \
  552. OPTIONAL {?uri crm:P1_is_identified_by ?uri_id . \
  553. ?uri_id rdfs:label ?id ; \
  554. crm:P2_has_type 'Segnatura' .} \
  555. OPTIONAL { ?uri crm:P43_has_dimension ?uri_consistency . \
  556. ?uri_consistency crm:P2_has_type 'Consistenza carte' ; \
  557. rdfs:label ?consistency } \
  558. OPTIONAL { ?uri crm:P43_has_dimension ?uri_dimension . \
  559. ?uri_dimension crm:P2_has_type 'Dimensioni' ; \
  560. rdfs:label ?dimension } \
  561. OPTIONAL { ?uri crm:P139_has_alternative_form ?uri_registro . \
  562. ?uri_registro rdfs:label ?sigla_registro; \
  563. crm:P2_has_type 'Sigla registro' . } \
  564. OPTIONAL { ?uri crm:P45_consist_of ?uri_material . \
  565. ?uri_material rdfs:label ?material } \
  566. OPTIONAL { ?uri crm:P52_has_current_owner ?uri_owner . \
  567. ?uri_owner rdfs:label ?owner . } \
  568. OPTIONAL { ?uri crm:P54_has_current_permanent_location ?location } \
  569. OPTIONAL { ?uri crm:P3_has_note ?uri_note . \
  570. ?uri_note rdfs:label ?note } \
  571. OPTIONAL { ?uri crm:P92i_was_brought_into_existence_by ?creation . \
  572. ?creation crm:P4_has_time-span ?uri_time_span . \
  573. ?uri_time_span rdfs:label ?time_span . } \
  574. OPTIONAL {?uri_document crm:P46_is_composed_of ?uri ; \
  575. rdfs:label ?document .} \
  576. } ",
  577. queryContent : " SELECT DISTINCT ?g AS ?graph ?uri ?titolo ?tipo (group_concat(distinct ?ref ; separator='<br />') as ?ref) \
  578. WHERE { \
  579. VALUES ?object {<{URI}>} \
  580. ?object crm:P128_carries ?uri . \
  581. ?uri rdf:type crm:E73_Information_Object . \
  582. GRAPH ?g { ?uri rdfs:label ?label } \
  583. OPTIONAL {?uri crm:P1_is_identified_by ?uri_titolo . \
  584. ?uri_titolo rdfs:label ?titolo ; \
  585. rdf:type crm:E35_Title . } \
  586. OPTIONAL { ?uri crm:P2_has_type ?uri_tipo . \
  587. ?uri_tipo rdfs:label ?tipo . } \
  588. OPTIONAL { ?uri crm:P67_refers_to ?uri_ref . \
  589. ?uri_ref rdfs:label ?ref . } \
  590. FILTER NOT EXISTS {GRAPH <http://dev.restore.ovi.cnr.it:8890/ovi/datini> { ?uri rdfs:label ?label }}. \
  591. }",
  592. queryOviLetter : " SELECT DISTINCT ?otherId ?InfObj \
  593. WHERE { \
  594. VALUES ?uri {<{URI}>} \
  595. ?uri crm:P1_is_identified_by ?uri_id . \
  596. ?uri_id crm:P2_has_type 'Segnatura' ; \
  597. crm:P139_has_alternative_form ?other_id . \
  598. ?other_id crm:P2_has_type ?uri_type ; \
  599. rdfs:label ?otherId . \
  600. ?uri_type rdfs:label 'Segnatura OVI' . \
  601. OPTIONAL { ?uri crm:P128_carries ?InfObj . \
  602. GRAPH <http://dev.restore.ovi.cnr.it:8890/ovi/datini> {?InfObj rdf:type crm:E73_Information_Object } } \
  603. } ",
  604. queryPersone : " SELECT DISTINCT ?uri_person ?name (group_concat(distinct ?p_type ; separator=', ') as ?types) (group_concat(distinct ?person_note ; separator=', ') as ?types2) ?note \
  605. WHERE { \
  606. VALUES ?uri {<{URI}>} \
  607. { \
  608. ?document crm:P141_assigned ?uri ; \
  609. crm:P67_refers_to ?uri_person . \
  610. ?uri_person foaf:name ?name ; \
  611. crm:P2_has_type ?person_type . \
  612. ?person_type rdfs:label ?p_type . \
  613. } UNION { \
  614. ?uri crm:P92i_was_brought_into_existence_by ?creation . \
  615. ?creation crm:P67_refers_to ?uri_person . \
  616. ?uri_person foaf:name ?name ; \
  617. crm:P67.1_type ?person_type . \
  618. OPTIONAL {?uri_person crm:P3_has_note ?note } \
  619. ?person_type rdfs:label ?p_type . \
  620. } UNION { \
  621. OPTIONAL {?uri crm:P46_is_composed_of ?uri_paper . } \
  622. {?uri_paper crm:P128_carries ?uri_doc } \
  623. UNION \
  624. {?uri crm:P128_carries ?uri_doc } \
  625. ?uri_doc crm:P70_documents ?event ; \
  626. rdfs:label ?document . \
  627. ?uri_obj crm:P128_carries ?uri_doc . \
  628. ?uri_doc rdfs:label ?object . \
  629. ?event crm:P01_has_domain ?domain . \
  630. ?domain crm:P02_has_range ?uri_person ; \
  631. crm:P14.1_in_the_role_of ?uri_role . \
  632. ?uri_role rdfs:label ?p_type . \
  633. ?uri_person rdfs:label ?name . \
  634. OPTIONAL {?uri_person crm:P3_has_note ?uri_person_note . \
  635. ?uri_person_note rdfs:label ?person_note; \
  636. crm:P2_has_type 'Nota collegamento con gettatello' . } \
  637. } \
  638. }",
  639. queryAssocDocs : " SELECT DISTINCT ?card ?doc_type ?name_card \
  640. WHERE { \
  641. VALUES ?uri {<{URI}>} \
  642. ?uri crm:P46_is_composed_of ?card . \
  643. ?card rdfs:label ?name_card . \
  644. OPTIONAL {?card crm:P2_has_type ?doc_type } \
  645. OPTIONAL {?document crm:P141_assigned ?card ; \
  646. crm:P67_refers_to ?uri_person . \
  647. ?uri_person foaf:name ?name ; \
  648. crm:P2_has_type ?person_type . \
  649. ?person_type rdfs:label ?type . \
  650. } \
  651. }",
  652. queryContrassegni : " SELECT DISTINCT ?g ?uri ?contrassegno ?image ?uri_person ?gettatello\
  653. WHERE {VALUES ?uri {<{URI}>} \
  654. GRAPH ?g {?uri ?p ?o} \
  655. ?uri crm:P138_represents ?uri_contrassegno ; \
  656. crm:P1_is_identified_by ?uri_id . \
  657. ?uri_id rdfs:label ?image . \
  658. ?uri_contrassegno rdfs:label ?contrassegno . \
  659. ?uri_documentation crm:P140_assigned_attribute_to ?uri_contrassegno ; \
  660. crm:P141_assigned ?uri_person . \
  661. ?uri_person rdfs:label ?gettatello . \
  662. }",
  663. queryEventiGettatelli : " SELECT DISTINCT ?uri_obj ?object ?name_event ?event_type ?uri_person ?label ?role ?time_span ?uri_place ?place \
  664. WHERE {VALUES ?uri {<{URI}>} \
  665. OPTIONAL {?uri crm:P46_is_composed_of ?uri_paper . } \
  666. {?uri_paper crm:P128_carries ?uri_doc } \
  667. UNION \
  668. {?uri crm:P128_carries ?uri_doc } \
  669. ?uri_doc crm:P70_documents ?event ; \
  670. rdfs:label ?document . \
  671. ?uri_obj crm:P128_carries ?uri_doc . \
  672. ?uri_doc rdfs:label ?object . \
  673. ?event rdfs:label ?name_event . \
  674. ?event crm:P2_has_type ?uri_event_type . \
  675. ?uri_event_type rdfs:label ?event_type . \
  676. ?event crm:P01_has_domain ?domain . \
  677. ?domain crm:P02_has_range ?uri_person ; \
  678. crm:P14.1_in_the_role_of ?uri_role . \
  679. ?uri_role rdfs:label ?role . \
  680. ?uri_person rdfs:label ?label . \
  681. OPTIONAL {?event crm:P4_has_time-span ?uri_time_span . \
  682. ?uri_time_span rdfs:label ?time_span . } \
  683. OPTIONAL {?event crm:P7_took_place_at ?uri_location . \
  684. ?uri_place owl:sameAs ?uri_location ; \
  685. crm:P168_place_is_defined_by ?coords; \
  686. rdfs:label ?place . } \
  687. }",
  688. queryLuoghiGT : " SELECT DISTINCT ?uri_place ?place \
  689. WHERE {VALUES ?uri {<{URI}>} \
  690. OPTIONAL {?uri crm:P46_is_composed_of ?uri_paper . } \
  691. {?uri_paper crm:P128_carries ?uri_doc } \
  692. UNION \
  693. {?uri crm:P128_carries ?uri_doc } \
  694. ?uri_doc crm:P70_documents ?event . \
  695. ?event crm:P7_took_place_at ?uri_place . \
  696. ?uri_place crm:P168_place_is_defined_by ?coords; \
  697. rdfs:label ?place . \
  698. }",
  699. queryTree : " SELECT DISTINCT ?uri ?label ?uri_document ?document \
  700. WHERE {VALUES ?uri {<{URI}>} \
  701. ?uri rdfs:label ?label ; \
  702. crm:P46_is_composed_of ?uri_document . \
  703. ?uri_document rdfs:label ?document \
  704. }"
  705. },
  706. querySchedaLuogo : {
  707. query : " SELECT DISTINCT ?graph ?uri ?name_place ?coordinates {\
  708. GRAPH ?graph { VALUES ?uri { <{URI}> } \
  709. ?uri crm:P168_place_is_defined_by ?coordinates;\
  710. rdfs:label ?name_place .\
  711. }\
  712. }",
  713. queryRiferimenti : " SELECT DISTINCT ?references {\
  714. <{URI}> owl:sameAs ?references\
  715. }",
  716. queryToponimi : " SELECT DISTINCT ?toponimi {\
  717. <{URI}> crm:P1_is_identified_by ?uri_toponym .\
  718. ?uri_toponym rdfs:label ?toponimi\
  719. }",
  720. queryRicezione : " SELECT DISTINCT ?segnatura ?document_uri ?document_name ?time_span ?InfObj \
  721. WHERE { \
  722. <{URI}> owl:sameAs ?place . \
  723. ?event_to crm:P26_moved_to ?place ; \
  724. rdf:type crm:EL3_Receive_Letter ; \
  725. rdfs:subClassOf ?event . \
  726. ?document_uri crm:P25i_moved_by ?event ; \
  727. rdfs:label ?document_name . \
  728. ?document_uri crm:P1_is_identified_by ?uriSegnatura . \
  729. ?uriSegnatura crm:P2_has_type 'Segnatura' ; \
  730. rdfs:label ?segnatura . \
  731. OPTIONAL {GRAPH <http://dev.restore.ovi.cnr.it:8890/ovi/datini> {?document_uri crm:P128_carries ?InfObj . \
  732. ?InfObj rdf:type crm:E73_Information_Object} }. \
  733. OPTIONAL {?event_to crm:P4_has_time-span ?uri_ts . \
  734. ?uri_ts rdfs:label ?time_span . } \
  735. } ",
  736. queryInvio : " SELECT DISTINCT ?segnatura ?document_uri ?document_name ?time_span ?InfObj \
  737. WHERE { \
  738. <{URI}> owl:sameAs ?place . \
  739. ?event_to crm:P27_moved_from ?place ; \
  740. rdf:type crm:EL2_Send_Letter ; \
  741. rdfs:subClassOf ?event . \
  742. ?document_uri crm:P25i_moved_by ?event ; \
  743. rdfs:label ?document_name . \
  744. ?document_uri crm:P1_is_identified_by ?uriSegnatura . \
  745. ?uriSegnatura crm:P2_has_type 'Segnatura' ; \
  746. rdfs:label ?segnatura . \
  747. OPTIONAL {GRAPH <http://dev.restore.ovi.cnr.it:8890/ovi/datini> {?document_uri crm:P128_carries ?InfObj . \
  748. ?InfObj rdf:type crm:E73_Information_Object} }. \
  749. OPTIONAL {?event_to crm:P4_has_time-span ?uri_ts . \
  750. ?uri_ts rdfs:label ?time_span . } \
  751. }",
  752. queryCitazione : " SELECT DISTINCT ?segnatura ?document_uri ?document_name SAMPLE(?time_span) AS ?time_span ?InfObj \
  753. WHERE { \
  754. VALUES ?uri {<{URI}>} \
  755. {?uri crm:P1_is_identified_by ?toponym . \
  756. ?InfObj crm:P67_refers_to ?toponym . \
  757. ?document_uri crm:P128_carries ?InfObj ; \
  758. rdfs:label ?document_name . \
  759. OPTIONAL {?document_uri crm:P1_is_identified_by ?uriSegnatura . \
  760. ?uriSegnatura crm:P2_has_type 'Segnatura' ; \
  761. rdfs:label ?segnatura . } \
  762. OPTIONAL {?document_uri crm:P25i_moved_by ?event . \
  763. ?event_send rdfs:subClassOf ?event ; \
  764. rdf:type crm:EL2_Send_Letter ; \
  765. crm:P4_has_time-span ?uri_ts . \
  766. ?uri_ts rdfs:label ?time_span . } \
  767. } UNION { \
  768. ?event_gt crm:P7_took_place_at ?uri . \
  769. ?document_inf crm:P70_documents ?event_gt . \
  770. ?document_uri crm:P128_carries ?document_inf ; \
  771. crm:P1_is_identified_by ?uriSegnatura ; \
  772. rdfs:label ?document_name . \
  773. ?uriSegnatura rdfs:label ?segnatura . \
  774. } \
  775. } ",
  776. queryPersone : " SELECT DISTINCT ?role ?range SAMPLE(?name) AS ?label COUNT(?range) AS ?count \
  777. WHERE{ \
  778. VALUES ?uri {<{URI}>} \
  779. {?place owl:sameAs ?uri . \
  780. ?event_to crm:P26_moved_to ?place ; \
  781. rdf:type crm:EL3_Receive_Letter ; \
  782. crm:P01_has_domain ?domain . \
  783. ?domain crm:P02_has_range ?range ; \
  784. crm:P14.1_in_the_role_of ?uri_role . \
  785. ?uri_role rdfs:label ?role . \
  786. ?range rdfs:label ?lb ; \
  787. foaf:name ?name . \
  788. } UNION { \
  789. ?place owl:sameAs ?uri . \
  790. ?event_to crm:P27_moved_from ?place ; \
  791. rdf:type crm:EL2_Send_Letter ; \
  792. crm:P01_has_domain ?domain . \
  793. ?domain crm:P02_has_range ?range ; \
  794. crm:P14.1_in_the_role_of ?uri_role . \
  795. ?uri_role rdfs:label ?role . \
  796. ?range rdfs:label ?lb ; \
  797. foaf:name ?name . \
  798. } UNION { \
  799. ?event_gt crm:P7_took_place_at ?uri ; \
  800. crm:P01_has_domain ?domain . \
  801. ?domain crm:P02_has_range ?range ; \
  802. crm:P14.1_in_the_role_of ?uri_role . \
  803. ?uri_role rdfs:label ?role . \
  804. ?range rdfs:label ?name . \
  805. } \
  806. } GROUP BY ?role ?range \
  807. ORDER BY ?label",
  808. queryCount : " SELECT ?place ?label COUNT(?label) AS ?Count \
  809. WHERE{ \
  810. ?place_to owl:sameAs <{URI}> . \
  811. ?event_to crm:P26_moved_to ?place_to ; \
  812. rdf:type crm:EL3_Receive_Letter ; \
  813. rdfs:subClassOf ?event . \
  814. ?event_from rdfs:subClassOf ?event ; \
  815. rdf:type crm:EL2_Send_Letter ; \
  816. crm:P27_moved_from ?place . \
  817. ?place rdfs:label ?label \
  818. } \
  819. ORDER BY DESC (?Count)",
  820. queryCount2 : " SELECT ?place ?label COUNT(?label) AS ?Count \
  821. WHERE{ \
  822. ?place_from owl:sameAs <{URI}> . \
  823. ?event_from crm:P27_moved_from ?place_from ; \
  824. rdf:type crm:EL2_Send_Letter ; \
  825. rdfs:subClassOf ?event . \
  826. ?event_to rdfs:subClassOf ?event ; \
  827. rdf:type crm:EL2_Send_Letter ; \
  828. crm:P27_moved_from ?place . \
  829. ?place rdfs:label ?label . \
  830. } \
  831. ORDER BY DESC (?Count) "
  832. },
  833. querySchedaOpera : {
  834. 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) ?uriSubjectPer ?personName ?personSurname ?personPatronymic ?iscrizione ?condition ?note \
  835. WHERE { \
  836. VALUES ?uri {<{URI}>} \
  837. GRAPH ?graph {?uri rdfs:label ?label} \
  838. OPTIONAL {?uri crm:P3_has_note ?note } \
  839. ?uri crm:P128_carries ?Inf_Obj . \
  840. OPTIONAL {?Inf_Obj crm:P1_is_identified_by ?uriTitle . \
  841. ?uriTitle rdf:type crm:E35_Title; \
  842. rdfs:label ?title } \
  843. OPTIONAL {?Inf_Obj crm:P2_has_type ?uriType . \
  844. ?uriType rdfs:label ?type } \
  845. OPTIONAL {?uri crm:P43_has_dimension ?uriDimension . \
  846. ?uriDimension crm:P90_has_value ?value; \
  847. crm:P91_has_unit ?uri_unit . \
  848. ?uri_unit rdfs:label ?unit } \
  849. OPTIONAL {?uri crm:P1_is_identified_by ?uriIdentifier . \
  850. ?uriIdentifier rdfs:label ?identifier } \
  851. OPTIONAL {?uri crm:P45_consists_of ?uriMaterial . \
  852. ?uriMaterial rdfs:label ?material } \
  853. OPTIONAL {?uri crm:P44_has_condition ?uriCondition . \
  854. ?uriCondition crm:P2_has_type ?condition} \
  855. OPTIONAL {?uri crm:P54_has_current_permanent_location ?current_location } \
  856. OPTIONAL {?uri crm:P62_depicts ?uriSubject . \
  857. ?uriSubject rdfs:label ?subject; \
  858. crm:P2_has_type 'Identificazione Iconografica' .} \
  859. OPTIONAL {?uri crm:P62_depicts ?uriSubjectPer . \
  860. ?uriSubjectPer foaf:givenName ?personName ; \
  861. foaf:familyName ?personSurname ; \
  862. person:patronymicName ?personPatronymic ; \
  863. rdf:type foaf:person . } \
  864. OPTIONAL {?uri crm:P52_has_current_owner ?uriOwner . \
  865. ?uriOwner rdfs:label ?current_owner } \
  866. OPTIONAL {?uri crm:P56_bears_feature ?uri_inscription . \
  867. ?uri_inscription crm:P128_carries ?uri_objInscr . \
  868. ?uri_objInscr crm:P3_has_note ?iscrizione . } \
  869. }",
  870. 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) \
  871. WHERE { \
  872. VALUES ?uri {<{URI}>} \
  873. ?uri crm:P128_carries ?Information_Object . \
  874. ?Information_Object crm:P108i_was_produced_by ?Production . \
  875. OPTIONAL {?Production crm:P4_has_time-span ?uriTS ; \
  876. crm:P32_used_general_technique ?uriTecne . \
  877. ?uriTS rdfs:label ?time_span . \
  878. ?uriTecne rdfs:label ?technique} \
  879. OPTIONAL {?pc crm:P01_has_domain ?Production ; \
  880. crm:P02_has_range ?uriPerson ; \
  881. crm:P14.1_in_the_role_of ?uriRole . \
  882. ?uriPerson rdfs:label ?person . \
  883. ?uriRole rdfs:label ?role} \
  884. }",
  885. queryBibliography : " SELECT DISTINCT ?bibliography ?pages \
  886. WHERE { \
  887. VALUES ?uri {<{URI}>} \
  888. ?uri crm:P128_carries ?infObj . \
  889. ?document crm:P70_documents ?infObj . \
  890. OPTIONAL {?document crm:P3_has_note ?pages} \
  891. ?edition crm:P46_is_composed_of ?document ; \
  892. rdfs:label ?bibliography ; \
  893. crm:P2_has_type 'Bibliografia' . \
  894. }"
  895. },
  896. queryTimeSpace : {
  897. querySpace : " SELECT DISTINCT ?uri_person ?person ?event ?uri_place ?place ?coords ?time_span ?year ?month ?day \
  898. WHERE {?uri_event rdfs:label ?event ; \
  899. crm:P01_has_domain ?pc ; \
  900. crm:P7_took_place_at ?uri_NTplace ; \
  901. crm:P4_has_time-span ?uri_time_span . \
  902. ?pc crm:P02_has_range ?uri_person . \
  903. ?uri_person rdfs:label ?person . \
  904. ?uri_place owl:sameAs ?uri_NTplace . \
  905. ?uri_place crm:P168_place_is_defined_by ?coords ; \
  906. rdfs:label ?place . \
  907. ?uri_time_span rdfs:label ?time_span ; \
  908. time:year ?year . \
  909. OPTIONAL {?uri_time_span time:month ?month} \
  910. OPTIONAL {?uri_time_span time:day ?day} \
  911. } ORDER BY ?year ?month ?day",
  912. queryTime1 : " SELECT DISTINCT ?event ?uri_place ?place ?coords ?time_span ?month ?day \
  913. WHERE {?uri_event rdfs:label ?event ; \
  914. crm:P01_has_domain ?pc ; \
  915. crm:P7_took_place_at ?uri_NTplace ; \
  916. crm:P4_has_time-span ?uri_time_span . \
  917. ?pc crm:P02_has_range ?uri_person . \
  918. ?uri_person rdfs:label ?person . \
  919. ?uri_place owl:sameAs ?uri_NTplace . \
  920. ?uri_place crm:P168_place_is_defined_by ?coords ; \
  921. rdfs:label ?place . \
  922. ?uri_time_span rdfs:label ?time_span ; \
  923. time:year {YEAR} . \
  924. OPTIONAL {?uri_time_span time:month ?month} \
  925. OPTIONAL {?uri_time_span time:day ?day} \
  926. } ORDER BY ?month ?day",
  927. queryTime2 : " SELECT DISTINCT ?uri_person ?person ?event ?uri_place ?place ?coords ?year ?month ?day \
  928. WHERE {?uri_event rdfs:label ?event ; \
  929. crm:P01_has_domain ?pc ; \
  930. crm:P7_took_place_at ?uri_NTplace ; \
  931. crm:P4_has_time-span ?uri_time_span . \
  932. ?pc crm:P02_has_range ?uri_person . \
  933. ?uri_person rdfs:label ?person . \
  934. ?uri_place owl:sameAs ?uri_NTplace . \
  935. ?uri_place crm:P168_place_is_defined_by ?coords ; \
  936. rdfs:label ?place . \
  937. ?uri_time_span rdfs:label '{DATE}' . \
  938. OPTIONAL {?uri_time_span time:year ?year} \
  939. OPTIONAL {?uri_time_span time:month ?month} \
  940. OPTIONAL {?uri_time_span time:day ?day} \
  941. } ORDER BY ?year ?month ?day",
  942. queryTimeLetters : " SELECT DISTINCT ?uri_subject ?subject ?uri_place ?place ?coords ?time_span ?year ?month ?day \
  943. WHERE {?uri_subject rdf:type crm:E22_Man-Made_Object ; \
  944. rdfs:label ?subject ; \
  945. crm:P25i_moved_by ?event1 . \
  946. ?send1 rdfs:subClassOf ?event1 ; \
  947. crm:P4_has_time-span ?uri_time_span . \
  948. ?uri_time_span rdfs:label ?time_span ; \
  949. time:year ?year ; \
  950. time:month ?month ; \
  951. time:day ?day . \
  952. ?uri_subject crm:P25i_moved_by ?event2 . \
  953. ?send2 rdfs:subClassOf ?event2 ; \
  954. crm:P27_moved_from ?uri_placeNT . \
  955. ?uri_place ?property ?uri_placeNT ; \
  956. rdfs:label ?place ; \
  957. crm:P168_place_is_defined_by ?coords \
  958. } ORDER BY ?year ?month ?day"
  959. },
  960. queryRicercaAvanzata : {
  961. queryOggetto : "SELECT DISTINCT ?graph AS ?g ?uri ?name ?identifier ?material ?owner ?type ?start_date ?end_date \
  962. WHERE {GRAPH ?graph {?uri rdf:type crm:E22_Man-Made_Object} \
  963. ?uri rdfs:label ?name . \
  964. OPTIONAL {?uri crm:P1_is_identified_by ?uri_identifier . \
  965. ?uri_identifier rdfs:label ?identifier . } \
  966. OPTIONAL {?uri crm:P45_consist_of ?uri_material . \
  967. ?uri_material rdfs:label ?material . } \
  968. OPTIONAL {?uri crm:P2_has_type ?uri_type . \
  969. ?uri_type rdfs:label ?type . } \
  970. OPTIONAL {?uri crm:P52_has_current_owner ?uri_owner . \
  971. ?uri_owner rdfs:label ?owner . } \
  972. OPTIONAL {?uri crm:P92i_was_brought_into_existence_by ?creationI . \
  973. ?creationI crm:P2_has_type 'Inizio'^^<http://www.w3.org/2001/XMLSchema#string> ; \
  974. crm:P4_has_time-span ?uri_time_spanI . \
  975. ?uri_time_spanI rdfs:label ?start_date . } \
  976. OPTIONAL {?uri crm:P92i_was_brought_into_existence_by ?creationF . \
  977. ?creationF crm:P2_has_type 'Fine'^^<http://www.w3.org/2001/XMLSchema#string> ; \
  978. crm:P4_has_time-span ?uri_time_spanF . \
  979. ?uri_time_spanF rdfs:label ?end_date . } \
  980. }",
  981. 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 \
  982. WHERE { \
  983. GRAPH ?graph {?uri rdfs:label ?label} \
  984. ?uri foaf:name ?name . \
  985. ?uri foaf:givenName ?givenName . \
  986. OPTIONAL {?uri foaf:familyName ?familyName} \
  987. OPTIONAL {?uri foaf:gender ?gender} \
  988. OPTIONAL {?uri person:patronymicName ?patronymic } \
  989. OPTIONAL {?uri crm:P74_has_current_or_former_residence ?uri_provenienza . \
  990. ?uri_provenienza crm:P2_has_type 'Provenienza'; \
  991. rdfs:label ?provenienza . } \
  992. OPTIONAL {?uri crm:P2_has_type ?uri_person_type . \
  993. ?uri_person_type rdfs:label ?person_type } \
  994. OPTIONAL {?uri schema:hasOccupation ?uriOccupation . \
  995. ?uriOccupation rdf:type schema:Occupation; \
  996. rdfs:label ?occupation } \
  997. OPTIONAL {?uri schema:honorificPrefix ?qualification} \
  998. OPTIONAL {?uri crm:P100i_died_in ?Death . \
  999. OPTIONAL {?Death crm:P4_has_time-span ?Death_TS . \
  1000. ?Death_TS rdfs:label ?Death_Date . } \
  1001. OPTIONAL {?Death crm:P7_took_place_at ?Place_D . \
  1002. ?Place_D rdfs:label ?Death_Place } \
  1003. } \
  1004. OPTIONAL {?uri crm:P98i_was_born ?Birth . \
  1005. OPTIONAL {?Birth crm:P4_has_time-span ?Birth_TS . \
  1006. ?Birth_TS rdfs:label ?Birth_Date . } \
  1007. OPTIONAL {?Birth crm:P7_took_place_at ?Place_B . \
  1008. ?Place_B rdfs:label ?Birth_Place } \
  1009. } \
  1010. OPTIONAL {?uri schema:alternateName ?alias . } \
  1011. OPTIONAL {?uri owl:sameAs ?variant . \
  1012. ?variant foaf:name ?otherName . } \
  1013. } ",
  1014. 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 \
  1015. WHERE {GRAPH ?graph {?uri rdf:type crm:E22_Man-Made_Object} \
  1016. ?uri rdfs:label ?name ; \
  1017. crm:P2_has_type 'Opera d\'Arte' . \
  1018. OPTIONAL {?uri crm:P1_is_identified_by ?uri_identifier . \
  1019. ?uri_identifier rdfs:label ?identifier . } \
  1020. OPTIONAL {?uri crm:P45_consists_of ?uri_material . \
  1021. ?uri_material rdfs:label ?material . } \
  1022. OPTIONAL {?uri crm:P52_has_current_owner ?uri_owner . \
  1023. ?uri_owner rdfs:label ?owner . } \
  1024. ?production crm:P108_has_produced ?uri . \
  1025. OPTIONAL {?production crm:P32_used_general_technique ?uri_teche . \
  1026. ?uri_teche rdfs:label ?technique . } \
  1027. OPTIONAL {?pc crm:P01_has_domain ?production ; \
  1028. crm:P02_has_range ?uri_person . \
  1029. ?uri_person rdfs:label ?name_artist .} \
  1030. OPTIONAL {?uri crm:P62_depicts ?uri_subject . \
  1031. ?uri_subject rdfs:label ?subject . } \
  1032. OPTIONAL {?productionI crm:P108_has_produced ?uri ; \
  1033. crm:P2_has_type 'Inizio'^^<http://www.w3.org/2001/XMLSchema#string> ; \
  1034. crm:P4_has_time-span ?uri_time_spanI . \
  1035. ?uri_time_spanI rdfs:label ?start_date . } \
  1036. OPTIONAL {?productionF crm:P108_has_produced ?uri ; \
  1037. crm:P2_has_type 'Fine'^^<http://www.w3.org/2001/XMLSchema#string> ; \
  1038. crm:P4_has_time-span ?uri_time_spanF . \
  1039. ?uri_time_spanF rdfs:label ?end_date . } \
  1040. }",
  1041. queryLettere : " SELECT DISTINCT * \
  1042. WHERE { GRAPH ?graph {?uri rdf:type crm:E73_Information_Object} \
  1043. ?uri crm:P2_has_type ?uri_type . \
  1044. ?uri_type rdfs:label 'lettera' . \
  1045. ?uri crm:P72_has_language ?uri_language . \
  1046. ?uri_language rdfs:label ?language ; \
  1047. crm:P3_has_note ?uri_area . \
  1048. ?uri_area rdfs:label ?linguistic_area . \
  1049. ?uri_documentation crm:P70_documents ?uri ; \
  1050. crm:P1_is_identified_by ?uri_editionL . \
  1051. ?uri_editionL rdfs:label ?long_edition ; \
  1052. crm:P139_has_alternative_form ?uri_editionS . \
  1053. ?uri_editionS rdfs:label ?short_edition . \
  1054. ?uri_doc crm:P128_carries ?uri . \
  1055. GRAPH <http://dev.restore.ovi.cnr.it:8890/aspo/datini> {?uri_doc crm:P25i_moved_by ?event} \
  1056. ?send rdfs:subClassOf ?event ; \
  1057. rdf:type crm:EL2_Send_Letter . \
  1058. OPTIONAL {?send crm:P4_has_time-span ?uri_time_spanS. \
  1059. ?uri_time_spanS rdfs:label ?start_date . } \
  1060. OPTIONAL {?send crm:P27_moved_from ?uri_placeS . \
  1061. ?uri_placeS rdfs:label ?start_place } \
  1062. OPTIONAL {?send crm:P01_has_domain ?pcS . \
  1063. ?pcS crm:P02_has_range ?uri_sender . \
  1064. ?uri_sender rdfs:label ?mittente .} \
  1065. ?receive rdfs:subClassOf ?event ; \
  1066. rdf:type crm:EL3_Receive_Letter . \
  1067. OPTIONAL {?receive crm:P4_has_time-span ?uri_time_spanE . \
  1068. ?uri_time_spanE rdfs:label ?end_date . } \
  1069. OPTIONAL {?received crm:P26_moved_to ?uri_placeE . \
  1070. ?uri_placeE rdfs:label ?end_place } \
  1071. OPTIONAL {?receive crm:P01_has_domain ?pcR . \
  1072. ?pcR crm:P02_has_range ?uri_receiver . \
  1073. ?uri_receiver rdfs:label ?destinatario .} \
  1074. ?uri crm:P67_refers_to ?uri_lemma . \
  1075. ?uri_lemma rdfs:label ?lemma . \
  1076. }"
  1077. },
  1078. queryCustom : {
  1079. queryTipo : " SELECT DISTINCT ?subject ?uri_contrassegno ?label \
  1080. WHERE { \
  1081. ?subject crm:P138_represents ?uri_contrassegno . \
  1082. ?uri_contrassegno rdfs:label ?label ; \
  1083. crm:P2_has_type '{TYPE}' . \
  1084. }",
  1085. queryOccupazione : "SELECT DISTINCT ?subject ?name ?id ?givenName ?familyName ?patronymic ?provenienza SAMPLE(?occupation) AS ?occupation \
  1086. WHERE {GRAPH ?g {?subject rdf:type crm:E21_Person} \
  1087. ?subject foaf:name ?name . \
  1088. OPTIONAL {?subject crm:P1_is_identified_by ?id . \
  1089. ?id rdfs:label ?identifier } \
  1090. OPTIONAL {?subject foaf:givenName ?givenName} \
  1091. OPTIONAL {?subject foaf:familyName ?familyName} \
  1092. OPTIONAL {?subject person:patronymicName ?patronymic } \
  1093. OPTIONAL {?subject crm:P74_has_current_or_former_residence ?uri_provenienza . \
  1094. ?uri_provenienza crm:P2_has_type 'Provenienza'; \
  1095. rdfs:label ?provenienza . } \
  1096. ?subject schema:hasOccupation ?uri_occupation . \
  1097. ?uri_occupation rdfs:label ?occupation . \
  1098. ?occupation bif:contains '\"{WORD}\"' \
  1099. }",
  1100. queryOpereGrafo : "SELECT DISTINCT ?subject ?label \
  1101. WHERE {GRAPH <{GRAPH}> {?subject rdf:type crm:E22_Man-Made_Object } \
  1102. ?subject rdfs:label ?label} "
  1103. }
  1104. };