iqvoc 4.3.3 → 4.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (624) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -0
  3. data/Gemfile +20 -21
  4. data/Gemfile.lock +212 -171
  5. data/LICENSE +1 -1
  6. data/README.md +12 -4
  7. data/app/assets/javascripts/framework.js +3 -3
  8. data/app/assets/javascripts/iqvoc/concept_mapper.js +6 -4
  9. data/app/assets/javascripts/iqvoc/entityselect.js.erb +19 -6
  10. data/app/assets/javascripts/iqvoc/federated_concept_mapper.js +4 -2
  11. data/app/assets/javascripts/iqvoc/onebox.js.erb +8 -9
  12. data/app/assets/stylesheets/framework.css.scss +1 -2
  13. data/app/assets/stylesheets/iqvoc/components/_components.css.scss +17 -7
  14. data/app/concerns/first_level_object_validations.rb +22 -0
  15. data/app/concerns/versioning.rb +187 -0
  16. data/app/controllers/collections/versions_controller.rb +144 -0
  17. data/app/controllers/collections_controller.rb +46 -29
  18. data/app/controllers/concepts/alphabetical_controller.rb +9 -6
  19. data/app/controllers/concepts/expired_controller.rb +1 -1
  20. data/app/controllers/concepts/hierarchical_controller.rb +15 -17
  21. data/app/controllers/concepts/scheme_controller.rb +8 -4
  22. data/app/controllers/concepts/untranslated_controller.rb +2 -4
  23. data/app/controllers/concepts/versions_controller.rb +24 -25
  24. data/app/controllers/concepts_controller.rb +40 -37
  25. data/app/controllers/concerns/dataset_initialization.rb +1 -2
  26. data/app/controllers/dashboard_controller.rb +6 -9
  27. data/app/controllers/exports_controller.rb +65 -0
  28. data/app/controllers/frontpage_controller.rb +0 -2
  29. data/app/controllers/hierarchy_controller.rb +24 -25
  30. data/app/controllers/imports_controller.rb +18 -9
  31. data/app/controllers/instance_configuration_controller.rb +19 -16
  32. data/app/controllers/rdf_controller.rb +8 -9
  33. data/app/controllers/remote_labels_controller.rb +2 -3
  34. data/app/controllers/search_results_controller.rb +33 -37
  35. data/app/controllers/triplestore_sync_controller.rb +12 -13
  36. data/app/controllers/user_sessions_controller.rb +10 -7
  37. data/app/controllers/users_controller.rb +20 -7
  38. data/app/exceptions/invalid_string_literal_error.rb +7 -0
  39. data/app/helpers/application_helper.rb +16 -24
  40. data/app/helpers/concepts_helper.rb +14 -20
  41. data/app/helpers/dashboard_helper.rb +11 -13
  42. data/app/helpers/form_helper.rb +3 -6
  43. data/app/helpers/link_helper.rb +3 -3
  44. data/app/helpers/navigation_helper.rb +15 -15
  45. data/app/helpers/rdf_helper.rb +29 -3
  46. data/app/helpers/rdf_namespaces_helper.rb +11 -0
  47. data/app/helpers/search_results_helper.rb +1 -3
  48. data/app/helpers/widget_helper.rb +0 -2
  49. data/app/jobs/export_job.rb +19 -0
  50. data/app/jobs/import_job.rb +2 -2
  51. data/app/models/collection/base.rb +25 -41
  52. data/app/models/collection/member/base.rb +4 -6
  53. data/app/models/collection/member/skos/base.rb +3 -4
  54. data/app/models/collection/skos/base.rb +4 -6
  55. data/app/models/collection/unordered.rb +1 -4
  56. data/app/models/concept/base.rb +53 -77
  57. data/app/models/concept/relation/base.rb +8 -10
  58. data/app/models/concept/relation/reverse_relation_extension.rb +4 -6
  59. data/app/models/concept/relation/skos/base.rb +5 -7
  60. data/app/models/concept/relation/skos/broader/base.rb +1 -3
  61. data/app/models/concept/relation/skos/broader/mono.rb +1 -3
  62. data/app/models/concept/relation/skos/broader/poly.rb +1 -3
  63. data/app/models/concept/relation/skos/narrower/base.rb +2 -4
  64. data/app/models/concept/relation/skos/related.rb +0 -2
  65. data/app/models/concept/skos/base.rb +4 -5
  66. data/app/models/concept/skos/scheme.rb +8 -8
  67. data/app/models/concept/validations.rb +25 -40
  68. data/app/models/configuration_setting.rb +1 -3
  69. data/app/models/dataset/adaptors/iqvoc/alphabetical_search_adaptor.rb +3 -3
  70. data/app/models/dataset/adaptors/iqvoc/http_adaptor.rb +2 -2
  71. data/app/models/dataset/adaptors/iqvoc/search_adaptor.rb +8 -8
  72. data/app/models/dataset/iqvoc_dataset.rb +2 -2
  73. data/app/models/export.rb +32 -0
  74. data/app/models/import.rb +2 -0
  75. data/app/models/label/base.rb +12 -18
  76. data/app/models/label/skos/base.rb +2 -2
  77. data/app/models/labeling/base.rb +7 -9
  78. data/app/models/labeling/skos/alt_label.rb +0 -2
  79. data/app/models/labeling/skos/base.rb +10 -19
  80. data/app/models/labeling/skos/hidden_label.rb +1 -3
  81. data/app/models/labeling/skos/pref_label.rb +0 -2
  82. data/app/models/match/base.rb +5 -7
  83. data/app/models/match/skos/base.rb +1 -3
  84. data/app/models/match/skos/broad_match.rb +0 -2
  85. data/app/models/match/skos/close_match.rb +0 -2
  86. data/app/models/match/skos/exact_match.rb +0 -2
  87. data/app/models/match/skos/mapping_relation.rb +0 -2
  88. data/app/models/match/skos/narrow_match.rb +0 -2
  89. data/app/models/match/skos/related_match.rb +0 -2
  90. data/app/models/notation/base.rb +6 -8
  91. data/app/models/note/annotated/base.rb +2 -4
  92. data/app/models/note/base.rb +15 -16
  93. data/app/models/note/skos/base.rb +7 -9
  94. data/app/models/note/skos/change_note.rb +2 -4
  95. data/app/models/note/skos/definition.rb +1 -3
  96. data/app/models/note/skos/editorial_note.rb +0 -2
  97. data/app/models/note/skos/example.rb +0 -2
  98. data/app/models/note/skos/history_note.rb +0 -2
  99. data/app/models/note/skos/scope_note.rb +0 -2
  100. data/app/models/search_extension.rb +3 -6
  101. data/app/models/user.rb +7 -8
  102. data/app/models/user_session.rb +0 -2
  103. data/app/presenters/alphabetical_search_result.rb +2 -2
  104. data/app/presenters/search_result_remote.rb +1 -1
  105. data/app/uploaders/base.rb +21 -0
  106. data/app/uploaders/rdf_uploader.rb +7 -0
  107. data/app/views/collections/_data.html.erb +40 -0
  108. data/app/views/collections/_form.html.erb +5 -4
  109. data/app/views/collections/_sidebar.html.erb +1 -0
  110. data/app/views/collections/show.iqrdf +4 -20
  111. data/app/views/collections/show_published.html.erb +16 -0
  112. data/app/views/collections/show_unpublished.html.erb +41 -0
  113. data/app/views/concepts/_form.html.erb +13 -8
  114. data/app/views/concepts/alphabetical/index.html.erb +2 -2
  115. data/app/views/concepts/expired/index.html.erb +1 -1
  116. data/app/views/concepts/scheme/_sidebar.html.erb +1 -0
  117. data/app/views/concepts/scheme/edit.html.erb +6 -4
  118. data/app/views/concepts/scheme/show.html.erb +1 -1
  119. data/app/views/concepts/scheme/show.iqrdf +3 -2
  120. data/app/views/concepts/show.iqrdf +3 -2
  121. data/app/views/concepts/show_published.html.erb +2 -2
  122. data/app/views/concepts/show_unpublished.html.erb +7 -7
  123. data/app/views/concepts/sidebars/_singular.html.erb +1 -0
  124. data/app/views/dashboard/_sidebar.html.erb +2 -5
  125. data/app/views/exports/index.html.erb +39 -0
  126. data/app/views/exports/show.html.erb +7 -0
  127. data/app/views/frontpage/index.html.erb +10 -7
  128. data/app/views/hierarchy/show.iqrdf +3 -2
  129. data/app/views/imports/index.html.erb +23 -30
  130. data/app/views/instance_configuration/index.html.erb +9 -8
  131. data/app/views/layouts/_controls.html.erb +1 -1
  132. data/app/views/layouts/_navigation.html.erb +13 -24
  133. data/app/views/layouts/application.html.erb +3 -2
  134. data/app/views/partials/collection/_edit_link_base.html.erb +4 -0
  135. data/app/views/partials/collection/_new_link_base.html.erb +3 -0
  136. data/app/views/partials/concept/_new_link_base.html.erb +1 -1
  137. data/app/views/partials/concept/relation/_edit_base.html.erb +1 -1
  138. data/app/views/partials/concept/relation/_edit_ranked.html.erb +1 -1
  139. data/app/views/partials/concept/relation/_ranked.html.erb +1 -1
  140. data/app/views/partials/labeling/skos/_edit_base.html.erb +5 -8
  141. data/app/views/partials/match/_edit_base.html.erb +8 -3
  142. data/app/views/partials/notation/_edit_base.html.erb +5 -5
  143. data/app/views/partials/note/_edit_base.html.erb +6 -7
  144. data/app/views/partials/note/skos/_edit_change_note.html.erb +10 -13
  145. data/app/views/rdf/dataset.iqrdf +3 -2
  146. data/app/views/search_results/_form.html.erb +9 -9
  147. data/app/views/search_results/_sidebar.html.erb +1 -0
  148. data/app/views/search_results/index.html.erb +1 -1
  149. data/app/views/search_results/index.iqrdf +3 -2
  150. data/app/views/search_results/sections/_collection.html.erb +6 -3
  151. data/app/views/search_results/sections/_datasets.html.erb +17 -14
  152. data/app/views/search_results/sections/_klass.html.erb +10 -7
  153. data/app/views/search_results/sections/_languages.html.erb +17 -14
  154. data/app/views/search_results/sections/_mode.html.erb +11 -8
  155. data/app/views/search_results/sections/_terms.html.erb +10 -7
  156. data/app/views/search_results/sections/_type.html.erb +23 -5
  157. data/app/views/triplestore_sync/index.html.erb +3 -2
  158. data/app/views/user_sessions/_form.html.erb +5 -5
  159. data/app/views/users/_form.html.erb +13 -10
  160. data/app/views/users/index.html.erb +27 -24
  161. data/config/application.rb +2 -29
  162. data/config/boot.rb +1 -1
  163. data/config/database.yml.mysql +3 -3
  164. data/config/engine.rb +7 -8
  165. data/config/environments/heroku.rb +0 -10
  166. data/config/initializers/apipie.rb +5 -5
  167. data/config/initializers/assets.rb +3 -0
  168. data/config/initializers/cookies_serializer.rb +3 -0
  169. data/config/initializers/filter_parameter_logging.rb +4 -0
  170. data/config/initializers/iqvoc.rb +4 -2
  171. data/config/initializers/mime_types.rb +3 -2
  172. data/config/initializers/{secret_token.rb.template → secret_token.rb} +1 -1
  173. data/config/initializers/session_store.rb +1 -1
  174. data/config/initializers/wrap_parameters.rb +14 -0
  175. data/config/locales/activerecord.de.yml +13 -0
  176. data/config/locales/activerecord.en.yml +11 -0
  177. data/config/locales/de.yml +17 -5
  178. data/config/locales/en.yml +17 -6
  179. data/config/routes.rb +51 -38
  180. data/config/secrets.yml +11 -0
  181. data/db/migrate/20100927101502_create_schema.rb +122 -122
  182. data/db/migrate/20101125141218_add_collection_tables.rb +2 -2
  183. data/db/migrate/20101210153916_add_indexes_to_collections.rb +2 -2
  184. data/db/migrate/20110204121244_create_collection_labels.rb +2 -2
  185. data/db/migrate/20110208084250_change_origin_lengths.rb +4 -4
  186. data/db/migrate/20110408120357_remove_classifications_and_classifiers.rb +15 -20
  187. data/db/migrate/20110408120740_remove_xl_specfic_stuff.rb +25 -28
  188. data/db/migrate/20110420133640_change_value_in_notes.rb +1 -1
  189. data/db/migrate/20110427120534_add_published_at_to_labels.rb +2 -2
  190. data/db/migrate/20110512132624_extend_notes_value_field_length.rb +1 -1
  191. data/db/migrate/20110525103100_separate_note_annotation_predicates.rb +5 -5
  192. data/db/migrate/20120119000000_create_configuration_settings.rb +1 -3
  193. data/db/migrate/20120201120736_add_top_term_to_concepts.rb +1 -3
  194. data/db/migrate/20120326102037_add_rank_to_concept_relations.rb +1 -1
  195. data/db/migrate/20130315093255_add_notations.rb +3 -3
  196. data/db/migrate/20130508103137_adjust_note_languages_setting.rb +5 -7
  197. data/db/migrate/20131220134356_create_delayed_jobs.rb +5 -5
  198. data/db/migrate/20131220144601_create_imports.rb +1 -1
  199. data/db/migrate/20140423095147_create_exports.rb +13 -0
  200. data/db/migrate/20140425130615_add_fk_indexes_to_exports_and_imports.rb +6 -0
  201. data/db/migrate/20140505144919_add_import_file_to_imports.rb +5 -0
  202. data/db/migrate/20140506073428_add_missing_imports_attributes.rb +6 -0
  203. data/db/migrate/20140506133619_add_namespace_to_exports.rb +5 -0
  204. data/db/schema.rb +57 -84
  205. data/db/seeds.rb +4 -4
  206. data/iqvoc.gemspec +21 -20
  207. data/lib/engine_tasks/db.rake +4 -3
  208. data/lib/generators/app/template.rb +19 -20
  209. data/lib/iqvoc.rb +0 -1
  210. data/lib/iqvoc/ability.rb +10 -13
  211. data/lib/iqvoc/configuration/collection.rb +2 -1
  212. data/lib/iqvoc/configuration/concept.rb +7 -8
  213. data/lib/iqvoc/configuration/core.rb +82 -82
  214. data/lib/iqvoc/configuration/label.rb +0 -1
  215. data/lib/iqvoc/configuration/sync.rb +4 -5
  216. data/lib/iqvoc/controller_extensions.rb +14 -15
  217. data/lib/iqvoc/deep_cloning.rb +8 -10
  218. data/lib/iqvoc/environments/development.rb +9 -9
  219. data/lib/iqvoc/environments/production.rb +4 -11
  220. data/lib/iqvoc/environments/test.rb +2 -8
  221. data/lib/iqvoc/inline_data_helper.rb +3 -5
  222. data/lib/iqvoc/instance_configuration.rb +5 -8
  223. data/lib/iqvoc/maker.rb +28 -30
  224. data/lib/iqvoc/navigation.rb +2 -2
  225. data/lib/iqvoc/origin.rb +6 -42
  226. data/lib/iqvoc/rankable.rb +0 -1
  227. data/lib/iqvoc/rdf_sync.rb +19 -21
  228. data/lib/iqvoc/rdfapi.rb +2 -2
  229. data/lib/iqvoc/skos_exporter.rb +153 -0
  230. data/lib/iqvoc/skos_importer.rb +125 -56
  231. data/lib/iqvoc/version.rb +1 -1
  232. data/lib/multi_logger.rb +0 -1
  233. data/lib/string.rb +1 -3
  234. data/lib/tasks/exporter.rake +22 -0
  235. data/lib/tasks/importer.rake +2 -1
  236. data/lib/tasks/reset.rake +14 -0
  237. data/public/export/{104047454295817920610168807659129435311.nt → 10110.nt} +0 -0
  238. data/public/export/{10726.nt → 10528.nt} +0 -0
  239. data/public/export/{10751365034669120987598940220863369604.nt → 11105.nt} +0 -0
  240. data/public/export/{111691466774189666307584118743393932328.nt → 11353.nt} +0 -0
  241. data/public/export/{12325399400132639231204595208154762660.nt → 11790.nt} +0 -0
  242. data/public/export/12931.nt +1 -0
  243. data/public/export/{151644452539207638297695765208032122293.nt → 1385.nt} +0 -0
  244. data/public/export/{15263706163704853684442315777380853572.nt → 15083.nt} +0 -0
  245. data/public/export/{15327.nt → 16538.nt} +0 -0
  246. data/public/export/{15666.nt → 1879.nt} +0 -0
  247. data/public/export/{173626129450223321263719262149444213847.nt → 19502.nt} +0 -0
  248. data/public/export/{18948.nt → 19834.nt} +0 -0
  249. data/public/export/{199578749544886032300136278910417855540.nt → 21183.nt} +0 -0
  250. data/public/export/{213890660005255527251394676521741138403.nt → 21512.nt} +0 -0
  251. data/public/export/{213987519797093111958174693910375706600.nt → 22034.nt} +0 -0
  252. data/public/export/{214800276811658695171005552465925318151.nt → 2434.nt} +0 -0
  253. data/public/export/{21930.nt → 24841.nt} +0 -0
  254. data/public/export/{220598335291843294191166072463233833628.nt → 26109.nt} +0 -0
  255. data/public/export/{242910803893093872189091525372405462985.nt → 27784.nt} +0 -0
  256. data/public/export/{24509.nt → 28422.nt} +0 -0
  257. data/public/export/{249458227092013520089223290936103182178.nt → 28627.nt} +0 -0
  258. data/public/export/{25981.nt → 29185.nt} +0 -0
  259. data/public/export/{271163890329327117562409702966294853312.nt → 30124.nt} +0 -0
  260. data/public/export/305768326302831570152374795088739069204.nt +447 -0
  261. data/public/export/3118.nt +1 -0
  262. data/public/export/{27484.nt → 31250.nt} +0 -0
  263. data/public/export/{287251617830426667971006908766107175810.nt → 31272.nt} +0 -0
  264. data/public/export/{28754.nt → 31875.nt} +0 -0
  265. data/public/export/{29022.nt → 32197.nt} +0 -0
  266. data/public/export/{293720064238755056739270868818770835353.nt → 32223.nt} +0 -0
  267. data/public/export/{29976.nt → 32324.nt} +0 -0
  268. data/public/export/{30643.nt → 33084.nt} +0 -0
  269. data/public/export/{309135899928267675232062298368405782595.nt → 33257.nt} +0 -0
  270. data/public/export/{317588775827727829310573625081613440402.nt → 33545.nt} +0 -0
  271. data/public/export/{3199.nt → 34179.nt} +0 -0
  272. data/public/export/34582.nt +1 -0
  273. data/public/export/{32054.nt → 35271.nt} +0 -0
  274. data/public/export/35426.nt +36 -0
  275. data/public/export/{327890543532187929176278243423558506722.nt → 36234.nt} +0 -0
  276. data/public/export/{33055.nt → 36363.nt} +0 -0
  277. data/public/export/{337748600310244218106909976567220577473.nt → 36559.nt} +0 -0
  278. data/public/export/{3383.nt → 37333.nt} +0 -0
  279. data/public/export/{33936.nt → 38332.nt} +0 -0
  280. data/public/export/{33993.nt → 38461.nt} +0 -0
  281. data/public/export/{34906.nt → 38721.nt} +0 -0
  282. data/public/export/{35365.nt → 39469.nt} +0 -0
  283. data/public/export/{37098.nt → 40637.nt} +0 -0
  284. data/public/export/{37534146541112437090211766955764945845.nt → 40746.nt} +0 -0
  285. data/public/export/{39353594202090916952403280275602550330.nt → 4297.nt} +0 -0
  286. data/public/export/{41272.nt → 43236.nt} +0 -0
  287. data/public/export/{42271.nt → 43644.nt} +0 -0
  288. data/public/export/{44392.nt → 45021.nt} +0 -0
  289. data/public/export/45120.nt +1 -0
  290. data/public/export/{45675.nt → 45552.nt} +0 -0
  291. data/public/export/{47529.nt → 46172.nt} +0 -0
  292. data/public/export/{48309.nt → 46739.nt} +0 -0
  293. data/public/export/{4956.nt → 4929.nt} +0 -0
  294. data/public/export/{49623.nt → 50335.nt} +0 -0
  295. data/public/export/{50516.nt → 51428.nt} +0 -0
  296. data/public/export/{50650725356216411444149011685563244498.nt → 51494.nt} +0 -0
  297. data/public/export/51877.nt +1 -0
  298. data/public/export/{54880.nt → 5359.nt} +0 -0
  299. data/public/export/{55142.nt → 53989.nt} +0 -0
  300. data/public/export/{55398.nt → 54563.nt} +0 -0
  301. data/public/export/{55625.nt → 54634.nt} +0 -0
  302. data/public/export/{5754.nt → 54759.nt} +0 -0
  303. data/public/export/{57727.nt → 54895.nt} +0 -0
  304. data/public/export/{58069939020968861674794480549301466954.nt → 55279.nt} +0 -0
  305. data/public/export/{5890.nt → 5567.nt} +0 -0
  306. data/public/export/{61404.nt → 57502.nt} +0 -0
  307. data/public/export/{62809.nt → 58015.nt} +0 -0
  308. data/public/export/{65156.nt → 58964.nt} +0 -0
  309. data/public/export/{6520.nt → 60674.nt} +0 -0
  310. data/public/export/{801.nt → 61265.nt} +0 -0
  311. data/public/export/{863.nt → 61895.nt} +0 -0
  312. data/public/export/{9372.nt → 62372.nt} +0 -0
  313. data/public/export/62469.nt +28 -0
  314. data/public/export/62880.nt +28 -0
  315. data/public/export/63673.nt +28 -0
  316. data/public/export/64151.nt +28 -0
  317. data/public/export/64891.nt +28 -0
  318. data/public/export/7089.nt +28 -0
  319. data/public/export/7365.nt +28 -0
  320. data/public/export/7473.nt +28 -0
  321. data/public/export/7939.nt +28 -0
  322. data/public/export/8509.nt +28 -0
  323. data/public/export/9370.nt +28 -0
  324. data/public/export/9600.nt +28 -0
  325. data/public/uploads/import/{038dd516e01fe211375441c3af8d90e8.nt → 01cb889ac483ce809435db5e37d01010.nt} +0 -0
  326. data/public/uploads/import/{07e71ca0235e798be39acd246114d962.nt → 05c5e3cc92a18a3ce176065485caafeb.nt} +0 -0
  327. data/public/uploads/import/0a539be7eb44e0aa1f4eebe485e67d32.nt +260 -0
  328. data/public/uploads/import/0ceccdec88406d5de2f9c91d6c32bd63.nt +260 -0
  329. data/public/uploads/import/{0a4c173bc9db7a5cd469c9454fdfa749.nt → 0d199979d7a157c89b517b0121f220de.nt} +0 -0
  330. data/public/uploads/import/0d1cb3a3c90c406735065c39ccf36882.nt +260 -0
  331. data/public/uploads/import/{0e8336cb2ef2c8b67767dfe8879d9cfb.nt → 1146b2566f01d412f53aefb921b8abf6.nt} +0 -0
  332. data/public/uploads/import/{0f4eb8cd6390b1c5c5354a22e533ee0e.nt → 12f08c2e20a05620666d39cabb148b90.nt} +0 -0
  333. data/public/uploads/import/{105400714d68d2207209e23826345e76.nt → 136c72e86af49d44b885c609a97050e5.nt} +0 -0
  334. data/public/uploads/import/{1130cde10b15a3f5fc203d47f6989aea.nt → 1406b0ff2e1b68d38bdafe54a54e7981.nt} +0 -0
  335. data/public/uploads/import/{1147ab054ce55abf0a5bf93b99220231.nt → 142764b92a63f20feb0e6d1398517394.nt} +0 -0
  336. data/public/uploads/import/{14b64b1f2252aba1e89d83f770d14e29.nt → 1618cd8f36abb0d25d5cee9eef4162dd.nt} +0 -0
  337. data/public/uploads/import/{1c6f11c300224248bf919885f8545daf.nt → 1838327ebac2c062a9036e0187d8c607.nt} +0 -0
  338. data/public/uploads/import/{21d34b65ef0a8156111e845992fd004f.nt → 1be9a54bb74a467fbd6321190e10a23b.nt} +0 -0
  339. data/public/uploads/import/{2783fade523132942999836a74228d64.nt → 1eb3eabccf76ddb2a6bba92eac8b84b9.nt} +0 -0
  340. data/public/uploads/import/{2bc90e07e5c42e5f26a1607756cc0ab3.nt → 1f147a50c4203690ea4b1ac66f748537.nt} +0 -0
  341. data/public/uploads/import/{2e4073a94eeae98095de9f43b5e5774a.nt → 22be1db3763deeafb6e9bdc8af7de52f.nt} +0 -0
  342. data/public/uploads/import/{32548678e7d47b3e256590d6eef6fb03.nt → 24ed4b1b10f4c9facb797d8055f3cc59.nt} +0 -0
  343. data/public/uploads/import/{330e08c32fde94fb80f656346d1f8383.nt → 25634d3f1c727c79e47104d45a169d22.nt} +0 -0
  344. data/public/uploads/import/{337790be2663214e66066b1215fdd137.nt → 25eb335ad83136428eedfd427409f5bb.nt} +0 -0
  345. data/public/uploads/import/{34b77ff970ca71511fb4b224b7dadd1c.nt → 283e799cc2342cf33550a1668e760021.nt} +0 -0
  346. data/public/uploads/import/{38de0d3c9cba92e8a3c312e7e95e7ec1.nt → 28848fff43a56cba0924478a015e4c8e.nt} +0 -0
  347. data/public/uploads/import/28a2a5974b1eed79e85d92046fe58d22.nt +260 -0
  348. data/public/uploads/import/296bea9c560bb915222cb892124c9bab.nt +260 -0
  349. data/public/uploads/import/2ac22cf493b3991b6524e7bf7c9c9483.nt +260 -0
  350. data/public/uploads/import/{3981aa91cf22e26fbf6b1312b2bcdcc8.nt → 2b0de64784aa4f574c74bd7a5ca67e81.nt} +0 -0
  351. data/public/uploads/import/{3d01f84539a62ebe6f76124e8cdbbb23.nt → 2be31e7e2493319f9cb7e210eabb84b6.nt} +0 -0
  352. data/public/uploads/import/2f7a5213d7e134237b69cbdc9c8e0985.nt +260 -0
  353. data/public/uploads/import/{3d05bb72c3751da3830cf53e966283d4.nt → 3025f07688ed08e81c430eed8e5e2b2c.nt} +0 -0
  354. data/public/uploads/import/{3e1d2f770bfe3c79a367780731536a3a.nt → 3062df55d07d30a0db0b00fc59a066ef.nt} +0 -0
  355. data/public/uploads/import/{3e41bd1875dc23401278c73bd12be881.nt → 35901d7daa6f90eb09b508eab2f19f97.nt} +0 -0
  356. data/public/uploads/import/35943ba240eb26dc43092746316a666a.nt +260 -0
  357. data/public/uploads/import/{3f3e3dbb09c3df6bfaed261311de3e7d.nt → 3a39842a235c47d341390bb5ff76b013.nt} +0 -0
  358. data/public/uploads/import/{4297d9970e47be5ced4991a083032eb9.nt → 4217de34967f03696a2d1c4ec832b395.nt} +0 -0
  359. data/public/uploads/import/{5925186958bd537ad5e79e76e3a1f714.nt → 432a521429991340c75d39069672f200.nt} +0 -0
  360. data/public/uploads/import/4410370b7349278a941ec73edc506afb.nt +260 -0
  361. data/public/uploads/import/{596c40774bb5979c8de5ce6daa58de35.nt → 44f43bafabc21e6a080bb820b86c8efa.nt} +0 -0
  362. data/public/uploads/import/{5dc5dcd978db1c59ec074e9137f0109c.nt → 4910bf38577bcef7ca835225a22d04cf.nt} +0 -0
  363. data/public/uploads/import/{5e46663e7e2eb92e5e8846d7c0f8e713.nt → 4a1092bfdd2c3e6cd684d00f2ebb48a0.nt} +0 -0
  364. data/public/uploads/import/{70022a2a7e808000dc3d55529d203480.nt → 4a924fe4d94485b794a0ac4ae2dbe7b2.nt} +0 -0
  365. data/public/uploads/import/4ab869eeeec7deaf5840548196350ffe.nt +260 -0
  366. data/public/uploads/import/{70b32583acaca5843ac7dbdc2a89de99.nt → 4d8c90b9e5b7a06e40dc9b426f19d762.nt} +0 -0
  367. data/public/uploads/import/4f884498309031e9a3b75c5d7c59b353.nt +260 -0
  368. data/public/uploads/import/{77ea050ae3a00aedd2a6e4158454a54d.nt → 503e198ce4ec0e311db1d06fc2b6962a.nt} +0 -0
  369. data/public/uploads/import/{7cc9feb5e9180d29865b9d4e81694921.nt → 51fcfdd1ba9e57f7afd8bfb3135b18be.nt} +0 -0
  370. data/public/uploads/import/{8030e54313e2c7231c4c30cd4145d576.nt → 525b24358e3b1a5afd18bbbe930bcb35.nt} +0 -0
  371. data/public/uploads/import/{8a380e32de64ffe7fce5da5068fe174f.nt → 542a2a3b0a62b9599922a67a5085c625.nt} +0 -0
  372. data/public/uploads/import/{8bb6484a9eb0c3266274c08ad8500669.nt → 5572705385339b834e975f5d7f26f89a.nt} +0 -0
  373. data/public/uploads/import/{8e0bf83a2ca503753efaa29bff6f84f6.nt → 56aafaf5adcdd148722aeaf0b37a2ba3.nt} +0 -0
  374. data/public/uploads/import/{90711ea002f6b7b4e5476e414e185603.nt → 59b6122c9a524891ae8dadf34e04f925.nt} +0 -0
  375. data/public/uploads/import/{918a5fc2c8fcdbaddc2a02588d599dcf.nt → 5d4578b7bb3e3f2067f354be5b68d08f.nt} +0 -0
  376. data/public/uploads/import/{923f9ebccb7b0e9e9fafddc60750b989.nt → 645eb1a598ae7003b45b29176587088b.nt} +0 -0
  377. data/public/uploads/import/{933e4e2baee4d91b8f7681fa4d2ad9fa.nt → 64cea1620f460841301aa57d23e6223c.nt} +0 -0
  378. data/public/uploads/import/{93f642eacd966c98645345d2ccdf578d.nt → 6bee752d1b71422389551999e1c29af9.nt} +0 -0
  379. data/public/uploads/import/{9a3d0f8d1872d4ba5dd281194ddea4a2.nt → 6c03e1aa271ca4613340130d16722850.nt} +0 -0
  380. data/public/uploads/import/{9a3f1c9de8e734b7e1d969d07ea57a83.nt → 6d829ce927bca0d0291d3ca94c87d47d.nt} +0 -0
  381. data/public/uploads/import/{9f91263fee5275ecbf303c7da0a9e84d.nt → 7019eec0ddbd6deccfa69f564e03007d.nt} +0 -0
  382. data/public/uploads/import/{9f9d6b4293be8def1b406156a3e2bcd9.nt → 70dcaf9bcb39a21172db26e20ef3abb1.nt} +0 -0
  383. data/public/uploads/import/{a230b36c3666a6b16fec6283e99b221f.nt → 7c7f872865d77373f4e5d12d3b46c6d1.nt} +0 -0
  384. data/public/uploads/import/7d630e4ae70fcdef7a26a5f54be1c87d.nt +260 -0
  385. data/public/uploads/import/{a51b35089dc096f0f1f5d5250edb8d5c.nt → 7e2154e0fb9ecfa38d7d1791ba1f91e2.nt} +0 -0
  386. data/public/uploads/import/{a5265a00946627588ecdac317c061c6c.nt → 7f5864cd2bb3608a478b6cacf213b6ef.nt} +0 -0
  387. data/public/uploads/import/{a712bf10adc7546d5c567194d7a13603.nt → 7fd575d1e51e867294cc3c55dd7b86d3.nt} +0 -0
  388. data/public/uploads/import/{a7e315db905ac7808126b600dd1f6203.nt → 81e614eb844d0a6e07724df0e0a391af.nt} +0 -0
  389. data/public/uploads/import/{a95b7d93b7483116ff13c894a46b5c1c.nt → 8635fc73b0ad52e5531f6542cf73aab0.nt} +0 -0
  390. data/public/uploads/import/{b5e47ea582afb81341f7b7084cc17a06.nt → 87e8ab3b30135925cd296a4f105fdf28.nt} +0 -0
  391. data/public/uploads/import/{b826bcfad8f18294a425d65482c46033.nt → 88f3ede5c716bcdc9ac4b16361f6014c.nt} +0 -0
  392. data/public/uploads/import/{bcf18c9e4dbe72745f4ec2878a4b1690.nt → 8a09903d5ce62375eb315fb5a28cfb1e.nt} +0 -0
  393. data/public/uploads/import/8dd67edd0888cc10c181b0cb13f114a5.nt +260 -0
  394. data/public/uploads/import/{c32855cb4b3e8616db2ef3f5f9cb5ca7.nt → 945e467cd3b86903a712322622403350.nt} +0 -0
  395. data/public/uploads/import/{c438f3150fb39b93ee01a6f8bc5bb7b9.nt → 947fc847742818ad2f8946150fa68280.nt} +0 -0
  396. data/public/uploads/import/{c7b54e24ea6bde65f8430d1d747a6dda.nt → 9668f439f7429886747a4981c53d2f7b.nt} +0 -0
  397. data/public/uploads/import/97bf213b1827e1b3fe4a93f660cd297b.nt +260 -0
  398. data/public/uploads/import/9cc1c8c8530900bb42723b35a85c997a.nt +260 -0
  399. data/public/uploads/import/{c8ee5bc696312468c4354bad6c583321.nt → a34ebe5f52348d8e0690efbbd7dbb29b.nt} +0 -0
  400. data/public/uploads/import/{cfc73574fe398be7ce684fbc17aa1bb7.nt → a6362a3aa7b0154ee5881aa4e97e4fc1.nt} +0 -0
  401. data/public/uploads/import/{d038a0416528900076cdb4a28211a84c.nt → acfb67a494ba87573b3cdd7997c7aba2.nt} +0 -0
  402. data/public/uploads/import/{d2366992f6e9e4377d02fc691fc2d3d3.nt → ae888974bc1697ae1949a95dbcaa104b.nt} +0 -0
  403. data/public/uploads/import/{d250e9b7a2819d62a43d5270031eaa6d.nt → b238195b0159fd1aca793e33ea179b1d.nt} +0 -0
  404. data/public/uploads/import/{dc14a0fa30c105a5770da2c960daaf29.nt → b36159aad53d09f5e6ca12e0dcea000c.nt} +0 -0
  405. data/public/uploads/import/{e9289f6f920cf44d0e81599410b39090.nt → b42cf56722b79ef7e6730d19130d9dfd.nt} +0 -0
  406. data/public/uploads/import/b54ffcb43a4c939b339fca358223177d.nt +260 -0
  407. data/public/uploads/import/{ed1c212d4f320e414caacda7a7988f83.nt → bc140bce0ab1818edd55350b793eb36c.nt} +0 -0
  408. data/public/uploads/import/{ed460af60bf4d0884d37a86bb02411e7.nt → bdfe458413c233f7c2e96041b8c2aa9d.nt} +0 -0
  409. data/public/uploads/import/{f0cde297ac63a3654a1d5e5535a6f685.nt → bf0168c5d5f472442707ff76115480b0.nt} +0 -0
  410. data/public/uploads/import/{f17024adf37be768041307528e848bd6.nt → c0479e6569a5cbd8fc74702c165f71b5.nt} +0 -0
  411. data/public/uploads/import/{f2f6025f6de90ee4609c2928a817c51d.nt → c2c0372e27f625ca1ce1aa527059d6d2.nt} +0 -0
  412. data/public/uploads/import/{f427507b1c208ddf69204ea5414e5d18.nt → c43fbad62457debced3e2b5f175b633a.nt} +0 -0
  413. data/public/uploads/import/{ffce91887b3ac5b7319a80926ff310ef.nt → c4d8f635e4bb5601713bbf9bc456c797.nt} +0 -0
  414. data/public/uploads/{tmp/1417625624-7926-3861/hobbies.nt → import/c61960b982b3a8308e41de6cf094255d.nt} +0 -0
  415. data/public/uploads/{tmp/1417625658-7975-5171/hobbies.nt → import/c63faf859a988775b27acb8e8712f13b.nt} +0 -0
  416. data/public/uploads/{tmp/1418649743-7886-1510/hobbies.nt → import/cb1b6b27edfcc404ca469fa3ec6b0664.nt} +0 -0
  417. data/public/uploads/{tmp/1418653029-9019-1572/hobbies.nt → import/cb37615bf36a26ecbfd6e0f738302d17.nt} +0 -0
  418. data/public/uploads/{tmp/1418656093-9614-5971/hobbies.nt → import/d0369e2cb8216ddc3858a5ae93307da2.nt} +0 -0
  419. data/public/uploads/import/d395b7bd9126c74ee3586b849768ef14.nt +260 -0
  420. data/public/uploads/{tmp/1418659992-10218-8665/hobbies.nt → import/d5d835b59eae82a208653c1b30ad74c9.nt} +0 -0
  421. data/public/uploads/{tmp/1418664440-11199-8740/hobbies.nt → import/d82612b6c9d65e2f2dcfbda202b59a90.nt} +0 -0
  422. data/public/uploads/{tmp/1418665022-11430-9919/hobbies.nt → import/df361efdd673094c731454a91d925850.nt} +0 -0
  423. data/public/uploads/import/df66a381628757d745ae3b60642c3746.nt +260 -0
  424. data/public/uploads/{tmp/1418665225-11485-5805/hobbies.nt → import/e1c59deb5c9119a65787bc5c2d71d678.nt} +0 -0
  425. data/public/uploads/{tmp/1418665744-11777-4958/hobbies.nt → import/e2242e8bc7216edacba54071db90e2f7.nt} +0 -0
  426. data/public/uploads/{tmp/1418666103-11837-9818/hobbies.nt → import/e3d2d0b824f8c45aae697261a4dbe891.nt} +0 -0
  427. data/public/uploads/{tmp/1418666157-11880-9002/hobbies.nt → import/e59bb2aced9152cc0c9a8b1be30bf7b0.nt} +0 -0
  428. data/public/uploads/{tmp/1418666292-11920-9076/hobbies.nt → import/e9a6f6db0a5a7e13b6eb576a8f724347.nt} +0 -0
  429. data/public/uploads/{tmp/1418666482-11968-5799/hobbies.nt → import/ea69b273df07fb624312cbf853c434f4.nt} +0 -0
  430. data/public/uploads/{tmp/1418666589-12006-6137/hobbies.nt → import/eaa64a373eab2b1ccf3a0caf4b9a9b36.nt} +0 -0
  431. data/public/uploads/import/eaec06e06215273b63df2bfbfcd1be1f.nt +260 -0
  432. data/public/uploads/{tmp/1419417707-62741-8601/hobbies.nt → import/ed37994c6a8c15cc9dfcc5f0fc98d25e.nt} +0 -0
  433. data/public/uploads/{tmp/1419418501-62977-9798/hobbies.nt → import/ef8c5b07b56a2f5bfd0818d146b54ad0.nt} +0 -0
  434. data/public/uploads/import/f02c74ffa5f9b0247ed608654d69afbe.nt +260 -0
  435. data/public/uploads/import/f19ecbe95745af34dc11c7ee3a185250.nt +260 -0
  436. data/public/uploads/{tmp/1419419091-63178-5200/hobbies.nt → import/f1f6bbcef457c577c6cf8a41c332ed52.nt} +0 -0
  437. data/public/uploads/{tmp/1419845421-37940-7338/hobbies.nt → import/f24e1405527ac90b18fc4b9103b0356b.nt} +0 -0
  438. data/public/uploads/{tmp/1419872019-93309-7785/hobbies.nt → import/f324628e42cd2165e0befb2dc9e19ec3.nt} +0 -0
  439. data/public/uploads/{tmp/1419872459-93489-7475/hobbies.nt → import/f4f4b5eb4283efc264b2e29b728b45ce.nt} +0 -0
  440. data/public/uploads/{tmp/1420204292-55473-2339/hobbies.nt → import/f6cda0379fadb6b9ed88b59b04d1544a.nt} +0 -0
  441. data/public/uploads/import/f8eb5272e6cc4b691765b370685b634e.nt +260 -0
  442. data/public/uploads/{tmp/1420469113-94913-1977/hobbies.nt → import/f92c5202d53cf595d63051016ebe2aed.nt} +0 -0
  443. data/public/uploads/{tmp/1420469218-94957-7818/hobbies.nt → import/f9948cb7e270f1582313d9d64a0013f4.nt} +0 -0
  444. data/public/uploads/tmp/1399391854-10068-6618/hobbies.nt +260 -0
  445. data/public/uploads/tmp/1399391911-10213-8446/hobbies.nt +260 -0
  446. data/public/uploads/tmp/1399392015-10496-2495/hobbies.nt +260 -0
  447. data/public/uploads/tmp/1399465936-82819-2227/hobbies.nt +260 -0
  448. data/public/uploads/tmp/1399562287-11058-4844/hobbies.nt +260 -0
  449. data/public/uploads/tmp/1399562349-11220-5006/hobbies.nt +260 -0
  450. data/public/uploads/tmp/1399562606-12081-8172/hobbies.nt +260 -0
  451. data/public/uploads/tmp/1399562663-12419-6959/hobbies.nt +260 -0
  452. data/public/uploads/tmp/1399562758-12675-1044/hobbies.nt +260 -0
  453. data/public/uploads/tmp/1399563325-14184-4165/hobbies.nt +260 -0
  454. data/public/uploads/tmp/1399563511-14691-1597/hobbies.nt +260 -0
  455. data/public/uploads/tmp/1399563577-14899-9811/hobbies.nt +260 -0
  456. data/public/uploads/tmp/1399563654-15101-9704/hobbies.nt +260 -0
  457. data/public/uploads/tmp/1399563789-15465-3853/hobbies.nt +260 -0
  458. data/public/uploads/tmp/1399564038-16136-7758/hobbies.nt +260 -0
  459. data/public/uploads/tmp/1399564391-17273-4324/hobbies.nt +260 -0
  460. data/public/uploads/tmp/1399565011-19048-6725/hobbies.nt +260 -0
  461. data/public/uploads/tmp/1399565066-19204-6162/hobbies.nt +260 -0
  462. data/public/uploads/tmp/1399639727-33218-9866/hobbies.nt +260 -0
  463. data/public/uploads/tmp/1399642528-42021-8916/hobbies.nt +260 -0
  464. data/public/uploads/tmp/1399642763-42734-7348/hobbies.nt +260 -0
  465. data/public/uploads/tmp/1399886894-13606-2429/hobbies.nt +260 -0
  466. data/public/uploads/tmp/{1420471310-95437-1840 → 1400683232-10539-5676}/hobbies.nt +0 -0
  467. data/public/uploads/tmp/{1420475764-97681-5693 → 1400683420-10634-8312}/hobbies.nt +0 -0
  468. data/public/uploads/tmp/{1420475937-97729-2119 → 1400683468-10666-6540}/hobbies.nt +0 -0
  469. data/public/uploads/tmp/{1420476857-98058-7891 → 1400684714-11424-9829}/hobbies.nt +0 -0
  470. data/public/uploads/tmp/{1420535851-99018-0174 → 1400846672-62648-9413}/hobbies.nt +0 -0
  471. data/public/uploads/tmp/{1420536204-1785-0172 → 1400846766-62697-7073}/hobbies.nt +0 -0
  472. data/public/uploads/tmp/{1420551687-4559-4581 → 1401180379-3162-2871}/hobbies.nt +0 -0
  473. data/public/uploads/tmp/{1420553228-5060-8398 → 1401185202-4377-2768}/hobbies.nt +0 -0
  474. data/public/uploads/tmp/{1420554138-5330-1218 → 1401192012-6573-2832}/hobbies.nt +0 -0
  475. data/public/uploads/tmp/{1420623682-11549-0730 → 1401194508-7699-9522}/hobbies.nt +0 -0
  476. data/public/uploads/tmp/{1420627830-12489-1669 → 1401194627-7742-0813}/hobbies.nt +0 -0
  477. data/public/uploads/tmp/{1420643849-18200-3932 → 1401194954-7841-9994}/hobbies.nt +0 -0
  478. data/public/uploads/tmp/{1420649772-21728-5542 → 1401195326-7932-3790}/hobbies.nt +0 -0
  479. data/public/uploads/tmp/{1420708117-27095-8292 → 1401206318-10643-2808}/hobbies.nt +0 -0
  480. data/public/uploads/tmp/{1420708387-27223-6774 → 1401292131-92601-6112}/hobbies.nt +0 -0
  481. data/public/uploads/tmp/{1420708470-27267-7475 → 1401292181-92670-8615}/hobbies.nt +0 -0
  482. data/public/uploads/tmp/{1420708517-27294-4695 → 1401292252-92839-0886}/hobbies.nt +0 -0
  483. data/public/uploads/tmp/{1420708539-27319-1354 → 1401292294-92900-5587}/hobbies.nt +0 -0
  484. data/public/uploads/tmp/{1420708586-27334-3786 → 1401292390-92976-9639}/hobbies.nt +0 -0
  485. data/public/uploads/tmp/{1420708992-27418-8019 → 1401701949-3140-4347}/hobbies.nt +0 -0
  486. data/public/uploads/tmp/{1420709221-27495-1252 → 1401702355-40904-9058}/hobbies.nt +0 -0
  487. data/public/uploads/tmp/{1420709888-27667-9904 → 1401702361-40926-1371}/hobbies.nt +0 -0
  488. data/public/uploads/tmp/{1420710092-27729-5735 → 1401702406-40992-5615}/hobbies.nt +0 -0
  489. data/public/uploads/tmp/{1420710448-27814-7190 → 1401702475-41050-2716}/hobbies.nt +0 -0
  490. data/public/uploads/tmp/{1420710886-27909-4558 → 1401702625-41136-3304}/hobbies.nt +0 -0
  491. data/public/uploads/tmp/{1420711474-28046-6914 → 1401702771-41202-1777}/hobbies.nt +0 -0
  492. data/public/uploads/tmp/{1420711601-28081-0714 → 1401704263-41803-0906}/hobbies.nt +0 -0
  493. data/public/uploads/tmp/{1420711904-28153-8591 → 1401704312-41845-2277}/hobbies.nt +0 -0
  494. data/public/uploads/tmp/{1420712160-28240-2054 → 1401704455-41906-3348}/hobbies.nt +0 -0
  495. data/public/uploads/tmp/{1420712349-28303-3685 → 1401704517-41941-3825}/hobbies.nt +0 -0
  496. data/public/uploads/tmp/{1420712756-28475-0893 → 1401704557-42078-2926}/hobbies.nt +0 -0
  497. data/public/uploads/tmp/{1420712995-28567-4743 → 1401704659-42140-2026}/hobbies.nt +0 -0
  498. data/public/uploads/tmp/{1420722946-31448-5312 → 1401704727-42194-2926}/hobbies.nt +0 -0
  499. data/public/uploads/tmp/{1420723021-31498-6069 → 1401704810-42233-0719}/hobbies.nt +0 -0
  500. data/public/uploads/tmp/{1420723172-31541-4390 → 1401704877-42346-6423}/hobbies.nt +0 -0
  501. data/public/uploads/tmp/{1420723249-31574-6508 → 1401704969-42396-2636}/hobbies.nt +0 -0
  502. data/public/uploads/tmp/{1422290833-38334-3392 → 1401706200-42741-9489}/hobbies.nt +0 -0
  503. data/public/uploads/tmp/{1422292996-38701-6635 → 1401706505-42885-6630}/hobbies.nt +0 -0
  504. data/public/uploads/tmp/{1422293183-38751-2662 → 1401706579-42925-3938}/hobbies.nt +0 -0
  505. data/public/uploads/tmp/{1422293478-38811-6215 → 1401706998-43068-7269}/hobbies.nt +0 -0
  506. data/public/uploads/tmp/{1422300870-38980-1343 → 1401707073-43147-4480}/hobbies.nt +0 -0
  507. data/public/uploads/tmp/{1422372626-67843-5956 → 1401707148-43190-8990}/hobbies.nt +0 -0
  508. data/public/uploads/tmp/{1422374262-68176-3483 → 1401707185-43233-6339}/hobbies.nt +0 -0
  509. data/public/uploads/tmp/{1422374611-68319-4455 → 1401707525-43306-5760}/hobbies.nt +0 -0
  510. data/public/uploads/tmp/{1422467418-10546-8937 → 1401716194-45552-4247}/hobbies.nt +0 -0
  511. data/public/uploads/tmp/{1422467614-10596-6509 → 1401716269-45634-6256}/hobbies.nt +0 -0
  512. data/public/uploads/tmp/{1422537271-15787-8339 → 1401716431-45713-6690}/hobbies.nt +0 -0
  513. data/public/uploads/tmp/{1422538114-15972-5522 → 1401717803-46392-3771}/hobbies.nt +0 -0
  514. data/public/uploads/tmp/{1422540419-16733-4506 → 1401717970-46482-3771}/hobbies.nt +0 -0
  515. data/public/uploads/tmp/1401719163-46906-3771/hobbies.nt +259 -0
  516. data/public/uploads/tmp/1401719307-46967-3771/hobbies.nt +259 -0
  517. data/public/uploads/tmp/1401719376-47013-3771/hobbies.nt +259 -0
  518. data/public/uploads/tmp/1401719630-47114-3771/hobbies.nt +259 -0
  519. data/public/uploads/tmp/1401719982-47199-3873/hobbies.nt +259 -0
  520. data/public/uploads/tmp/1401720178-47285-9163/hobbies.nt +259 -0
  521. data/public/uploads/tmp/1401720378-47376-3771/hobbies.nt +259 -0
  522. data/public/uploads/tmp/1401720550-47464-3771/hobbies.nt +259 -0
  523. data/public/uploads/tmp/1401720661-47532-3771/hobbies.nt +259 -0
  524. data/public/uploads/tmp/1401721032-47662-3771/hobbies.nt +259 -0
  525. data/public/uploads/tmp/1401721110-47707-3771/hobbies.nt +259 -0
  526. data/public/uploads/tmp/1401722057-48025-3771/hobbies.nt +259 -0
  527. data/public/uploads/tmp/1401722131-48079-3771/hobbies.nt +259 -0
  528. data/public/uploads/tmp/1401722177-48112-3771/hobbies.nt +259 -0
  529. data/public/uploads/tmp/1401722330-48176-3771/hobbies.nt +259 -0
  530. data/public/uploads/tmp/1401722430-48237-4227/hobbies.nt +259 -0
  531. data/public/uploads/tmp/1401722732-48343-4227/hobbies.nt +259 -0
  532. data/public/uploads/tmp/1401722909-48424-1412/hobbies.nt +259 -0
  533. data/public/uploads/tmp/1401723009-48482-7948/hobbies.nt +259 -0
  534. data/public/uploads/tmp/1401723431-48680-9071/hobbies.nt +259 -0
  535. data/public/uploads/tmp/1401724808-49229-3988/hobbies.nt +259 -0
  536. data/public/uploads/tmp/1401725005-49344-4227/hobbies.nt +259 -0
  537. data/public/uploads/tmp/1401801415-57643-7508/hobbies.nt +259 -0
  538. data/public/uploads/tmp/1401801470-57683-1511/hobbies.nt +259 -0
  539. data/public/uploads/tmp/1401801589-57766-6716/hobbies.nt +259 -0
  540. data/public/uploads/tmp/1401801648-57810-6653/hobbies.nt +259 -0
  541. data/public/uploads/tmp/1401801703-57902-1218/hobbies.nt +259 -0
  542. data/public/uploads/tmp/1401801780-57957-6963/hobbies.nt +259 -0
  543. data/public/uploads/tmp/1401801876-58010-6576/hobbies.nt +259 -0
  544. data/public/uploads/tmp/1401801925-58061-5018/hobbies.nt +259 -0
  545. data/public/uploads/tmp/1401801966-58088-4598/hobbies.nt +259 -0
  546. data/public/uploads/tmp/1401802064-58134-0309/hobbies.nt +259 -0
  547. data/public/uploads/tmp/1401802128-58183-5882/hobbies.nt +259 -0
  548. data/public/uploads/tmp/1401802254-58261-9292/hobbies.nt +259 -0
  549. data/public/uploads/tmp/1401802305-58305-0716/hobbies.nt +259 -0
  550. data/public/uploads/tmp/1401802559-58393-8087/hobbies.nt +259 -0
  551. data/public/uploads/tmp/1401802603-58429-5414/hobbies.nt +259 -0
  552. data/public/uploads/tmp/1401802704-58494-3176/hobbies.nt +259 -0
  553. data/public/uploads/tmp/1401876393-11719-7974/hobbies.nt +259 -0
  554. data/public/uploads/tmp/1401880994-13325-5134/hobbies.nt +259 -0
  555. data/public/uploads/tmp/1401881408-13497-2210/hobbies.nt +259 -0
  556. data/public/uploads/tmp/1402407940-72993-0117/hobbies.nt +259 -0
  557. data/public/uploads/tmp/1403276908-17566-3335/hobbies.nt +259 -0
  558. data/public/uploads/tmp/1403276972-17606-3705/hobbies.nt +259 -0
  559. data/public/uploads/tmp/1403277054-17662-2528/hobbies.nt +259 -0
  560. data/public/uploads/tmp/1405605924-28482-6761/hobbies.nt +259 -0
  561. data/public/uploads/tmp/1405606039-28627-4530/hobbies.nt +259 -0
  562. data/public/uploads/tmp/1405606796-29190-4080/hobbies.nt +259 -0
  563. data/test/authentication.rb +33 -0
  564. data/test/controllers/hierarchy_test.rb +406 -0
  565. data/test/{functional → controllers}/rdf_rendering_test.rb +26 -33
  566. data/test/integration/alphabetical_test.rb +18 -16
  567. data/test/integration/authentication_test.rb +13 -15
  568. data/test/integration/browse_concepts_and_labels_test.rb +27 -32
  569. data/test/integration/client_augmentation_test.rb +14 -15
  570. data/test/integration/client_edit_concept_test.rb +31 -33
  571. data/test/integration/collection_circularity_test.rb +57 -53
  572. data/test/integration/concept_browsing_test.rb +23 -25
  573. data/test/integration/concept_scheme_browsing_test.rb +28 -28
  574. data/test/integration/edit_collections_test.rb +21 -0
  575. data/test/integration/edit_concepts_test.rb +15 -13
  576. data/test/integration/export_test.rb +73 -0
  577. data/test/integration/import_test.rb +77 -0
  578. data/test/integration/instance_configuration_browsing_test.rb +19 -21
  579. data/test/integration/navigation_test.rb +14 -16
  580. data/test/integration/note_annotations_test.rb +34 -36
  581. data/test/integration/search_test.rb +105 -100
  582. data/test/integration/tree_test.rb +13 -5
  583. data/test/integration/untranslated_test.rb +19 -22
  584. data/test/integration/user_management_test.rb +51 -0
  585. data/test/integration_test_helper.rb +10 -2
  586. data/test/{unit → models}/concept_scheme_test.rb +1 -1
  587. data/test/models/concept_test.rb +178 -0
  588. data/test/{unit → models}/hygiene_test.rb +8 -8
  589. data/test/{unit → models}/inline_data_test.rb +11 -13
  590. data/test/{unit → models}/instance_configuration_test.rb +16 -18
  591. data/test/{unit → models}/note_test.rb +4 -6
  592. data/test/models/origin_test.rb +83 -0
  593. data/test/{unit → models}/rdf_sync_test.rb +20 -22
  594. data/test/{unit → models}/rdfapi_test.rb +0 -1
  595. data/test/models/skos_collection_import_test.rb +104 -0
  596. data/test/models/skos_export_test.rb +48 -0
  597. data/test/models/skos_import_test.rb +143 -0
  598. data/test/models/testdata.nt +22 -0
  599. data/test/test_helper.rb +5 -3
  600. metadata +454 -305
  601. data/app/views/collections/show.html.erb +0 -53
  602. data/app/views/concepts/index.iqrdf +0 -28
  603. data/app/views/kaminari/_first_page.html.erb +0 -13
  604. data/app/views/kaminari/_gap.html.erb +0 -8
  605. data/app/views/kaminari/_last_page.html.erb +0 -13
  606. data/app/views/kaminari/_next_page.html.erb +0 -13
  607. data/app/views/kaminari/_page.html.erb +0 -12
  608. data/app/views/kaminari/_paginator.html.erb +0 -25
  609. data/app/views/kaminari/_prev_page.html.erb +0 -13
  610. data/config/initializers/secret_token_configurator.rb +0 -29
  611. data/config/initializers/simple_form.rb +0 -177
  612. data/config/locales/simple_form.en.yml +0 -24
  613. data/config/locales/simple_form.pt.yml +0 -23
  614. data/lib/engine_tasks/setup.rake +0 -10
  615. data/lib/iqvoc/versioning.rb +0 -151
  616. data/lib/tasks/heroku.rake +0 -14
  617. data/lib/tasks/setup.rake +0 -7
  618. data/lib/templates/erb/scaffold/_form.html.erb +0 -13
  619. data/test/capybara_helper.rb +0 -31
  620. data/test/factories.rb +0 -75
  621. data/test/functional/hierarchy_test.rb +0 -408
  622. data/test/unit/concept_test.rb +0 -153
  623. data/test/unit/origin_test.rb +0 -78
  624. data/test/unit/skos_import_test.rb +0 -228
@@ -43,8 +43,8 @@ module Iqvoc
43
43
  # can use the index to insert it's item under the group
44
44
  def self.setup_extension_group(position)
45
45
  group = {
46
- :text => proc { t("txt.views.navigation.extensions") },
47
- :items => []
46
+ text: proc { t('txt.views.navigation.extensions') },
47
+ items: []
48
48
  }
49
49
 
50
50
  if position && !items[position][:items]
data/lib/iqvoc/origin.rb CHANGED
@@ -49,55 +49,20 @@ module Iqvoc
49
49
  end
50
50
  end
51
51
 
52
- class UmlautReplacer < GenericFilter
52
+ class UriConformanceFilter < GenericFilter
53
53
  def call(obj, str)
54
- str = str.gsub(/Ö/, 'Oe').
55
- gsub(/Ä/, 'Ae').
56
- gsub(/Ü/, 'Ue').
57
- gsub(/ö/, 'oe').
58
- gsub(/ä/, 'ae').
59
- gsub(/ü/, 'ue').
60
- gsub(/ß/, 'ss')
54
+ str = str.parameterize # basic url conformance
61
55
 
62
- run(obj, str)
63
- end
64
- end
65
-
66
- class WhitespaceReplacer < GenericFilter
67
- def call(obj, str)
68
- str = str.gsub(/\s([a-zA-Z])?/) do
69
- $1.to_s.upcase
70
- end
71
-
72
- run(obj, str)
73
- end
74
- end
75
-
76
- class SpecialCharReplacer < GenericFilter
77
- def call(obj, str)
78
- str = str.gsub(/[(\[:]/, "--").
79
- gsub(/[)\]'""]/, "").
80
- gsub(/[,\.\/&;]/, '-')
81
-
82
- run(obj, str)
83
- end
84
- end
85
-
86
- class LeadingNumberHandler < GenericFilter
87
- def call(obj, str)
56
+ # prefix with '_' if origin starts with digit
88
57
  str = str.gsub(/^[0-9].*$/) do |match|
89
58
  "_#{match}"
90
59
  end
91
-
92
60
  run(obj, str)
93
61
  end
94
62
  end
95
63
 
96
- @filters = ActiveSupport::OrderedHash.new
97
- @filters[:replace_umlauts] = UmlautReplacer
98
- @filters[:replace_whitespace] = WhitespaceReplacer
99
- @filters[:replace_special_chars] = SpecialCharReplacer
100
- @filters[:handle_leading_numbers] = LeadingNumberHandler
64
+ @filters = {}
65
+ @filters[:uri_conformance_filter] = UriConformanceFilter
101
66
 
102
67
  def self.register(name, klass)
103
68
  @filters[name.to_sym] = klass
@@ -140,8 +105,7 @@ module Iqvoc
140
105
  end
141
106
 
142
107
  def inspect
143
- "#<Iqvoc::Origin:0x%08x>" % object_id
108
+ '#<Iqvoc::Origin:0x%08x>' % object_id
144
109
  end
145
-
146
110
  end
147
111
  end
@@ -29,6 +29,5 @@ module Iqvoc
29
29
  'partials/concept/relation/edit_ranked'
30
30
  end
31
31
  end
32
-
33
32
  end
34
33
  end
@@ -1,18 +1,18 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  class Iqvoc::RDFSync
4
- delegate :url_helpers, :to => "Rails.application.routes"
4
+ delegate :url_helpers, to: 'Rails.application.routes'
5
5
 
6
6
  ADAPTORS = { # XXX: inappropriate?
7
- "virtuoso" => lambda do |host_url, options|
7
+ 'virtuoso' => lambda do |host_url, options|
8
8
  require 'iq_triplestorage/virtuoso_adaptor'
9
9
  return IqTriplestorage::VirtuosoAdaptor.new(host_url, options)
10
10
  end,
11
- "sesame" => lambda do |host_url, options|
11
+ 'sesame' => lambda do |host_url, options|
12
12
  require 'iq_triplestorage/sesame_adaptor'
13
- host_url, _, repo = host_url.rpartition("/repositories/")
13
+ host_url, _, repo = host_url.rpartition('/repositories/')
14
14
  if host_url.blank? || repo.blank?
15
- raise ArgumentError, "missing repository in Sesame URL"
15
+ raise ArgumentError, 'missing repository in Sesame URL'
16
16
  end
17
17
  options[:repository] = repo
18
18
  return IqTriplestorage::SesameAdaptor.new(host_url, options)
@@ -26,7 +26,7 @@ class Iqvoc::RDFSync
26
26
  @password = options[:password]
27
27
  @batch_size = options[:batch_size] || 100
28
28
  @view_context = options[:view_context] # XXX: not actually optional
29
- raise(ArgumentError, "missing view context") unless @view_context # XXX: smell (see above)
29
+ raise(ArgumentError, 'missing view context') unless @view_context # XXX: smell (see above)
30
30
  end
31
31
 
32
32
  def all # TODO: rename
@@ -57,14 +57,14 @@ class Iqvoc::RDFSync
57
57
  def push(records)
58
58
  data = records.inject({}) do |memo, record|
59
59
  graph_uri = url_helpers.rdf_url(record.origin,
60
- :host => URI.parse(@base_url).host, :format => nil, :lang => nil)
60
+ host: URI.parse(@base_url).host, format: nil, lang: nil)
61
61
  memo[graph_uri] = serialize(record)
62
62
  memo
63
63
  end
64
64
 
65
- adaptor_type = "sesame" # XXX: hard-coded
66
- adaptor = ADAPTORS[adaptor_type].call(@target_url, :username => @username,
67
- :password => @password)
65
+ adaptor_type = 'sesame' # XXX: hard-coded
66
+ adaptor = ADAPTORS[adaptor_type].call(@target_url, username: @username,
67
+ password: @password)
68
68
  return adaptor.batch_update(data)
69
69
  end
70
70
 
@@ -73,8 +73,9 @@ class Iqvoc::RDFSync
73
73
  # view in order to get to the RDF serialization
74
74
 
75
75
  doc = IqRdf::Document.new(@base_url)
76
- Iqvoc.default_rdf_namespace_helper_methods.each do |meth|
77
- doc.namespaces(@view_context.send(meth))
76
+ RdfNamespacesHelper.instance_methods.each do |meth|
77
+ namespaces = @view_context.send(meth)
78
+ doc.namespaces(namespaces) if namespaces.is_a?(Hash)
78
79
  end
79
80
 
80
81
  rdf_helper = Object.new.extend(RdfHelper)
@@ -90,7 +91,7 @@ class Iqvoc::RDFSync
90
91
  # yields batches of candidates for synchronization
91
92
  def gather_candidates # TODO: rename
92
93
  Iqvoc::Sync.syncable_classes.each do |klass|
93
- self.class.candidates(klass).find_in_batches(:batch_size => @batch_size) do |records|
94
+ self.class.candidates(klass).find_in_batches(batch_size: @batch_size) do |records|
94
95
  yield records
95
96
  end
96
97
  end
@@ -102,18 +103,15 @@ class Iqvoc::RDFSync
102
103
  return klass ? klass.published.unsynced :
103
104
  Iqvoc::Sync.syncable_classes.map { |klass| candidates(klass) }
104
105
  end
105
-
106
106
  end
107
107
 
108
108
  module Iqvoc::RDFSync::Helper # TODO: rename -- XXX: does not belong here!?
109
-
110
109
  def triplestore_syncer
111
- base_url = root_url(:lang => nil) # XXX: brittle in the face of future changes?
110
+ base_url = root_url(lang: nil) # XXX: brittle in the face of future changes?
112
111
 
113
- return Iqvoc::RDFSync.new(base_url, Iqvoc.config["triplestore.url"],
114
- :username => Iqvoc.config["triplestore.username"].presence,
115
- :password => Iqvoc.config["triplestore.password"].presence,
116
- :view_context => view_context) # fugly, but necessary; cf. RDFSync#serialize
112
+ return Iqvoc::RDFSync.new(base_url, Iqvoc.config['triplestore.url'],
113
+ username: Iqvoc.config['triplestore.username'].presence,
114
+ password: Iqvoc.config['triplestore.password'].presence,
115
+ view_context: view_context) # fugly, but necessary; cf. RDFSync#serialize
117
116
  end
118
-
119
117
  end
data/lib/iqvoc/rdfapi.rb CHANGED
@@ -36,6 +36,7 @@ module Iqvoc
36
36
  end
37
37
 
38
38
  URI_REGEXP = /^https?:\/\/[^\s]+$/
39
+ LITERAL_REGEXP = /^"(.+)"(@(.+))?$/
39
40
 
40
41
  def self.devour(rdf_subject, rdf_predicate, rdf_object)
41
42
  case rdf_predicate
@@ -46,7 +47,7 @@ module Iqvoc
46
47
  else
47
48
  target = rdf_object
48
49
  end
49
- target.find_or_initialize_by(:origin => rdf_subject)
50
+ target.find_or_initialize_by(origin: rdf_subject)
50
51
  when String
51
52
  # dictionary lookup
52
53
  target = PREDICATE_DICTIONARY[rdf_predicate] || rdf_predicate.constantize
@@ -55,6 +56,5 @@ module Iqvoc
55
56
  rdf_predicate.build_from_rdf(rdf_subject, rdf_predicate, rdf_object)
56
57
  end
57
58
  end
58
-
59
59
  end
60
60
  end
@@ -0,0 +1,153 @@
1
+ require 'iq_rdf'
2
+ require 'uri'
3
+ require 'fileutils'
4
+
5
+ module Iqvoc
6
+ class SkosExporter
7
+ include RdfHelper # necessary to use render_concept helper
8
+ include RdfNamespacesHelper
9
+ include Rails.application.routes.url_helpers
10
+
11
+ def initialize(file_path, type, default_namespace_url, logger = Rails.logger)
12
+ default_url_options[:port] = URI.parse(default_namespace_url).port
13
+ default_url_options[:host] = URI.parse(default_namespace_url).to_s.gsub(/\/$/, '')
14
+
15
+ @file_path = file_path
16
+ @type = type
17
+ @logger = logger
18
+ @document = IqRdf::Document.new
19
+
20
+ unless ['ttl', 'nt', 'xml'].include? @type
21
+ raise "Iqvoc::SkosExporter: Unknown rdf serialization. Parameter 'type' should be 'ttl' (Turtle), 'nt' (N-Triples) or 'xml' (RDF-XML)."
22
+ end
23
+
24
+ unless @file_path.is_a?(String)
25
+ raise "Iqvoc::SkosExporter#export: Parameter 'file' should be a String."
26
+ end
27
+ end
28
+
29
+ def run
30
+ export
31
+ end
32
+
33
+ private
34
+
35
+ def export
36
+ ActiveSupport.run_load_hooks(:rdf_export_before, self)
37
+
38
+ start = Time.now
39
+ @logger.info 'Starting export...'
40
+ @logger.info "file_path = #{@file_path}"
41
+ @logger.info "type = #{@type}"
42
+
43
+ # add export data
44
+ add_namespaces(@document)
45
+ add_collections(@document)
46
+ add_concepts(@document)
47
+
48
+ ActiveSupport.run_load_hooks(:rdf_export_before_save, self)
49
+
50
+ # saving export to disk
51
+ save_file(@file_path, @type, @document)
52
+
53
+ done = Time.now
54
+ @logger.info "Export Job finished in #{(done - start).to_i} seconds."
55
+
56
+ ActiveSupport.run_load_hooks(:rdf_export_after, self)
57
+ end
58
+
59
+ def add_namespaces(document)
60
+ @logger.info 'Exporting namespaces...'
61
+
62
+ RdfNamespacesHelper.instance_methods.each do |meth|
63
+ namespaces = send(meth)
64
+ document.namespaces(namespaces) if namespaces.is_a?(Hash)
65
+ end
66
+
67
+ @logger.info 'Finished exporting namespaces.'
68
+ end
69
+
70
+ def add_collections(document)
71
+ @logger.info 'Exporting collections...'
72
+
73
+ offset = 0
74
+ while true
75
+ collections = Iqvoc::Collection.base_class.published.order('id').limit(100).offset(offset)
76
+ limit = collections.size < 100 ? collections.size : 100
77
+ break if collections.size == 0
78
+
79
+ # Todo: Preloading???
80
+ collections.each do |collection|
81
+ render_collection(document, collection)
82
+ end
83
+
84
+ @logger.info "Collections #{offset+1}-#{offset+limit} exported."
85
+ offset += collections.size # Size is important!
86
+ end
87
+
88
+ @logger.info "Finished exporting collections (#{offset} collections exported)."
89
+ end
90
+
91
+ def add_concepts(document)
92
+ @logger.info 'Exporting concepts...'
93
+
94
+ offset = 0
95
+ while true
96
+ concepts = Iqvoc::Concept.base_class.published.order('id').limit(100).offset(offset)
97
+ limit = concepts.size < 100 ? concepts.size : 100
98
+ break if concepts.size == 0
99
+
100
+ # When in single query mode, AR handles ALL includes to be loaded by that
101
+ # one query. We don't want that! So let's do it manually :-)
102
+ ActiveRecord::Associations::Preloader.new.preload(concepts,
103
+ Iqvoc::Concept.base_class.default_includes + [
104
+ :matches,
105
+ :collection_members,
106
+ :notations,
107
+ { relations: :target, labelings: :target, notes: :annotations }
108
+ ])
109
+
110
+ concepts.each do |concept|
111
+ render_concept(document, concept, true)
112
+ end
113
+
114
+ @logger.info "Concepts #{offset+1}-#{offset+limit} exported."
115
+ offset += concepts.size # Size is important!
116
+ end
117
+
118
+ @logger.info "Finished exporting concepts (#{offset} concepts exported)."
119
+ end
120
+
121
+ def save_file(file_path, type, content)
122
+ begin
123
+ @logger.info "Saving export to '#{@file_path}'"
124
+ create_directory(@file_path)
125
+ file = File.open(@file_path, 'w')
126
+ content = serialize_rdf(content, type)
127
+ file.write(content)
128
+ rescue IOError => e
129
+ # some error occur
130
+ # e.g not writable
131
+ ensure
132
+ file.close unless file == nil
133
+ end
134
+ end
135
+
136
+ def create_directory(file_path)
137
+ dirname = File.dirname(file_path)
138
+ unless File.directory?(dirname)
139
+ FileUtils.mkdir_p(dirname)
140
+ end
141
+ end
142
+
143
+ def serialize_rdf(document, type)
144
+ if type == 'xml'
145
+ document.to_xml
146
+ elsif type == 'ttl'
147
+ document.to_turtle
148
+ else
149
+ document.to_ntriples
150
+ end
151
+ end
152
+ end
153
+ end
@@ -2,21 +2,37 @@ require 'iqvoc/rdfapi'
2
2
 
3
3
  module Iqvoc
4
4
  class SkosImporter
5
+ class_attribute :first_level_object_classes, :second_level_object_classes
6
+ self.first_level_object_classes = [
7
+ Iqvoc::Concept.base_class,
8
+ Iqvoc::Collection.base_class
9
+ ]
10
+ self.second_level_object_classes = Iqvoc::Concept.labeling_classes.keys +
11
+ Iqvoc::Concept.note_classes +
12
+ Iqvoc::Concept.relation_classes +
13
+ Iqvoc::Concept.match_classes +
14
+ Iqvoc::Concept.notation_classes +
15
+ Iqvoc::Concept.additional_association_classes.keys +
16
+ [Iqvoc::Concept.root_class] +
17
+ [Iqvoc::Collection.member_class]
18
+
19
+ def self.prepend_first_level_object_classes(args)
20
+ self.first_level_object_classes.unshift(*args)
21
+ end
5
22
 
6
- FIRST_LEVEL_OBJECT_CLASSES = [Iqvoc::Concept.base_class, Iqvoc::Collection.base_class]
7
- SECOND_LEVEL_OBJECT_CLASSES = Iqvoc::Concept.labeling_classes.keys +
8
- Iqvoc::Concept.note_classes +
9
- Iqvoc::Concept.relation_classes +
10
- Iqvoc::Concept.match_classes +
11
- Iqvoc::Concept.notation_classes +
12
- Iqvoc::Concept.additional_association_classes.keys +
13
- [Iqvoc::Concept.root_class] +
14
- [Iqvoc::Collection.member_class]
15
-
16
- def initialize(file, default_namespace_url, logger = Rails.logger, publish = true)
17
- @file = file
23
+ def initialize(object, default_namespace_url, logger = Rails.logger, publish = true, verbose = false)
24
+ @file = case object
25
+ when File
26
+ File.open(object)
27
+ when Array
28
+ object
29
+ else
30
+ open(object)
31
+ end
32
+
33
+ @default_namespace_url = default_namespace_url
18
34
  @publish = publish
19
-
35
+ @verbose = verbose
20
36
  @logger = logger
21
37
 
22
38
  unless @file.is_a?(File) || @file.is_a?(Array)
@@ -25,10 +41,10 @@ module Iqvoc
25
41
 
26
42
  # Some general Namespaces to support in any case
27
43
  @prefixes = {
28
- "http://www.w3.org/2004/02/skos/core#" => "skos:",
29
- "http://www.w3.org/2008/05/skos#" => "skos:",
30
- "http://www.w3.org/1999/02/22-rdf-syntax-ns#" => "rdf:",
31
- default_namespace_url => ":"
44
+ 'http://www.w3.org/2004/02/skos/core#' => 'skos:',
45
+ 'http://www.w3.org/2008/05/skos#' => 'skos:',
46
+ 'http://www.w3.org/1999/02/22-rdf-syntax-ns#' => 'rdf:',
47
+ default_namespace_url => ':'
32
48
  }
33
49
  # Add the namespaces specified in the Iqvoc config
34
50
  Iqvoc.rdf_namespaces.each do |pref, uri|
@@ -39,22 +55,22 @@ module Iqvoc
39
55
 
40
56
  # Assign the default concept scheme singleton instance as a seen first level object upfront
41
57
  # in order to handle a missing scheme definition in ntriple data
42
- @seen_first_level_objects[Iqvoc::Concept.root_class.instance.origin] = Iqvoc::Concept.root_class.instance
58
+ @seen_first_level_objects[Iqvoc::Concept.root_class.instance.origin] = Iqvoc::Concept.root_class
43
59
 
44
- @new_subjects = [] # Concepts to be published later
60
+ @new_subjects = {} # Concepts, collections, labels etc. to be published later
45
61
 
46
62
  # Triples the importer doesn't understand immediately. Example:
47
63
  #
48
64
  # :a skos:prefLabel "foo". # => What is :a? Remember this and try again later
49
65
  # ....
50
- # :a rdf:type skos:Concept # => Now I know :a, good I remebered it's prefLabel...
51
- @unknown_second_level_triples = []
66
+ # :a rdf:type skos:Concept # => Now I know :a, good I remembered it's prefLabel...
67
+ @unknown_second_level_triples = Set.new
52
68
 
53
69
  # Hash of arrays of arrays: { "_:n123" => [["pred1", "obj1"], ["pred2", "obj2"]] }
54
70
  @blank_nodes = {}
55
71
 
56
72
  @existing_origins = {} # To prevent the creation of first level objects we already have
57
- Iqvoc::RDFAPI::FIRST_LEVEL_OBJECT_CLASSES.each do |klass|
73
+ first_level_object_classes.each do |klass|
58
74
  klass.select('origin').load.each do |thing|
59
75
  @existing_origins[thing.origin] = klass
60
76
  end
@@ -72,47 +88,69 @@ module Iqvoc
72
88
 
73
89
  start = Time.now
74
90
 
91
+ @logger.info "default namespace: '#{@default_namespace_url}'"
92
+ @logger.info "publish: '#{@publish}'"
93
+
75
94
  first_level_types = {} # type identifier ("namespace:SomeClass") to Iqvoc class assignment hash
76
- FIRST_LEVEL_OBJECT_CLASSES.each do |klass|
95
+ first_level_object_classes.each do |klass|
77
96
  first_level_types["#{klass.rdf_namespace}:#{klass.rdf_class}"] = klass
78
97
  end
79
98
  second_level_types = {}
80
- SECOND_LEVEL_OBJECT_CLASSES.each do |klass|
99
+ second_level_object_classes.each do |klass|
81
100
  second_level_types["#{klass.rdf_namespace}:#{klass.rdf_predicate}"] = klass
82
101
  end
83
102
 
84
- file.each do |line|
85
- identify_blank_nodes(*extract_triple(line)) ||
86
- import_first_level_objects(first_level_types, *extract_triple(line)) ||
87
- import_second_level_objects(second_level_types, false, *extract_triple(line))
103
+ @logger.info 'Iqvoc::SkosImporter: Importing triples...'
104
+ file.each_with_index do |line, index|
105
+ extracted_triple = *extract_triple(line)
106
+
107
+ if @verbose && has_unknown_namespaces?(extracted_triple)
108
+ @logger.warn "Iqvoc::SkosImporter: Unknown namespaces. Skipping #{extracted_triple.join(' ')}"
109
+ end
110
+
111
+ identify_blank_nodes(*extracted_triple) ||
112
+ import_first_level_objects(first_level_types, *extracted_triple) ||
113
+ import_second_level_objects(second_level_types, false, line)
88
114
  end
89
115
 
90
- @logger.debug "Computing 'forward' defined triples..."
91
- @unknown_second_level_triples.each do |s, p, o|
92
- import_second_level_objects(second_level_types, true, s, p, o)
116
+ # treeify blank nodes hash
117
+ @blank_nodes.each do |origin, bnode_struct|
118
+ tranform_blank_node(origin, bnode_struct)
119
+ end
120
+
121
+ @logger.info "Computing 'forward' defined triples..."
122
+ @unknown_second_level_triples.each do |line|
123
+ import_second_level_objects(second_level_types, true, line)
93
124
  end
94
125
 
95
126
  first_import_step_done = Time.now
96
- @logger.debug "Basic import done (took #{(first_import_step_done - start).to_i} seconds)."
127
+ @logger.info "Basic import done (took #{(first_import_step_done - start).to_i} seconds)."
97
128
 
98
129
  published = publish
99
130
 
100
131
  done = Time.now
101
- @logger.debug "Publishing of #{published} subjects done (took #{(done - first_import_step_done).to_i} seconds). #{@new_subjects.count - published} are in draft state."
102
- puts "Imported #{published} published and #{@new_subjects.count - published} draft subjects in #{(done - start).to_i} seconds."
103
- puts " First step took #{(first_import_step_done - start).to_i} seconds, publishing took #{(done - first_import_step_done).to_i} seconds."
132
+ @logger.info "Publishing of #{published} subjects done (took #{(done - first_import_step_done).to_i} seconds). #{@new_subjects.count - published} are in draft state."
133
+ @logger.info "Imported #{published} published and #{@new_subjects.count - published} draft subjects in #{(done - start).to_i} seconds."
134
+ @logger.info "First step took #{(first_import_step_done - start).to_i} seconds, publishing took #{(done - first_import_step_done).to_i} seconds."
104
135
 
105
136
  ActiveSupport.run_load_hooks(:skos_importer_after_import, self)
106
137
  end
107
138
 
108
139
  def publish
109
140
  published = 0
141
+ # Respect order of first level classes configured in FIRST_LEVEL_OBJECTS
142
+ # Example: XL labels have to be published before referencing concepts
143
+ sorted_new_subjects = @new_subjects.sort_by do |origin, klass|
144
+ first_level_object_classes.index(klass)
145
+ end
146
+
110
147
  if @publish
111
- @logger.debug "Publishing #{@new_subjects.count} new subjects..."
112
- @new_subjects.each do |subject|
113
- if subject.valid_with_full_validation?
114
- subject.publish
115
- subject.save!
148
+ @logger.info "Publishing #{@new_subjects.count} new subjects..."
149
+
150
+ sorted_new_subjects.each do |origin, klass|
151
+ subject = klass.find_by(origin: origin)
152
+ if subject.publishable?
153
+ subject.publish!
116
154
  published += 1
117
155
  else
118
156
  @logger.warn "WARNING: Publishing failed! Subject ('#{subject.origin}') invalid: #{subject.errors.to_hash.inspect}"
@@ -133,7 +171,7 @@ module Iqvoc
133
171
  end
134
172
 
135
173
  def import_first_level_objects(types, subject, predicate, object)
136
- if (predicate == "rdf:type" && types[object] && subject =~ /^:(.+)$/)
174
+ if (predicate == 'rdf:type' && types[object] && subject =~ /^:(.+)$/)
137
175
  # We've found a subject definition with a class we know and which is in our responsibility (":")
138
176
  origin = $1
139
177
 
@@ -144,8 +182,14 @@ module Iqvoc
144
182
  @logger.warn "Iqvoc::SkosImporter: Subject with origin '#{origin} already exists but has another class (#{@existing_origins[origin]}) then the one I wanted to create (#{types[object]}). You seem to have a problem with your configuration!"
145
183
  end
146
184
  else
147
- @seen_first_level_objects[origin] = types[object].create!(:origin => origin)
148
- @new_subjects << @seen_first_level_objects[origin]
185
+ @logger.info "Iqvoc::SkosImporter: Creating Subject: #{subject} #{predicate} #{object}" if @verbose
186
+ # FIXME
187
+
188
+ types[object].create do |klass|
189
+ klass.origin = origin
190
+ end
191
+ @seen_first_level_objects[origin] = types[object]
192
+ @new_subjects[origin] = types[object]
149
193
  end
150
194
  true
151
195
  else
@@ -153,10 +197,10 @@ module Iqvoc
153
197
  end
154
198
  end
155
199
 
156
- def import_second_level_objects(types, final, subject, predicate, object)
157
- return unless (subject =~ /^:(.*)$/ && types[predicate]) # We're not responsible for this
200
+ def import_second_level_objects(types, final, line)
201
+ subject, predicate, object = *extract_triple(line)
158
202
 
159
- initial_triple = [subject, predicate, object]
203
+ return unless (subject =~ /^:(.*)$/ && types[predicate]) # We're not responsible for this
160
204
 
161
205
  # Load the subject and replace the string by the respective data object
162
206
  subject_origin = $1
@@ -165,7 +209,7 @@ module Iqvoc
165
209
  if final
166
210
  @logger.warn "Iqvoc::SkosImporter: Couldn't find Subject with origin '#{subject_origin}. Skipping entry '#{subject} #{predicate} #{object}.'"
167
211
  else
168
- @unknown_second_level_triples << initial_triple
212
+ @unknown_second_level_triples << line
169
213
  end
170
214
  return false
171
215
  end
@@ -176,9 +220,9 @@ module Iqvoc
176
220
  object = load_first_level_object(object_origin)
177
221
  unless object
178
222
  if final
179
- @logger.warn "Iqvoc::SkosImporter: Couldn't find Object with origin '#{object_origin}'. Skipping entry ':#{subject_origin} #{predicate} #{object}.'"
223
+ @logger.warn "Iqvoc::SkosImporter: Couldn't find Object with origin '#{object_origin}'. Skipping entry ':#{subject_origin} #{predicate} #{object_origin}.'"
180
224
  else
181
- @unknown_second_level_triples << initial_triple
225
+ @unknown_second_level_triples << line
182
226
  end
183
227
  return false
184
228
  end
@@ -194,14 +238,14 @@ module Iqvoc
194
238
  if final
195
239
  object = @blank_nodes[object]
196
240
  else
197
- @unknown_second_level_triples << initial_triple
241
+ @unknown_second_level_triples << line
198
242
  return false
199
243
  end
200
244
  end
201
245
  begin
202
246
  types[predicate].build_from_rdf(subject, predicate, object)
203
247
  rescue InvalidStringLiteralError => e
204
- warn e.message
248
+ @logger.warn e.message
205
249
  end
206
250
  end
207
251
 
@@ -209,11 +253,15 @@ module Iqvoc
209
253
  unless @seen_first_level_objects[origin]
210
254
  klass = @existing_origins[origin]
211
255
  if klass
212
- @seen_first_level_objects[origin] = klass.by_origin(origin).last
256
+ @seen_first_level_objects[origin] = klass
213
257
  end
214
258
  end
215
259
 
216
- @seen_first_level_objects[origin]
260
+ # FIXME: bang
261
+ # FIXME: return something?
262
+ if klass = @seen_first_level_objects[origin]
263
+ klass.find_by!(origin: origin)
264
+ end
217
265
  end
218
266
 
219
267
  def blank_node?(str)
@@ -229,7 +277,7 @@ module Iqvoc
229
277
  triple.each do |e| # Do some fun with the uris and literals
230
278
  @prefixes.keys.each do |uri_prefix| # Use prefixes instead of full uris
231
279
  e.gsub! /^<#{uri_prefix}([^>]*)>/ do |matches|
232
- @prefixes[uri_prefix] + $1.gsub(".", "_")
280
+ @prefixes[uri_prefix] + $1.gsub('.', '_')
233
281
  end
234
282
  end
235
283
  e.squish!
@@ -237,11 +285,32 @@ module Iqvoc
237
285
  ":#{Iqvoc::Origin.new($1)}" # Force correct origins in the default namespace
238
286
  end
239
287
  end
240
-
241
288
  triple
242
289
  end
243
290
 
291
+ def has_unknown_namespaces?(triple)
292
+ triple.each do |obj|
293
+ return true if obj =~ /^<.*>$/
294
+ break
295
+ end
296
+ false
297
+ end
298
+
299
+ # if blank node contains another blank node,
300
+ # move child blank node to his parent
301
+ def tranform_blank_node(origin, bnode_struct)
302
+ bnode_struct.each_index do |i|
303
+ bnode_origin = bnode_struct[i][1] # only origin could contain another blank node
304
+ if blank_node?(bnode_origin)
305
+ bnode_child_struct = @blank_nodes[bnode_origin]
306
+ bnode_struct[i][1] = bnode_child_struct # move to parent node
307
+ tranform_blank_node(bnode_origin, bnode_child_struct)
308
+
309
+ @blank_nodes.delete(bnode_origin) # remove old blank node
310
+ end
311
+ end
312
+ end
313
+
244
314
  ActiveSupport.run_load_hooks(:skos_importer, self)
245
315
  end
246
-
247
316
  end