voruby 1.1.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,4 +0,0 @@
1
- require 'rubygems'
2
- require 'xml/mapping'
3
-
4
- require 'voruby/loader'
@@ -1,9 +0,0 @@
1
- require 'voruby/resources/voregistry/voregistry_v1_0'
2
-
3
- module VORuby
4
- module Resources
5
- module VORegistry
6
- #include VORegistry::V1_0
7
- end
8
- end
9
- end
@@ -1,40 +0,0 @@
1
- require 'voruby/resources/voregistry/loader'
2
- require 'voruby/resources/voresource/voresource_v0_9'
3
-
4
- include VORuby::Resources::VOResource::V0_9
5
-
6
- module VORuby
7
- module Resources
8
- module VORegistry
9
- module V0_2
10
-
11
- # Forward declarations
12
- class RegistryType < ServiceType; end
13
- class Registry < RegistryType; end
14
- class ManagedAuthority < AuthorityIDType; end
15
- class AuthorityType < ResourceType; end
16
- class Authority < AuthorityType; end
17
- class ManagingOrg < IdentifierType; end
18
-
19
- # A service that provides access to descriptions of resources.
20
- class Registry; end
21
- class RegistryType
22
- array_node :managed_authorities, 'ManagedAuthority', :class => ManagedAuthority, :optional => false
23
- end
24
-
25
- # An authority identifier managed by a registry.
26
- class ManageAuthority; end
27
-
28
- # A naming authority; an assertion of control over a namespace represented by an authority identifier.
29
- class Authority; end
30
- class AuthorityType
31
- object_node :managing_org, 'ManagingOrg', :class => ManagingOrg, :optional => true
32
- end
33
-
34
- # A reference to an organization that manages something.
35
- class ManagingOrg; end
36
-
37
- end
38
- end
39
- end
40
- end
@@ -1,30 +0,0 @@
1
- require 'voruby/resources/voregistry/loader'
2
- require 'voruby/resources/voresource/voresource_v0_10'
3
-
4
- include VORuby::Resources::VOResource::V0_10
5
-
6
- module VORuby
7
- module Resources
8
- module VORegistry
9
- module V0_3
10
-
11
- # Forward declarations
12
- class Registry < Service; end
13
- class Authority < Resource; end
14
-
15
- # A service that provides access to descriptions of resources.
16
- class Registry
17
- # an authority identifier managed by a registry
18
- array_node :managed_authorities, 'managedAuthority', :class => AuthorityID, :optional => true, :default_value => []
19
- end
20
-
21
- # A naming authority; an assertion of control over a namespace represented by an authority identifier.
22
- class Authority
23
- # the organization that manages or owns the this authority
24
- object_node :managing_org, 'managingOrg', :class => ResourceName, :optional => true
25
- end
26
-
27
- end
28
- end
29
- end
30
- end
@@ -1,86 +0,0 @@
1
- require 'voruby/resources/voregistry/loader'
2
- require 'voruby/resources/voresource/voresource_v1_0'
3
-
4
- include VORuby::Resources::VOResource::V1_0
5
-
6
- module VORuby
7
- module Resources
8
- module VORegistry
9
- module V1_0
10
-
11
- # Forward declarations
12
- class Registry < Service; end
13
- class RegCapRestriction < Capability; end
14
- class Harvest < RegCapRestriction; end
15
- class ExtensionSearchSupport; end
16
- class OptionalProtocol; end
17
- class OAIHTTP < Interface; end
18
- class OAISOAP < WebService; end
19
- class Authority < Resource; end
20
- class Search < RegCapRestriction; end
21
-
22
- # A service that provides access to descriptions of resources.
23
- class Registry
24
- boolean_node :full, 'full', 'true', 'false', :optional => true, :default_value => false
25
-
26
- array_node :managed_authorities, 'managedAuthority', :class => AuthorityID,
27
- :optional => true, :default_values => []
28
- end
29
-
30
- # An abstract capability that fixes the standardID to the IVOA ID for the Registry standard.
31
- class RegCapRestriction
32
- def standard_id=(id)
33
- @standard_id = URI.parse('ivo://ivoa.net/std/Registry')
34
- end
35
- end
36
-
37
- # The capabilities of the Registry Harvest implementation.
38
- class Harvest
39
- numeric_node :max_records, 'maxRecords', :optional => false, :default_value => 0
40
- end
41
-
42
- # The level of support provided for searching against metadata defined in a legal VOResource extension schema.
43
- class ExtensionSearchSupport
44
- include XML::Mapping
45
-
46
- text_enumeration_node :value, '', :optional => false,
47
- :choices => ['core', 'partial', 'full']
48
- end
49
-
50
- # The name of an optional advanced search protocol supported.
51
- class OptionalProtocol
52
- include XML::Mapping
53
-
54
- text_enumeration_node :value, '', :optional => false,
55
- :choices => ['XQuery']
56
- end
57
-
58
- # A description of the standard OAI PMH interface using HTTP (GET or POST) queries.
59
- class OAIHTTP
60
- #
61
- end
62
-
63
- # A description of the standard OAI PMH interface using a SOAP Web Service interface.
64
- class OAISOAP
65
- #
66
- end
67
-
68
- # A naming authority; an assertion of control over a namespace represented by an authority identifier.
69
- class Authority
70
- object_node :managing_org, 'managingOrg', :class => ResourceName, :optional => true
71
- end
72
-
73
- # The capabilities of the Registry Search implementation.
74
- class Search
75
- numeric_node :max_records, 'maxRecords', :optional => false, :default_value => 0
76
-
77
- object_node :extension_search_support, 'extensionSearchSupport', :class => ExtensionSearchSupport, :optional => false
78
-
79
- array_node :optional_protocol, 'optionalProtocol', :class => OptionalProtocol,
80
- :optional => true, :default_values => []
81
- end
82
-
83
- end
84
- end
85
- end
86
- end
@@ -1,17 +0,0 @@
1
- require 'rubygems'
2
- require 'xml/mapping'
3
- require 'uri'
4
-
5
- require 'voruby/resources/loader'
6
- require 'voruby/resources/nodes'
7
-
8
- # Register specialized node types.
9
- XML::Mapping.add_node_class(VORuby::VOResource::Mapping::DateTimeNode)
10
- XML::Mapping.add_node_class(VORuby::VOResource::Mapping::JulianDateTimeNode)
11
- XML::Mapping.add_node_class(VORuby::VOResource::Mapping::UtcTimestampNode)
12
- XML::Mapping.add_node_class(VORuby::VOResource::Mapping::UtcDateTimeNode)
13
- XML::Mapping.add_node_class(VORuby::VOResource::Mapping::TextEnumerationNode)
14
- XML::Mapping.add_node_class(VORuby::VOResource::Mapping::NumericEnumerationNode)
15
- XML::Mapping.add_node_class(VORuby::VOResource::Mapping::FullObjectNode)
16
- XML::Mapping.add_node_class(VORuby::VOResource::Mapping::FullArrayNode)
17
- XML::Mapping.add_node_class(VORuby::VOResource::Mapping::TextFloatArrayNode)
@@ -1,9 +0,0 @@
1
- require 'voruby/resources/voresource/voresource_v1_0'
2
-
3
- module VORuby
4
- module Resources
5
- module VOResource
6
- #include VOResource::V1_0
7
- end
8
- end
9
- end
@@ -1,327 +0,0 @@
1
- require 'voruby/resources/voresource/loader'
2
-
3
- module VORuby
4
- module Resources
5
- module VOResource
6
- module V0_10
7
-
8
- # Forward declarations
9
- class Resource; end
10
- class ShortName; end
11
- class AnyURI; end
12
- class IdentifierURI < AnyURI; end
13
- class Curation; end
14
- class ResourceName; end
15
- class Creator; end
16
- class Date; end
17
- class Contact; end
18
- class Content; end
19
- class String; end
20
- class Source; end
21
- class Type; end
22
- class ContentLevel; end
23
- class Relationship; end
24
- class RelationshipType; end
25
- class AuthorityID; end
26
- class ResourceKey; end
27
- class Organisation < Resource; end
28
- class Service < Resource; end
29
- class Interface; end
30
- class AccessURL < AnyURI; end
31
- class WebBrowser < Interface; end
32
- class Capability; end
33
-
34
- # Any entity that is describable and identifiable by a IVOA Identifier.
35
- class Resource
36
- include XML::Mapping
37
-
38
- # the full name given to the resource
39
- text_node :title, 'title', :optional => false
40
-
41
- # the date this resource metadata description was created
42
- date_time_node :created, '@created', :optional => true
43
- # the date this resource metadata description was last updated
44
- date_time_node :updated, '@updated', :optional => true
45
-
46
- # a tag indicating whether this resource is believed to be still actively maintained.
47
- text_enumeration_node :status, '@status', :optional => true, :default_value => 'active',
48
- :choices => ['active', 'inactive', 'deleted']
49
-
50
- # a short name or abbreviation given to the resource.
51
- object_node :short_name, 'shortName', :class => ShortName, :optional => true
52
- # unambiguous reference to the resource conforming to the IVOA standard for identifiers
53
- object_node :identifier, 'identifier', :class => IdentifierURI, :optional => false
54
- # information regarding the general curation of the resource
55
- object_node :curation, 'curation', :class => Curation, :optional => false
56
- # information regarding the general content of the resource
57
- object_node :content, 'content', :class => Content, :optional => false
58
- end
59
-
60
- # A short name or abbreviation given to something.
61
- class ShortName
62
- include XML::Mapping
63
-
64
- text_node :value, '', :optional => false
65
-
66
- def value=(short_name)
67
- short_name.strip!
68
- raise RuntimeError, "ShortName '#{short_name}' must have <= 16 characters" if short_name.size > 16
69
-
70
- @value = short_name
71
- end
72
- end
73
-
74
- class AnyURI
75
- include XML::Mapping
76
-
77
- text_node :value, '', :optional => false
78
-
79
- def value=(uri)
80
- @value = URI.parse(uri.strip)
81
- end
82
- end
83
-
84
- class IdentifierURI
85
- def value=(uri)
86
- # Strictly, this should be ivo only, but I notice that sometimes http is used.
87
- #raise RuntimeError, "IdentifierURI '#{uri}' in wrong format" if !uri.strip.match('^(ivo|http):')
88
-
89
- begin
90
- @value = URI.parse(uri.strip)
91
- rescue URI::InvalidURIError
92
- return nil
93
- end
94
- end
95
- end
96
-
97
- # Information regarding the general curation of a resource.
98
- class Curation
99
- include XML::Mapping
100
-
101
- # label associated with creation or availablilty of a version of a resource
102
- text_node :version, 'version', :optional => true
103
-
104
- # entity (e.g. person or organisation) responsible for making the resource available
105
- object_node :publisher, 'publisher', :class => ResourceName, :optional => true
106
- # the entity (e.g. person or organisation) primarily responsible for creating the content or constitution of the resource
107
- object_node :creator, 'creator', :class => Creator, :optional => true
108
- # information that can be used for contacting someone with regard to this resource
109
- object_node :contact, 'contact', :class => Contact, :optional => true
110
-
111
- # entity responsible for contributions to the content of the resource
112
- array_node :contributors, 'contributor', :class => ResourceName, :optional => true, :default_value => []
113
- # date associated with an event in the life cycle of the resource
114
- array_node :dates, 'date', :class => Date, :optional => true, :default_value => []
115
- end
116
-
117
- # The name of a potentially registered resource. That is, the entity referred to may have an associated identifier.
118
- class ResourceName
119
- include XML::Mapping
120
-
121
- text_node :value, '', :optional => false
122
-
123
- # the URI form of the IVOA identifier for the resource refered to
124
- object_node :ivo_id, '@ivo-id', :class => IdentifierURI, :optional => true
125
- end
126
-
127
- # The entity (e.g. person or organisation) primarily responsible for creating something.
128
- class Creator
129
- include XML::Mapping
130
-
131
- # the name or title of the creating person or organization
132
- object_node :name, 'name', :class => ResourceName, :optional => false
133
- # URL pointing to a graphical logo, which may be used to help identify the information source
134
- object_node :logo, 'logo', :class => AnyURI, :optional => true
135
- end
136
-
137
- class Date
138
- include XML::Mapping
139
-
140
- text_node :value, '', :optional => false
141
-
142
- # a string indicating what the date refers to
143
- text_node :role, 'role', :optional => true, :default_value => 'representative'
144
-
145
- def value=(v)
146
- @value = DateTime.parse(v)
147
- end
148
- end
149
-
150
- # Information that can be used for contacting someone.
151
- class Contact
152
- include XML::Mapping
153
-
154
- # the contact mailing address
155
- text_node :address, 'address', :optional => true
156
- # the contact email address
157
- text_node :email, 'email', :optional => true
158
- # the contact telephone number
159
- text_node :telephone, 'telephone', :optional => true
160
-
161
- # the name or title of the contact person
162
- object_node :name, 'name', :class => ResourceName, :optional => false
163
- end
164
-
165
- # Information regarding the general content of a resource.
166
- class Content
167
- include XML::Mapping
168
-
169
- # an account of the nature of the resource
170
- text_node :description, 'description', :optional => false
171
-
172
- # a bibliographic reference from which the present resource is derived or extracted
173
- object_node :source, 'source', :class => Source, :optional => true
174
- # URL pointing to a human-readable document describing this resource.
175
- object_node :reference_url, 'referenceURL', :class => AnyURI, :optional => true
176
-
177
- # list of topics, object types, or other descriptive keywords about the resource
178
- array_node :subjects, 'subject', :class => String, :optional => true, :default_value => []
179
- # nature or genre of the content of the resource
180
- array_node :types, 'type', :class => Type, :optional => true, :default_value => []
181
- # description of the content level or intended audience
182
- array_node :content_levels, 'contentLevel', :class => ContentLevel, :optional => true, :default_value => []
183
- # a description of a relationship to another resource
184
- array_node :relationships, 'relationship', :class => Relationship, :optional => true, :default_value => []
185
- end
186
-
187
- class String
188
- include XML::Mapping
189
-
190
- text_node :value, '', :optional => false
191
- end
192
-
193
- class Source
194
- include XML::Mapping
195
-
196
- text_node :value, '', :optional => false
197
- # the reference format. Recognized values include "bibcode", refering to a standard astronomical bibcode bibcode
198
- # (http://cdsweb.u-strasbg.fr/simbad/refcode.html).
199
- text_node :format, '@format', :optional => true
200
- end
201
-
202
- class Type
203
- include XML::Mapping
204
-
205
- text_enumeration_node :value, '', :optional => false,
206
- :choices => ['Other', 'Archive', 'Bibliography', 'Catalog', 'Journal', 'Library',
207
- 'Simulation', 'Survey', 'Transformation', 'Education', 'Outreach', 'EPOResource',
208
- 'Animation', 'Artwork', 'Background', 'BasicData', 'Historical', 'Photographic',
209
- 'Press', 'Organisation', 'Project', 'Registry']
210
- end
211
-
212
- class ContentLevel
213
- include XML::Mapping
214
-
215
- text_enumeration_node :value, '', :optional => false,
216
- :choices => ['General', 'Elementary Education', 'Middle School Education', 'Secondary Education',
217
- 'Community College', 'University', 'Research', 'Amateur', 'Informal Education']
218
- end
219
-
220
- # A description of the relationship between one resource and one or more other resources.
221
- class Relationship
222
- include XML::Mapping
223
-
224
- # the named type of relationship
225
- object_node :relationship_type, 'relationshipType', :class => RelationshipType, :optional => false
226
-
227
- # the name of resource that this resource is related to
228
- array_node :related_resources, 'relatedResource', :class => ResourceName, :optional => false
229
- end
230
-
231
- class RelationshipType
232
- include XML::Mapping
233
-
234
- text_enumeration_node :value, '', :optional => false,
235
- :choices => ['mirror-of', 'service-for', 'derived-from', 'related-to']
236
- end
237
-
238
- class AuthorityID
239
- include XML::Mapping
240
-
241
- text_node :value, '', :optional => false
242
-
243
- def value=(authid)
244
- raise RuntimeError, "AuthorityID '#{authid} in wrong format" if !authid.match(/^[\w\d][\w\d\-_\.!~\*'\(\)\+=]{2,}$/)
245
-
246
- @value = authid
247
- end
248
- end
249
-
250
- class ResourceKey
251
- include XML::Mapping
252
-
253
- text_node :value, '', :optional => false
254
-
255
- def value=(reskey)
256
- raise RuntimeError, "ResourceKey '#{reskey} in wrong format" if !reskey.match("^[\w\d\-_\.!~\*'\(\)\+=]+(/[\w\d\-_\.!~\*'\(\)\+=]+)*$")
257
-
258
- @value = reskey
259
- end
260
- end
261
-
262
- # A named group of one or more persons brought together to pursue participation in VO applications.
263
- class Organisation
264
- # the observatory or facility used to collect the data contained or managed by this resource
265
- array_node :facilities, 'facility', :class => ResourceName, :optional => true, :default_value => []
266
- # the instrument used to collect the data contain or managed by a resource.
267
- array_node :instruments, 'instrument', :class => ResourceName, :optional => true, :default_value => []
268
- end
269
-
270
- # A resource that can be invoked by a client to perform some action on its behalf.
271
- class Service
272
- # a description of how a client invokes the service
273
- unmarshaller = Proc.new{ |xml|
274
- ns_prefix, type = xml.attributes['type'].split(':')
275
- type = ns_prefix if !type
276
-
277
- the_module = NAMESPACE_MODULE_MAP[xml.namespace(ns_prefix)]
278
- the_module = 'VORuby::Resources::VOResource::V_10' if !the_module
279
-
280
- # The name of the appropriate class corresponds to the type.
281
- begin
282
- eval("#{the_module}::#{type}.load_from_xml(xml)") # Would like to get rid of this eval somehow...
283
- rescue NameError
284
- Interface.load_from_xml(xml)
285
- end
286
- }
287
- array_node :interfaces, 'interface', :unmarshaller => unmarshaller, :optional => true, :default_value => []
288
- end
289
-
290
- # A description of a service interface. Since this type is abstract, one must use an Interface subclass
291
- # to describe an actual interface.
292
- class Interface
293
- include XML::Mapping
294
-
295
- # the URL (or base URL) that a client uses to access the
296
- # service. How this URL is to be interpreted and used
297
- # depends on the specific Interface subclass
298
- object_node :access_url, 'accessURL', :class => AccessURL, :optional => false
299
- end
300
-
301
- # A flag indicating whether this should be interpreted as a base
302
- # URL, a full URL, or a URL to a directory that will produce a
303
- # listing of files.
304
- class AccessURL
305
- text_enumeration_node :use, '@use', :optional => true,
306
- :choices => ['full', 'base', 'dir']
307
- end
308
-
309
- # A (form-based) interface intended to be accesed interactively by a user via a web browser.
310
- class WebServer; end
311
-
312
- # To provide a metadata specific to a particular Service type,
313
- # this type is usually extended and added as a child of the
314
- # specific Service subclass.
315
- class Capability
316
- include XML::Mapping
317
-
318
- # an IVOA identifier for a standard service
319
- object_node :standard_id, '@standardID', :class => IdentifierURI, :optional => true
320
- # a URL that points to a human-readable document that describes the standard upon which a service is based.
321
- object_node :standard_url, '@standardURL', :class => AnyURI, :optional => true
322
- end
323
-
324
- end
325
- end
326
- end
327
- end