voruby 1.1.1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (257) hide show
  1. data/Rakefile.rb +107 -224
  2. data/lib/misc.rb +1 -0
  3. data/lib/misc/misc.rb +60 -0
  4. data/lib/misc/propertyfile.rb +31 -0
  5. data/lib/symphony.rb +1 -0
  6. data/lib/symphony/symphony.rb +247 -0
  7. data/lib/voruby.rb +186 -0
  8. data/lib/voruby/active_votable/active_votable.rb +468 -347
  9. data/lib/voruby/adql/1.0/adql.rb +2418 -0
  10. data/lib/voruby/adql/support.rb +2 -0
  11. data/lib/voruby/misc.rb +351 -0
  12. data/lib/voruby/misc/connection_monitor.rb +97 -0
  13. data/lib/voruby/misc/libxml_ext.rb +121 -0
  14. data/lib/voruby/misc/rexml_ext.rb +223 -0
  15. data/lib/voruby/resolver/resolver.rb +12 -0
  16. data/lib/voruby/resolver/sesame.rb +299 -0
  17. data/lib/voruby/sky_query/sky_query.rb +192 -0
  18. data/lib/voruby/stc/1.10/coords.rb +2272 -0
  19. data/lib/voruby/stc/1.10/region.rb +892 -0
  20. data/lib/voruby/stc/1.10/stc.rb +3271 -0
  21. data/lib/voruby/stc/1.30/stc.rb +8666 -0
  22. data/lib/voruby/stc/support.rb +2 -0
  23. data/lib/voruby/ucd/ucd.rb +173 -0
  24. data/lib/voruby/voevent/1.1/voevent.rb +1124 -0
  25. data/lib/voruby/voevent/support.rb +5 -0
  26. data/lib/voruby/votable/1.0/votable.rb +1807 -0
  27. data/lib/voruby/votable/1.1/votable.rb +2100 -0
  28. data/lib/voruby/votable/votable.rb +305 -0
  29. data/lib/voruby/wesix/wesix.rb +491 -0
  30. data/lib/voruby/xlink/1.2/xlink.rb +21 -0
  31. data/test/voruby/active_votable/complex.vot +60 -0
  32. data/test/voruby/active_votable/error.vot +6 -0
  33. data/test/voruby/active_votable/large.vot +130040 -0
  34. data/test/voruby/active_votable/simple1.vot +38 -0
  35. data/test/voruby/active_votable/simple2.vot +38 -0
  36. data/test/voruby/active_votable/test.rb +193 -0
  37. data/test/voruby/adql/1.0/adql-alias.sql +1 -0
  38. data/test/voruby/adql/1.0/adql-alias.xml +26 -0
  39. data/test/voruby/adql/1.0/adql-avg.sql +1 -0
  40. data/test/voruby/adql/1.0/adql-avg.xml +31 -0
  41. data/test/voruby/adql/1.0/adql-circle.sql +1 -0
  42. data/test/voruby/adql/1.0/adql-circle.xml +46 -0
  43. data/test/voruby/adql/1.0/adql-expr.sql +1 -0
  44. data/test/voruby/adql/1.0/adql-expr.xml +34 -0
  45. data/test/voruby/adql/1.0/adql-function.sql +1 -0
  46. data/test/voruby/adql/1.0/adql-function.xml +41 -0
  47. data/test/voruby/adql/1.0/adql-group.sql +1 -0
  48. data/test/voruby/adql/1.0/adql-group.xml +51 -0
  49. data/test/voruby/adql/1.0/adql-having.sql +1 -0
  50. data/test/voruby/adql/1.0/adql-having.xml +25 -0
  51. data/test/voruby/adql/1.0/adql-like.sql +1 -0
  52. data/test/voruby/adql/1.0/adql-like.xml +17 -0
  53. data/test/voruby/adql/1.0/adql-order.sql +1 -0
  54. data/test/voruby/adql/1.0/adql-order.xml +37 -0
  55. data/test/voruby/adql/1.0/adql-simple.sql +1 -0
  56. data/test/voruby/adql/1.0/adql-simple.xml +12 -0
  57. data/test/voruby/adql/1.0/adql-top.sql +1 -0
  58. data/test/voruby/adql/1.0/adql-top.xml +33 -0
  59. data/test/voruby/adql/1.0/test.rb +2220 -0
  60. data/test/voruby/misc/test.rb +32 -0
  61. data/test/voruby/resolver/sesame/test.rb +56 -0
  62. data/test/voruby/sky_query/test.rb +107 -0
  63. data/test/voruby/stc/1.10/coords_test.rb +3704 -0
  64. data/test/voruby/stc/1.10/region_test.rb +993 -0
  65. data/test/voruby/stc/1.10/stc-catalog-entry-location.xml +112 -0
  66. data/test/voruby/stc/1.10/stc-obs-data-location.xml +126 -0
  67. data/test/voruby/stc/1.10/stc-region-circle.xml +5 -0
  68. data/test/voruby/stc/1.10/stc-region-convex.xml +11 -0
  69. data/test/voruby/stc/1.10/stc-region-convexhull.xml +5 -0
  70. data/test/voruby/stc/1.10/stc-region-ellipse.xml +7 -0
  71. data/test/voruby/stc/1.10/stc-region-intersection.xml +25 -0
  72. data/test/voruby/stc/1.10/stc-region-negation.xml +7 -0
  73. data/test/voruby/stc/1.10/stc-region-polygon.xml +13 -0
  74. data/test/voruby/stc/1.10/stc-region-sector.xml +6 -0
  75. data/test/voruby/stc/1.10/stc-region-union.xml +25 -0
  76. data/test/voruby/stc/1.10/stc-resource-profile.xml +60 -0
  77. data/test/voruby/stc/1.10/stc-search-location.xml +54 -0
  78. data/test/voruby/stc/1.10/stc_test.rb +4626 -0
  79. data/test/voruby/stc/1.30/stc-catalog-entry-location.xml +210 -0
  80. data/test/voruby/stc/1.30/stc-obs-data-location-arecibo.xml +353 -0
  81. data/test/voruby/stc/1.30/stc-obs-data-location-fits.xml +250 -0
  82. data/test/voruby/stc/1.30/stc-obs-data-location-xlink.xml +63 -0
  83. data/test/voruby/stc/1.30/stc-obs-data-location.xml +216 -0
  84. data/test/voruby/stc/1.30/stc-resource-profile-unusual-ref-pos.xml +39 -0
  85. data/test/voruby/stc/1.30/stc-resource-profile.xml +129 -0
  86. data/test/voruby/stc/1.30/stc-search-location-arecibo.xml +86 -0
  87. data/test/voruby/stc/1.30/stc-search-location.xml +101 -0
  88. data/test/voruby/stc/1.30/test.rb +6274 -0
  89. data/test/voruby/ucd/test.rb +48 -0
  90. data/test/voruby/voevent/1.1/test.rb +812 -0
  91. data/test/{voevent/voevent_v1_1.xml → voruby/voevent/1.1/voevent.xml} +2 -2
  92. data/test/voruby/voregistry/0.3/test.rb +137 -0
  93. data/test/voruby/votable/1.0/test.rb +714 -0
  94. data/test/voruby/votable/1.0/votable.basic.xml +660 -0
  95. data/test/voruby/votable/1.0/votable.html +86 -0
  96. data/test/voruby/votable/1.0/votable.ns.xml +56 -0
  97. data/test/voruby/votable/1.1/test.rb +785 -0
  98. data/test/voruby/votable/1.1/votable.basic.xml +38 -0
  99. data/test/voruby/votable/1.1/votable.html +86 -0
  100. data/test/voruby/votable/1.1/votable.ns.xml +56 -0
  101. data/test/voruby/votable/test.rb +15 -0
  102. data/test/voruby/wesix/test.rb +268 -0
  103. data/test/voruby/wesix/testr.fits +28 -0
  104. metadata +234 -247
  105. data/REQUIREMENTS +0 -6
  106. data/lib/voruby/active_votable/loader.rb +0 -5
  107. data/lib/voruby/adql/adql.rb +0 -2787
  108. data/lib/voruby/adql/ext.rb +0 -14
  109. data/lib/voruby/adql/loader.rb +0 -6
  110. data/lib/voruby/adql/operations.rb +0 -54
  111. data/lib/voruby/adql/parser.rb +0 -160
  112. data/lib/voruby/adql/transforms.rb +0 -573
  113. data/lib/voruby/ext.rb +0 -17
  114. data/lib/voruby/loader.rb +0 -4
  115. data/lib/voruby/misc/propertyfile.rb +0 -36
  116. data/lib/voruby/plastic/applications.rb +0 -174
  117. data/lib/voruby/plastic/constants.rb +0 -30
  118. data/lib/voruby/plastic/loader.rb +0 -10
  119. data/lib/voruby/plastic/plastic.rb +0 -1
  120. data/lib/voruby/resources/conesearch/conesearch.rb +0 -9
  121. data/lib/voruby/resources/conesearch/conesearch_v0_2.rb +0 -55
  122. data/lib/voruby/resources/conesearch/conesearch_v0_3.rb +0 -50
  123. data/lib/voruby/resources/conesearch/conesearch_v1_0.rb +0 -72
  124. data/lib/voruby/resources/conesearch/loader.rb +0 -4
  125. data/lib/voruby/resources/loader.rb +0 -50
  126. data/lib/voruby/resources/nodes.rb +0 -190
  127. data/lib/voruby/resources/openskynode/loader.rb +0 -4
  128. data/lib/voruby/resources/openskynode/openskynode.rb +0 -9
  129. data/lib/voruby/resources/openskynode/openskynode_v0_1.rb +0 -54
  130. data/lib/voruby/resources/sia/loader.rb +0 -5
  131. data/lib/voruby/resources/sia/sia.rb +0 -9
  132. data/lib/voruby/resources/sia/sia_v0_6.rb +0 -90
  133. data/lib/voruby/resources/sia/sia_v0_7.rb +0 -89
  134. data/lib/voruby/resources/sia/sia_v1_0.rb +0 -122
  135. data/lib/voruby/resources/stsci.rb +0 -59
  136. data/lib/voruby/resources/vodataservice/coverage_v0_2.rb +0 -195
  137. data/lib/voruby/resources/vodataservice/coverage_v0_3.rb +0 -158
  138. data/lib/voruby/resources/vodataservice/loader.rb +0 -5
  139. data/lib/voruby/resources/vodataservice/vodataservice.rb +0 -9
  140. data/lib/voruby/resources/vodataservice/vodataservice_v0_4.rb +0 -189
  141. data/lib/voruby/resources/vodataservice/vodataservice_v0_5.rb +0 -163
  142. data/lib/voruby/resources/vodataservice/vodataservice_v1_0.rb +0 -221
  143. data/lib/voruby/resources/voregistry/loader.rb +0 -4
  144. data/lib/voruby/resources/voregistry/voregistry.rb +0 -9
  145. data/lib/voruby/resources/voregistry/voregistry_v0_2.rb +0 -40
  146. data/lib/voruby/resources/voregistry/voregistry_v0_3.rb +0 -30
  147. data/lib/voruby/resources/voregistry/voregistry_v1_0.rb +0 -86
  148. data/lib/voruby/resources/voresource/loader.rb +0 -17
  149. data/lib/voruby/resources/voresource/voresource.rb +0 -9
  150. data/lib/voruby/resources/voresource/voresource_v0_10.rb +0 -327
  151. data/lib/voruby/resources/voresource/voresource_v0_9.rb +0 -405
  152. data/lib/voruby/resources/voresource/voresource_v1_0.rb +0 -230
  153. data/lib/voruby/services/ext.rb +0 -11
  154. data/lib/voruby/services/gestalt/footprint.rb +0 -95
  155. data/lib/voruby/services/gestalt/wcs_fixer.rb +0 -105
  156. data/lib/voruby/services/gestalt/wesix.rb +0 -155
  157. data/lib/voruby/services/loader.rb +0 -7
  158. data/lib/voruby/services/registry/registry.rb +0 -53
  159. data/lib/voruby/services/resolver/resolver.rb +0 -35
  160. data/lib/voruby/services/schema/schema.rb +0 -644
  161. data/lib/voruby/sesame/loader.rb +0 -6
  162. data/lib/voruby/sesame/sesame_v1_0.rb +0 -64
  163. data/lib/voruby/simple/loader.rb +0 -6
  164. data/lib/voruby/simple/parameters.rb +0 -196
  165. data/lib/voruby/simple/sap.rb +0 -446
  166. data/lib/voruby/spacetime/loader.rb +0 -3
  167. data/lib/voruby/spacetime/spacetime.rb +0 -607
  168. data/lib/voruby/stc/coords_v1_20.rb +0 -900
  169. data/lib/voruby/stc/loader.rb +0 -55
  170. data/lib/voruby/stc/region_v1_20.rb +0 -274
  171. data/lib/voruby/stc/stc_v1_20.rb +0 -1196
  172. data/lib/voruby/util.rb +0 -27
  173. data/lib/voruby/voevent/loader.rb +0 -7
  174. data/lib/voruby/voevent/voevent_v1_0.rb +0 -213
  175. data/lib/voruby/voevent/voevent_v1_1.rb +0 -196
  176. data/lib/voruby/votables/chandra.rb +0 -373
  177. data/lib/voruby/votables/data.rb +0 -179
  178. data/lib/voruby/votables/galex.rb +0 -377
  179. data/lib/voruby/votables/int.rb +0 -354
  180. data/lib/voruby/votables/libxml_parser.rb +0 -411
  181. data/lib/voruby/votables/libxml_votable.rb +0 -67
  182. data/lib/voruby/votables/loader.rb +0 -10
  183. data/lib/voruby/votables/meta.rb +0 -763
  184. data/lib/voruby/votables/misc.rb +0 -51
  185. data/lib/voruby/votables/nsa.rb +0 -410
  186. data/lib/voruby/votables/rexml_parser.rb +0 -408
  187. data/lib/voruby/votables/rexml_votable.rb +0 -67
  188. data/lib/voruby/votables/sdss.rb +0 -356
  189. data/lib/voruby/votables/transforms.rb +0 -388
  190. data/lib/voruby/votables/tree.rb +0 -45
  191. data/lib/voruby/votables/types.rb +0 -391
  192. data/lib/voruby/votables/votable.rb +0 -687
  193. data/test/active_votable/database.yml +0 -6
  194. data/test/active_votable/test.vot +0 -168492
  195. data/test/active_votable/unittest.rb +0 -41
  196. data/test/adql/test1.adql +0 -49
  197. data/test/adql/test2.adql +0 -51
  198. data/test/adql/test3.adql +0 -81
  199. data/test/adql/test4.adql +0 -53
  200. data/test/adql/test5.adql +0 -55
  201. data/test/adql/test6.adql +0 -18
  202. data/test/adql/test7.adql +0 -48
  203. data/test/adql/unittest.rb +0 -1672
  204. data/test/plastic/test.rb +0 -44
  205. data/test/plastic/test.vot +0 -5385
  206. data/test/plastic/unittest.rb +0 -66
  207. data/test/resources/conesearch/conesearch_v0_3.xml +0 -31
  208. data/test/resources/conesearch/conesearch_v1_0.xml +0 -86
  209. data/test/resources/conesearch/unittest_v0_3.rb +0 -22
  210. data/test/resources/conesearch/unittest_v1_0.rb +0 -24
  211. data/test/resources/openskynode/open_sky_node_v0_1.xml +0 -32
  212. data/test/resources/openskynode/unittest_v0_1.rb +0 -31
  213. data/test/resources/sia/simple_image_access_v0_7.xml +0 -36
  214. data/test/resources/sia/simple_image_access_v1_0.xml +0 -122
  215. data/test/resources/sia/unittest_v0_7.rb +0 -24
  216. data/test/resources/sia/unittest_v1_0.rb +0 -29
  217. data/test/resources/stsci.xml +0 -336
  218. data/test/resources/unittest_stsci.rb +0 -25
  219. data/test/resources/vodataservice/catalog_service_resource_v1_0.xml +0 -128
  220. data/test/resources/vodataservice/data_collection_resource_v0_5.xml +0 -54
  221. data/test/resources/vodataservice/data_collection_resource_v1_0.xml +0 -117
  222. data/test/resources/vodataservice/data_service_resource_v1_0.xml +0 -115
  223. data/test/resources/vodataservice/sky_service_resource_v0_10.xml +0 -45
  224. data/test/resources/vodataservice/table_service_resource_v1_0.xml +0 -122
  225. data/test/resources/vodataservice/tabular_sky_service_resource_v0_10.xml +0 -60
  226. data/test/resources/vodataservice/unittest_v0_5.rb +0 -126
  227. data/test/resources/vodataservice/unittest_v1_0.rb +0 -151
  228. data/test/resources/voregistry/authority_resource_v0_3.xml +0 -20
  229. data/test/resources/voregistry/authority_resource_v1_0.xml +0 -82
  230. data/test/resources/voregistry/registry_service_v0_3.xml +0 -20
  231. data/test/resources/voregistry/registry_service_v1_0.xml +0 -107
  232. data/test/resources/voregistry/unittest_v0_3.rb +0 -31
  233. data/test/resources/voregistry/unittest_v1_0.rb +0 -34
  234. data/test/resources/voresource/organisation_resource_v1_0.xml +0 -90
  235. data/test/resources/voresource/resource_organisation_v0_10.xml +0 -22
  236. data/test/resources/voresource/resource_service_v0_10.xml +0 -19
  237. data/test/resources/voresource/resource_v0_10.xml +0 -19
  238. data/test/resources/voresource/resource_v1_0.xml +0 -79
  239. data/test/resources/voresource/service_resource_v1_0.xml +0 -91
  240. data/test/resources/voresource/unittest_v0_10.rb +0 -61
  241. data/test/resources/voresource/unittest_v0_9.rb +0 -4
  242. data/test/resources/voresource/unittest_v1_0.rb +0 -190
  243. data/test/services/gestalt/unittest.rb +0 -74
  244. data/test/services/registry/unittest.rb +0 -34
  245. data/test/services/resolver/unittest.rb +0 -38
  246. data/test/simple/unittest.rb +0 -46
  247. data/test/spacetime/unittest.rb +0 -39
  248. data/test/stc/catalog_entry_location_v1_20.xml +0 -112
  249. data/test/stc/obs_data_location_v1_20.xml +0 -108
  250. data/test/stc/search_location_v1_20.xml +0 -54
  251. data/test/stc/stc_resource_profile_v1_20.xml +0 -60
  252. data/test/stc/unittest_v1_20.rb +0 -620
  253. data/test/voevent/unittest_v1_0.rb +0 -79
  254. data/test/voevent/unittest_v1_1.rb +0 -70
  255. data/test/voevent/voevent_v1_0.xml +0 -96
  256. data/test/votables/test.vot +0 -366
  257. data/test/votables/unittest.rb +0 -54
@@ -1,122 +0,0 @@
1
- require 'voruby/resources/sia/loader'
2
-
3
- require 'voruby/resources/voresource/voresource_v1_0'
4
- require 'voruby/resources/vodataservice/vodataservice_v1_0'
5
-
6
- include VORuby::Resources::VOResource::V1_0
7
- include VORuby::Resources::VODataService::V1_0
8
-
9
- module VORuby
10
- module Resources
11
- module SIA
12
- module V1_0
13
-
14
- # Forward declarations
15
- class SIACapRestriction < Capability; end
16
- class SimpleImageAccess < SIACapRestriction; end
17
- class SkySize; end
18
- class SkyPos; end
19
- class ImageSize; end
20
- class ImageServiceType; end
21
- class Query; end
22
-
23
- # An abstract capability that fixes the standardID to the IVOA ID for the ConeSearch standard.
24
- class SIACapRestriction
25
- text_node :description, 'description', :optional => true
26
- text_node :standard_id, 'standardID', :class => IdentifierURI, :optional => false,
27
- :default_value => 'ivo://ivoa.net/std/SIA'
28
-
29
- array_node :validation_levels, 'validationLevel', :class => Validation, :optional => true, :default_value => []
30
- array_node :interfaces, 'interface', :class => Interface, :optional => true, :default_value => []
31
-
32
- def standard_id
33
- id = IdentifierURI.new
34
- id.value = 'ivo://ivoa.net/std/SIA'
35
-
36
- return id
37
- end
38
- end
39
-
40
- # The capabilities of an SIA implementation.
41
- class SimpleImageAccess
42
- # the class of image service: Cutout, Mosaic, Atlas, Pointed
43
- object_node :image_service_type, 'imageServiceType', :class => ImageServiceType, :optional => false
44
- # the maximum image query region size, expressed in
45
- # decimal degrees. A value of 360 degrees indicates that
46
- # there is no limit and the entire data collection
47
- # (entire sky) can be queried.
48
- object_node :max_query_region_size, 'maxQueryRegionSize', :class => SkySize, :optional => false
49
- # the maximum image query region size, expressed in
50
- # decimal degrees. A value of 360 degrees indicates
51
- # that there is no limit and the entire data collection
52
- # (entire sky) can be requested.
53
- object_node :max_image_extent, 'maxImageExtent', :class => SkySize, :optional => false
54
- # the largest image (in terms of pixels) that can be requested
55
- object_node :max_image_size, 'maxImageSize', :class => ImageSize, :optional => false
56
- # a set of query parameters that is expected to produce at least one matched record which
57
- # can be used to test the service.
58
- object_node :test_query, 'testQuery', :class => Query, :optional => true
59
-
60
- # the maximum image file size in bytes
61
- numeric_node :max_file_size, 'maxFileSize', :optional => false
62
- numeric_node :max_records, 'maxRecords', :optional => false
63
- end
64
-
65
- class SkySize
66
- include XML::Mapping
67
-
68
- # the maximum size in the longitude (R.A.) direction
69
- numeric_node :long, 'long', :optional => false
70
- # the maximum size in the latitdude (Dec.) direction
71
- numeric_node :lat, 'lat', :optional => false
72
- end
73
-
74
- class SkyPos
75
- include XML::Mapping
76
-
77
- # the sky position in the longitude (R.A.) direction
78
- numeric_node :long, 'long', :optional => false
79
- # the sky position in the latitdude (Dec.) direction
80
- numeric_node :lat, 'lat', :optional => false
81
- end
82
-
83
- class ImageSize
84
- include XML::Mapping
85
-
86
- # the image size in the longitude (R.A.) direction in pixels
87
- numeric_node :long, 'long', :optional => false
88
- # the image size in the latitdude (Dec.) direction in pixels
89
- numeric_node :lat, 'lat', :optional => false
90
- end
91
-
92
- # The class of image service: Cutout, Mosaic, Atlas, Pointed.
93
- class ImageServiceType
94
- include XML::Mapping
95
-
96
- text_enumeration_node :value, '', :optional => false,
97
- :choices => ['Cutout', 'Mosaic', 'Atlas', 'Pointed']
98
- end
99
-
100
- # A query to be sent to the service.
101
- class Query
102
- include XML::Mapping
103
-
104
- # the right ascension of the search cone's center in decimal degrees
105
- object_node :pos, 'pos', :class => SkyPos, :optional => true
106
- # the declination of the search cone's center in decimal degrees
107
- object_node :size, 'size', :class => SkySize, :optional => true
108
-
109
- # the verbosity level to use where 0 means the bare
110
- # minimum set of columns and 3 means the full set of available columns
111
- numeric_node :verb, 'verb', :optional => true
112
-
113
- # any extra (particularly non-standard) parameters that must
114
- # be provided (apart from what is part of base URL given by
115
- # the accessURL element).
116
- text_node :extras, 'extras', :optional => true
117
- end
118
-
119
- end
120
- end
121
- end
122
- end
@@ -1,59 +0,0 @@
1
- require 'rubygems'
2
- require 'xml/mapping'
3
-
4
- require 'voruby/resources/loader'
5
-
6
- # STScI's registry uses the following resource versions...
7
- require 'voruby/resources/voresource/voresource_v0_10'
8
- require 'voruby/resources/vodataservice/vodataservice_v0_5'
9
- require 'voruby/resources/voregistry/voregistry_v0_3'
10
- require 'voruby/resources/conesearch/conesearch_v0_3'
11
- require 'voruby/resources/openskynode/openskynode_v0_1'
12
- require 'voruby/resources/sia/sia_v0_7'
13
-
14
- module VORuby
15
- module Resources
16
- module STScI
17
-
18
- # Forward declarations
19
- class ArrayOfResource; end
20
-
21
- $ResourceUnmarshaller = Resources::namespace_dispatcher(
22
- 'VORuby::Resources::VOResource::V0_10', 'Resource', Resource
23
- )
24
-
25
- class ArrayOfResource
26
- include XML::Mapping
27
-
28
- array_node :resources, 'Resource', :unmarshaller => $ResourceUnmarshaller, :optional => false, :default_value => []
29
- end
30
-
31
- # STScI's registry has some quirks which we'd like to clean up a bit.
32
- def self.clean(doc)
33
- return STScI::remove_empty_elements(STScI::remove_invalid_ivo_ids(doc))
34
- end
35
-
36
- # STScI occasionally puts 'NOT PROVIDED' or '' in the ivo-id attribute of (in particular) the publisher element which is not valid.
37
- # This removes the ivo-id in that situation.
38
- def self.remove_invalid_ivo_ids(doc)
39
- doc.elements.each('//*[@ivo-id="NOT PROVIDED" or @ivo-id=""]'){ |el|
40
- el.delete_attribute('ivo-id')
41
- }
42
-
43
- return doc
44
- end
45
-
46
- # Sometimes STScI puts empty elements (no attributes at all) into its resource definitions
47
- # (particularly in the curation element). I don't think this is valid--if an element exists at all, it
48
- # should have *some* kind of content. Therefore I remove all elements who have no attributes and no children.
49
- def self.remove_empty_elements(doc)
50
- doc.elements.each('//*'){ |el|
51
- el.parent.delete_element(el) if !el.has_attributes? and !el.has_elements? and !el.has_text?
52
- }
53
-
54
- return doc
55
- end
56
-
57
- end
58
- end
59
- end
@@ -1,195 +0,0 @@
1
- require 'voruby/resources/vodataservice/loader'
2
-
3
- module VORuby
4
- module Resources
5
- module VODataServiceCoverage
6
- module V0_2
7
-
8
- # Forward declarations
9
- class Coverage < CoverageType; end
10
- class SpatialType; end
11
- class Spatial < SpatialType; end
12
- class RegionType; end
13
- class Region < RegionType; end
14
- class AllSky < RegionType; end
15
- class CoordFrameType; end
16
- class CoordFrame < CoordFrameType; end
17
- class CoordRangeType < RegionType; end
18
- class CircleRegionType < RegionType; end
19
- class CircleRegion < CirlceRegionType; end
20
- class PositionType; end
21
- class CenterPosition < PositionType; end
22
- class SpatialResolution; end
23
- class RegionOfRegard; end
24
- class TemporalType; end
25
- class Temporal < TemporalType; end
26
- class StartTime; end
27
- class EndTime; end
28
- class TemporalResolution; end
29
- class SpectralType; end
30
- class Spectral < SpectralType; end
31
- class WavebandType; end
32
- class Waveband < WavebandType; end
33
- class WavelengthRangeType; end
34
- class WavelengthRange < WavelengthRangeType; end
35
- class SpectralResolution; end
36
- class MinMaxRange; end
37
-
38
- # Extent of the content of the resource over space, time, and frequency.
39
- class Coverage; end
40
- class CoverageType
41
- include XML::Mapping
42
-
43
- object_node :spatial, 'Spatial', :class => Spatial, :optional => true
44
- object_node :spectral, 'Spectral', :class => Spectral, :optional => true
45
- object_node :temporal, 'Temporal', :class => Temporal, :optional => true
46
- end
47
-
48
- # The spatial coverage of a resource.
49
- class Spatial; end
50
- class SpatialType
51
- include XML::Mapping
52
-
53
- object_node :spatial_resolution, 'SpatialResolution', :class => SpatialResolution, :optional => true
54
- object_node :region_of_regard, 'RegionOfRegard', :class => RegionOfRegard, :optional => true
55
-
56
- array_node :regions, 'Region', :class => Region, :optional => true, :default_value => []
57
- end
58
-
59
- # A coverage area of the sky.
60
- class Region; end
61
- class RegionType
62
- include XML::Mapping
63
- end
64
-
65
- # A coverage area covering the entire sky.
66
- class AllSky; end
67
-
68
- # A coordinate system frame.
69
- class CoordFrame; end
70
- class CoordFrameType
71
- include XML::Mapping
72
-
73
- text_enumeration_node :value, '', :optional => false,
74
- :choices => ['ICRS', 'FK5', 'FK4', 'ECL', 'GAL', 'SGAL']
75
- end
76
-
77
- # A coverage area of the sky characterized by a range of longitude and latitude.
78
- class CoordRange; end
79
- class CoordRangeType
80
- object_node :coord_frame, 'CoordFrame', :class => CoordFrame, :optional => false
81
- object_node :long, 'long', :class => MinMaxRange, :optional => false
82
- object_node :lat, 'lat', :class => MinMaxRange, :optional => false
83
- end
84
-
85
- class MinMaxRange
86
- require XML::Mapping
87
-
88
- numeric_node :min, 'min', :optional => false
89
- numeric_node :max, 'max', :optional => false
90
- end
91
-
92
- # A coverage area of the sky characterized by a central position and angular radius.
93
- class CircleRegion; end
94
- class CircleRegionType
95
- numeric_node :radius, 'radius', :optional => false
96
-
97
- object_node :coord_frame, 'CoordFrame', :class => CoordFrame, :optional => false
98
- object_node :center_position, 'CenterPosition', :class => CenterPosition, :optional => false
99
- end
100
-
101
- # The position of the center of some region of the sky.
102
- class CenterPosition; end
103
- class PositionType
104
- include XML::Mapping
105
-
106
- numeric_node :long, 'long', :optional => false
107
- numeric_node :lat, 'lat', :optional => false
108
- end
109
-
110
- # The spatial (angular) resolution that is typical of the observations of interest, in decimal degrees.
111
- class SpatialResolution
112
- include XML::Mapping
113
-
114
- numeric_node :value, '', :optional => false
115
- end
116
-
117
- # The intrinsic size scale, given in arcseconds, associated with data items contained in a resource.
118
- class RegionOfRegard
119
- include XML::Mapping
120
-
121
- numeric_node :value, '', :optional => false
122
- end
123
-
124
- # The temporal coverage of a resource.
125
- class Temporal; end
126
- class TemporalType
127
- include XML::Mapping
128
-
129
- object_node :start_time, 'StartTime', :class => StartTime, :optional => true
130
- object_node :end_time, 'EndTime', :class => EndTime, :optional => true
131
- object_node :temporal_resolution, 'TemporalResolution', :class => TemporalResolution, :optional => true
132
- end
133
-
134
- # The earliest temporal coverage of the resource.
135
- class StartTime
136
- include XML::Mapping
137
-
138
- date_time_node :value, '', :optional => false
139
- end
140
-
141
- # The latest temporal coverage of the resource.
142
- class EndTime
143
- include XML::Mapping
144
-
145
- date_time_node :value, '', :optional => false
146
- end
147
-
148
- # The temporal resolution that is typical of the observations of interest, in seconds.
149
- class TemporalResolution
150
- include XML::Mapping
151
-
152
- numeric_node :value, '', :optional => false
153
- end
154
-
155
- # The spectral coverage of a resource.
156
- class Spectral; end
157
- class SpectralType
158
- include XML::Mapping
159
-
160
- object_node :wavelength_range, 'WavelengthRange', :class => WavelengthRange, :optional => true
161
- object_node :spectral_resolution, 'SpectralResolution', :class => SpectralResolution, :optional => true
162
-
163
- array_node :wavebands, 'Waveband', :class => Waveband, :optional => true, :default_value => []
164
- end
165
-
166
- # A named spectral region of the electro-magnetic spectrum.
167
- class Waveband; end
168
- class WavebandType
169
- include XML::Mapping
170
-
171
- text_enumeration_node :value, '', :optional => false,
172
- :choices => ['Radio', 'Millimeter', 'Infrared', 'Optical', 'UV', 'EUV', 'X-ray', 'Gamma-ray']
173
- end
174
-
175
- # A range of the electro-magnetic spectrum specified by a lower and upper wavelength limit.
176
- class WavelengthRange; end
177
- class WavelengthRangeType
178
- include XML::Mapping
179
-
180
- numeric_node :min, 'min', :optional => false
181
- numeric_node :max, 'max', :optional => false
182
- end
183
-
184
- # The spectral resolution that is typical of the observations of interest, given as a ratio of the wavelength
185
- # width (delta-lambda) to the observing wavelength (lambda).
186
- class SpectralResolution
187
- include XML::Mapping
188
-
189
- numeric_node :value, '', :optional => false
190
- end
191
-
192
- end
193
- end
194
- end
195
- end
@@ -1,158 +0,0 @@
1
- require 'voruby/resources/vodataservice/loader'
2
-
3
- module VORuby
4
- module Resources
5
- module VODataServiceCoverage
6
- module V0_3
7
-
8
- # Forward declarations
9
- class Coverage; end
10
- class Spatial; end
11
- class Region; end
12
- class Spectral; end
13
- class Waveband; end
14
- class WavelengthRange; end
15
- class Temporal; end
16
- class AllSky < Region; end
17
- class CoordFrame; end
18
- class CoordRange < Region; end
19
- class AngleRange; end
20
- class CircleRegion < Region; end
21
- class Position; end
22
-
23
- class Coverage
24
- include XML::Mapping
25
-
26
- # the spatial coverage of a resource
27
- object_node :spatial, 'spatial', :class => Spatial, :optional => true
28
- # the spectral coverage of a resource
29
- object_node :spectral, 'spectral', :class => Spectral, :optional => true
30
- # the temporal coverage of a resource
31
- object_node :temporal, 'temporal', :class => Temporal, :optional => true
32
- end
33
-
34
- class Spatial
35
- include XML::Mapping
36
-
37
- # the spatial (angular) resolution that is typical of the observations of interest, in decimal degrees.
38
- numeric_node :resolution, 'resolution', :optional => true
39
- # the intrinsic size scale, given in arcseconds, associated with data items contained in a resource.
40
- numeric_node :region_of_regard, 'regionOfRegard', :optional => true
41
-
42
- # a coverage area of the sky
43
- unmarshaller = Proc.new{ |xml|
44
- ns_prefix, type = xml.attributes['type'].split(':')
45
- type = ns_prefix if !type
46
-
47
- the_module = NAMESPACE_MODULE_MAP[xml.namespace(ns_prefix)]
48
- the_module = 'VORuby::Resources::VODataServiceCoverage::V0_3' if !the_module
49
-
50
- # The name of the appropriate class corresponds to the type.
51
- begin
52
- eval("#{the_module}::#{type}.load_from_xml(xml)") # Would like to get rid of this eval somehow...
53
- rescue NameError
54
- Region.load_from_xml(xml)
55
- end
56
- }
57
- array_node :regions, 'region', :unmarshaller => unmarshaller, :optional => true, :default_value => []
58
- end
59
-
60
- class Region
61
- include XML::Mapping
62
- end
63
-
64
- class Spectral
65
- include XML::Mapping
66
-
67
- # the spectral resolution that is typical of the
68
- # observations of interest, given as a ratio of the wavelength
69
- # width (delta-lambda) to the observing wavelength (lambda).
70
- numeric_node :resolution, 'resolution', :optional => true
71
-
72
- # a range of the electro-magnetic spectrum specified by a lower and upper wavelength limit
73
- object_node :range, 'range', :class => WavelengthRange, :optional => true
74
-
75
- # a named spectral region of the electro-magnetic spectrum
76
- array_node :wavebands, 'waveband', :class => Waveband, :optional => true, :default_value => []
77
- end
78
-
79
- class Waveband
80
- include XML::Mapping
81
-
82
- text_enumeration_node :value, '', :optional => false,
83
- :choices => ['Radio', 'Millimeter', 'Infrared', 'Optical', 'UV', 'EUV', 'X-ray', 'Gamma-ray']
84
- end
85
-
86
- class WavelengthRange
87
- include XML::Mapping
88
-
89
- # the minimum wavelength
90
- numeric_node :min, 'min', :optional => false
91
- # the minimum wavelength
92
- numeric_node :max, 'max', :optional => false
93
- end
94
-
95
- class Temporal
96
- include XML::Mapping
97
-
98
- # the earliest temporal coverage of the resource
99
- date_time_node :start_time, 'startTime', :optional => true
100
- # the latest temporal coverage of the resource
101
- date_time_node :end_time, 'endTime', :optional => true
102
-
103
- # the temporal resolution that is typical of the observations of interest, in seconds.
104
- numeric_node :resolution, 'resolution', :optional => true
105
- end
106
-
107
- # A coverage area covering the entire sky.
108
- class AllSky; end
109
-
110
- class CoordFrame
111
- include XML::Mapping
112
-
113
- text_enumeration_node :value, '', :optional => false,
114
- :choices => ['ICRS', 'FK5', 'FK4', 'ECL', 'GAL', 'SGAL']
115
- end
116
-
117
- # A coverage area of the sky characterized by a range of longitude and latitude.
118
- class CoordRange
119
- # a coordinate system frame
120
- object_node :coord_frame, 'coordFrame', :class => CoordFrame, :optional => false
121
- # the range in longitude
122
- object_node :long, 'long', :class => AngleRange, :optional => false
123
- # the range in latitude
124
- object_node :lat, 'lat', :class => AngleRange, :optional => false
125
- end
126
-
127
- class AngleRange
128
- include XML::Mapping
129
-
130
- # the minimum angle
131
- numeric_node :min, 'min', :optional => false
132
- # the maximum angle
133
- numeric_node :max, 'max', :optional => false
134
- end
135
-
136
- # A coverage area of the sky characterized by a central position and angular radius.
137
- class CircleRegion
138
- # a coordinate system frame
139
- object_node :coord_frame, 'coordFrame', :class => CoordFrame, :optional => false
140
- # the position of the center of the circle/cone
141
- object_node :center, 'center', :class => Position, :optional => false
142
- # the radius of the circle in degrees
143
- numeric_node :radius, 'radius', :optional => false
144
- end
145
-
146
- class Position
147
- include XML::Mapping
148
-
149
- # the longitude component of the sky position
150
- numeric_node :long, 'long', :optional => false
151
- # the latitude component of the sky position
152
- numeric_node :lat, 'lat', :optional => false
153
- end
154
-
155
- end
156
- end
157
- end
158
- end