managerQuery.js 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137
  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 ?uri_place ; \
  295. crm:P2_has_type ?uri_type . \
  296. ?uri_type rdfs:label ?tipo . \
  297. ?uri_place rdf:type crm:E53_Place ; \
  298. rdfs:label ?label . \
  299. ?place owl:sameAs ?uri_place ; \
  300. crm:P168_place_is_defined_by ?coordinates . \
  301. } \
  302. }",
  303. 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 \
  304. WHERE { \
  305. VALUES ?uri {<{URI}>} \
  306. GRAPH ?graph {?uri rdfs:label ?label} \
  307. ?uri foaf:name ?name . \
  308. OPTIONAL {?uri crm:P1_is_identified_by ?id . \
  309. ?id rdfs:label ?identifier ; \
  310. crm:P2_has_type ?id_type .} \
  311. OPTIONAL {?uri foaf:givenName ?givenName} \
  312. OPTIONAL {?uri foaf:familyName ?familyName} \
  313. OPTIONAL {?uri foaf:gender ?gender} \
  314. OPTIONAL {?uri person:patronymicName ?patronymic } \
  315. OPTIONAL {?uri crm:P74_has_current_or_former_residence ?uri_provenienza . \
  316. ?uri_provenienza crm:P2_has_type 'Provenienza'; \
  317. rdfs:label ?provenienza . } \
  318. OPTIONAL {?uri crm:P2_has_type ?uri_person_type . \
  319. ?uri_person_type rdfs:label ?person_type } \
  320. OPTIONAL {?uri schema:hasOccupation ?uriOccupation . \
  321. ?uriOccupation rdf:type schema:Occupation; \
  322. rdfs:label ?occupation } \
  323. OPTIONAL {?uri schema:honorificPrefix ?qualification} \
  324. OPTIONAL {?uri crm:P100i_died_in ?Death . \
  325. OPTIONAL {?Death crm:P4_has_time-span ?Death_TS . \
  326. ?Death_TS rdfs:label ?Death_Date . } \
  327. OPTIONAL {?Death crm:P7_took_place_at ?Place_D . \
  328. ?Place_D rdfs:label ?Death_Place } \
  329. } \
  330. OPTIONAL {?uri crm:P98i_was_born ?Birth . \
  331. OPTIONAL {?Birth crm:P4_has_time-span ?Birth_TS . \
  332. ?Birth_TS rdfs:label ?Birth_Date . } \
  333. OPTIONAL {?Birth crm:P7_took_place_at ?Place_B . \
  334. ?Place_B rdfs:label ?Birth_Place } \
  335. } \
  336. OPTIONAL {?uri crm:P107i_is_current_or_former_member_of ?uriGroup . \
  337. ?uriGroup rdfs:label ?group } \
  338. OPTIONAL {?uri schema:alternateName ?alias . } \
  339. OPTIONAL {?uri owl:sameAs ?variant . \
  340. ?variant foaf:name ?otherName . } \
  341. OPTIONAL {?relation2 crm:P141_assigned ?uri ; \
  342. crm:P42_assigned ?uri_rel_type2 . \
  343. ?uri_rel_type2 rdfs:label 'Avo di secondo grado' . \
  344. ?uri_relative2 crm:P141_assigned ?relation2; \
  345. rdfs:label ?relative2 .} \
  346. OPTIONAL {?relation3 crm:P141_assigned ?uri ; \
  347. crm:P42_assigned ?uri_rel_type3 . \
  348. ?uri_rel_type3 rdfs:label 'Avo di terzo grado' . \
  349. ?uri_relative3 crm:P141_assigned ?relation3; \
  350. rdfs:label ?relative3 .} \
  351. } \
  352. 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 \
  353. LIMIT 1 ",
  354. queryInfoGettatelli : " SELECT DISTINCT ?card ?uri_card \
  355. WHERE { \
  356. VALUES ?uri {<{URI}>} \
  357. ?documentation crm:P67_refers_to ?uri ; \
  358. crm:P141_assigned ?uri_card . \
  359. ?uri_card rdfs:label ?card . \
  360. } ",
  361. queryRelazioni : " SELECT DISTINCT ?relation_type ?note ?uri_person ?name ?givenName ?familyName ?patronymic ?provenienza \
  362. WHERE { \
  363. VALUES ?uri {<{URI}>} \
  364. ?uri crm:P141_assigned ?relation . \
  365. ?relation crm:P42_assigned ?uri_type ; \
  366. crm:P141_assigned ?uri_person . \
  367. ?uri_type rdfs:label ?relation_type . \
  368. OPTIONAL {?uri_type crm:P3_has_note ?note } \
  369. ?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. queryRelazioniInverse : " SELECT DISTINCT ?relation_type ?note ?uri_person SAMPLE(?name) AS ?name ?givenName ?familyName ?patronymic ?provenienza \
  378. WHERE { \
  379. VALUES ?uri {<{URI}>} \
  380. ?relation crm:P141_assigned ?uri; \
  381. crm:P42_assigned ?uri_type . \
  382. ?uri_person crm:P141_assigned ?relation . \
  383. ?uri_type rdfs:label ?relation_type . \
  384. OPTIONAL {?uri_type crm:P3_has_note ?note } \
  385. OPTIONAL {?uri_person foaf:name ?name } \
  386. OPTIONAL {?uri_person foaf:givenName ?givenName} \
  387. OPTIONAL {?uri_person foaf:familyName ?familyName} \
  388. OPTIONAL {?uri_person person:patronymicName ?patronymic } \
  389. OPTIONAL {?uri_person crm:P74_has_current_or_former_residence ?uri_provenienza . \
  390. ?uri_provenienza crm:P2_has_type 'Provenienza'; \
  391. rdfs:label ?provenienza . } \
  392. } ",
  393. queryLetters : " SELECT DISTINCT ?type ?segnatura ?document_uri ?document_name ?time_span ?InfObj \
  394. WHERE { \
  395. VALUES ?uri {<{URI}>} \
  396. {?pc crm:P02_has_range ?uri . \
  397. } UNION { \
  398. ?group crm:P107_has_current_or_former_member ?uri; \
  399. crm:P2_has_type 'Gruppo scrittura lettera' . \
  400. ?pc crm:P02_has_range ?group . \
  401. } \
  402. ?ev_move crm:P01_has_domain ?pc ; \
  403. rdfs:label ?type ; \
  404. rdfs:subClassOf ?event . \
  405. ?document_uri crm:P25i_moved_by ?event ; \
  406. rdfs:label ?document_name . \
  407. ?document_uri crm:P1_is_identified_by ?uriSegnatura . \
  408. ?uriSegnatura crm:P2_has_type 'Segnatura' ; \
  409. rdfs:label ?segnatura . \
  410. OPTIONAL {GRAPH <http://dev.restore.ovi.cnr.it:8890/ovi/datini> {?document_uri crm:P128_carries ?InfObj . \
  411. ?InfObj rdf:type crm:E73_Information_Object} }. \
  412. OPTIONAL {?ev_move crm:P4_has_time-span ?uri_ts . \
  413. ?uri_ts rdfs:label ?time_span . } \
  414. }",
  415. queryDocuments : " SELECT DISTINCT ?role ?document ?label ?id (group_concat(distinct ?time_span ;separator='-') as ?time_span) \
  416. WHERE { \
  417. ?document ?property ?event ; \
  418. crm:P1_is_identified_by ?uri_id ; \
  419. rdfs:label ?label . \
  420. ?uri_id rdfs:label ?id ; \
  421. crm:P2_has_type 'Segnatura' . \
  422. OPTIONAL { \
  423. {?event crm:P4_has_time-span ?uri_time_span . \
  424. ?uri_time_span rdfs:label ?time_span . \
  425. } UNION { \
  426. ?sub_event rdfs:subClassOf ?event ; \
  427. crm:P4_has_time-span ?uri_time_span . \
  428. ?uri_time_span rdfs:label ?time_span . } \
  429. } \
  430. ?event crm:P01_has_domain ?domain . \
  431. ?domain crm:P02_has_range <{URI}> ; \
  432. crm:P14.1_in_the_role_of ?uri_role . \
  433. ?uri_role rdfs:label ?role . \
  434. } \
  435. GROUP BY ?document ?label ?id ?role ",
  436. queryOtherDoc : " SELECT DISTINCT ?document ?label ?id (group_concat(distinct ?time_span ;separator='-') as ?time_span) \
  437. WHERE { \
  438. VALUES ?uri {<{URI}> } \
  439. {?domain crm:P02_has_range ?uri . \
  440. ?event crm:P01_has_domain ?domain . \
  441. ?document crm:P92i_was_brought_into_existence_by ?event ; \
  442. crm:P1_is_identified_by ?uri_id ; \
  443. rdfs:label ?label . \
  444. ?uri_id crm:P2_has_type 'Segnatura'; \
  445. rdfs:label ?id . \
  446. } UNION { \
  447. ?event crm:P67_refers_to ?uri . \
  448. ?document crm:P92i_was_brought_into_existence_by ?event ; \
  449. rdfs:label ?label ; \
  450. crm:P1_is_identified_by ?uri_id . \
  451. ?uri_id rdfs:label ?id ; \
  452. crm:P2_has_type 'Segnatura' . \
  453. } UNION { \
  454. ?event crm:P67_refers_to ?uri . \
  455. ?documentation crm:P67_refers_to ?uri ; \
  456. crm:P141_assigned ?card . \
  457. ?document crm:P46_is_composed_of ?card ; \
  458. rdfs:label ?label ; \
  459. crm:P1_is_identified_by ?uri_id . \
  460. ?uri_id rdfs:label ?id ; \
  461. crm:P2_has_type 'Segnatura' . \
  462. } \
  463. OPTIONAL {?event crm:P4_has_time-span ?uri_time_span . \
  464. ?uri_time_span rdfs:label ?time_span} \
  465. } ",
  466. queryOpere : " SELECT DISTINCT ?subject ?label ?nct (group_concat(distinct ?time_span ;separator='-') as ?time_span) \
  467. WHERE {?subject rdf:type crm:E22_Man-Made_Object ; \
  468. rdfs:label ?label ; \
  469. crm:P1_is_identified_by ?uri_nct . \
  470. ?uri_nct rdfs:label ?nct . \
  471. ?production crm:P108_has_produced ?subject . \
  472. OPTIONAL {?production crm:P4_has_time-span ?uri_time_span . \
  473. ?uri_time_span rdfs:label ?time_span } \
  474. ?pc crm:P01_has_domain ?production ; \
  475. crm:P02_has_range <{URI}> } \
  476. GROUP BY ?subject ?label ?nct ",
  477. queryGettatelliEv : " SELECT DISTINCT ?event_type ?time_span \
  478. WHERE { \
  479. VALUES ?uri {<{URI}>} \
  480. ?uri crm:P12i_was_present_at ?event . \
  481. ?event crm:P2_has_type ?uri_event_type ; \
  482. crm:P4_has_time-span ?uri_time_span . \
  483. ?uri_time_span rdfs:label ?time_span . \
  484. ?uri_event_type rdfs:label ?event_type . \
  485. } ",
  486. 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 \
  487. WHERE { \
  488. VALUES ?uri {<{URI}>} \
  489. ?domain crm:P02_has_range ?uri ; \
  490. crm:P14.1_in_the_role_of ?uri_role . \
  491. ?uri_role rdfs:label ?role . \
  492. ?event crm:P01_has_domain ?domain ; \
  493. crm:P2_has_type ?uri_event_type . \
  494. ?uri_event_type rdfs:label ?event_type . \
  495. OPTIONAL {?event crm:P4_has_time-span ?uri_time_span . \
  496. ?uri_time_span rdfs:label ?time_span . \
  497. OPTIONAL {?uri_time_span time:year ?year .} \
  498. OPTIONAL {?uri_time_span time:month ?month .} \
  499. OPTIONAL {?uri_time_span time:day ?day .} \
  500. } \
  501. ?event crm:P7_took_place_at ?uri_location . \
  502. ?uri_location rdfs:label ?place . \
  503. OPTIONAL {?uri_place owl:sameAs ?uri_location . \
  504. ?uri_place crm:P168_place_is_defined_by ?coords } \
  505. OPTIONAL {?uri_location crm:P89_falls_within ?uri_place2 . \
  506. ?uri_place2 rdfs:label ?place2 . \
  507. OPTIONAL {?uri_place2 crm:P168_place_is_defined_by ?coords2 . } \
  508. OPTIONAL {?uri_place2 crm:P89_falls_within ?uri_place3 . \
  509. ?uri_place3 rdfs:label ?place3 . \
  510. OPTIONAL {?uri_place3 crm:P168_place_is_defined_by ?coords3 . \
  511. OPTIONAL {?uri_place3 crm:P89_falls_within ?uri_place4 . \
  512. ?uri_place4 rdfs:label ?place4 . \
  513. OPTIONAL {?uri_place4 crm:P168_place_is_defined_by ?coords4 .} \
  514. } \
  515. } \
  516. }} \
  517. ?document_info crm:P70_documents ?event . \
  518. ?uri_document crm:P128_carries ?document_info ; \
  519. rdfs:label ?document . \
  520. } \
  521. ORDER BY ?year ?month ?day ",
  522. queryCompagnia : " SELECT DISTINCT ?denomination ?occupation ?uri_sede ?uri_place ?sede \
  523. WHERE { \
  524. VALUES ?uri {<{URI}>} \
  525. ?uri rdf:type crm:E74_Group . \
  526. ?uri crm:P2_has_type ?denomination . \
  527. OPTIONAL {?uri schema:hasOccupation ?uri_Occupation . \
  528. ?uri_Occupation rdfs:label ?occupation .} \
  529. OPTIONAL {?uri crm:P74_has_current_or_former_residence ?uri_sede . \
  530. ?uri_sede rdfs:label ?sede . \
  531. OPTIONAL {?uri_sede owl:sameAs ?uri_place . \
  532. ?uri_place crm:P168_place_is_defined_by ?coords .} \
  533. } \
  534. }",
  535. queryContrassegni : " SELECT DISTINCT ?contrassegno ?image \
  536. WHERE { \
  537. VALUES ?uri {<{URI}>} \
  538. ?event crm:P141_assigned ?uri ; \
  539. crm:P140_assigned_attribute_to ?uri_contrassegno . \
  540. ?uri_contrassegno crm:P2_has_type 'Contrassegno'; \
  541. rdfs:label ?contrassegno . \
  542. ?uri_image crm:P138_represents ?uri_contrassegno ; \
  543. crm:P1_is_identified_by ?uri_id . \
  544. ?uri_id rdfs:label ?image . \
  545. } "
  546. },
  547. querySchedaOggetto : {
  548. 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 \
  549. WHERE { \
  550. VALUES ?uri {<{URI}>} \
  551. GRAPH ?g { ?uri rdfs:label ?label } \
  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 ?uri_contrassegno ?contrassegno \
  653. WHERE {VALUES ?uri {<{URI}>} \
  654. ?uri crm:P46_is_composed_of ?uri_paper . \
  655. ?uri_documentation crm:P141_assigned ?uri_paper ; \
  656. crm:P140_assigned_attribute_to ?uri_contrassegno . \
  657. ?uri_contrassegno rdfs:label ?contrassegno . \
  658. }",
  659. queryEventiGettatelli : " SELECT DISTINCT ?uri_obj ?object ?name_event ?event_type ?uri_person ?label ?role ?time_span ?uri_place ?place \
  660. WHERE {VALUES ?uri {<{URI}>} \
  661. OPTIONAL {?uri crm:P46_is_composed_of ?uri_paper . } \
  662. {?uri_paper crm:P128_carries ?uri_doc } \
  663. UNION \
  664. {?uri crm:P128_carries ?uri_doc } \
  665. ?uri_doc crm:P70_documents ?event ; \
  666. rdfs:label ?document . \
  667. ?uri_obj crm:P128_carries ?uri_doc . \
  668. ?uri_doc rdfs:label ?object . \
  669. ?event rdfs:label ?name_event . \
  670. ?event crm:P2_has_type ?uri_event_type . \
  671. ?uri_event_type rdfs:label ?event_type . \
  672. ?event crm:P01_has_domain ?domain . \
  673. ?domain crm:P02_has_range ?uri_person ; \
  674. crm:P14.1_in_the_role_of ?uri_role . \
  675. ?uri_role rdfs:label ?role . \
  676. ?uri_person rdfs:label ?label . \
  677. OPTIONAL {?event crm:P4_has_time-span ?uri_time_span . \
  678. ?uri_time_span rdfs:label ?time_span . } \
  679. OPTIONAL {?event crm:P7_took_place_at ?uri_location . \
  680. ?uri_place owl:sameAs ?uri_location ; \
  681. crm:P168_place_is_defined_by ?coords; \
  682. rdfs:label ?place . } \
  683. }",
  684. queryLuoghiGT : " SELECT DISTINCT ?uri_place ?place \
  685. WHERE {VALUES ?uri {<{URI}>} \
  686. OPTIONAL {?uri crm:P46_is_composed_of ?uri_paper . } \
  687. {?uri_paper crm:P128_carries ?uri_doc } \
  688. UNION \
  689. {?uri crm:P128_carries ?uri_doc } \
  690. ?uri_doc crm:P70_documents ?event . \
  691. ?event crm:P7_took_place_at ?uri_location . \
  692. ?uri_place owl:sameAs ?uri_location ; \
  693. crm:P168_place_is_defined_by ?coords; \
  694. rdfs:label ?place . \
  695. }"
  696. },
  697. querySchedaLuogo : {
  698. query : " SELECT DISTINCT ?graph ?uri ?name_place ?coordinates {\
  699. GRAPH ?graph { VALUES ?uri { <{URI}> } \
  700. ?uri crm:P168_place_is_defined_by ?coordinates;\
  701. rdfs:label ?name_place .\
  702. }\
  703. }",
  704. queryRiferimenti : " SELECT DISTINCT ?references {\
  705. <{URI}> owl:sameAs ?references\
  706. }",
  707. queryToponimi : " SELECT DISTINCT ?toponimi {\
  708. <{URI}> crm:P1_is_identified_by ?uri_toponym .\
  709. ?uri_toponym rdfs:label ?toponimi\
  710. }",
  711. queryRicezione : " SELECT DISTINCT ?segnatura ?document_uri ?document_name ?time_span ?InfObj \
  712. WHERE { \
  713. <{URI}> owl:sameAs ?place . \
  714. ?event_to crm:P26_moved_to ?place ; \
  715. rdf:type crm:EL3_Receive_Letter ; \
  716. rdfs:subClassOf ?event . \
  717. ?document_uri crm:P25i_moved_by ?event ; \
  718. rdfs:label ?document_name . \
  719. ?document_uri crm:P1_is_identified_by ?uriSegnatura . \
  720. ?uriSegnatura crm:P2_has_type 'Segnatura' ; \
  721. rdfs:label ?segnatura . \
  722. OPTIONAL {GRAPH <http://dev.restore.ovi.cnr.it:8890/ovi/datini> {?document_uri crm:P128_carries ?InfObj . \
  723. ?InfObj rdf:type crm:E73_Information_Object} }. \
  724. OPTIONAL {?event_to crm:P4_has_time-span ?uri_ts . \
  725. ?uri_ts rdfs:label ?time_span . } \
  726. } ",
  727. queryInvio : " SELECT DISTINCT ?segnatura ?document_uri ?document_name ?time_span ?InfObj \
  728. WHERE { \
  729. <{URI}> owl:sameAs ?place . \
  730. ?event_to crm:P27_moved_from ?place ; \
  731. rdf:type crm:EL2_Send_Letter ; \
  732. rdfs:subClassOf ?event . \
  733. ?document_uri crm:P25i_moved_by ?event ; \
  734. rdfs:label ?document_name . \
  735. ?document_uri crm:P1_is_identified_by ?uriSegnatura . \
  736. ?uriSegnatura crm:P2_has_type 'Segnatura' ; \
  737. rdfs:label ?segnatura . \
  738. OPTIONAL {GRAPH <http://dev.restore.ovi.cnr.it:8890/ovi/datini> {?document_uri crm:P128_carries ?InfObj . \
  739. ?InfObj rdf:type crm:E73_Information_Object} }. \
  740. OPTIONAL {?event_to crm:P4_has_time-span ?uri_ts . \
  741. ?uri_ts rdfs:label ?time_span . } \
  742. }",
  743. queryCitazione : " SELECT DISTINCT ?segnatura ?document_uri ?document_name SAMPLE(?time_span) AS ?time_span ?InfObj \
  744. WHERE { \
  745. VALUES ?uri {<{URI}>} \
  746. {?uri crm:P1_is_identified_by ?toponym . \
  747. ?InfObj crm:P67_refers_to ?toponym . \
  748. ?document_uri crm:P128_carries ?InfObj ; \
  749. rdfs:label ?document_name . \
  750. OPTIONAL {?document_uri crm:P1_is_identified_by ?uriSegnatura . \
  751. ?uriSegnatura crm:P2_has_type 'Segnatura' ; \
  752. rdfs:label ?segnatura . } \
  753. OPTIONAL {?document_uri crm:P25i_moved_by ?event . \
  754. ?event_send rdfs:subClassOf ?event ; \
  755. rdf:type crm:EL2_Send_Letter ; \
  756. crm:P4_has_time-span ?uri_ts . \
  757. ?uri_ts rdfs:label ?time_span . } \
  758. } UNION { \
  759. ?uri owl:sameAs ?place . \
  760. ?event_gt crm:P7_took_place_at ?place . \
  761. ?document_inf crm:P70_documents ?event_gt . \
  762. ?document_uri crm:P128_carries ?document_inf ; \
  763. crm:P1_is_identified_by ?uriSegnatura ; \
  764. rdfs:label ?document_name . \
  765. ?uriSegnatura rdfs:label ?segnatura . \
  766. } \
  767. } ",
  768. queryPersone : " SELECT DISTINCT ?role ?range SAMPLE(?name) AS ?label COUNT(?range) AS ?count \
  769. WHERE{ \
  770. {?place owl:sameAs <{URI}> . \
  771. ?event_to crm:P26_moved_to ?place ; \
  772. rdf:type crm:EL3_Receive_Letter ; \
  773. crm:P01_has_domain ?domain . \
  774. ?domain crm:P02_has_range ?range ; \
  775. crm:P14.1_in_the_role_of ?uri_role . \
  776. ?uri_role rdfs:label ?role . \
  777. ?range rdfs:label ?lb ; \
  778. foaf:name ?name . \
  779. } UNION { \
  780. ?place owl:sameAs <{URI}> . \
  781. ?event_to crm:P27_moved_from ?place ; \
  782. rdf:type crm:EL2_Send_Letter ; \
  783. crm:P01_has_domain ?domain . \
  784. ?domain crm:P02_has_range ?range ; \
  785. crm:P14.1_in_the_role_of ?uri_role . \
  786. ?uri_role rdfs:label ?role . \
  787. ?range rdfs:label ?lb ; \
  788. foaf:name ?name . \
  789. } UNION { \
  790. <{URI}> owl:sameAs ?place . \
  791. ?event_gt crm:P7_took_place_at ?place ; \
  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 ?name . \
  797. } \
  798. } GROUP BY ?role ?range \
  799. ORDER BY ?label",
  800. queryCount : " SELECT ?place ?label COUNT(?label) AS ?Count \
  801. WHERE{ \
  802. ?place_to owl:sameAs <{URI}> . \
  803. ?event_to crm:P26_moved_to ?place_to ; \
  804. rdf:type crm:EL3_Receive_Letter ; \
  805. rdfs:subClassOf ?event . \
  806. ?event_from rdfs:subClassOf ?event ; \
  807. rdf:type crm:EL2_Send_Letter ; \
  808. crm:P27_moved_from ?place . \
  809. ?place rdfs:label ?label \
  810. } \
  811. ORDER BY DESC (?Count)",
  812. queryCount2 : " SELECT ?place ?label COUNT(?label) AS ?Count \
  813. WHERE{ \
  814. ?place_from owl:sameAs <{URI}> . \
  815. ?event_from crm:P27_moved_from ?place_from ; \
  816. rdf:type crm:EL2_Send_Letter ; \
  817. rdfs:subClassOf ?event . \
  818. ?event_to rdfs:subClassOf ?event ; \
  819. rdf:type crm:EL2_Send_Letter ; \
  820. crm:P27_moved_from ?place . \
  821. ?place rdfs:label ?label . \
  822. } \
  823. ORDER BY DESC (?Count) "
  824. },
  825. querySchedaOpera : {
  826. 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 \
  827. WHERE { \
  828. VALUES ?uri {<{URI}>} \
  829. GRAPH ?graph {?uri rdfs:label ?label} \
  830. OPTIONAL {?uri crm:P3_has_note ?note } \
  831. ?uri crm:P128_carries ?Inf_Obj . \
  832. OPTIONAL {?Inf_Obj crm:P1_is_identified_by ?uriTitle . \
  833. ?uriTitle rdf:type crm:E35_Title; \
  834. rdfs:label ?title } \
  835. OPTIONAL {?Inf_Obj crm:P2_has_type ?uriType . \
  836. ?uriType rdfs:label ?type } \
  837. OPTIONAL {?uri crm:P43_has_dimension ?uriDimension . \
  838. ?uriDimension crm:P90_has_value ?value; \
  839. crm:P91_has_unit ?uri_unit . \
  840. ?uri_unit rdfs:label ?unit } \
  841. OPTIONAL {?uri crm:P1_is_identified_by ?uriIdentifier . \
  842. ?uriIdentifier rdfs:label ?identifier } \
  843. OPTIONAL {?uri crm:P45_consists_of ?uriMaterial . \
  844. ?uriMaterial rdfs:label ?material } \
  845. OPTIONAL {?uri crm:P44_has_condition ?uriCondition . \
  846. ?uriCondition crm:P2_has_type ?condition} \
  847. OPTIONAL {?uri crm:P54_has_current_permanent_location ?current_location } \
  848. OPTIONAL {?uri crm:P62_depicts ?uriSubject . \
  849. ?uriSubject rdfs:label ?subject; \
  850. crm:P2_has_type 'Identificazione Iconografica' .} \
  851. OPTIONAL {?uri crm:P52_has_current_owner ?uriOwner . \
  852. ?uriOwner rdfs:label ?current_owner } \
  853. }",
  854. 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) \
  855. WHERE { \
  856. VALUES ?uri {<{URI}>} \
  857. ?uri crm:P128_carries ?Information_Object . \
  858. ?Information_Object crm:P108i_was_produced_by ?Production . \
  859. OPTIONAL {?Production crm:P4_has_time-span ?uriTS ; \
  860. crm:P32_used_general_technique ?uriTecne . \
  861. ?uriTS rdfs:label ?time_span . \
  862. ?uriTecne rdfs:label ?technique} \
  863. OPTIONAL {?pc crm:P01_has_domain ?Production ; \
  864. crm:P02_has_range ?uriPerson ; \
  865. crm:P14.1_in_the_role_of ?uriRole . \
  866. ?uriPerson rdfs:label ?person . \
  867. ?uriRole rdfs:label ?role} \
  868. }"
  869. },
  870. queryTimeSpace : {
  871. querySpace : " SELECT DISTINCT ?uri_person ?person ?event ?uri_place ?place ?coords ?time_span ?year ?month ?day \
  872. WHERE {?uri_event rdfs:label ?event ; \
  873. crm:P01_has_domain ?pc ; \
  874. crm:P7_took_place_at ?uri_NTplace ; \
  875. crm:P4_has_time-span ?uri_time_span . \
  876. ?pc crm:P02_has_range ?uri_person . \
  877. ?uri_person rdfs:label ?person . \
  878. ?uri_place owl:sameAs ?uri_NTplace . \
  879. ?uri_place crm:P168_place_is_defined_by ?coords ; \
  880. rdfs:label ?place . \
  881. ?uri_time_span rdfs:label ?time_span ; \
  882. time:year ?year . \
  883. OPTIONAL {?uri_time_span time:month ?month} \
  884. OPTIONAL {?uri_time_span time:day ?day} \
  885. } ORDER BY ?year ?month ?day",
  886. queryTime1 : " SELECT DISTINCT ?event ?uri_place ?place ?coords ?time_span ?month ?day \
  887. WHERE {?uri_event rdfs:label ?event ; \
  888. crm:P01_has_domain ?pc ; \
  889. crm:P7_took_place_at ?uri_NTplace ; \
  890. crm:P4_has_time-span ?uri_time_span . \
  891. ?pc crm:P02_has_range ?uri_person . \
  892. ?uri_person rdfs:label ?person . \
  893. ?uri_place owl:sameAs ?uri_NTplace . \
  894. ?uri_place crm:P168_place_is_defined_by ?coords ; \
  895. rdfs:label ?place . \
  896. ?uri_time_span rdfs:label ?time_span ; \
  897. time:year {YEAR} . \
  898. OPTIONAL {?uri_time_span time:month ?month} \
  899. OPTIONAL {?uri_time_span time:day ?day} \
  900. } ORDER BY ?month ?day",
  901. queryTime2 : " SELECT DISTINCT ?uri_person ?person ?event ?uri_place ?place ?coords ?year ?month ?day \
  902. WHERE {?uri_event rdfs:label ?event ; \
  903. crm:P01_has_domain ?pc ; \
  904. crm:P7_took_place_at ?uri_NTplace ; \
  905. crm:P4_has_time-span ?uri_time_span . \
  906. ?pc crm:P02_has_range ?uri_person . \
  907. ?uri_person rdfs:label ?person . \
  908. ?uri_place owl:sameAs ?uri_NTplace . \
  909. ?uri_place crm:P168_place_is_defined_by ?coords ; \
  910. rdfs:label ?place . \
  911. ?uri_time_span rdfs:label '{DATE}' . \
  912. OPTIONAL {?uri_time_span time:year ?year} \
  913. OPTIONAL {?uri_time_span time:month ?month} \
  914. OPTIONAL {?uri_time_span time:day ?day} \
  915. } ORDER BY ?year ?month ?day",
  916. queryTimeLetters : " SELECT DISTINCT ?uri_subject ?subject ?uri_place ?place ?coords ?time_span ?year ?month ?day \
  917. WHERE {?uri_subject rdf:type crm:E22_Man-Made_Object ; \
  918. rdfs:label ?subject ; \
  919. crm:P25i_moved_by ?event1 . \
  920. ?send1 rdfs:subClassOf ?event1 ; \
  921. crm:P4_has_time-span ?uri_time_span . \
  922. ?uri_time_span rdfs:label ?time_span ; \
  923. time:year ?year ; \
  924. time:month ?month ; \
  925. time:day ?day . \
  926. ?uri_subject crm:P25i_moved_by ?event2 . \
  927. ?send2 rdfs:subClassOf ?event2 ; \
  928. crm:P27_moved_from ?uri_placeNT . \
  929. ?uri_place ?property ?uri_placeNT ; \
  930. rdfs:label ?place ; \
  931. crm:P168_place_is_defined_by ?coords \
  932. } ORDER BY ?year ?month ?day"
  933. },
  934. queryRicercaAvanzata : {
  935. queryOggetto : "SELECT DISTINCT ?graph AS ?g ?uri ?name ?identifier ?material ?owner ?type ?start_date ?end_date \
  936. WHERE {GRAPH ?graph {?uri rdf:type crm:E22_Man-Made_Object} \
  937. ?uri rdfs:label ?name . \
  938. OPTIONAL {?uri crm:P1_is_identified_by ?uri_identifier . \
  939. ?uri_identifier rdfs:label ?identifier . } \
  940. OPTIONAL {?uri crm:P45_consist_of ?uri_material . \
  941. ?uri_material rdfs:label ?material . } \
  942. OPTIONAL {?uri crm:P2_has_type ?uri_type . \
  943. ?uri_type rdfs:label ?type . } \
  944. OPTIONAL {?uri crm:P52_has_current_owner ?uri_owner . \
  945. ?uri_owner rdfs:label ?owner . } \
  946. OPTIONAL {?uri crm:P92i_was_brought_into_existence_by ?creationI . \
  947. ?creationI crm:P2_has_type 'Inizio'^^<http://www.w3.org/2001/XMLSchema#string> ; \
  948. crm:P4_has_time-span ?uri_time_spanI . \
  949. ?uri_time_spanI rdfs:label ?start_date . } \
  950. OPTIONAL {?uri crm:P92i_was_brought_into_existence_by ?creationF . \
  951. ?creationF crm:P2_has_type 'Fine'^^<http://www.w3.org/2001/XMLSchema#string> ; \
  952. crm:P4_has_time-span ?uri_time_spanF . \
  953. ?uri_time_spanF rdfs:label ?end_date . } \
  954. }",
  955. 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 \
  956. WHERE { \
  957. GRAPH ?graph {?uri rdfs:label ?label} \
  958. ?uri foaf:name ?name . \
  959. ?uri foaf:givenName ?givenName . \
  960. OPTIONAL {?uri foaf:familyName ?familyName} \
  961. OPTIONAL {?uri foaf:gender ?gender} \
  962. OPTIONAL {?uri person:patronymicName ?patronymic } \
  963. OPTIONAL {?uri crm:P74_has_current_or_former_residence ?uri_provenienza . \
  964. ?uri_provenienza crm:P2_has_type 'Provenienza'; \
  965. rdfs:label ?provenienza . } \
  966. OPTIONAL {?uri crm:P2_has_type ?uri_person_type . \
  967. ?uri_person_type rdfs:label ?person_type } \
  968. OPTIONAL {?uri schema:hasOccupation ?uriOccupation . \
  969. ?uriOccupation rdf:type schema:Occupation; \
  970. rdfs:label ?occupation } \
  971. OPTIONAL {?uri schema:honorificPrefix ?qualification} \
  972. OPTIONAL {?uri crm:P100i_died_in ?Death . \
  973. OPTIONAL {?Death crm:P4_has_time-span ?Death_TS . \
  974. ?Death_TS rdfs:label ?Death_Date . } \
  975. OPTIONAL {?Death crm:P7_took_place_at ?Place_D . \
  976. ?Place_D rdfs:label ?Death_Place } \
  977. } \
  978. OPTIONAL {?uri crm:P98i_was_born ?Birth . \
  979. OPTIONAL {?Birth crm:P4_has_time-span ?Birth_TS . \
  980. ?Birth_TS rdfs:label ?Birth_Date . } \
  981. OPTIONAL {?Birth crm:P7_took_place_at ?Place_B . \
  982. ?Place_B rdfs:label ?Birth_Place } \
  983. } \
  984. OPTIONAL {?uri schema:alternateName ?alias . } \
  985. OPTIONAL {?uri owl:sameAs ?variant . \
  986. ?variant foaf:name ?otherName . } \
  987. } ",
  988. 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 \
  989. WHERE {GRAPH ?graph {?uri rdf:type crm:E22_Man-Made_Object} \
  990. ?uri rdfs:label ?name ; \
  991. crm:P2_has_type 'Opera d\'Arte' . \
  992. OPTIONAL {?uri crm:P1_is_identified_by ?uri_identifier . \
  993. ?uri_identifier rdfs:label ?identifier . } \
  994. OPTIONAL {?uri crm:P45_consists_of ?uri_material . \
  995. ?uri_material rdfs:label ?material . } \
  996. OPTIONAL {?uri crm:P52_has_current_owner ?uri_owner . \
  997. ?uri_owner rdfs:label ?owner . } \
  998. ?production crm:P108_has_produced ?uri . \
  999. OPTIONAL {?production crm:P32_used_general_technique ?uri_teche . \
  1000. ?uri_teche rdfs:label ?technique . } \
  1001. OPTIONAL {?pc crm:P01_has_domain ?production ; \
  1002. crm:P02_has_range ?uri_person . \
  1003. ?uri_person rdfs:label ?name_artist .} \
  1004. OPTIONAL {?uri crm:P62_depicts ?uri_subject . \
  1005. ?uri_subject rdfs:label ?subject . } \
  1006. OPTIONAL {?productionI crm:P108_has_produced ?uri ; \
  1007. crm:P2_has_type 'Inizio'^^<http://www.w3.org/2001/XMLSchema#string> ; \
  1008. crm:P4_has_time-span ?uri_time_spanI . \
  1009. ?uri_time_spanI rdfs:label ?start_date . } \
  1010. OPTIONAL {?productionF crm:P108_has_produced ?uri ; \
  1011. crm:P2_has_type 'Fine'^^<http://www.w3.org/2001/XMLSchema#string> ; \
  1012. crm:P4_has_time-span ?uri_time_spanF . \
  1013. ?uri_time_spanF rdfs:label ?end_date . } \
  1014. }",
  1015. queryLettere : " SELECT DISTINCT * \
  1016. WHERE { GRAPH ?graph {?uri rdf:type crm:E73_Information_Object} \
  1017. ?uri crm:P2_has_type ?uri_type . \
  1018. ?uri_type rdfs:label 'lettera' . \
  1019. ?uri crm:P72_has_language ?uri_language . \
  1020. ?uri_language rdfs:label ?language ; \
  1021. crm:P3_has_note ?uri_area . \
  1022. ?uri_area rdfs:label ?linguistic_area . \
  1023. ?uri_documentation crm:P70_documents ?uri ; \
  1024. crm:P1_is_identified_by ?uri_editionL . \
  1025. ?uri_editionL rdfs:label ?long_edition ; \
  1026. crm:P139_has_alternative_form ?uri_editionS . \
  1027. ?uri_editionS rdfs:label ?short_edition . \
  1028. ?uri_doc crm:P128_carries ?uri . \
  1029. GRAPH <http://dev.restore.ovi.cnr.it:8890/aspo/datini> {?uri_doc crm:P25i_moved_by ?event} \
  1030. ?send rdfs:subClassOf ?event ; \
  1031. rdf:type crm:EL2_Send_Letter . \
  1032. OPTIONAL {?send crm:P4_has_time-span ?uri_time_spanS. \
  1033. ?uri_time_spanS rdfs:label ?start_date . } \
  1034. OPTIONAL {?send crm:P27_moved_from ?uri_placeS . \
  1035. ?uri_placeS rdfs:label ?start_place } \
  1036. OPTIONAL {?send crm:P01_has_domain ?pcS . \
  1037. ?pcS crm:P02_has_range ?uri_sender . \
  1038. ?uri_sender rdfs:label ?mittente .} \
  1039. ?receive rdfs:subClassOf ?event ; \
  1040. rdf:type crm:EL3_Receive_Letter . \
  1041. OPTIONAL {?receive crm:P4_has_time-span ?uri_time_spanE . \
  1042. ?uri_time_spanE rdfs:label ?end_date . } \
  1043. OPTIONAL {?received crm:P26_moved_to ?uri_placeE . \
  1044. ?uri_placeE rdfs:label ?end_place } \
  1045. OPTIONAL {?receive crm:P01_has_domain ?pcR . \
  1046. ?pcR crm:P02_has_range ?uri_receiver . \
  1047. ?uri_receiver rdfs:label ?destinatario .} \
  1048. ?uri crm:P67_refers_to ?uri_lemma . \
  1049. ?uri_lemma rdfs:label ?lemma . \
  1050. }"
  1051. },
  1052. queryCustom : {
  1053. queryTipo : " SELECT DISTINCT ?subject ?label \
  1054. WHERE {GRAPH ?g {?subject rdf:type crm:E22_Man-Made_Object} \
  1055. ?subject crm:P2_has_type '{TYPE}' ; \
  1056. rdfs:label ?label . \
  1057. }",
  1058. queryOccupazione : "SELECT DISTINCT ?subject ?name ?id ?givenName ?familyName ?patronymic ?provenienza SAMPLE(?occupation) AS ?occupation \
  1059. WHERE {GRAPH ?g {?subject rdf:type crm:E21_Person} \
  1060. ?subject foaf:name ?name . \
  1061. OPTIONAL {?subject crm:P1_is_identified_by ?id . \
  1062. ?id rdfs:label ?identifier } \
  1063. OPTIONAL {?subject foaf:givenName ?givenName} \
  1064. OPTIONAL {?subject foaf:familyName ?familyName} \
  1065. OPTIONAL {?subject person:patronymicName ?patronymic } \
  1066. OPTIONAL {?subject crm:P74_has_current_or_former_residence ?uri_provenienza . \
  1067. ?uri_provenienza crm:P2_has_type 'Provenienza'; \
  1068. rdfs:label ?provenienza . } \
  1069. ?subject schema:hasOccupation ?uri_occupation . \
  1070. ?uri_occupation rdfs:label ?occupation . \
  1071. ?occupation bif:contains '\"{WORD}\"' \
  1072. }",
  1073. queryOpereGrafo : "SELECT DISTINCT ?subject ?label \
  1074. WHERE {GRAPH <{GRAPH}> {?subject rdf:type crm:E22_Man-Made_Object } \
  1075. ?subject rdfs:label ?label} "
  1076. }
  1077. };