managerQuery.js 44 KB

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