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.
- data/Rakefile.rb +107 -224
- data/lib/misc.rb +1 -0
- data/lib/misc/misc.rb +60 -0
- data/lib/misc/propertyfile.rb +31 -0
- data/lib/symphony.rb +1 -0
- data/lib/symphony/symphony.rb +247 -0
- data/lib/voruby.rb +186 -0
- data/lib/voruby/active_votable/active_votable.rb +468 -347
- data/lib/voruby/adql/1.0/adql.rb +2418 -0
- data/lib/voruby/adql/support.rb +2 -0
- data/lib/voruby/misc.rb +351 -0
- data/lib/voruby/misc/connection_monitor.rb +97 -0
- data/lib/voruby/misc/libxml_ext.rb +121 -0
- data/lib/voruby/misc/rexml_ext.rb +223 -0
- data/lib/voruby/resolver/resolver.rb +12 -0
- data/lib/voruby/resolver/sesame.rb +299 -0
- data/lib/voruby/sky_query/sky_query.rb +192 -0
- data/lib/voruby/stc/1.10/coords.rb +2272 -0
- data/lib/voruby/stc/1.10/region.rb +892 -0
- data/lib/voruby/stc/1.10/stc.rb +3271 -0
- data/lib/voruby/stc/1.30/stc.rb +8666 -0
- data/lib/voruby/stc/support.rb +2 -0
- data/lib/voruby/ucd/ucd.rb +173 -0
- data/lib/voruby/voevent/1.1/voevent.rb +1124 -0
- data/lib/voruby/voevent/support.rb +5 -0
- data/lib/voruby/votable/1.0/votable.rb +1807 -0
- data/lib/voruby/votable/1.1/votable.rb +2100 -0
- data/lib/voruby/votable/votable.rb +305 -0
- data/lib/voruby/wesix/wesix.rb +491 -0
- data/lib/voruby/xlink/1.2/xlink.rb +21 -0
- data/test/voruby/active_votable/complex.vot +60 -0
- data/test/voruby/active_votable/error.vot +6 -0
- data/test/voruby/active_votable/large.vot +130040 -0
- data/test/voruby/active_votable/simple1.vot +38 -0
- data/test/voruby/active_votable/simple2.vot +38 -0
- data/test/voruby/active_votable/test.rb +193 -0
- data/test/voruby/adql/1.0/adql-alias.sql +1 -0
- data/test/voruby/adql/1.0/adql-alias.xml +26 -0
- data/test/voruby/adql/1.0/adql-avg.sql +1 -0
- data/test/voruby/adql/1.0/adql-avg.xml +31 -0
- data/test/voruby/adql/1.0/adql-circle.sql +1 -0
- data/test/voruby/adql/1.0/adql-circle.xml +46 -0
- data/test/voruby/adql/1.0/adql-expr.sql +1 -0
- data/test/voruby/adql/1.0/adql-expr.xml +34 -0
- data/test/voruby/adql/1.0/adql-function.sql +1 -0
- data/test/voruby/adql/1.0/adql-function.xml +41 -0
- data/test/voruby/adql/1.0/adql-group.sql +1 -0
- data/test/voruby/adql/1.0/adql-group.xml +51 -0
- data/test/voruby/adql/1.0/adql-having.sql +1 -0
- data/test/voruby/adql/1.0/adql-having.xml +25 -0
- data/test/voruby/adql/1.0/adql-like.sql +1 -0
- data/test/voruby/adql/1.0/adql-like.xml +17 -0
- data/test/voruby/adql/1.0/adql-order.sql +1 -0
- data/test/voruby/adql/1.0/adql-order.xml +37 -0
- data/test/voruby/adql/1.0/adql-simple.sql +1 -0
- data/test/voruby/adql/1.0/adql-simple.xml +12 -0
- data/test/voruby/adql/1.0/adql-top.sql +1 -0
- data/test/voruby/adql/1.0/adql-top.xml +33 -0
- data/test/voruby/adql/1.0/test.rb +2220 -0
- data/test/voruby/misc/test.rb +32 -0
- data/test/voruby/resolver/sesame/test.rb +56 -0
- data/test/voruby/sky_query/test.rb +107 -0
- data/test/voruby/stc/1.10/coords_test.rb +3704 -0
- data/test/voruby/stc/1.10/region_test.rb +993 -0
- data/test/voruby/stc/1.10/stc-catalog-entry-location.xml +112 -0
- data/test/voruby/stc/1.10/stc-obs-data-location.xml +126 -0
- data/test/voruby/stc/1.10/stc-region-circle.xml +5 -0
- data/test/voruby/stc/1.10/stc-region-convex.xml +11 -0
- data/test/voruby/stc/1.10/stc-region-convexhull.xml +5 -0
- data/test/voruby/stc/1.10/stc-region-ellipse.xml +7 -0
- data/test/voruby/stc/1.10/stc-region-intersection.xml +25 -0
- data/test/voruby/stc/1.10/stc-region-negation.xml +7 -0
- data/test/voruby/stc/1.10/stc-region-polygon.xml +13 -0
- data/test/voruby/stc/1.10/stc-region-sector.xml +6 -0
- data/test/voruby/stc/1.10/stc-region-union.xml +25 -0
- data/test/voruby/stc/1.10/stc-resource-profile.xml +60 -0
- data/test/voruby/stc/1.10/stc-search-location.xml +54 -0
- data/test/voruby/stc/1.10/stc_test.rb +4626 -0
- data/test/voruby/stc/1.30/stc-catalog-entry-location.xml +210 -0
- data/test/voruby/stc/1.30/stc-obs-data-location-arecibo.xml +353 -0
- data/test/voruby/stc/1.30/stc-obs-data-location-fits.xml +250 -0
- data/test/voruby/stc/1.30/stc-obs-data-location-xlink.xml +63 -0
- data/test/voruby/stc/1.30/stc-obs-data-location.xml +216 -0
- data/test/voruby/stc/1.30/stc-resource-profile-unusual-ref-pos.xml +39 -0
- data/test/voruby/stc/1.30/stc-resource-profile.xml +129 -0
- data/test/voruby/stc/1.30/stc-search-location-arecibo.xml +86 -0
- data/test/voruby/stc/1.30/stc-search-location.xml +101 -0
- data/test/voruby/stc/1.30/test.rb +6274 -0
- data/test/voruby/ucd/test.rb +48 -0
- data/test/voruby/voevent/1.1/test.rb +812 -0
- data/test/{voevent/voevent_v1_1.xml → voruby/voevent/1.1/voevent.xml} +2 -2
- data/test/voruby/voregistry/0.3/test.rb +137 -0
- data/test/voruby/votable/1.0/test.rb +714 -0
- data/test/voruby/votable/1.0/votable.basic.xml +660 -0
- data/test/voruby/votable/1.0/votable.html +86 -0
- data/test/voruby/votable/1.0/votable.ns.xml +56 -0
- data/test/voruby/votable/1.1/test.rb +785 -0
- data/test/voruby/votable/1.1/votable.basic.xml +38 -0
- data/test/voruby/votable/1.1/votable.html +86 -0
- data/test/voruby/votable/1.1/votable.ns.xml +56 -0
- data/test/voruby/votable/test.rb +15 -0
- data/test/voruby/wesix/test.rb +268 -0
- data/test/voruby/wesix/testr.fits +28 -0
- metadata +234 -247
- data/REQUIREMENTS +0 -6
- data/lib/voruby/active_votable/loader.rb +0 -5
- data/lib/voruby/adql/adql.rb +0 -2787
- data/lib/voruby/adql/ext.rb +0 -14
- data/lib/voruby/adql/loader.rb +0 -6
- data/lib/voruby/adql/operations.rb +0 -54
- data/lib/voruby/adql/parser.rb +0 -160
- data/lib/voruby/adql/transforms.rb +0 -573
- data/lib/voruby/ext.rb +0 -17
- data/lib/voruby/loader.rb +0 -4
- data/lib/voruby/misc/propertyfile.rb +0 -36
- data/lib/voruby/plastic/applications.rb +0 -174
- data/lib/voruby/plastic/constants.rb +0 -30
- data/lib/voruby/plastic/loader.rb +0 -10
- data/lib/voruby/plastic/plastic.rb +0 -1
- data/lib/voruby/resources/conesearch/conesearch.rb +0 -9
- data/lib/voruby/resources/conesearch/conesearch_v0_2.rb +0 -55
- data/lib/voruby/resources/conesearch/conesearch_v0_3.rb +0 -50
- data/lib/voruby/resources/conesearch/conesearch_v1_0.rb +0 -72
- data/lib/voruby/resources/conesearch/loader.rb +0 -4
- data/lib/voruby/resources/loader.rb +0 -50
- data/lib/voruby/resources/nodes.rb +0 -190
- data/lib/voruby/resources/openskynode/loader.rb +0 -4
- data/lib/voruby/resources/openskynode/openskynode.rb +0 -9
- data/lib/voruby/resources/openskynode/openskynode_v0_1.rb +0 -54
- data/lib/voruby/resources/sia/loader.rb +0 -5
- data/lib/voruby/resources/sia/sia.rb +0 -9
- data/lib/voruby/resources/sia/sia_v0_6.rb +0 -90
- data/lib/voruby/resources/sia/sia_v0_7.rb +0 -89
- data/lib/voruby/resources/sia/sia_v1_0.rb +0 -122
- data/lib/voruby/resources/stsci.rb +0 -59
- data/lib/voruby/resources/vodataservice/coverage_v0_2.rb +0 -195
- data/lib/voruby/resources/vodataservice/coverage_v0_3.rb +0 -158
- data/lib/voruby/resources/vodataservice/loader.rb +0 -5
- data/lib/voruby/resources/vodataservice/vodataservice.rb +0 -9
- data/lib/voruby/resources/vodataservice/vodataservice_v0_4.rb +0 -189
- data/lib/voruby/resources/vodataservice/vodataservice_v0_5.rb +0 -163
- data/lib/voruby/resources/vodataservice/vodataservice_v1_0.rb +0 -221
- data/lib/voruby/resources/voregistry/loader.rb +0 -4
- data/lib/voruby/resources/voregistry/voregistry.rb +0 -9
- data/lib/voruby/resources/voregistry/voregistry_v0_2.rb +0 -40
- data/lib/voruby/resources/voregistry/voregistry_v0_3.rb +0 -30
- data/lib/voruby/resources/voregistry/voregistry_v1_0.rb +0 -86
- data/lib/voruby/resources/voresource/loader.rb +0 -17
- data/lib/voruby/resources/voresource/voresource.rb +0 -9
- data/lib/voruby/resources/voresource/voresource_v0_10.rb +0 -327
- data/lib/voruby/resources/voresource/voresource_v0_9.rb +0 -405
- data/lib/voruby/resources/voresource/voresource_v1_0.rb +0 -230
- data/lib/voruby/services/ext.rb +0 -11
- data/lib/voruby/services/gestalt/footprint.rb +0 -95
- data/lib/voruby/services/gestalt/wcs_fixer.rb +0 -105
- data/lib/voruby/services/gestalt/wesix.rb +0 -155
- data/lib/voruby/services/loader.rb +0 -7
- data/lib/voruby/services/registry/registry.rb +0 -53
- data/lib/voruby/services/resolver/resolver.rb +0 -35
- data/lib/voruby/services/schema/schema.rb +0 -644
- data/lib/voruby/sesame/loader.rb +0 -6
- data/lib/voruby/sesame/sesame_v1_0.rb +0 -64
- data/lib/voruby/simple/loader.rb +0 -6
- data/lib/voruby/simple/parameters.rb +0 -196
- data/lib/voruby/simple/sap.rb +0 -446
- data/lib/voruby/spacetime/loader.rb +0 -3
- data/lib/voruby/spacetime/spacetime.rb +0 -607
- data/lib/voruby/stc/coords_v1_20.rb +0 -900
- data/lib/voruby/stc/loader.rb +0 -55
- data/lib/voruby/stc/region_v1_20.rb +0 -274
- data/lib/voruby/stc/stc_v1_20.rb +0 -1196
- data/lib/voruby/util.rb +0 -27
- data/lib/voruby/voevent/loader.rb +0 -7
- data/lib/voruby/voevent/voevent_v1_0.rb +0 -213
- data/lib/voruby/voevent/voevent_v1_1.rb +0 -196
- data/lib/voruby/votables/chandra.rb +0 -373
- data/lib/voruby/votables/data.rb +0 -179
- data/lib/voruby/votables/galex.rb +0 -377
- data/lib/voruby/votables/int.rb +0 -354
- data/lib/voruby/votables/libxml_parser.rb +0 -411
- data/lib/voruby/votables/libxml_votable.rb +0 -67
- data/lib/voruby/votables/loader.rb +0 -10
- data/lib/voruby/votables/meta.rb +0 -763
- data/lib/voruby/votables/misc.rb +0 -51
- data/lib/voruby/votables/nsa.rb +0 -410
- data/lib/voruby/votables/rexml_parser.rb +0 -408
- data/lib/voruby/votables/rexml_votable.rb +0 -67
- data/lib/voruby/votables/sdss.rb +0 -356
- data/lib/voruby/votables/transforms.rb +0 -388
- data/lib/voruby/votables/tree.rb +0 -45
- data/lib/voruby/votables/types.rb +0 -391
- data/lib/voruby/votables/votable.rb +0 -687
- data/test/active_votable/database.yml +0 -6
- data/test/active_votable/test.vot +0 -168492
- data/test/active_votable/unittest.rb +0 -41
- data/test/adql/test1.adql +0 -49
- data/test/adql/test2.adql +0 -51
- data/test/adql/test3.adql +0 -81
- data/test/adql/test4.adql +0 -53
- data/test/adql/test5.adql +0 -55
- data/test/adql/test6.adql +0 -18
- data/test/adql/test7.adql +0 -48
- data/test/adql/unittest.rb +0 -1672
- data/test/plastic/test.rb +0 -44
- data/test/plastic/test.vot +0 -5385
- data/test/plastic/unittest.rb +0 -66
- data/test/resources/conesearch/conesearch_v0_3.xml +0 -31
- data/test/resources/conesearch/conesearch_v1_0.xml +0 -86
- data/test/resources/conesearch/unittest_v0_3.rb +0 -22
- data/test/resources/conesearch/unittest_v1_0.rb +0 -24
- data/test/resources/openskynode/open_sky_node_v0_1.xml +0 -32
- data/test/resources/openskynode/unittest_v0_1.rb +0 -31
- data/test/resources/sia/simple_image_access_v0_7.xml +0 -36
- data/test/resources/sia/simple_image_access_v1_0.xml +0 -122
- data/test/resources/sia/unittest_v0_7.rb +0 -24
- data/test/resources/sia/unittest_v1_0.rb +0 -29
- data/test/resources/stsci.xml +0 -336
- data/test/resources/unittest_stsci.rb +0 -25
- data/test/resources/vodataservice/catalog_service_resource_v1_0.xml +0 -128
- data/test/resources/vodataservice/data_collection_resource_v0_5.xml +0 -54
- data/test/resources/vodataservice/data_collection_resource_v1_0.xml +0 -117
- data/test/resources/vodataservice/data_service_resource_v1_0.xml +0 -115
- data/test/resources/vodataservice/sky_service_resource_v0_10.xml +0 -45
- data/test/resources/vodataservice/table_service_resource_v1_0.xml +0 -122
- data/test/resources/vodataservice/tabular_sky_service_resource_v0_10.xml +0 -60
- data/test/resources/vodataservice/unittest_v0_5.rb +0 -126
- data/test/resources/vodataservice/unittest_v1_0.rb +0 -151
- data/test/resources/voregistry/authority_resource_v0_3.xml +0 -20
- data/test/resources/voregistry/authority_resource_v1_0.xml +0 -82
- data/test/resources/voregistry/registry_service_v0_3.xml +0 -20
- data/test/resources/voregistry/registry_service_v1_0.xml +0 -107
- data/test/resources/voregistry/unittest_v0_3.rb +0 -31
- data/test/resources/voregistry/unittest_v1_0.rb +0 -34
- data/test/resources/voresource/organisation_resource_v1_0.xml +0 -90
- data/test/resources/voresource/resource_organisation_v0_10.xml +0 -22
- data/test/resources/voresource/resource_service_v0_10.xml +0 -19
- data/test/resources/voresource/resource_v0_10.xml +0 -19
- data/test/resources/voresource/resource_v1_0.xml +0 -79
- data/test/resources/voresource/service_resource_v1_0.xml +0 -91
- data/test/resources/voresource/unittest_v0_10.rb +0 -61
- data/test/resources/voresource/unittest_v0_9.rb +0 -4
- data/test/resources/voresource/unittest_v1_0.rb +0 -190
- data/test/services/gestalt/unittest.rb +0 -74
- data/test/services/registry/unittest.rb +0 -34
- data/test/services/resolver/unittest.rb +0 -38
- data/test/simple/unittest.rb +0 -46
- data/test/spacetime/unittest.rb +0 -39
- data/test/stc/catalog_entry_location_v1_20.xml +0 -112
- data/test/stc/obs_data_location_v1_20.xml +0 -108
- data/test/stc/search_location_v1_20.xml +0 -54
- data/test/stc/stc_resource_profile_v1_20.xml +0 -60
- data/test/stc/unittest_v1_20.rb +0 -620
- data/test/voevent/unittest_v1_0.rb +0 -79
- data/test/voevent/unittest_v1_1.rb +0 -70
- data/test/voevent/voevent_v1_0.xml +0 -96
- data/test/votables/test.vot +0 -366
- data/test/votables/unittest.rb +0 -54
@@ -1,50 +0,0 @@
|
|
1
|
-
require 'voruby/loader'
|
2
|
-
|
3
|
-
module VORuby
|
4
|
-
module Resources
|
5
|
-
NAMESPACE_MODULE_MAP =
|
6
|
-
{
|
7
|
-
'http://www.ivoa.net/xml/VOResource/v0.10' => 'VORuby::Resources::VOResource::V_10',
|
8
|
-
'http://www.ivoa.net/xml/VOResource/v0.9' => 'VORuby::Resources::VOResource::V0_9',
|
9
|
-
'http://www.ivoa.net/xml/VOResource/v1.0' => 'VORuby::Resources::VOResource::V1_0',
|
10
|
-
'http://www.ivoa.net/xml/VODataService/v0.4' => 'VORuby::Resources::VODataService',
|
11
|
-
'http://www.ivoa.net/xml/VODataService/v0.5' => 'VORuby::Resources::VODataService::V0_5',
|
12
|
-
'http://www.ivoa.net/xml/VODataService/v1.0' => 'VORuby::Resources::VODataService::V1_0',
|
13
|
-
'http://www.ivoa.net/xml/OpenSkyNode/v0.1' => 'VORuby::OpenSkyNode',
|
14
|
-
'http://www.ivoa.net/xml/VORegistry/v0.2' => 'VORuby::Resources::VORegistry::V0_2',
|
15
|
-
'http://www.ivoa.net/xml/VORegistry/v0.3' => 'VORuby::Resources::VORegistry::V0_3',
|
16
|
-
'http://www.ivoa.net/xml/VORegistry/v1.0' => 'VORuby::Resources::VORegistry::V1_0',
|
17
|
-
'http://www.ivoa.net/xml/SIA/v0.6' => 'VORuby::Resources::SIA::V0_6',
|
18
|
-
'http://www.ivoa.net/xml/SIA/v0.7' => 'VORuby::Resources::SIA::V0_7',
|
19
|
-
'http://www.ivoa.net/xml/SIA/v1.0' => 'VORuby::Resources::SIA::V1_0',
|
20
|
-
'http://www.ivoa.net/xml/ConeSearch/v0.2' => 'VORuby::Resources::ConeSearch::V0_2',
|
21
|
-
'http://www.ivoa.net/xml/ConeSearch/v0.3' => 'VORuby::Resources::ConeSearch::V0_3',
|
22
|
-
'http://www.ivoa.net/xml/ConeSearch/v1.0' => 'VORuby::Resources::ConeSearch::V1_0'
|
23
|
-
}
|
24
|
-
|
25
|
-
# Dynamically dispatches a request to a class using the determined XML
|
26
|
-
# namespace.
|
27
|
-
def self.namespace_dispatcher(default_module, default_type, default_class)
|
28
|
-
return Proc.new{ |xml|
|
29
|
-
the_module = type = nil
|
30
|
-
if xml.attributes['type']
|
31
|
-
ns_prefix, type = xml.attributes['type'].split(':')
|
32
|
-
type = ns_prefix if !type
|
33
|
-
|
34
|
-
the_module = NAMESPACE_MODULE_MAP[xml.namespace(ns_prefix)]
|
35
|
-
the_module = default_module if !the_module
|
36
|
-
else
|
37
|
-
the_module = default_module
|
38
|
-
type = default_type
|
39
|
-
end
|
40
|
-
|
41
|
-
# The name of the appropriate class corresponds to the type.
|
42
|
-
begin
|
43
|
-
eval("#{the_module}::#{type}.load_from_xml(xml)") # Would like to get rid of this eval somehow...
|
44
|
-
rescue NameError
|
45
|
-
default_class.load_from_xml(xml)
|
46
|
-
end
|
47
|
-
}
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
@@ -1,190 +0,0 @@
|
|
1
|
-
require 'xml/mapping'
|
2
|
-
require 'date'
|
3
|
-
require 'time'
|
4
|
-
|
5
|
-
module VORuby
|
6
|
-
module VOResource
|
7
|
-
module Mapping
|
8
|
-
|
9
|
-
class DateTimeNode < XML::Mapping::SingleAttributeNode
|
10
|
-
def initialize_impl(path)
|
11
|
-
@path = XML::XXPath.new(path)
|
12
|
-
end
|
13
|
-
|
14
|
-
def extract_attr_value(xml)
|
15
|
-
txt = default_when_xpath_err{ @path.first(xml).text }
|
16
|
-
DateTime.parse(txt)
|
17
|
-
end
|
18
|
-
|
19
|
-
def set_attr_value(xml, value)
|
20
|
-
raise RuntimeError, "Not a date/time: #{value}" unless Time === value
|
21
|
-
@path.first(xml, :ensure_created => true).text = value.to_s
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
class JulianDateTimeNode < DateTimeNode
|
26
|
-
def extract_attr_value(xml)
|
27
|
-
txt = default_when_xpath_err{ @path.first(xml).text }
|
28
|
-
DateTime.jd(txt.to_i)
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
class UtcTimestampNode < DateTimeNode
|
33
|
-
def set_attr_value(xml, value)
|
34
|
-
raise RuntimeError, "Not a date/time: #{value}" unless Time === value
|
35
|
-
@path.first(xml, :ensure_created => true).text = value.to_s
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
class UtcDateTimeNode < DateTimeNode
|
40
|
-
def set_attr_value(xml, value)
|
41
|
-
raise RuntimeError, "Not a date/time: #{value}" unless Time === value
|
42
|
-
@path.first(xml, :ensure_created => true).text = value.getutc.xmlschema
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
module Misc
|
47
|
-
def raise_error(value)
|
48
|
-
raise RuntimeError, "Not a valid choice: #{value}. Choose one of: #{@options[:choices].join(', ')}"
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
class TextEnumerationNode < XML::Mapping::TextNode
|
53
|
-
include Misc
|
54
|
-
|
55
|
-
def extract_attr_value(xml)
|
56
|
-
txt = default_when_xpath_err{ @path.first(xml).text }
|
57
|
-
self.raise_error("#{txt} in #{xml.parent}") if !@options[:choices].include?(txt)
|
58
|
-
|
59
|
-
return txt
|
60
|
-
end
|
61
|
-
|
62
|
-
def set_attr_value(xml, value)
|
63
|
-
self.raise_error(value) unless @options[:choices].include?(value)
|
64
|
-
@path.first(xml, :ensure_created => true).text = value.to_s
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
class NumericEnumerationNode < XML::Mapping::NumericNode
|
69
|
-
include Misc
|
70
|
-
|
71
|
-
def extract_attr_value(xml)
|
72
|
-
txt = default_when_xpath_err{ @path.first(xml).text }
|
73
|
-
|
74
|
-
num = nil
|
75
|
-
begin
|
76
|
-
num = Integer(txt)
|
77
|
-
rescue ArgumentError
|
78
|
-
num = Float(txt)
|
79
|
-
end
|
80
|
-
|
81
|
-
self.raise_error(txt) if !@options[:choices].include?(num)
|
82
|
-
|
83
|
-
return num
|
84
|
-
end
|
85
|
-
|
86
|
-
def set_attr_value(xml, value)
|
87
|
-
raise RuntimeError, "Not an integer: #{value}" unless Numeric === value
|
88
|
-
self.raise_error(value) unless @options[:choices].include?(value)
|
89
|
-
@path.first(xml,:ensure_created=>true).text = value.to_s
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
# This is a copy of ObjectNode, but using REXML's full XPath
|
94
|
-
# implementation (i.e. not pre-compiling expressions). It's
|
95
|
-
# potentially slower but necessary for some schema.
|
96
|
-
class FullObjectNode < XML::Mapping::SubObjectBaseNode
|
97
|
-
# Initializer. _path_ (a string denoting an XPath expression) is
|
98
|
-
# the location of the subtree.
|
99
|
-
def initialize_impl(path)
|
100
|
-
super
|
101
|
-
@path_str = path
|
102
|
-
end
|
103
|
-
|
104
|
-
def extract_attr_value(xml) # :nodoc:
|
105
|
-
paths = []
|
106
|
-
@path_str.split(/\s*\|\s*/).each{ |path|
|
107
|
-
paths << path
|
108
|
-
xml.prefixes.each{ |prefix|
|
109
|
-
paths << "#{prefix}:#{path}"
|
110
|
-
}
|
111
|
-
}
|
112
|
-
xpath = paths.join('|')
|
113
|
-
|
114
|
-
result = default_when_xpath_err{REXML::XPath.first(xml, xpath)}
|
115
|
-
result ? @options[:unmarshaller].call(result): nil
|
116
|
-
end
|
117
|
-
|
118
|
-
def set_attr_value(xml, value) # :nodoc:
|
119
|
-
@options[:marshaller].call(@path.first(xml,:ensure_created=>true), value)
|
120
|
-
end
|
121
|
-
end
|
122
|
-
|
123
|
-
class FullArrayNode < XML::Mapping::SubObjectBaseNode
|
124
|
-
# Initializer, delegates to do_initialize. Called with keyword
|
125
|
-
# arguments and either 1 or 2 paths; the hindmost path argument
|
126
|
-
# passed is delegated to _per_arrelement_path_; the preceding
|
127
|
-
# path argument (if present, "" by default) is delegated to
|
128
|
-
# _base_path_.
|
129
|
-
def initialize_impl(path,path2=nil)
|
130
|
-
super
|
131
|
-
if path2
|
132
|
-
do_initialize(path,path2)
|
133
|
-
else
|
134
|
-
do_initialize("",path)
|
135
|
-
end
|
136
|
-
end
|
137
|
-
|
138
|
-
# "Real" initializer.
|
139
|
-
def do_initialize(base_path, per_arrelement_path)
|
140
|
-
@base_path = base_path
|
141
|
-
@per_arrelement_path = per_arrelement_path
|
142
|
-
end
|
143
|
-
|
144
|
-
def extract_attr_value(xml) # :nodoc:
|
145
|
-
paths = []
|
146
|
-
@per_arrelement_path.split(/\s*\|\s*/).each{ |path|
|
147
|
-
paths << path
|
148
|
-
xml.prefixes.each{ |prefix|
|
149
|
-
paths << "#{prefix}:#{path}"
|
150
|
-
}
|
151
|
-
}
|
152
|
-
xpath = @base_path + '(' + paths.join('|') + ')'
|
153
|
-
|
154
|
-
result = []
|
155
|
-
default_when_xpath_err{REXML::XPath.match(xml, xpath)}.each do |elt|
|
156
|
-
result << @options[:unmarshaller].call(elt)
|
157
|
-
end
|
158
|
-
|
159
|
-
result
|
160
|
-
end
|
161
|
-
|
162
|
-
def set_attr_value(xml, value) # :nodoc:
|
163
|
-
base_elt = @base_path.first(xml,:ensure_created=>true)
|
164
|
-
value.each do |arr_elt|
|
165
|
-
@options[:marshaller].call(@per_arrelement_path.create_new(base_elt), arr_elt)
|
166
|
-
end
|
167
|
-
end
|
168
|
-
end
|
169
|
-
|
170
|
-
class TextFloatArrayNode < XML::Mapping::TextNode
|
171
|
-
def extract_attr_value(xml)
|
172
|
-
txt = default_when_xpath_err{ @path.first(xml).text }
|
173
|
-
|
174
|
-
nums = []
|
175
|
-
txt.split(/\s+/).each do |str|
|
176
|
-
nums << str.to_f
|
177
|
-
end
|
178
|
-
|
179
|
-
return nums
|
180
|
-
end
|
181
|
-
|
182
|
-
def set_attr_value(xml, value)
|
183
|
-
raise RuntimeError, "Not an array: #{value}" unless Array === value
|
184
|
-
@path.first(xml, :ensure_created=>true).text = value.join(' ')
|
185
|
-
end
|
186
|
-
end
|
187
|
-
|
188
|
-
end
|
189
|
-
end
|
190
|
-
end
|
@@ -1,54 +0,0 @@
|
|
1
|
-
require 'voruby/resources/openskynode/loader'
|
2
|
-
|
3
|
-
require 'voruby/resources/voresource/voresource_v0_10'
|
4
|
-
require 'voruby/resources/vodataservice/vodataservice_v0_5'
|
5
|
-
|
6
|
-
include VORuby::Resources::VOResource::V0_10
|
7
|
-
include VORuby::Resources::VODataService::V0_5
|
8
|
-
|
9
|
-
module VORuby
|
10
|
-
module Resources
|
11
|
-
module OpenSkyNode
|
12
|
-
module V0_1
|
13
|
-
|
14
|
-
# Forward declarations
|
15
|
-
class OpenSkyNode < TabularSkyService; end
|
16
|
-
class OSNCapRestriction < Capability; end
|
17
|
-
class OSNCapability < OSNCapRestriction; end
|
18
|
-
|
19
|
-
|
20
|
-
# Registry data for the standard openskynode service.
|
21
|
-
class OpenSkyNode
|
22
|
-
object_node :capability, 'capability', :class => OSNCapability, :optional => false
|
23
|
-
end
|
24
|
-
|
25
|
-
# An abstract capability that sets the standardURL to the OpenSkyNode standard definition.
|
26
|
-
class OSNCapRestriction
|
27
|
-
object_node :standard_id, 'StandardID', :class => IdentifierURI, :optional => true
|
28
|
-
object_node :standard_url, 'StandardURL', :class => AnyURI, :optional => true,
|
29
|
-
:default_value => 'http://www.ivoa.net/internal/IVOA/IvoaVOQL/SkyNodeInterface-0.7.4.pdf'
|
30
|
-
end
|
31
|
-
|
32
|
-
# The capabilities of an OpenSkyNode implementation. It includes required parameters for OpenSkyQuery portal.
|
33
|
-
class OSNCapability
|
34
|
-
# indicates level of compliance: full, basic, partial for OSN. A full node
|
35
|
-
# must implement all the methods of the Spec including ExecutePlan.
|
36
|
-
# A Basic node only needs performQuery, tables, columns and availability.
|
37
|
-
text_node :compliance, 'Compliance', :optional => false
|
38
|
-
# table name which contains the main positions and key - used by the query builder on the portal
|
39
|
-
text_node :primary_table, 'PrimaryTable', :optional => false
|
40
|
-
# the primary key of the primary Table - used by the query builder on the portal
|
41
|
-
text_node :primary_key, 'PrimaryKey', :optional => false
|
42
|
-
|
43
|
-
# the latitude Earth position of archive (GPS)
|
44
|
-
numeric_node :latitude, 'Latitude', :optional => false
|
45
|
-
# the longitude Earth position of archive (GPS)
|
46
|
-
numeric_node :longitude, 'Longitude', :optional => false
|
47
|
-
# maximum records the service will return
|
48
|
-
numeric_node :max_records, 'MaxRecords', :optional => false
|
49
|
-
end
|
50
|
-
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
@@ -1,90 +0,0 @@
|
|
1
|
-
require 'voruby/resources/sia/loader'
|
2
|
-
|
3
|
-
require 'voruby/resources/voresource/voresource_v0_9'
|
4
|
-
require 'voruby/resources/vodataservice/vodataservice_v0_3'
|
5
|
-
|
6
|
-
include VORuby::Resources::VOResource::V0_9
|
7
|
-
include VORuby::Resources::VODataService::V0_3
|
8
|
-
|
9
|
-
module VORuby
|
10
|
-
module Resources
|
11
|
-
module SIA
|
12
|
-
module V0_6
|
13
|
-
|
14
|
-
# Forward declarations
|
15
|
-
class SimpleImageAccessType < Capability; end
|
16
|
-
class SimpleImageAccess < SimpleImageAccessType; end
|
17
|
-
class MaxRecords; end
|
18
|
-
class MaxFileSize; end
|
19
|
-
class MaxQueryRegionSize; end
|
20
|
-
class MaxImageExtent; end
|
21
|
-
class MaxImageSize; end
|
22
|
-
class ImageServiceType; end
|
23
|
-
|
24
|
-
# The capabilities of an SIA implementation. It includes
|
25
|
-
# the listing of the columns that appear in image query
|
26
|
-
# output VOTable and SIA-specific metadata.
|
27
|
-
class SimpleImageAccess; end
|
28
|
-
class SimpleImageAccessType
|
29
|
-
object_node :image_service_type, 'ImageServiceType', :class => ImageServiceType, :optional => false
|
30
|
-
object_node :max_query_region_size, 'MaxQueryRegionSize', :class => MaxQueryRegionSize, :optional => false
|
31
|
-
object_node :max_image_extent, 'MaxImageExtent', :class => MaxImageExtent, :optional => false
|
32
|
-
object_node :max_image_size, 'MaxImageSize', :class => MaxImageSize, :optional => false
|
33
|
-
object_node :max_file_size, 'MaxFileSize', :class => MaxFileSize, :optional => false
|
34
|
-
object_node :max_records, 'MaxRecords', :class => MaxRecords, :optional => false
|
35
|
-
end
|
36
|
-
|
37
|
-
# The largest number of records that the Image Query web method will return.
|
38
|
-
class MaxRecords
|
39
|
-
include XML::Mapping
|
40
|
-
|
41
|
-
numeric_node :value, '', :optional => false
|
42
|
-
end
|
43
|
-
|
44
|
-
# The maximum image file size in bytes.
|
45
|
-
class MaxFileSize
|
46
|
-
include XML::Mapping
|
47
|
-
|
48
|
-
numeric_node :value, '', :optional => false
|
49
|
-
end
|
50
|
-
|
51
|
-
# The maximum image query region size, expressed in decimal
|
52
|
-
# degrees. A value of 360 degrees indicates that there is no limit
|
53
|
-
# and the entire data collection (entire sky) can be queried.
|
54
|
-
class MaxQueryRegionSize
|
55
|
-
include XML::Mapping
|
56
|
-
|
57
|
-
numeric_node :long, 'long', :optional => false
|
58
|
-
numeric_node :lat, 'lat', :optional => false
|
59
|
-
end
|
60
|
-
|
61
|
-
# The maximum image query region size, expressed in decimal
|
62
|
-
# degrees. A value of 360 degrees indicates that there is no limit
|
63
|
-
# and the entire data collection (entire sky) can be requested.
|
64
|
-
class MaxImageExtent
|
65
|
-
include XML::Mapping
|
66
|
-
|
67
|
-
numeric_node :long, 'long', :optional => false
|
68
|
-
numeric_node :lat, 'lat', :optional => false
|
69
|
-
end
|
70
|
-
|
71
|
-
# The largest image (in terms of pixels) that can be requested.
|
72
|
-
class MaxImageSize
|
73
|
-
include XML::Mapping
|
74
|
-
|
75
|
-
numeric_node :long, 'long', :optional => false
|
76
|
-
numeric_node :lat, 'lat', :optional => false
|
77
|
-
end
|
78
|
-
|
79
|
-
# The class of image service: Cutout, Mosaic, Atlas, Pointed.
|
80
|
-
class ImageServiceType
|
81
|
-
include XML::Mapping
|
82
|
-
|
83
|
-
text_enumeration_node :value, '', :optional => false,
|
84
|
-
:choices => ['Cutout', 'Mosaic', 'Atlas', 'Pointed']
|
85
|
-
end
|
86
|
-
|
87
|
-
end
|
88
|
-
end
|
89
|
-
end
|
90
|
-
end
|
@@ -1,89 +0,0 @@
|
|
1
|
-
require 'voruby/resources/sia/loader'
|
2
|
-
|
3
|
-
require 'voruby/resources/voresource/voresource_v0_10'
|
4
|
-
require 'voruby/resources/vodataservice/vodataservice_v0_5'
|
5
|
-
|
6
|
-
include VORuby::Resources::VOResource::V0_10
|
7
|
-
include VORuby::Resources::VODataService::V0_5
|
8
|
-
|
9
|
-
module VORuby
|
10
|
-
module Resources
|
11
|
-
module SIA
|
12
|
-
module V0_7
|
13
|
-
|
14
|
-
# Forward declarations
|
15
|
-
class SimpleImageAccess < TabularSkyService; end
|
16
|
-
class SIACapRestriction < Capability; end
|
17
|
-
class SIACapability < SIACapRestriction; end
|
18
|
-
class SkySize; end
|
19
|
-
class ImageSize; end
|
20
|
-
class ImageServiceType; end
|
21
|
-
|
22
|
-
# The capabilities of an SIA implementation. It includes
|
23
|
-
# the listing of the columns that appear in image query
|
24
|
-
# output VOTable and SIA-specific metadata.
|
25
|
-
class SimpleImageAccess
|
26
|
-
# a description of the behavior and limitations of the SIA implementation
|
27
|
-
object_node :capability, 'capability', :class => SIACapability, :optional => false
|
28
|
-
end
|
29
|
-
|
30
|
-
# An abstract capability that sets the standardURL to the ConeSearch standard definition,
|
31
|
-
class SIACapRestriction
|
32
|
-
object_node :standard_id, '@standardID', :class => IdentifierURI, :optional => true
|
33
|
-
object_node :standard_url, '@standardURL', :class => AnyURI, :optional => true,
|
34
|
-
:default_value => 'http://www.us-vo.org/metadata/sia.html'
|
35
|
-
end
|
36
|
-
|
37
|
-
# The capabilities of an SIA implementation.
|
38
|
-
class SIACapability
|
39
|
-
# the class of image service: Cutout, Mosaic, Atlas, Pointed
|
40
|
-
object_node :image_service_type, 'imageServiceType', :class => ImageServiceType, :optional => false
|
41
|
-
# the maximum image query region size, expressed in
|
42
|
-
# decimal degrees. A value of 360 degrees indicates that
|
43
|
-
# there is no limit and the entire data collection
|
44
|
-
# (entire sky) can be queried.
|
45
|
-
object_node :max_query_region_size, 'maxQueryRegionSize', :class => SkySize, :optional => false
|
46
|
-
# the maximum image query region size, expressed in
|
47
|
-
# decimal degrees. A value of 360 degrees indicates
|
48
|
-
# that there is no limit and the entire data collection
|
49
|
-
# (entire sky) can be requested.
|
50
|
-
object_node :max_image_extent, 'maxImageExtent', :class => SkySize, :optional => false
|
51
|
-
# the largest image (in terms of pixels) that can be requested.
|
52
|
-
object_node :max_image_size, 'maxImageSize', :class => ImageSize, :optional => false
|
53
|
-
|
54
|
-
# the maximum image file size in bytes
|
55
|
-
numeric_node :max_file_size, 'maxFileSize', :optional => false
|
56
|
-
# the largest number of records that the Image Query web method will return
|
57
|
-
numeric_node :max_records, 'maxRecords', :optional => false
|
58
|
-
end
|
59
|
-
|
60
|
-
class SkySize
|
61
|
-
include XML::Mapping
|
62
|
-
|
63
|
-
# the maximum size in the longitude (R.A.) direction
|
64
|
-
numeric_node :long, 'long', :optional => false
|
65
|
-
# the maximum size in the latitdude (Dec.) direction
|
66
|
-
numeric_node :lat, 'lat', :optional => false
|
67
|
-
end
|
68
|
-
|
69
|
-
class ImageSize
|
70
|
-
include XML::Mapping
|
71
|
-
|
72
|
-
# the image size in the longitude (R.A.) direction in pixels
|
73
|
-
numeric_node :long, 'long', :optional => false
|
74
|
-
# the image size in the latitdude (Dec.) direction in pixels
|
75
|
-
numeric_node :lat, 'lat', :optional => false
|
76
|
-
end
|
77
|
-
|
78
|
-
# the class of image service: Cutout, Mosaic, Atlas, Pointed
|
79
|
-
class ImageServiceType
|
80
|
-
include XML::Mapping
|
81
|
-
|
82
|
-
text_enumeration_node :value, '', :optional => false,
|
83
|
-
:choices => ['Cutout', 'Mosaic', 'Atlas', 'Pointed']
|
84
|
-
end
|
85
|
-
|
86
|
-
end
|
87
|
-
end
|
88
|
-
end
|
89
|
-
end
|