voruby 1.0.1

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 (156) hide show
  1. data/LICENSE +339 -0
  2. data/REQUIREMENTS +4 -0
  3. data/Rakefile.rb +296 -0
  4. data/lib/voruby/adql/adql.rb +2735 -0
  5. data/lib/voruby/adql/ext.rb +15 -0
  6. data/lib/voruby/adql/loader.rb +5 -0
  7. data/lib/voruby/adql/operations.rb +54 -0
  8. data/lib/voruby/adql/parser.rb +160 -0
  9. data/lib/voruby/adql/transforms.rb +573 -0
  10. data/lib/voruby/ext.rb +17 -0
  11. data/lib/voruby/loader.rb +4 -0
  12. data/lib/voruby/misc/propertyfile.rb +36 -0
  13. data/lib/voruby/plastic/applications.rb +174 -0
  14. data/lib/voruby/plastic/constants.rb +30 -0
  15. data/lib/voruby/plastic/loader.rb +10 -0
  16. data/lib/voruby/plastic/plastic.rb +1 -0
  17. data/lib/voruby/resources/conesearch/conesearch.rb +9 -0
  18. data/lib/voruby/resources/conesearch/conesearch_v0_2.rb +55 -0
  19. data/lib/voruby/resources/conesearch/conesearch_v0_3.rb +50 -0
  20. data/lib/voruby/resources/conesearch/conesearch_v1_0.rb +72 -0
  21. data/lib/voruby/resources/conesearch/loader.rb +4 -0
  22. data/lib/voruby/resources/loader.rb +50 -0
  23. data/lib/voruby/resources/nodes.rb +190 -0
  24. data/lib/voruby/resources/openskynode/loader.rb +4 -0
  25. data/lib/voruby/resources/openskynode/openskynode.rb +9 -0
  26. data/lib/voruby/resources/openskynode/openskynode_v0_1.rb +54 -0
  27. data/lib/voruby/resources/sia/loader.rb +5 -0
  28. data/lib/voruby/resources/sia/sia.rb +9 -0
  29. data/lib/voruby/resources/sia/sia_v0_6.rb +90 -0
  30. data/lib/voruby/resources/sia/sia_v0_7.rb +89 -0
  31. data/lib/voruby/resources/sia/sia_v1_0.rb +122 -0
  32. data/lib/voruby/resources/stsci.rb +59 -0
  33. data/lib/voruby/resources/vodataservice/coverage_v0_2.rb +195 -0
  34. data/lib/voruby/resources/vodataservice/coverage_v0_3.rb +158 -0
  35. data/lib/voruby/resources/vodataservice/loader.rb +5 -0
  36. data/lib/voruby/resources/vodataservice/vodataservice.rb +9 -0
  37. data/lib/voruby/resources/vodataservice/vodataservice_v0_4.rb +189 -0
  38. data/lib/voruby/resources/vodataservice/vodataservice_v0_5.rb +163 -0
  39. data/lib/voruby/resources/vodataservice/vodataservice_v1_0.rb +221 -0
  40. data/lib/voruby/resources/voregistry/loader.rb +4 -0
  41. data/lib/voruby/resources/voregistry/voregistry.rb +9 -0
  42. data/lib/voruby/resources/voregistry/voregistry_v0_2.rb +40 -0
  43. data/lib/voruby/resources/voregistry/voregistry_v0_3.rb +30 -0
  44. data/lib/voruby/resources/voregistry/voregistry_v1_0.rb +86 -0
  45. data/lib/voruby/resources/voresource/loader.rb +17 -0
  46. data/lib/voruby/resources/voresource/voresource.rb +9 -0
  47. data/lib/voruby/resources/voresource/voresource_v0_10.rb +322 -0
  48. data/lib/voruby/resources/voresource/voresource_v0_9.rb +405 -0
  49. data/lib/voruby/resources/voresource/voresource_v1_0.rb +230 -0
  50. data/lib/voruby/services/ext.rb +11 -0
  51. data/lib/voruby/services/gestalt/footprint.rb +95 -0
  52. data/lib/voruby/services/gestalt/wcs_fixer.rb +105 -0
  53. data/lib/voruby/services/gestalt/wesix.rb +155 -0
  54. data/lib/voruby/services/loader.rb +7 -0
  55. data/lib/voruby/services/registry/registry.rb +53 -0
  56. data/lib/voruby/services/resolver/resolver.rb +35 -0
  57. data/lib/voruby/sesame/loader.rb +6 -0
  58. data/lib/voruby/sesame/sesame_v1_0.rb +64 -0
  59. data/lib/voruby/simple/loader.rb +6 -0
  60. data/lib/voruby/simple/parameters.rb +196 -0
  61. data/lib/voruby/simple/sap.rb +446 -0
  62. data/lib/voruby/spacetime/loader.rb +3 -0
  63. data/lib/voruby/spacetime/spacetime.rb +607 -0
  64. data/lib/voruby/stc/coords_v1_20.rb +900 -0
  65. data/lib/voruby/stc/loader.rb +55 -0
  66. data/lib/voruby/stc/region_v1_20.rb +274 -0
  67. data/lib/voruby/stc/stc_v1_20.rb +1196 -0
  68. data/lib/voruby/util.rb +27 -0
  69. data/lib/voruby/voevent/loader.rb +7 -0
  70. data/lib/voruby/voevent/voevent_v1_0.rb +213 -0
  71. data/lib/voruby/voevent/voevent_v1_1.rb +196 -0
  72. data/lib/voruby/votables/chandra.rb +410 -0
  73. data/lib/voruby/votables/cnoc.rb +393 -0
  74. data/lib/voruby/votables/data.rb +179 -0
  75. data/lib/voruby/votables/galex.rb +390 -0
  76. data/lib/voruby/votables/hst.rb +391 -0
  77. data/lib/voruby/votables/int.rb +391 -0
  78. data/lib/voruby/votables/libxml_parser.rb +411 -0
  79. data/lib/voruby/votables/libxml_votable.rb +67 -0
  80. data/lib/voruby/votables/loader.rb +10 -0
  81. data/lib/voruby/votables/meta.rb +763 -0
  82. data/lib/voruby/votables/misc.rb +51 -0
  83. data/lib/voruby/votables/nsa.rb +393 -0
  84. data/lib/voruby/votables/nsar3.rb +410 -0
  85. data/lib/voruby/votables/rexml_parser.rb +408 -0
  86. data/lib/voruby/votables/rexml_votable.rb +67 -0
  87. data/lib/voruby/votables/sdss.rb +393 -0
  88. data/lib/voruby/votables/transforms.rb +388 -0
  89. data/lib/voruby/votables/tree.rb +45 -0
  90. data/lib/voruby/votables/types.rb +391 -0
  91. data/lib/voruby/votables/votable.rb +630 -0
  92. data/lib/voruby/votables/xmm.rb +394 -0
  93. data/test/adql/test1.adql +49 -0
  94. data/test/adql/test2.adql +51 -0
  95. data/test/adql/test3.adql +81 -0
  96. data/test/adql/test4.adql +53 -0
  97. data/test/adql/test5.adql +55 -0
  98. data/test/adql/test6.adql +18 -0
  99. data/test/adql/test7.adql +48 -0
  100. data/test/adql/unittest.rb +1672 -0
  101. data/test/plastic/test.rb +44 -0
  102. data/test/plastic/test.vot +5385 -0
  103. data/test/plastic/unittest.rb +66 -0
  104. data/test/resources/conesearch/conesearch_v0_3.xml +31 -0
  105. data/test/resources/conesearch/conesearch_v1_0.xml +86 -0
  106. data/test/resources/conesearch/unittest_v0_3.rb +22 -0
  107. data/test/resources/conesearch/unittest_v1_0.rb +24 -0
  108. data/test/resources/openskynode/open_sky_node_v0_1.xml +32 -0
  109. data/test/resources/openskynode/unittest_v0_1.rb +31 -0
  110. data/test/resources/sia/simple_image_access_v0_7.xml +36 -0
  111. data/test/resources/sia/simple_image_access_v1_0.xml +122 -0
  112. data/test/resources/sia/unittest_v0_7.rb +24 -0
  113. data/test/resources/sia/unittest_v1_0.rb +29 -0
  114. data/test/resources/stsci.xml +336 -0
  115. data/test/resources/unittest_stsci.rb +25 -0
  116. data/test/resources/vodataservice/catalog_service_resource_v1_0.xml +128 -0
  117. data/test/resources/vodataservice/data_collection_resource_v0_5.xml +54 -0
  118. data/test/resources/vodataservice/data_collection_resource_v1_0.xml +117 -0
  119. data/test/resources/vodataservice/data_service_resource_v1_0.xml +115 -0
  120. data/test/resources/vodataservice/sky_service_resource_v0_10.xml +45 -0
  121. data/test/resources/vodataservice/table_service_resource_v1_0.xml +122 -0
  122. data/test/resources/vodataservice/tabular_sky_service_resource_v0_10.xml +60 -0
  123. data/test/resources/vodataservice/unittest_v0_5.rb +126 -0
  124. data/test/resources/vodataservice/unittest_v1_0.rb +151 -0
  125. data/test/resources/voregistry/authority_resource_v0_3.xml +20 -0
  126. data/test/resources/voregistry/authority_resource_v1_0.xml +82 -0
  127. data/test/resources/voregistry/registry_service_v0_3.xml +20 -0
  128. data/test/resources/voregistry/registry_service_v1_0.xml +107 -0
  129. data/test/resources/voregistry/unittest_v0_3.rb +31 -0
  130. data/test/resources/voregistry/unittest_v1_0.rb +34 -0
  131. data/test/resources/voresource/organisation_resource_v1_0.xml +90 -0
  132. data/test/resources/voresource/resource_organisation_v0_10.xml +22 -0
  133. data/test/resources/voresource/resource_service_v0_10.xml +19 -0
  134. data/test/resources/voresource/resource_v0_10.xml +19 -0
  135. data/test/resources/voresource/resource_v1_0.xml +79 -0
  136. data/test/resources/voresource/service_resource_v1_0.xml +91 -0
  137. data/test/resources/voresource/unittest_v0_10.rb +61 -0
  138. data/test/resources/voresource/unittest_v0_9.rb +4 -0
  139. data/test/resources/voresource/unittest_v1_0.rb +190 -0
  140. data/test/services/gestalt/unittest.rb +74 -0
  141. data/test/services/registry/unittest.rb +34 -0
  142. data/test/services/resolver/unittest.rb +38 -0
  143. data/test/simple/unittest.rb +46 -0
  144. data/test/spacetime/unittest.rb +39 -0
  145. data/test/stc/catalog_entry_location_v1_20.xml +112 -0
  146. data/test/stc/obs_data_location_v1_20.xml +108 -0
  147. data/test/stc/search_location_v1_20.xml +54 -0
  148. data/test/stc/stc_resource_profile_v1_20.xml +60 -0
  149. data/test/stc/unittest_v1_20.rb +620 -0
  150. data/test/voevent/unittest_v1_0.rb +79 -0
  151. data/test/voevent/unittest_v1_1.rb +70 -0
  152. data/test/voevent/voevent_v1_0.xml +96 -0
  153. data/test/voevent/voevent_v1_1.xml +76 -0
  154. data/test/votables/test.vot +366 -0
  155. data/test/votables/unittest.rb +54 -0
  156. metadata +256 -0
@@ -0,0 +1,158 @@
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
@@ -0,0 +1,5 @@
1
+ require 'rubygems'
2
+ require 'xml/mapping'
3
+
4
+ require 'voruby/loader'
5
+
@@ -0,0 +1,9 @@
1
+ require 'voruby/resources/vodataservice/vodataservice_v1_0'
2
+
3
+ module VORuby
4
+ module Resources
5
+ module VODataService
6
+ #include VODataService::V1_0
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,189 @@
1
+ require 'voruby/resources/vodataservice/loader'
2
+
3
+ require 'voruby/resources/voresource/voresource_v0_9'
4
+ require 'voruby/resources/vodataservice/coverage_v0_2'
5
+
6
+ include VORuby::Resources::VOResource::V0_9
7
+ include VORuby::Resources::VODataServiceCoverage::V0_2
8
+
9
+ module VORuby
10
+ module Resources
11
+ module VODataService
12
+ module V0_4
13
+
14
+ # Forward declarations
15
+ class DataCollectionType < ResourceType; end
16
+ class DataCollection < DataCollectionType; end
17
+ class AccessType; end
18
+ class Access < AccessType; end
19
+ class FormatType; end
20
+ class Format < FormatType; end
21
+ class RightsType; end
22
+ class Rights < Rights; end
23
+ class SkyServiceType < ServiceType; end
24
+ class SkyService < SkyServiceType; end
25
+ class ExtendedInterfaceType < InterfaceType; end
26
+ class ParamHTTPType < ExtendedInterfaceType; end
27
+ class ParamHTTP < ParamHTTPType; end
28
+ class HTTPQueryType; end
29
+ class HTTPResults; end
30
+ class VOTableColumns; end
31
+ class TabularSkyServiceType < SkyServiceType; end
32
+ class TabularSkyService < TabularSkyServiceType; end
33
+ class TableType; end
34
+ class Table < TableType; end
35
+ class ParamType; end
36
+ class Column < ParamType; end
37
+ class DataType; end
38
+ class Unit; end
39
+ class UCD; end
40
+ class CoverageType; end
41
+
42
+ # A logical grouping of data which, in general, is composed of one or more accessible datasets.
43
+ class DataCollection; end
44
+ class DataCollectionType
45
+ object_node :coverage, 'Coverage', :class => Coverage, :optional => true
46
+ object_node :access, 'Access', :class => Access, :optional => true
47
+
48
+ array_node :facilities, 'Facility', :class => ResourceType, :optional => true, :default_value => []
49
+ array_node :instruments, 'Instrument', :class => Instrument, :optional => true, :default_value => []
50
+ end
51
+
52
+ # A description about how a data collection may be accessed.
53
+ class Access; end
54
+ class AccessType
55
+ include XML::Mapping
56
+
57
+ object_node :rights, 'Rights', :class => Rights, :optional => true
58
+ object_node :access_url, 'AccessURL', :class => AccessURL, :optional => true
59
+
60
+ array_node :format, 'Format', :class => Format, :optional => true, :default_value => []
61
+ end
62
+
63
+ # The physical or digital manifestation of the information supported by a resource.
64
+ class Format; end
65
+ class FormatType
66
+ include XML::Mapping
67
+
68
+ text_node :value, '', :optional => false
69
+ boolean_node :is_mime_type, '@isMIMEType', 'true', 'false', :optional => true, :default_value => 'false'
70
+ end
71
+
72
+ # Information about rights held in and over the resource.
73
+ class Rights; end
74
+ class RightsType
75
+ include XML::Mapping
76
+
77
+ text_enumeration_node :value, '', :optional => false,
78
+ :choices => ['public', 'secure', 'proprietary']
79
+ end
80
+
81
+ # A service for accessing astronomical data.
82
+ class SkyService; end
83
+ class SkyServiceType
84
+ object_node :coverage, 'Coverage', :class => Coverage, :optional => false
85
+
86
+ array_node :facilities, 'Facility', :class => Facility, :optional => true, :default_value => []
87
+ array_node :instruments, 'Instrument', :class => Instrument, :optional => true, :default_value => []
88
+ end
89
+
90
+ # A service invoked via an HTTP Query (either Get or Post) with a set of arguments consisting of keyword name-value pairs.
91
+ class ParamHTTP; end
92
+ class ParamHTTPType
93
+ object_node :qtype, '@qtype', 'HTTPQueryType', :optional => true
94
+ object_node :http_results, 'HTTPResults', :class => HTTPResults, :optional => false
95
+
96
+ array_node :params, 'Param', :class => Param, :optional => true, :default_value => []
97
+ end
98
+
99
+ # This is used as a base type for extended Interface types. It simply restricts the value of Invocation to be "Extended".
100
+ class ExtendedInterfaceType
101
+ object_node :invocation, 'Invocation', :class => Invocation, :optional => false
102
+ object_node :description, 'Description', :class => Description, :optional => true
103
+ object_node :access_url, 'AccessURL', :class => AccessURL, :optional => false
104
+ end
105
+
106
+ # The type of HTTP request, either GET or POST.
107
+ class HTTPQueryType
108
+ include XML::Mapping
109
+
110
+ text_enumeration_node :value, '', :optional => false,
111
+ :choices => ['GET', 'POST']
112
+ end
113
+
114
+ # The MIME type of a document returned by an HTTP Get.
115
+ class HTTPResults
116
+ include XML::Mapping
117
+
118
+ text_enumeration_node :value, '', :optional => false
119
+ end
120
+
121
+ # This element is recommended for use within extensions of the Capability element.
122
+ class VOTableColumns
123
+ include XML::Mapping
124
+
125
+ # Requires VOTable model
126
+ #object_node :fields, 'FIELD', :class => Field, :optional => true, :default_value => []
127
+ end
128
+
129
+ # A service that interacts with one or more specified tables having some coverage of the sky, time, and/or frequency.
130
+ class TabularSkyService; end
131
+ class TabularSkyServiceType
132
+ array_node :tables, 'Table', :class => Table, :optional => true, :default_value => []
133
+ end
134
+
135
+ # A description of a table and its columns.
136
+ class Table; end
137
+ class TableType
138
+ include XML::Mapping
139
+
140
+ text_node :role, '@role', :optional => true
141
+
142
+ object_node :name, 'Name', :class => Name, :optional => true
143
+ object_node :description, 'Description', :class => Description, :optional => true
144
+
145
+ array_node :columns, 'Column', :class => Column, :optional => true, :default_value => []
146
+ end
147
+
148
+ # A description of a table column.
149
+ class Column; end
150
+
151
+ class ParamType
152
+ include XML::Mapping
153
+
154
+ object_node :name, 'Name', :class => Name, :optional => false
155
+ object_node :description, 'Description', :class => Description, :optional => true
156
+ object_node :data_type, 'DataType', :class => DataType, :optional => true
157
+ object_node :unit, 'Unit', :class => Unit, :optional => true
158
+ object_node :ucd, 'UCD', :class => UCD, :optional => true
159
+ end
160
+
161
+ # A (VOTable-supported) data type.
162
+ class DataType
163
+ include XML::Mapping
164
+
165
+ text_node :arraysize, '@arraysize', :optional => true
166
+
167
+ text_enumeration_node :value, '', :optional => false,
168
+ :choices => ['boolean', 'bit', 'unsignedByte', 'short', 'int', 'long',
169
+ 'char', 'unicodeChar', 'float', 'double', 'floatComplex', 'doubleComplex']
170
+ end
171
+
172
+ # The measurement unit associated with a measurement.
173
+ class Unit
174
+ include XML::Mapping
175
+
176
+ text_node :value, '', :optional => false
177
+ end
178
+
179
+ # The name of a unified content descriptor.
180
+ class UCD
181
+ include XML::Mapping
182
+
183
+ text_node :value, '', :optional => false
184
+ end
185
+
186
+ end
187
+ end
188
+ end
189
+ end
@@ -0,0 +1,163 @@
1
+ require 'voruby/resources/vodataservice/loader'
2
+
3
+ require 'voruby/resources/voresource/voresource_v0_10'
4
+ require 'voruby/resources/vodataservice/coverage_v0_3'
5
+
6
+ include VORuby::Resources::VOResource::V0_10
7
+ include VORuby::Resources::VODataServiceCoverage::V0_3
8
+
9
+ module VORuby
10
+ module Resources
11
+ module VODataService
12
+ module V0_5
13
+
14
+ # Forward declarations
15
+ class DataCollection < Resource; end
16
+ class Format; end
17
+ class Rights; end
18
+ class SkyService < Service; end
19
+ class WebService < Interface; end
20
+ class GLUService < Interface; end
21
+ class ParamHTTP < Interface; end
22
+ class Param; end
23
+ class ScalarDataType; end
24
+ class DataType < ScalarDataType; end
25
+ class ArrayShape; end
26
+ class HTTPQueryType; end
27
+ class TabularSkyService < SkyService; end
28
+ class Table; end
29
+
30
+ # A logical grouping of data which, in general, is composed of one or more accessible datasets.
31
+ class DataCollection
32
+ # extent of the content of the resource over space, time, and frequency.
33
+ object_node :coverage, 'coverage', :class => Coverage, :optional => true
34
+ # the URL that can be used to download the data contained in this data collection
35
+ object_node :access_url, 'accessURL', :class => AccessURL, :optional => true
36
+
37
+ # the observatory or facility used to collect the data contained or managed by this resource
38
+ array_node :facilities, 'facility', :class => ResourceName, :optional => true, :default_value => []
39
+ # the instrument used to collect the data contain or managed by a resource
40
+ array_node :instruments, 'instrument', :class => ResourceName, :optional => true, :default_value => []
41
+ # the physical or digital manifestation of the information supported by a resource
42
+ array_node :formats, 'format', :class => Format, :optional => true, :default_value => []
43
+ # information about rights held in and over the resource.
44
+ array_node :rights, 'rights', :class => Rights, :optional => true, :default_value => []
45
+ end
46
+
47
+ class Format
48
+ include XML::Mapping
49
+
50
+ text_node :value, '', :optional => false
51
+ boolean_node :is_mime_type, '@isMIMEType', 'true', 'false', :optional => false, :default_value => 'false'
52
+ end
53
+
54
+ class Rights
55
+ include XML::Mapping
56
+
57
+ text_enumeration_node :value, '', :optional => false,
58
+ :choices => ['public', 'secure', 'proprietary']
59
+ end
60
+
61
+ # A service for accessing astronomical data.
62
+ class SkyService
63
+ # extent of the content of the resource over space, time, and frequency
64
+ object_node :coverage, 'coverage', :class => Coverage, :optional => true
65
+
66
+ # the observatory or facility used to collect the data contained or managed by this resource
67
+ array_node :facilities, 'facility', :class => ResourceName, :optional => true, :default_value => []
68
+ # the instrument used to collect the data contain or managed by a resource
69
+ array_node :instruments, 'instrument', :class => ResourceName, :optional => true, :default_value => []
70
+ end
71
+
72
+ # A Web Service that is describable by a WSDL document.
73
+ # The access_url gives the URL to the WSDL document for the service.
74
+ class WebService; end
75
+
76
+ # A web-based service that is described in a GLU registry.
77
+ # The access_url gives the URL to the GLU record describing the service.
78
+ class GLUService; end
79
+
80
+ # A service invoked via an HTTP Query (either Get or Post) with a set of arguments consisting of keyword name-value pairs.
81
+ class ParamHTTP
82
+ # the MIME type of a document returned by an HTTP Get
83
+ text_node :result_type, 'resultType', :optional => true
84
+
85
+ # the type of HTTP request, either GET or POST
86
+ object_node :qtype, '@qtype', :class => HTTPQueryType, :optional => true
87
+
88
+ # a description of a input parameter. Each should be rendered as name=value in the query URL's arguements
89
+ array_node :params, 'param', :optional => true, :default_value => []
90
+ end
91
+
92
+ class Param
93
+ include XML::Mapping
94
+
95
+ # the name of the column
96
+ text_node :name, 'name', :optional => true
97
+ # a description of the column's contents
98
+ text_node :description, 'description', :optional => true
99
+ # the unit associated with all values in the column
100
+ text_node :unit, 'unit', :optional => true
101
+ # the name of a unified content descriptor
102
+ text_node :ucd, 'ucd', :optional => true
103
+
104
+ # a type of data contained in the column
105
+ object_node :data_type, 'dataType', :class => DataType, :optional => true
106
+ end
107
+
108
+ class ScalarDataType
109
+ include XML::Mapping
110
+
111
+ text_enumeration_node :value, '', :optional => false,
112
+ :choices => ['boolean', 'bit', 'unsignedByte', 'short', 'int', 'long', 'char', 'unicodeChar',
113
+ 'float', 'double', 'floatComplex', 'doubleComplex']
114
+ end
115
+
116
+ # A (VOTable-supported) data type.
117
+ class DataType
118
+ # the shape of the array that constitutes the value
119
+ object_node :arraysize, '@arraysize', :object => ArrayShape, :optional => true, :default => '1'
120
+ end
121
+
122
+ class ArrayShape
123
+ include XML::Mapping
124
+
125
+ text_node :value, '', :optional => false
126
+
127
+ def value=(shape)
128
+ raise RuntimeError, "ArrayShape '#{shape}' in wrong format" if !shape.match(/^([0-9]+x)*[0-9]*[*]?$/)
129
+
130
+ @value = shape
131
+ end
132
+ end
133
+
134
+ # The type of HTTP request, either GET or POST.
135
+ class HTTPQueryType
136
+ include XML::Mapping
137
+
138
+ text_enumeration_node :value, '', :optional => false,
139
+ :choices => ['GET', 'POST']
140
+ end
141
+
142
+ # A service that interacts with one or more specified tables having some coverage of the sky, time, and/or frequency.
143
+ class TabularSkyService
144
+ # a description of a table and its columns
145
+ array_node :tables, 'table', :class => Table, :optional => true, :default_value => []
146
+ end
147
+
148
+ class Table
149
+ include XML::Mapping
150
+
151
+ # the name of the table
152
+ text_node :name, 'name', :optional => true
153
+ # a description of the tables contents
154
+ text_node :description, 'description', :optional => true
155
+
156
+ # a description of a table column
157
+ array_node :params, 'param', :class => Param, :optional => true, :default_value => []
158
+ end
159
+
160
+ end
161
+ end
162
+ end
163
+ end