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,405 @@
1
+ require 'voruby/resources/voresource/loader'
2
+
3
+ require 'voruby/resources/voresource/voresource_v0_10'
4
+
5
+ module VORuby
6
+ module Resources
7
+ module VOResource
8
+ module V0_9
9
+
10
+ # Forward declarations
11
+ class VODescription; end
12
+ class VOResource; end
13
+ class ResourceType; end
14
+ class Resource < ResourceType; end
15
+ class IdentifierType; end
16
+ class Identifier < IdentifierType; end
17
+ class AuthorityIDType; end
18
+ class AuthorityID < AuthorityIDType; end
19
+ class ResourceKeyType; end
20
+ class ResourceKey < ResourceKeyType; end
21
+ class Title; end
22
+ class ShortName; end
23
+ class SummaryType; end
24
+ class Summary < SummaryType; end
25
+ class Description; end
26
+ class SourceType; end
27
+ class Source < SourceType; end
28
+ class ReferenceURL < VOResource::V0_10::AnyURI; end
29
+ class CategoryType; end
30
+ class Type < CategoryType; end
31
+ class RelatedResourceType; end
32
+ class RelatedResource < RelatedResourceType; end
33
+ class RelationshipType; end
34
+ class Relationship < RelationshipType; end
35
+ class LogicalIdentifierType < IdentifierType; end
36
+ class LogicalIdentifier < LogicalIdentifierType; end
37
+ class CurationType; end
38
+ class Curation < CurationType; end
39
+ class ResourceReferenceType; end
40
+ class Publisher < ResourceReferenceType; end
41
+ class RelatedTo < ResourceReferenceType; end
42
+ class ContactType; end
43
+ class Contact < ContactType; end
44
+ class Name; end
45
+ class Email; end
46
+ class DateType; end
47
+ class Date < DateType; end
48
+ class NameReferenceType; end
49
+ class CreatorType < NameReferenceType; end
50
+ class Contributor < NameReferenceType; end
51
+ class Creator < CreatorType; end
52
+ class Logo < VOResource::V0_10::AnyURI; end
53
+ class Version; end
54
+ class Subject; end
55
+ class ContentLevelType; end
56
+ class ContentLevel < ContentLevelType; end
57
+ class InterfaceType; end
58
+ class Interface < InterfaceType; end
59
+ class InvocationType; end
60
+ class Invocation < InvocationType; end
61
+ class AccessURLType < VOResource::V0_10::AnyURI; end
62
+ class AccessURL < AccessURLType; end
63
+ class CapabilityType; end
64
+ class Capability < CapabilityType; end
65
+ class Facility < ResourceReferenceType; end
66
+ class Instrument < ResourceReferenceType; end
67
+ class ServiceType < ResourceType; end
68
+ class Service < ServiceType; end
69
+ class StandardID < IdentifierType; end
70
+ class StandardURL < VOResource::V0_10::AnyURI; end
71
+
72
+ # A description of one or more VO Resources.
73
+ class VODescription
74
+ include XML::Mapping
75
+
76
+ array_node :resources, 'Resource', :class => Resource, :optional => false
77
+ end
78
+
79
+ # A description of a single VO Resource.
80
+ class VOResource
81
+ include XML::Mapping
82
+
83
+ object_node :resource, 'Resource', :class => Resource, :optional => false
84
+ end
85
+
86
+ # Any entity that is describable and identifiable by a IVOA Identifier.
87
+ class Resource; end
88
+ class ResourceType
89
+ include XML::Mapping
90
+
91
+ date_time_node :created, '@created', :optional => true
92
+ date_time_node :updated, '@updated', :optional => true
93
+
94
+ text_enumeration_node :status, :optional => true, :default_value => 'active',
95
+ :choices => ['active', 'inactive', 'deleted']
96
+
97
+ object_node :identifier, 'Identifier', :class => Identifier, :optional => false
98
+ object_node :title, 'Title', :class => Title, :optional => false
99
+ object_node :short_name, 'ShortName', :class => ShortName, :optional => true
100
+ object_node :summary, 'Summary', :class => Summary, :optional => false
101
+ object_node :curation, 'Curation', :class => Curation, :optional => false
102
+
103
+ array_node :types, 'Type', :class => Type, :optional => true
104
+ array_node :related_resources, 'RelatedResource', :class => RelatedResource, :optional => true, :default_value => []
105
+ array_node :logical_identifiers, 'LogicalIdentifier', :class => LogicalIdentifier, :optional => true, :default_value => []
106
+ array_node :subjects, 'Subject', :class => Subject, :optional => true, :default_value => []
107
+ array_node :content_levels, 'ContentLevel', :class => ContentLevel, :optional => true, :default_value => []
108
+ end
109
+
110
+ # Unambiguous reference to the resource conforming to the IVOA standard for identifiers.
111
+ class Identifier; end
112
+ class IdentifierType
113
+ include XML::Mapping
114
+
115
+ object_node :authority_id, 'AuthorityID', :class => AuthorityID, :optional => false
116
+ object_node :resource_key, 'ResourceKey', :class => ResourceKey, :optional => false
117
+ end
118
+
119
+ # The identifier of a namespace under the control of a single naming authority.
120
+ class AuthorityID; end
121
+ class AuthorityIDType
122
+ include XML::Mapping
123
+
124
+ text_node :value, '', :optional => false
125
+
126
+ def value=(authid)
127
+ raise RuntimeError, "AuthorityID '#{authid} in wrong format" if !authid.match(/^[\w\d][\w\d\-_\.!~\*'\(\)]{2,}$/)
128
+
129
+ @value = authid
130
+ end
131
+ end
132
+
133
+ # A name for a resource that is unique within an authority's namespace.
134
+ class ResourceKey; end
135
+ class ResourceKeyType
136
+ include XML::Mapping
137
+
138
+ text_node :value, '', :optional => false
139
+
140
+ def value=(reskey)
141
+ raise RuntimeError, "Resource Key '#{reskey}' in wrong format" if !reskey.match("^[\w\d\-_\.!~\*'\(\)]+(/[\w\d\-_\.!~\*'\(\)]+)*$")
142
+ end
143
+ end
144
+
145
+ # The full name of a resource.
146
+ class Title
147
+ include XML::Mapping
148
+
149
+ text_node :value, '', :optional => false
150
+ end
151
+
152
+ # A short name or abbreviation for this resource that applications may use to refer to this resource in a compact display.
153
+ class ShortName
154
+ include XML::Mapping
155
+
156
+ text_node :value, '', :optional => false
157
+ end
158
+
159
+ # An account of the nature of the resource.
160
+ class Description
161
+ include XML::Mapping
162
+
163
+ text_node :value, '', :optional => false
164
+ end
165
+
166
+ # An informational, human-readable overview of a resource.
167
+ class Summary; end
168
+ class SummaryType
169
+ include XML::Mapping
170
+
171
+ object_node :description, 'Description', :class => Description, :optional => false
172
+ object_node :reference_url, 'ReferenceURL', :class => ReferenceURL, :optional => false
173
+ object_node :source, 'Source', :class => Source, :optional => true
174
+ end
175
+
176
+ # A bibliographic reference from which the present resource is derived or extracted.
177
+ class Source; end
178
+ class SourceType
179
+ include XML::Mapping
180
+
181
+ text_node :value, '', :optional => false
182
+ text_node :format, '@format', :optional => true
183
+ end
184
+
185
+ # URL pointing to a human-readable document describing this resource.
186
+ class ReferenceURL; end
187
+
188
+ # Nature or genre of the content of the resource.
189
+ class Type; end
190
+ class CategoryType
191
+ include XML::Mapping
192
+
193
+ text_enumeration_node :value, '', :optional => false,
194
+ :choices => ['Other', 'Archive', 'Bibliography', 'Catalog',
195
+ 'Journal', 'Library', 'Simulation', 'Survey',
196
+ 'Transformation', 'Education', 'Outreach', 'EPOResource',
197
+ 'Animation', 'Artwork', 'Background', 'BasicData',
198
+ 'Historical', 'Photographic', 'Press', 'Organisation',
199
+ 'Project', 'Person']
200
+ end
201
+
202
+ # A description of a relationship to another resource.
203
+ class RelatedResource; end
204
+ class RelatedResourceType
205
+ include XML::Mapping
206
+
207
+ object_node :relationship, 'Relationship', :class => Relationship, :optional => false
208
+ object_node :related_to, 'RelatedTo', :class => RelatedTo, :optional => false
209
+ end
210
+
211
+ # A property that relates one resource to another.
212
+ class Relationship; end
213
+ class RelationshipType
214
+ include XML::Mapping
215
+
216
+ text_enumeration_node :value, '', :optional => false,
217
+ :choices => ['service-for', 'derived-from', 'related-to']
218
+ end
219
+
220
+ # The resource that is related to the current one being described.
221
+ class RelatedTo; end
222
+
223
+ # A reference to a group of resources which the current resouce
224
+ # claims to be similar to in some way. A resource's registered
225
+ # identifier (given by the Identifier element) is its default
226
+ # LogicalIdentifier.
227
+ class LogicalIdentifier; end
228
+ class LogicalIdentiferType
229
+ include XML::Mapping
230
+
231
+ # a name refering to the characteristic that relates resources having this logical identifier.
232
+ text_node :role, '@role', :optional => true
233
+ end
234
+
235
+ # Information regarding the general curation of the resource.
236
+ class Curation; end
237
+ class CurationType
238
+ include XML::Mapping
239
+
240
+ object_node :publisher, 'Publisher', :class => Publisher, :optional => false
241
+ object_node :contact, 'Contact', :class => Contact, :optional => false
242
+ object_node :creator, 'Creator', :class => Creator, :optional => true
243
+ object_node :version, 'Version', :class => Version, :optional => true
244
+
245
+ array_node :dates, 'Date', :class => Date, :optional => true, :default_value => []
246
+ array_node :contributors, 'Contributor', :class => Contributor, :optional => true, :default_value => []
247
+ end
248
+
249
+ # Entity (e.g. person or organisation) responsible for making the resource available.
250
+ class Publisher; end
251
+
252
+ class ResourceReferenceType
253
+ include XML::Mapping
254
+
255
+ object_node :identifier, 'Identifier', :class => Identifier, :optional => true
256
+ object_node :title, 'Title', :class => Title, :optional => false
257
+ object_node :description, 'Description', :class => Description, :optional => true
258
+ object_node :reference_url, 'ReferenceURL', :class => ReferenceURL, :optional => true
259
+ end
260
+
261
+ # Information that can be used for contacting someone with regard to this resource.
262
+ class Contact; end
263
+ class ContactType
264
+ include XML::Mapping
265
+
266
+ object_node :name, 'Name', :class => Name, :optional => false
267
+ object_node :identifier, 'Identifier', :class => Identifier, :optional => true
268
+ object_name :email, 'Email', :class => Email, :optional => true
269
+ end
270
+
271
+ # The name of someone or something.
272
+ class Name
273
+ include XML::Mapping
274
+
275
+ text_node :value, '', :optional => false
276
+ end
277
+
278
+ # An email address.
279
+ class Email
280
+ include XML::Mapping
281
+
282
+ text_node :value, '', :optional => false
283
+ end
284
+
285
+ # Date associated with an event in the life cycle of the resource.
286
+ class Date; end
287
+ class DateType
288
+ include XML::Mapping
289
+
290
+ # a string indicating what the date refers to
291
+ text_node :role, '@role', :optional => true, :default_value => 'representative'
292
+
293
+ date_time_node :value, '', :optional => false
294
+ end
295
+
296
+ # Entity responsible for contributions to the content of the resource.
297
+ class Contributor; end
298
+
299
+ class NameReferenceType
300
+ include XML::Mapping
301
+
302
+ object_node :identifier, 'Identifier', :class => Identifier, :optional => true
303
+ object_node :name, 'Name', :class => Name, :optional => false
304
+ end
305
+
306
+ # The entity (e.g. person or organisation) primarily responsible for creating the content or constitution of the resource.
307
+ class Creator; end
308
+ class CreatorType
309
+ object_node :logo, 'Logo', :class => Logo, :optional => true
310
+ end
311
+
312
+ # URL pointing to a graphical logo, which may be used to help identify the information source.
313
+ class Logo; end
314
+
315
+ # Label associated with creation or availablilty of a version ofa resource.
316
+ class Version
317
+ include XML::Mapping
318
+
319
+ text_node :value, '', :optional => false
320
+ end
321
+
322
+ # List of topics, object types, or other descriptive keywords about the resource.
323
+ class Subject
324
+ include XML::Mapping
325
+
326
+ text_node :value, '', :optional => false
327
+ end
328
+
329
+ # Description of the content level or intended audience.
330
+ class ContentLevel; end
331
+ class ContentLevelType
332
+ include XML::Mapping
333
+
334
+ text_enumeration_node :value, '', :optional => false,
335
+ :choices => ['General', 'Elementary Education', 'Middle School Education', 'Secondary Education',
336
+ 'Community College', 'University', 'Research', 'Amateur', 'Informal Education']
337
+ end
338
+
339
+ # A description of a service interface.
340
+ class Interface; end
341
+ # This is typically used as a base type for defining specific
342
+ # kinds of service interfaces. If this type is used
343
+ # directly, the Description element should be used to describe
344
+ # how to invoke the service.
345
+ class InterfaceType
346
+ require XML::Mapping
347
+
348
+ object_node :invocation, 'Invocation', :class => Invocation, :optional => false
349
+ object_node :description, 'Description', :class => Description, :optional => true
350
+ object_node :access_url, 'AccessURL', :class => AccessURL, :optional => false
351
+ end
352
+
353
+ # The type of interface used by the current Service, expressed as a controlled name.
354
+ class Invocation; end
355
+ class InvocationType
356
+ require XML::Mapping
357
+
358
+ text_enumeration_node :value, '', :optional => false,
359
+ :choices => ['Extended', 'WebService', 'WebBrowser', 'GLUService']
360
+ end
361
+
362
+ # A full or base URL that can be used to access data or a service.
363
+ class AccessURL; end
364
+ class AccessURLType
365
+ # a flag indicating whether this should be interpreted as a base
366
+ # URL, a full URL, or a URL to a directory that will produce a
367
+ # listing of files
368
+ text_enumeration_node :use, '@use', :optional => true,
369
+ :choices => ['full', 'base', 'dir']
370
+ end
371
+
372
+ # A specific description of the context and capabilities of a service.
373
+ class Capability; end
374
+ # This is a base type for defining specific kinds of service
375
+ # capability descriptions, each with its own special mark-up schema.
376
+ class CapabilityType
377
+ include XML::Mapping
378
+
379
+ object_node :standard_url, 'StandardURL', :class => StandardURL, :optional => true
380
+ object_node :standard_id, 'StandardID', :class => StandardID, :optional => true
381
+ end
382
+
383
+ # The observatory or facility used to collect the data contained or managed by this resource.
384
+ class Facility; end
385
+
386
+ # the instrument used to collect the data contain or managed by a resource.
387
+ class Instrument; end
388
+
389
+ # A resource that provides an interface for executing some operation or retrieving data.
390
+ class Service; end
391
+ class ServiceType
392
+ object_node :capability, 'Capability', :class => Capability, :optional => true
393
+ object_node :interface, 'Interface', :class => Interface, :optional => false
394
+ end
395
+
396
+ # An identifier for a registered standard.
397
+ class StandardID; end
398
+
399
+ # A URL that points to a human-readable document that describes the standard upon which a resource is based.
400
+ class StandardURL; end
401
+
402
+ end
403
+ end
404
+ end
405
+ end
@@ -0,0 +1,230 @@
1
+ require 'voruby/resources/voresource/loader'
2
+
3
+ # Re-use the classes unchanged from previous versions of the schema.
4
+ require 'voruby/resources/voresource/voresource_v0_10'
5
+
6
+ module VORuby
7
+ module Resources
8
+ module VOResource
9
+ module V1_0
10
+
11
+ # Forward declarations
12
+ class Resource; end
13
+ class Organisation < Resource; end
14
+ class Service < Resource; end
15
+ class ValidationLevel; end
16
+ class Curation; end
17
+ class ResourceName < VOResource::V0_10::ResourceName; end
18
+ class Creator < VOResource::V0_10::Creator; end
19
+ class Contact < VOResource::V0_10::Contact; end
20
+ class Content; end
21
+ class Subject; end
22
+ class Source < VOResource::V0_10::Source; end
23
+ class Type < VOResource::V0_10::Type; end
24
+ class ContentLevel < VOResource::V0_10::ContentLevel; end
25
+ class Relationship; end
26
+ class RelatedResource; end
27
+ class Rights; end
28
+ class Capability; end
29
+ class Interface; end
30
+ class SecurityMethod; end
31
+ class AuthorityID < VOResource::V0_10::AuthorityID; end
32
+ class WebBrowser < Interface; end
33
+ class WebService < Interface; end
34
+ class Validation < ValidationLevel; end
35
+ class UTCTimestamp; end
36
+ class UTCDateTime < UTCTimestamp; end
37
+ class Date < UTCDateTime; end
38
+ class ShortName < VOResource::V0_10::ShortName; end
39
+ class AnyURI < VOResource::V0_10::AnyURI; end
40
+ class IdentifierURI < VOResource::V0_10::IdentifierURI; end
41
+ class AccessURL < AnyURI; end
42
+ class ResourceKey < VOResource::V0_10::ResourceKey; end
43
+
44
+ $CapabilityUnmarshaller = Resources::namespace_dispatcher(
45
+ 'VORuby::Resources::VOResource::V1_0',
46
+ 'Capability', Capability)
47
+ $InterfaceUnmarshaller = Resources::namespace_dispatcher(
48
+ 'VORuby::Resources::VOResource::V1_0',
49
+ 'Interface', Interface)
50
+
51
+ # Any entity or component of a VO application that is describable and identifiable by a IVOA Identifier.
52
+ class Resource
53
+ include XML::Mapping
54
+
55
+ text_node :title, 'title', :optional => false
56
+ date_time_node :created, '@created', :optional => true
57
+ date_time_node :updated, '@updated', :optional => true
58
+
59
+ text_enumeration_node :status, '@status', :optional => false, :default_value => 'active',
60
+ :choices => ['active', 'inactive', 'deleted']
61
+
62
+ object_node :short_name, 'shortName', :class => ShortName, :optional => true
63
+ object_node :identifier, 'identifier', :class => IdentifierURI, :optional => false
64
+ object_node :curation, 'curation', :class => Curation, :optional => false
65
+ object_node :content, 'content', :class => Content, :optional => false
66
+ array_node :validation_levels, 'validationLevel', :class => Validation, :optional => true, :default_value => []
67
+ end
68
+
69
+ # A numeric grade describing the quality of the
70
+ # resource description, when applicable,
71
+ # to be used to indicate the confidence an end-user
72
+ # can put in the resource as part of a VO application
73
+ # or research study.
74
+ class ValidationLevel
75
+ include XML::Mapping
76
+
77
+ numeric_enumeration_node :value, '', :optional => false,
78
+ :choices => [0, 1, 2, 3, 4]
79
+ end
80
+
81
+ # Information regarding the general curation of the resource.
82
+ class Curation
83
+ include XML::Mapping
84
+
85
+ text_node :version, 'version', :optional => true
86
+
87
+ object_node :publisher, 'publisher', :class => ResourceName, :optional => false
88
+
89
+ array_node :creators, 'creator', :class => Creator, :default_value => [], :optional => true
90
+ array_node :contributors, 'contributor', :class => ResourceName, :default_value => [], :optional => true
91
+ array_node :dates, 'date', :class => Date, :default_value => [], :optional => true
92
+ array_node :contacts, 'contact', :class => Contact, :optional => false
93
+ end
94
+
95
+ # Date associated with an event in the life cycle of the resource.
96
+ class Date
97
+ include XML::Mapping
98
+
99
+ text_node :role, '@role', :optional => false, :default_value => 'representative'
100
+ end
101
+
102
+ # Information regarding the general content of the resource.
103
+ class Content
104
+ include XML::Mapping
105
+
106
+ text_node :description, 'description', :optional => false
107
+
108
+ object_node :source, 'source', :class => Source, :optional => true
109
+ object_node :reference_url, 'referenceURL', :class => AnyURI, :optional => false
110
+
111
+ array_node :subjects, 'subject', :class => Subject, :optional => false
112
+ array_node :types, 'type', :class => Type, :default_value => [], :optional => true
113
+ array_node :content_levels, 'contentLevel', :class => ContentLevel, :default_value => [], :optional => true
114
+ array_node :relationships, 'relationship', :class => Relationship, :default_value => [], :optional => true
115
+ end
116
+
117
+ # A topic, object type, or other descriptive keywords about the resource.
118
+ class Subject
119
+ include XML::Mapping
120
+
121
+ text_node :value, '', :optional => false
122
+ end
123
+
124
+ # A description of a relationship to another resource.
125
+ class Relationship
126
+ include XML::Mapping
127
+
128
+ text_node :relationship_type, 'relationshipType', :optional => false
129
+
130
+ array_node :related_resources, 'relatedResource', :class => RelatedResource, :optional => false
131
+ end
132
+
133
+ # The name of resource that this resource is related to.
134
+ class RelatedResource
135
+ include XML::Mapping
136
+
137
+ text_node :value, '', :optional => false
138
+ end
139
+
140
+ # A named group of one or more persons brought together to pursue participation in VO applications.
141
+ class Organisation
142
+ array_node :facilities, 'facility', :class => ResourceName, :optional => true, :default_value => []
143
+ array_node :instruments, 'instrument', :class => ResourceName, :optional => true, :default_value => []
144
+ end
145
+
146
+ # A resource that can be invoked by a client to perform some action on its behalf.
147
+ class Service
148
+ array_node :rights, 'rights', :class => Rights, :optional => true, :default_value => []
149
+
150
+ # Choose the capability based on the type.
151
+ array_node :capabilities, 'capability', :unmarshaller => $CapabilityUnmarshaller, :optional => true,
152
+ :default_value => []
153
+ end
154
+
155
+ # Information about rights held in and over the resource.
156
+ class Rights
157
+ include XML::Mapping
158
+
159
+ text_enumeration_node :value, '', :optional => false,
160
+ :choices => ['public', 'secure', 'proprietary']
161
+ end
162
+
163
+ # A description of a general capability of the service and how to use it.
164
+ class Capability
165
+ include XML::Mapping
166
+
167
+ text_node :capability_type, '@type', :optional => true
168
+ text_node :description, 'description', :optional => true
169
+
170
+ object_node :standard_id, '@standardID', :class => AnyURI, :optional => true
171
+
172
+ array_node :validation_levels, 'validationLevel', :class => Validation, :optional => true, :default_value => []
173
+ array_node :interfaces, 'interface', :unmarshaller => $InterfaceUnmarshaller, :optional => true, :default_value => []
174
+ end
175
+
176
+ # A description of how to call the service to access this capability
177
+ class Interface
178
+ include XML::Mapping
179
+
180
+ text_node :interface_type, '@type', :optional => false
181
+ text_node :version, '@version', :optional => true, :default_value => '1.0'
182
+ text_node :role, '@role', :optional => true
183
+
184
+ array_node :access_urls, 'accessURL', :class => AccessURL, :optional => false
185
+ array_node :security_methods, 'securityMethod', :class => SecurityMethod, :optional => true, :default_value => []
186
+ end
187
+
188
+ # The URL (or base URL) that a client uses to access the service.
189
+ class AccessURL
190
+ text_enumeration_node :use, '@use', :optional => false, :default_value => 'full',
191
+ :choices => ['full', 'base', 'post', 'dir']
192
+ end
193
+
194
+ # A description of a security mechanism.
195
+ class SecurityMethod
196
+ include XML::Mapping
197
+
198
+ object_node :standard_id, '@standardID', :class => AnyURI, :optional => false
199
+ end
200
+
201
+ # A (form-based) interface intended to be accesed interactively by a user via a web browser.
202
+ class WebBrowser; end
203
+
204
+ # A Web Service that is describable by a WSDL document.
205
+ class WebService
206
+ array_node :wsdl_urls, 'wsdlURL', :class => AnyURI, :optional => true, :default_value => []
207
+ end
208
+
209
+ # A validation stamp combining a validation level and the ID of the validator.
210
+ class Validation
211
+ object_node :validated_by, '@validatedBy', :class => IdentifierURI, :optional => false
212
+ end
213
+
214
+ # A timestamp that is compliant with ISO8601 but disallows the use of a timezone indicator.
215
+ class UTCTimestamp
216
+ include XML::Mapping
217
+
218
+ text_node :value, '', :optional => false
219
+
220
+ def value=(timestamp)
221
+ raise RuntimeError, "UTCTimestamp '#{timestamp} in wrong format" if !timestamp.strip.match('^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(\.\d+)?$')
222
+
223
+ @value = Time.parse(timestamp.strip)
224
+ end
225
+ end
226
+
227
+ end
228
+ end
229
+ end
230
+ end
@@ -0,0 +1,11 @@
1
+ class Hash
2
+ require 'soap/mapping/registry'
3
+
4
+ def to_soap_map
5
+ map = SOAP::Mapping::Object.new()
6
+ self.each do |name, value|
7
+ map[name] = value
8
+ end
9
+ map
10
+ end
11
+ end