datacite-mapping 0.1.17.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (205) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +33 -0
  3. data/README.md +93 -150
  4. data/datacite-mapping.gemspec +1 -1
  5. data/lib/datacite/mapping.rb +12 -27
  6. data/lib/datacite/mapping/alternate_identifier.rb +2 -0
  7. data/lib/datacite/mapping/contributor.rb +6 -2
  8. data/lib/datacite/mapping/creator.rb +33 -3
  9. data/lib/datacite/mapping/date.rb +28 -76
  10. data/lib/datacite/mapping/date_value.rb +116 -0
  11. data/lib/datacite/mapping/description.rb +9 -8
  12. data/lib/datacite/mapping/funding_reference.rb +20 -5
  13. data/lib/datacite/mapping/geo_location.rb +25 -4
  14. data/lib/datacite/mapping/geo_location_box.rb +10 -8
  15. data/lib/datacite/mapping/geo_location_node.rb +68 -0
  16. data/lib/datacite/mapping/geo_location_point.rb +8 -8
  17. data/lib/datacite/mapping/geo_location_polygon.rb +76 -0
  18. data/lib/datacite/mapping/identifier.rb +23 -11
  19. data/lib/datacite/mapping/module_info.rb +3 -3
  20. data/lib/datacite/mapping/name_identifier.rb +1 -0
  21. data/lib/datacite/mapping/namespace_extensions.rb +12 -0
  22. data/lib/datacite/mapping/read_only_nodes.rb +65 -0
  23. data/lib/datacite/mapping/related_identifier.rb +28 -0
  24. data/lib/datacite/mapping/resource.rb +88 -43
  25. data/lib/datacite/mapping/rights.rb +2 -0
  26. data/lib/datacite/mapping/subject.rb +10 -9
  27. data/lib/datacite/mapping/title.rb +7 -11
  28. data/spec/data/{dash1-datacite-xml → dash1}/dataone-ark+=c5146=r3059p-mrt-datacite.xml +0 -0
  29. data/spec/data/{dash1-datacite-xml → dash1}/dataone-ark+=c5146=r31017-mrt-datacite.xml +0 -0
  30. data/spec/data/{dash1-datacite-xml → dash1}/dataone-ark+=c5146=r3201j-mrt-datacite.xml +0 -0
  31. data/spec/data/{dash1-datacite-xml → dash1}/dataone-ark+=c5146=r33w26-mrt-datacite.xml +0 -0
  32. data/spec/data/{dash1-datacite-xml → dash1}/dataone-ark+=c5146=r34s3v-mrt-datacite.xml +0 -0
  33. data/spec/data/{dash1-datacite-xml → dash1}/dataone-ark+=c5146=r36p4t-mrt-datacite.xml +0 -0
  34. data/spec/data/{dash1-datacite-xml → dash1}/dataone-ark+=c5146=r39g6f-mrt-datacite.xml +0 -0
  35. data/spec/data/{dash1-datacite-xml → dash1}/dataone-ark+=c5146=r3cc7d-mrt-datacite.xml +0 -0
  36. data/spec/data/{dash1-datacite-xml → dash1}/dataone-ark+=c5146=r3d59d-mrt-datacite.xml +0 -0
  37. data/spec/data/{dash1-datacite-xml → dash1}/dataone-ark+=c5146=r3f59q-mrt-datacite.xml +0 -0
  38. data/spec/data/{dash1-datacite-xml → dash1}/dataone-ark+=c5146=r3g591-mrt-datacite.xml +0 -0
  39. data/spec/data/{dash1-datacite-xml → dash1}/dataone-ark+=c5146=r3k016-mrt-datacite.xml +0 -0
  40. data/spec/data/{dash1-datacite-xml → dash1}/dataone-ark+=c5146=r3kw2j-mrt-datacite.xml +0 -0
  41. data/spec/data/{dash1-datacite-xml → dash1}/dataone-ark+=c5146=r3mw2v-mrt-datacite.xml +0 -0
  42. data/spec/data/{dash1-datacite-xml → dash1}/dataone-ark+=c5146=r3np4v-mrt-datacite.xml +0 -0
  43. data/spec/data/{dash1-datacite-xml → dash1}/dataone-ark+=c5146=r3pp45-mrt-datacite.xml +0 -0
  44. data/spec/data/{dash1-datacite-xml → dash1}/dataone-ark+=c5146=r3rp4s-mrt-datacite.xml +0 -0
  45. data/spec/data/{dash1-datacite-xml → dash1}/dataone-ark+=c5146=r3tg63-mrt-datacite.xml +0 -0
  46. data/spec/data/{dash1-datacite-xml → dash1}/ucb-ark+=b6078=d1159q-mrt-datacite.xml +0 -0
  47. data/spec/data/{dash1-datacite-xml → dash1}/ucb-ark+=b6078=d17g6j-mrt-datacite.xml +0 -0
  48. data/spec/data/{dash1-datacite-xml → dash1}/ucb-ark+=b6078=d1c88g-mrt-datacite.xml +0 -0
  49. data/spec/data/{dash1-datacite-xml → dash1}/ucb-ark+=b6078=d1cc74-mrt-datacite.xml +0 -0
  50. data/spec/data/{dash1-datacite-xml → dash1}/ucb-ark+=b6078=d1h019-mrt-datacite.xml +0 -0
  51. data/spec/data/{dash1-datacite-xml → dash1}/ucb-ark+=b6078=d1ms3x-mrt-datacite.xml +0 -0
  52. data/spec/data/{dash1-datacite-xml → dash1}/ucb-ark+=b6078=d1mw2k-mrt-datacite.xml +0 -0
  53. data/spec/data/{dash1-datacite-xml → dash1}/ucb-ark+=b6078=d1rg66-mrt-datacite.xml +0 -0
  54. data/spec/data/{dash1-datacite-xml → dash1}/ucb-ark+=b6078=d1rp4h-mrt-datacite.xml +0 -0
  55. data/spec/data/{dash1-datacite-xml → dash1}/ucb-ark+=b6078=d1wc7s-mrt-datacite.xml +0 -0
  56. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1001p-mrt-datacite.xml +0 -0
  57. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1059f-mrt-datacite.xml +0 -0
  58. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d11010-mrt-datacite.xml +0 -0
  59. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1159r-mrt-datacite.xml +0 -0
  60. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d12019-mrt-datacite.xml +0 -0
  61. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d12s30-mrt-datacite.xml +0 -0
  62. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1301m-mrt-datacite.xml +0 -0
  63. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d13s39-mrt-datacite.xml +0 -0
  64. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d13w2z-mrt-datacite.xml +0 -0
  65. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d14s3m-mrt-datacite.xml +0 -0
  66. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d15k5m-mrt-datacite.xml +0 -0
  67. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d15p48-mrt-datacite.xml +0 -0
  68. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d16k5x-mrt-datacite.xml +0 -0
  69. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d16p4k-mrt-datacite.xml +0 -0
  70. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d17g6k-mrt-datacite.xml +0 -0
  71. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d17p4w-mrt-datacite.xml +0 -0
  72. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d18g6w-mrt-datacite.xml +0 -0
  73. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1988w-mrt-datacite.xml +0 -0
  74. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d19g66-mrt-datacite.xml +0 -0
  75. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1b886-mrt-datacite.xml +0 -0
  76. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1bc7v-mrt-datacite.xml +0 -0
  77. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1c88h-mrt-datacite.xml +0 -0
  78. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1cc75-mrt-datacite.xml +0 -0
  79. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1d595-mrt-datacite.xml +0 -0
  80. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1f30c-mrt-datacite.xml +0 -0
  81. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1f59g-mrt-datacite.xml +0 -0
  82. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1g011-mrt-datacite.xml +0 -0
  83. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1g59s-mrt-datacite.xml +0 -0
  84. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1h01b-mrt-datacite.xml +0 -0
  85. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1h593-mrt-datacite.xml +0 -0
  86. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1j01n-mrt-datacite.xml +0 -0
  87. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1js3b-mrt-datacite.xml +0 -0
  88. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1k01z-mrt-datacite.xml +0 -0
  89. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1ks3n-mrt-datacite.xml +0 -0
  90. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1kw29-mrt-datacite.xml +0 -0
  91. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1ms3z-mrt-datacite.xml +0 -0
  92. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1mw2m-mrt-datacite.xml +0 -0
  93. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1np4m-mrt-datacite.xml +0 -0
  94. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1pk58-mrt-datacite.xml +0 -0
  95. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1pp4x-mrt-datacite.xml +0 -0
  96. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1qg6x-mrt-datacite.xml +0 -0
  97. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1qp47-mrt-datacite.xml +0 -0
  98. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1rg67-mrt-datacite.xml +0 -0
  99. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1rp4j-mrt-datacite.xml +0 -0
  100. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1sg6j-mrt-datacite.xml +0 -0
  101. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1t88j-mrt-datacite.xml +0 -0
  102. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1tg6v-mrt-datacite.xml +0 -0
  103. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1v88v-mrt-datacite.xml +0 -0
  104. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1vc7h-mrt-datacite.xml +0 -0
  105. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1w885-mrt-datacite.xml +0 -0
  106. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1wc7t-mrt-datacite.xml +0 -0
  107. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1x59t-mrt-datacite.xml +0 -0
  108. data/spec/data/{dash1-datacite-xml → dash1}/uci-ark+=b7280=d1z594-mrt-datacite.xml +0 -0
  109. data/spec/data/{dash1-datacite-xml → dash1}/ucla-ark+=b5060=d2qr4v2t-mrt-datacite.xml +0 -0
  110. data/spec/data/{dash1-datacite-xml → dash1}/ucla-ark+=b5068=d1cc7x-mrt-datacite.xml +0 -0
  111. data/spec/data/{dash1-datacite-xml → dash1}/ucla-ark+=b5068=d1h59v-mrt-datacite.xml +0 -0
  112. data/spec/data/{dash1-datacite-xml → dash1}/ucla-ark+=b5068=d1rp49-mrt-datacite.xml +0 -0
  113. data/spec/data/{dash1-datacite-xml → dash1}/ucla-ark+=b5068=d1wc7k-mrt-datacite.xml +0 -0
  114. data/spec/data/{dash1-datacite-xml → dash1}/ucm-ark+=13030=m51g217t-mrt-datacite.xml +0 -0
  115. data/spec/data/{dash1-datacite-xml → dash1}/ucm-ark+=b6071=z7wc73-mrt-datacite.xml +0 -0
  116. data/spec/data/{dash1-datacite-xml → dash1}/ucop-ark+=b5060=d8301x-mrt-datacite.xml +0 -0
  117. data/spec/data/{dash1-datacite-xml → dash1}/ucop-ark+=b5060=d86p4w-mrt-datacite.xml +0 -0
  118. data/spec/data/{dash1-datacite-xml → dash1}/ucop-ark+=b5060=d8bc75-mrt-datacite.xml +0 -0
  119. data/spec/data/{dash1-datacite-xml → dash1}/ucop-ark+=b5060=d8g593-mrt-datacite.xml +0 -0
  120. data/spec/data/{dash1-datacite-xml → dash1}/ucop-ark+=b5060=d8h59d-mrt-datacite.xml +0 -0
  121. data/spec/data/{dash1-datacite-xml → dash1}/ucop-ark+=b5060=d8kw2m-mrt-datacite.xml +0 -0
  122. data/spec/data/{dash1-datacite-xml → dash1}/ucop-ark+=b5060=d8rp4v-mrt-datacite.xml +0 -0
  123. data/spec/data/{dash1-datacite-xml → dash1}/ucop-ark+=b5060=d8z59f-mrt-datacite.xml +0 -0
  124. data/spec/data/{dash1-datacite-xml → dash1}/ucsc-ark+=b7291=d11592-mrt-datacite.xml +0 -0
  125. data/spec/data/{dash1-datacite-xml → dash1}/ucsc-ark+=b7291=d17p46-mrt-datacite.xml +0 -0
  126. data/spec/data/{dash1-datacite-xml → dash1}/ucsc-ark+=b7291=d1h59d-mrt-datacite.xml +0 -0
  127. data/spec/data/{dash1-datacite-xml → dash1}/ucsc-ark+=b7291=d1mw2x-mrt-datacite.xml +0 -0
  128. data/spec/data/{dash1-datacite-xml → dash1}/ucsc-ark+=b7291=d1wc74-mrt-datacite.xml +0 -0
  129. data/spec/data/{dash1-datacite-xml → dash1}/ucsf-ark+=b7272=q6057cv6-mrt-datacite.xml +0 -0
  130. data/spec/data/{dash1-datacite-xml → dash1}/ucsf-ark+=b7272=q6154f00-mrt-datacite.xml +0 -0
  131. data/spec/data/{dash1-datacite-xml → dash1}/ucsf-ark+=b7272=q61z429d-mrt-datacite.xml +0 -0
  132. data/spec/data/{dash1-datacite-xml → dash1}/ucsf-ark+=b7272=q62z13fs-mrt-datacite.xml +0 -0
  133. data/spec/data/{dash1-datacite-xml → dash1}/ucsf-ark+=b7272=q65q4t1r-mrt-datacite.xml +0 -0
  134. data/spec/data/{dash1-datacite-xml → dash1}/ucsf-ark+=b7272=q66q1v54-mrt-datacite.xml +0 -0
  135. data/spec/data/{dash1-datacite-xml → dash1}/ucsf-ark+=b7272=q67p8w9z-mrt-datacite.xml +0 -0
  136. data/spec/data/{dash1-datacite-xml → dash1}/ucsf-ark+=b7272=q68g8hmp-mrt-datacite.xml +0 -0
  137. data/spec/data/{dash1-datacite-xml → dash1}/ucsf-ark+=b7272=q6bg2kwf-mrt-datacite.xml +0 -0
  138. data/spec/data/{dash1-datacite-xml → dash1}/ucsf-ark+=b7272=q6c8276k-mrt-datacite.xml +0 -0
  139. data/spec/data/{dash1-datacite-xml → dash1}/ucsf-ark+=b7272=q6cc0xmh-mrt-datacite.xml +0 -0
  140. data/spec/data/{dash1-datacite-xml → dash1}/ucsf-ark+=b7272=q6d798bd-mrt-datacite.xml +0 -0
  141. data/spec/data/{dash1-datacite-xml → dash1}/ucsf-ark+=b7272=q6h12zxh-mrt-datacite.xml +0 -0
  142. data/spec/data/{dash1-datacite-xml → dash1}/ucsf-ark+=b7272=q6h41pb7-mrt-datacite.xml +0 -0
  143. data/spec/data/{dash1-datacite-xml → dash1}/ucsf-ark+=b7272=q6kw5cxv-mrt-datacite.xml +0 -0
  144. data/spec/data/{dash1-datacite-xml → dash1}/ucsf-ark+=b7272=q6ms3qnx-mrt-datacite.xml +0 -0
  145. data/spec/data/{dash1-datacite-xml → dash1}/ucsf-ark+=b7272=q6mw2f2n-mrt-datacite.xml +0 -0
  146. data/spec/data/{dash1-datacite-xml → dash1}/ucsf-ark+=b7272=q6pn93h6-mrt-datacite.xml +0 -0
  147. data/spec/data/{dash1-datacite-xml → dash1}/ucsf-ark+=b7272=q6qn64nk-mrt-datacite.xml +0 -0
  148. data/spec/data/{dash1-datacite-xml → dash1}/ucsf-ark+=b7272=q6rf5rzx-mrt-datacite.xml +0 -0
  149. data/spec/data/{dash1-datacite-xml → dash1}/ucsf-ark+=b7272=q6rn35sz-mrt-datacite.xml +0 -0
  150. data/spec/data/{dash1-datacite-xml → dash1}/ucsf-ark+=b7272=q6sf2t3q-mrt-datacite.xml +0 -0
  151. data/spec/data/{dash1-datacite-xml → dash1}/ucsf-ark+=b7272=q6td9v7j-mrt-datacite.xml +0 -0
  152. data/spec/data/{dash1-datacite-xml → dash1}/ucsf-ark+=b7272=q6w66hpn-mrt-datacite.xml +0 -0
  153. data/spec/data/{dash1-datacite-xml → dash1}/ucsf-ark+=b7272=q6x63jt1-mrt-datacite.xml +0 -0
  154. data/spec/data/{dash1-datacite-xml → dash1}/ucsf-ark+=b7272=q6z60kzd-mrt-datacite.xml +0 -0
  155. data/spec/data/datacite-4-synthetic.xml +110 -0
  156. data/spec/data/datacite3/datacite-example-Box_dateCollected_DataCollector-v3.0.xml +46 -0
  157. data/spec/data/datacite3/datacite-example-GeoLocation-v3.0.xml +50 -0
  158. data/spec/data/datacite3/datacite-example-HasMetadata-v3.0.xml +52 -0
  159. data/spec/data/datacite3/datacite-example-ResearchGroup_Methods-v3.0.xml +36 -0
  160. data/spec/data/datacite3/datacite-example-ResourceTypeGeneral_Collection-v3.0.xml +38 -0
  161. data/spec/data/datacite3/datacite-example-complicated-v3.0.xml +48 -0
  162. data/spec/data/datacite3/datacite-example-dataset-v3.0.xml +35 -0
  163. data/spec/data/datacite3/datacite-example-full-v3.1.xml +61 -0
  164. data/spec/data/datacite3/datacite-example-relationTypeIsIdenticalTo-v3.0.xml +48 -0
  165. data/spec/data/datacite3/datacite-example-video-v3.0.xml +26 -0
  166. data/spec/data/datacite3/datacite-example-workflow-v3.0.xml +43 -0
  167. data/spec/data/{metadata.xsd → datacite3/metadata.xsd} +0 -0
  168. data/spec/data/datacite4/datacite-example-Box_dateCollected_DataCollector-v4.0.xml +52 -0
  169. data/spec/data/datacite4/datacite-example-GeoLocation-v4.0.xml +66 -0
  170. data/spec/data/datacite4/datacite-example-HasMetadata-v4.0.xml +62 -0
  171. data/spec/data/datacite4/datacite-example-ResearchGroup_Methods-v4.0.xml +44 -0
  172. data/spec/data/datacite4/datacite-example-ResourceTypeGeneral_Collection-v4.0.xml +52 -0
  173. data/spec/data/datacite4/datacite-example-complicated-v4.0.xml +54 -0
  174. data/spec/data/datacite4/datacite-example-dataset-v4.0.xml +39 -0
  175. data/spec/data/{resource.xml → datacite4/datacite-example-full-v4.0.xml} +14 -4
  176. data/spec/data/{kernel-4.0 → datacite4}/datacite-example-fundingReference-v.4.0.xml +0 -0
  177. data/spec/data/datacite4/datacite-example-relationTypeIsIdenticalTo-v4.0.xml +65 -0
  178. data/spec/data/datacite4/datacite-example-video-v4.0.xml +31 -0
  179. data/spec/data/datacite4/datacite-example-workflow-v4.0.xml +55 -0
  180. data/spec/data/{kernel-4.0 → datacite4}/metadata.xsd +0 -0
  181. data/spec/rspec_custom_matchers.rb +5 -1
  182. data/spec/spec_helper.rb +1 -1
  183. data/spec/unit/datacite/mapping/contributor_spec.rb +7 -0
  184. data/spec/unit/datacite/mapping/creator_spec.rb +92 -0
  185. data/spec/unit/datacite/mapping/date_spec.rb +25 -214
  186. data/spec/unit/datacite/mapping/date_value_spec.rb +143 -0
  187. data/spec/unit/datacite/mapping/description_spec.rb +4 -3
  188. data/spec/unit/datacite/mapping/funding_reference_spec.rb +5 -5
  189. data/spec/unit/datacite/mapping/geo_location_box_spec.rb +0 -36
  190. data/spec/unit/datacite/mapping/geo_location_point_spec.rb +0 -25
  191. data/spec/unit/datacite/mapping/geo_location_polygon_spec.rb +47 -0
  192. data/spec/unit/datacite/mapping/geo_location_spec.rb +153 -6
  193. data/spec/unit/datacite/mapping/identifier_spec.rb +9 -0
  194. data/spec/unit/datacite/mapping/related_identifier_spec.rb +23 -0
  195. data/spec/unit/datacite/mapping/resource_spec.rb +994 -874
  196. data/spec/unit/datacite/mapping/subject_spec.rb +12 -6
  197. data/spec/unit/datacite/mapping/title_spec.rb +20 -6
  198. metadata +320 -278
  199. data/lib/datacite/mapping/nonvalidating.rb +0 -10
  200. data/lib/datacite/mapping/nonvalidating/identifier.rb +0 -40
  201. data/lib/datacite/mapping/nonvalidating/subject.rb +0 -43
  202. data/spec/data/mrt-datacite.xml +0 -61
  203. data/spec/unit/datacite/mapping/log_spec.rb +0 -23
  204. data/spec/unit/datacite/mapping/nonvalidating/identifier_spec.rb +0 -52
  205. data/spec/unit/datacite/mapping/resource_type_spec.rb +0 -68
@@ -1,10 +0,0 @@
1
- require 'logger'
2
-
3
- module Datacite
4
- module Mapping
5
- # Nonvalidating types for non-strict parsing
6
- module Nonvalidating
7
- Dir.glob(File.expand_path('../nonvalidating/*.rb', __FILE__)).sort.each(&method(:require))
8
- end
9
- end
10
- end
@@ -1,40 +0,0 @@
1
- require 'xml/mapping'
2
-
3
- module Datacite
4
- module Mapping
5
- module Nonvalidating
6
-
7
- # The persistent identifier that identifies the resource.
8
- #
9
- # @!attribute [r] identifier_type
10
- # @return [String] the identifier type (always 'DOI')
11
- # @!attribute [rw] value
12
- # @return [String, nil] the identifier value. Should be a valid DOI value (`10.`_registrant code_`/`_suffix_)
13
- class Identifier
14
- include XML::Mapping
15
-
16
- DOI = 'DOI'.freeze
17
-
18
- use_mapping :nonvalidating
19
-
20
- text_node :identifier_type, '@identifierType'
21
- text_node :value, 'text()', default_value: nil
22
-
23
- fallback_mapping(:_default, :nonvalidating)
24
-
25
- # Initializes a new {Identifier}
26
- # @param value [String, nil]
27
- # the identifier value. Should be a valid DOI value (`10.`_registrant code_`/`_suffix_)
28
- def initialize(value:)
29
- self.identifier_type = DOI
30
- self.value = value
31
- end
32
-
33
- # Gets the identifiery type.
34
- def identifier_type
35
- @identifier_type ||= DOI
36
- end
37
- end
38
- end
39
- end
40
- end
@@ -1,43 +0,0 @@
1
- require 'xml/mapping'
2
-
3
- module Datacite
4
- module Mapping
5
- module Nonvalidating
6
- # Subject, keyword, classification code, or key phrase describing the {Resource}.
7
- class Subject
8
- include XML::Mapping
9
-
10
- use_mapping :nonvalidating
11
-
12
- text_node :scheme, '@subjectScheme', default_value: nil
13
- uri_node :scheme_uri, '@schemeURI', default_value: nil
14
- text_node :language, '@xml:lang', default_value: 'en'
15
- text_node :value, 'text()', default_value: nil
16
-
17
- fallback_mapping(:_default, :nonvalidating)
18
-
19
- # Initializes a new {Subject}
20
- # @param scheme [String, nil] the subject scheme or classification code or authority if one is used. Optional.
21
- # @param scheme_uri [URI, nil] the URI of the subject scheme or classification code or authority if one is used. Optional.
22
- # @param language [String] an IETF BCP 47, ISO 639-1 language code identifying the language.
23
- # It's unclear from the spec whether language is required; to play it safe, if it's missing, we default to 'en'.
24
- # @param value [String] the subject itself.
25
- def initialize(scheme: nil, scheme_uri: nil, language: 'en', value: nil)
26
- self.scheme = scheme
27
- self.scheme_uri = scheme_uri
28
- self.language = language
29
- self.value = value
30
- end
31
-
32
- def language
33
- @language || 'en'
34
- end
35
-
36
- def language=(value)
37
- @language = value.strip if value
38
- end
39
-
40
- end
41
- end
42
- end
43
- end
@@ -1,61 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <resource xmlns="http://datacite.org/schema/kernel-3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://datacite.org/schema/kernel-3 http://schema.datacite.org/meta/kernel-3/metadata.xsd">
3
- <identifier identifierType="DOI"/>
4
- <creators>
5
- <creator>
6
- <creatorName>Baldassare, Mark</creatorName>
7
- </creator>
8
- </creators>
9
- <titles>
10
- <title>Annual Survey of Orange County 2000</title>
11
- </titles>
12
- <publisher>UC Irvine</publisher>
13
- <publicationYear>2014</publicationYear>
14
- <subjects>
15
- <subject>Consumer Confidence</subject>
16
- <subject>El Toro Airport</subject>
17
- <subject>School Vouchers</subject>
18
- <subject>Transportation</subject>
19
- <subject>Measure M</subject>
20
- <subject>Social Issues</subject>
21
- </subjects>
22
- <contributors>
23
- <contributor contributorType="DataManager">
24
- <contributorName>McKinley, Matthew J.</contributorName>
25
- </contributor>
26
- <contributor contributorType="Funder">
27
- <contributorName>University of California, Irvine</contributorName>
28
- </contributor>
29
- </contributors>
30
- <relatedIdentifiers>
31
- <relatedIdentifier relatedIdentifierType="URL" relationType="IsSupplementedBy">http://data.lib.uci.edu/ocs/</relatedIdentifier>
32
- </relatedIdentifiers>
33
- <resourceType resourceTypeGeneral="Dataset">Dataset</resourceType>
34
- <sizes>
35
- <size>546378</size>
36
- </sizes>
37
- <rightsList>
38
- <rights rightsURI="https://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International (CC-BY 4.0)</rights>
39
- </rightsList>
40
- <descriptions>
41
- <description descriptionType="Abstract">This 19th Orange County Annual Survey, UCI, continues to monitor social, economic and political trends. The Orange County Consumer Confidence Index now stands at 112, the highest score since the study began tracking this five-question measure in 1986, surpassing the U.S. index, which is at 109. The 2000 survey was conducted May 3-14, 2000, and includes random telephone interviews with 1,005 Orange County adults in English and Spanish.
42
-
43
- Online data analysis &amp; additional documentation in Link below.</description>
44
- <description descriptionType="Methods">The 2000 Orange County Annual Survey was directed by Mark Baldassare, professor and Johnson Chair in Civic Governance at UCI, and Senior Fellow at the Public Policy Institute of California. Cheryl Katz, research associate, was co-director. The random telephone survey included interviews with 1,005 Orange County adult residents conducted May 3-14, 2000. We follow the methods used in the 18 previous surveys.
45
-
46
- Interviewing was conducted on weekend days and weekday nights, using a computer-generated random sample of telephone numbers. Within a household, adult respondents were randomly chosen for interview. Each interview and took an average of 20 minutes to complete. The interviewing was conducted in English and Spanish as needed. The completion rate was 67%. Telephone interviewing was conducted by Interviewing Services of America in Van Nuys, CA. The sample's demographic characteristics were comparable to data from the U.S. Census, California Department of Finance, and previous Orange County Annual Surveys.
47
-
48
- The sampling error for this survey is +/- 3% at the 95% confidence level. This means that 95 times out of 100, the results will be within 3 percentage points of what they would be if all adults in Orange County were interviewed. The sampling error for any subgroup would be larger. Sampling error is just one type of error to which surveys are subject. Results may also be affected by factors such as question wording, ordering, and survey timing.
49
-
50
- Throughout the report, we refer to two geographic regions. North refers to cities and communities north of the 55 Freeway, including Anaheim, Orange, Villa Park, La Habra, Brea, Buena Park, Fullerton, Placentia, Yorba Linda, La Palma, Cypress, Los Alamitos, Rossmoor, Seal Beach, Westminster, Midway City,
51
- Stanton, Fountain Valley, Huntington Beach, Santa Ana, Garden Grove, Tustin, Tustin Foothills and Costa Mesa. South refers to cities and communities south of the 55 Freeway, including Newport Beach, Irvine,
52
- Lake Forest, Newport Coast, Aliso Viejo, Laguna Hills, Laguna Niguel, Laguna Woods, Mission Viejo, Portola Hills, Rancho Santa Margarita, Foothill Ranch, Coto de Caza, Trabuco, Laguna Beach, Dana Point, San Clemente, Capistrano Beach and San Juan Capistrano. In the analysis of questions on the proposed El Toro airport, we include Newport Beach in the North County.
53
-
54
- Some of the questions in this survey are repeated from national surveys conducted by the University of Michigan in 2000, the Pew Research Center in 1999, the Wall Street Journal and NBC News in 1999, CBS News in 1999, Fox News in 2000, and the Gallup Organization in 1999. Questions with California comparisons are repeated from the Public Policy Institute of California's Statewide Surveys in 2000, directed by Mark Baldassare.</description>
55
- </descriptions>
56
- <geoLocations>
57
- <geoLocation>
58
- <geoLocationPlace>Orange County (Calif.)</geoLocationPlace>
59
- </geoLocation>
60
- </geoLocations>
61
- </resource>
@@ -1,23 +0,0 @@
1
- require 'spec_helper'
2
-
3
- module Datacite
4
- module Mapping
5
- describe 'log' do
6
- it 'logs to stdout in a timestamp-first format' do
7
- out = StringIO.new
8
- Mapping.log_device = out
9
- begin
10
- msg = 'I am a log message'
11
- Mapping.log.warn(msg)
12
- logged = out.string
13
- expect(logged).to include(msg)
14
- timestamp_str = logged.split[0]
15
- timestamp = DateTime.parse(timestamp_str)
16
- expect(timestamp.to_date).to eq(Time.now.utc.to_date)
17
- ensure
18
- Mapping.log_device = $stdout
19
- end
20
- end
21
- end
22
- end
23
- end
@@ -1,52 +0,0 @@
1
- require 'spec_helper'
2
-
3
- module Datacite
4
- module Mapping
5
- module Nonvalidating
6
- describe Identifier do
7
-
8
- describe '#new' do
9
- it 'accepts a nil value' do
10
- id = Identifier.new(value: nil)
11
- expect(id.identifier_type).to eq('DOI')
12
- end
13
-
14
- it 'accepts an invalid value' do
15
- id = Identifier.new(value: 'elvis')
16
- expect(id.value).to eq('elvis')
17
- end
18
-
19
- end
20
-
21
- describe '#load_from_xml' do
22
- it 'parses a valid identifier' do
23
- xml_text = "<identifier identifierType='DOI'>10.14749/1407399498</identifier>"
24
- id = Identifier.parse_xml(xml_text, mapping: :nonvalidating)
25
- expect(id.identifier_type).to eq('DOI')
26
- expect(id.value).to eq('10.14749/1407399498')
27
- end
28
-
29
- it 'parses an identifier with a missing value' do
30
- xml_text = "<identifier identifierType='DOI'/>"
31
- id = Identifier.parse_xml(xml_text, mapping: :nonvalidating)
32
- expect(id.identifier_type).to eq('DOI')
33
- expect(id.value).to be_nil
34
- end
35
- end
36
-
37
- describe '#save_to_xml' do
38
- it 'writes a valid identifier' do
39
- xml_text = "<identifier identifierType='DOI'>10.14749/1407399498</identifier>"
40
- id = Identifier.parse_xml(xml_text, mapping: :nonvalidating)
41
- expect(id.write_xml(mapping: :nonvalidating)).to be_xml(xml_text)
42
- end
43
- it 'writes an identifier with a missing value' do
44
- xml_text = "<identifier identifierType='DOI'/>"
45
- id = Identifier.parse_xml(xml_text, mapping: :nonvalidating)
46
- expect(id.write_xml(mapping: :nonvalidating)).to be_xml(xml_text)
47
- end
48
- end
49
- end
50
- end
51
- end
52
- end
@@ -1,68 +0,0 @@
1
- require 'spec_helper'
2
-
3
- module Datacite
4
- module Mapping
5
- describe ResourceType do
6
- describe '#initialize' do
7
- it 'sets the value' do
8
- rt = ResourceType.new(resource_type_general: ResourceTypeGeneral::DATASET, value: 'some data')
9
- expect(rt.value).to eq('some data')
10
- end
11
- it 'sets the general resource type' do
12
- rt = ResourceType.new(resource_type_general: ResourceTypeGeneral::DATASET, value: 'some data')
13
- expect(rt.resource_type_general).to eq(ResourceTypeGeneral::DATASET)
14
- end
15
- it 'allows a nil value' do
16
- rt = ResourceType.new(resource_type_general: ResourceTypeGeneral::DATASET)
17
- expect(rt.value).to be_nil
18
- end
19
- it 'requires a general resource type' do
20
- expect { ResourceType.new(value: 'some data') }.to raise_error(ArgumentError)
21
- end
22
- end
23
-
24
- describe 'resourceTypeGeneral=' do
25
- it 'sets the general resource type' do
26
- rt = ResourceType.allocate
27
- rt.resource_type_general = ResourceTypeGeneral::DATASET
28
- expect(rt.resource_type_general).to eq(ResourceTypeGeneral::DATASET)
29
- end
30
- it 'requires a general resource type' do
31
- rt = ResourceType.new(resource_type_general: ResourceTypeGeneral::DATASET, value: 'some data')
32
- expect { rt.resource_type_general = nil }.to raise_error(ArgumentError)
33
- expect(rt.resource_type_general).to eq(ResourceTypeGeneral::DATASET)
34
- end
35
- end
36
-
37
- describe 'value' do
38
- it 'sets the value' do
39
- rt = ResourceType.allocate
40
- rt.value = 'some data'
41
- expect(rt.value).to eq('some data')
42
- end
43
- it 'allows a nil value' do
44
- rt = ResourceType.new(resource_type_general: ResourceTypeGeneral::DATASET, value: 'some data')
45
- rt.value = nil
46
- expect(rt.value).to be_nil
47
- end
48
- end
49
-
50
- describe '#load_from_xml' do
51
- it 'parses XML' do
52
- xml_text = '<resourceType resourceTypeGeneral="Software">XML</resourceType>'
53
- rt = ResourceType.parse_xml(xml_text)
54
- expect(rt.resource_type_general).to eq(ResourceTypeGeneral::SOFTWARE)
55
- expect(rt.value).to eq('XML')
56
- end
57
- end
58
-
59
- describe '#save_to_xml' do
60
- it 'writes XML' do
61
- rt = ResourceType.new(resource_type_general: ResourceTypeGeneral::DATASET, value: 'some data')
62
- expected_xml = '<resourceType resourceTypeGeneral="Dataset">some data</resourceType>'
63
- expect(rt.save_to_xml).to be_xml(expected_xml)
64
- end
65
- end
66
- end
67
- end
68
- end