managerQuery.js 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  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 ?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 { \
  80. {?subject crm:P2_has_type ?type .} \
  81. UNION { \
  82. ?subject crm:P2_has_type ?uri_type . \
  83. ?uri_type rdfs:label ?type . } \
  84. } \
  85. ?subject crm:P67_refers_to ?object_uri . \
  86. ?object_uri rdfs:label ?object_Label . \
  87. <{WORD}> \
  88. }"
  89. },
  90. queryPER: {
  91. queryNome: " SELECT DISTINCT ?g AS ?graph ?subject ?name \
  92. WHERE { <{GRAPH}> \
  93. GRAPH ?g { ?subject ?property ?object . } \
  94. ?subject rdf:type crm:E21_Person ; \
  95. foaf:name ?name . \
  96. ?name bif:contains <{WORD}> . \
  97. } ",
  98. queryNote: " SELECT DISTINCT ?g AS ?graph ?subject ?name ?note \
  99. WHERE {<{GRAPH}> \
  100. GRAPH ?g { ?subject ?property ?object . } \
  101. ?subject rdf:type crm:E21_Person ; \
  102. foaf:name ?name . \
  103. ?subject crm:P3_has_note ?note . \
  104. ?note bif:contains <{WORD}> . \
  105. }",
  106. queryOccupazione: " SELECT DISTINCT ?g AS ?graph ?subject ?name ?occupation \
  107. WHERE {<{GRAPH}> \
  108. GRAPH ?g { ?subject ?property ?object . } \
  109. ?subject rdf:type crm:E21_Person ; \
  110. foaf:name ?name . \
  111. ?subject schema:hasOccupation ?uri_occupation . \
  112. ?uri_occupation rdfs:label ?occupation . \
  113. ?occupation bif:contains <{WORD}> . \
  114. }"
  115. },
  116. queryLG: {
  117. queryLuoghi : " SELECT DISTINCT ?g AS ?graph ?subject ?label \
  118. WHERE {<{GRAPH}> \
  119. GRAPH ?g { ?subject ?property ?object } \
  120. ?subject rdfs:label ?label ; \
  121. rdf:type crm:E53_Place ; \
  122. crm:P168_place_is_defined_by ?coords . \
  123. ?label bif:contains <{WORD}> . \
  124. }"
  125. },
  126. queryRES: {
  127. queryExchange : " SELECT DISTINCT ?uri_document ?document ?time_span_from ?time_span_to ?uri_place_from ?place_from ?uri_place_to ?place_to \
  128. { \
  129. ?event_from rdfs:subClassOf ?event ; \
  130. rdf:type crm:EL2_Send_Letter . \
  131. ?event_to rdfs:subClassOf ?event ; \
  132. rdf:type crm:EL3_Receive_Letter . \
  133. \
  134. ?event_from crm:P01_has_domain ?pc_from . \
  135. ?pc_from crm:P02_has_range <{MITTENTE}> . \
  136. OPTIONAL {?event_from crm:P4_has_time-span ?uri_time_span_from . \
  137. ?uri_time_span_from rdfs:label ?time_span_from} \
  138. OPTIONAL {?event_from crm:P27_moved_from ?aspo_place_from . \
  139. ?aspo_place_from owl:sameAs ?uri_place_from . \
  140. ?uri_place_from rdfs:label ?place_from ; \
  141. crm:P168_place_is_defined_by ?coords_from} \
  142. \
  143. ?event_to crm:P01_has_domain ?pc_to . \
  144. ?pc_to crm:P02_has_range <{DESTINATARIO}> . \
  145. OPTIONAL {?event_to crm:P4_has_time-span ?uri_time_span_to . \
  146. ?uri_time_span_to rdfs:label ?time_span_to} \
  147. OPTIONAL {?event_to crm:P26_moved_to ?aspo_place_to . \
  148. ?aspo_place_to owl:sameAs ?uri_place_to . \
  149. ?uri_place_to rdfs:label ?place_to ; \
  150. crm:P168_place_is_defined_by ?coords_to} \
  151. \
  152. ?uri_document crm:P25i_moved_by ?event ; \
  153. rdfs:label ?document . \
  154. }",
  155. queryEsploraDocumenti : " SELECT DISTINCT ?document ?uri_document ?uri_infObj (group_concat(distinct ?type ;separator=', ') as ?types) \
  156. WHERE { \
  157. { ?uri_thing crm:P128_carries <{URI}> . \
  158. ?uri_infObj crm:P67_refers_to ?uri_thing . \
  159. } UNION { \
  160. ?uri_infObj crm:P67_refers_to <{URI}> . } \
  161. ?uri_document crm:P128_carries ?uri_infObj ; \
  162. rdfs:label ?document . \
  163. OPTIONAL {?uri_infObj crm:P2_has_type ?uri_type . \
  164. ?uri_type rdfs:label ?type . } \
  165. }"
  166. }
  167. };