voruby 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
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,66 @@
1
+ require 'test/unit'
2
+ require 'voruby/plastic/plastic'
3
+
4
+ include VORuby::Plastic
5
+
6
+ class BasicAppTest < Test::Unit::TestCase
7
+ def setup
8
+ @app = Application::Base.new('test_xmlrpc_app1')
9
+ end
10
+
11
+ def test_app_registration
12
+ puts "Hub ID is: #{@app.hub_id}"
13
+
14
+ puts "Registering app..."
15
+ @app.register()
16
+ puts "\tID is: #{@app.app_id}"
17
+
18
+ puts "Listing registered apps:"
19
+ @app.get_registered_ids().each do |uri|
20
+ reg_line = "\t#{uri}"
21
+ app_name = @app.get_name(uri)
22
+ reg_line << " [#{app_name}]" if name
23
+ reg_line << " (hub)" if uri == @app.hub_id
24
+ puts reg_line
25
+
26
+ puts "\t\tUnderstood messages:"
27
+ @app.get_understood_messages(uri).each do |message|
28
+ puts "\t\t\t#{message}"
29
+ end
30
+ end
31
+
32
+ puts "Core message inventory:"
33
+ Messages::CORE_MESSAGES.each do |msg|
34
+ puts "\t#{msg}"
35
+ @app.get_message_registered_ids(msg).each do |app_id|
36
+ puts "\t\t#{app_id}"
37
+ end
38
+ end
39
+ end
40
+
41
+ def test_app_requests
42
+ puts "Asking registered apps to..."
43
+
44
+ puts "\t#{Messages::TEST_ECHO}"
45
+ @app.request(Messages::TEST_ECHO, 'Hello, world!').each do |app_id, response|
46
+ puts "\t\t#{app_id} -> #{response}"
47
+ end
48
+
49
+ Messages::CORE_MESSAGES.delete_if{ |msg|
50
+ msg == Messages::TEST_ECHO ||
51
+ msg == Messages::HUB_EVENT_APPLICATION_REGISTERED ||
52
+ msg == Messages::HUB_EVENT_APPLICATION_UNREGISTERED ||
53
+ msg == Messages::HUB_EVENT_HUB_STOPPING
54
+ }.each do |msg|
55
+ puts "\t#{msg}"
56
+ @app.request(msg).each do |app_id, response|
57
+ puts "\t\t#{app_id} -> #{response}"
58
+ end
59
+ end
60
+ end
61
+
62
+ def teardown
63
+ puts "Unregistering app #{@app.app_id}..."
64
+ @app.unregister()
65
+ end
66
+ end
@@ -0,0 +1,31 @@
1
+ <Resource xmlns:q1="http://www.ivoa.net/xml/ConeSearch/v0.3" xsi:type="q1:ConeSearch" updated="2005-04-08">
2
+ <title xmlns="http://www.ivoa.net/xml/VOResource/v0.10">Copernicus Satellite</title>
3
+ <shortName xmlns="http://www.ivoa.net/xml/VOResource/v0.10">Copernicus </shortName>
4
+ <identifier xmlns="http://www.ivoa.net/xml/VOResource/v0.10">ivo://archive.stsci.edu/copernicus</identifier>
5
+ <curation xmlns="http://www.ivoa.net/xml/VOResource/v0.10">
6
+ <publisher>Space Telescope Science </publisher>
7
+
8
+ <contributor>Princeton University</contributor>
9
+ <version>NOT PROVIDED</version>
10
+ </curation>
11
+ <content xmlns="http://www.ivoa.net/xml/VOResource/v0.10">
12
+ <subject>Stars</subject>
13
+ <subject> Hot stars</subject>
14
+
15
+ <subject> Cool stars</subject>
16
+ <subject> Variable stars</subject>
17
+ <description>The Copernicus satellite, otherwise known as the Orbiting Astronomical Observatory 3 (OAO-3), obtained a series of high resolution far- (900-1560 Å) and near- (1650-3150 Å) ultraviolet spectral scans of 551 objects, primarily bright stars, from 1972 to 1981.</description>
18
+ <referenceURL>http://archive.stsci.edu/copernicus/</referenceURL>
19
+ <contentLevel>Research</contentLevel>
20
+
21
+ </content>
22
+ <interface xmlns:q2="http://www.ivoa.net/xml/VODataService/v0.5" xsi:type="q2:ParamHTTP"
23
+ xmlns="http://www.ivoa.net/xml/VOResource/v0.10">
24
+ <accessURL>http://archive.stsci.edu/copernicus/search.php?</accessURL>
25
+ </interface>
26
+ <q1:capability>
27
+ <q1:maxSR>180</q1:maxSR>
28
+ <q1:maxRecords>100</q1:maxRecords>
29
+ <q1:verbosity>false</q1:verbosity>
30
+ </q1:capability>
31
+ </Resource>
@@ -0,0 +1,86 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <resource xmlns:vr="http://www.ivoa.net/xml/VOResource/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Service" xsi:schemaLocation="http://www.ivoa.net/xml/VOResource/v1.0 http://www.ivoa.net/xml/VOResource/v1.0" created="2006-08-14T08:00:00" updated="2006-08-14T13:26:00" xmlns:vs="http://www.ivoa.net/xml/VODataService/v1.0" xmlns:cs="http://www.ivoa.net/xml/ConeSearch/v1.0">
3
+ <validationLevel validatedBy="ivo://noao.edu/">2</validationLevel>
4
+ <validationLevel validatedBy="ivo://ncsa.uiuc.edu/">3</validationLevel>
5
+ <title>NCSA Radio Astronomy Imaging</title>
6
+ <shortName>NCSA-RAI</shortName>
7
+ <identifier>ivo://rai.ncsa/RAI</identifier>
8
+ <curation>
9
+ <publisher ivo-id="ivo://ncsa.uiuc/NCSA">
10
+ National Center for Supercomputing Applications
11
+ </publisher>
12
+ <creator>
13
+ <name> Dr. Richard Crutcher </name>
14
+ <logo>
15
+ http://rai.ncsa.uiuc.edu/rai.jpg
16
+ </logo>
17
+ </creator>
18
+ <creator>
19
+ <name> David Gasson </name>
20
+ <logo>
21
+ http://www.noao.edu/rai.jpg
22
+ </logo>
23
+ </creator>
24
+ <contributor>Dave Bell</contributor>
25
+ <contributor>Chris Miller</contributor>
26
+ <date>1993-01-01T02:34:45</date>
27
+ <date>2006-08-14T12:25:23</date>
28
+ <version>1.1</version>
29
+ <contact>
30
+ <name>Dr. Raymond Plante</name>
31
+ <email>rplante@ncsa.uiuc.edu</email>
32
+ </contact>
33
+ <contact>
34
+ <name>David Gasson</name>
35
+ <email>dgasson@noao.edu</email>
36
+ <address>950 N. Cherry Avenue, Tucson, AZ 85719 USA</address>
37
+ <telephone>+1-520-318-8381</telephone>
38
+ </contact>
39
+ </curation>
40
+ <content>
41
+ <subject>radio astronomy</subject>
42
+ <subject>data repositories</subject>
43
+ <subject>digital libraries</subject>
44
+ <subject>grid-based processing</subject>
45
+ <description>
46
+ The Radio Astronomy Imaging Group at the National Center for
47
+ Supercomputing Applications is focused on applying
48
+ high-performance computing to astronomical research. Our
49
+ projects include the NCSA Astronomy Digital Image Library,
50
+ the BIMA Data Archive, the BIMA Image Pipeline, and the
51
+ National Virtual Observatory.
52
+ </description>
53
+ <referenceURL>http://rai.ncsa.uiuc.edu/</referenceURL>
54
+ <source format="bibcode">1989ApJ...342L..71R</source>
55
+ <type>Organisation</type>
56
+ <type>Archive</type>
57
+ <type>Survey</type>
58
+ <contentLevel>Elementary Education</contentLevel>
59
+ <contentLevel>Middle School Education</contentLevel>
60
+ <contentLevel>General</contentLevel>
61
+ <relationship>
62
+ <relationshipType>Relationship 1</relationshipType>
63
+ <relatedResource>http://blah</relatedResource>
64
+ <relatedResource>http://blah2</relatedResource>
65
+ </relationship>
66
+ <relationship>
67
+ <relationshipType>Relationship 2</relationshipType>
68
+ <relatedResource>http://blah3</relatedResource>
69
+ </relationship>
70
+ </content>
71
+ <rights>secure</rights>
72
+ <rights>public</rights>
73
+ <capability xsi:type="cs:ConeSearch">
74
+ <maxSR>54.0</maxSR>
75
+ <maxRecords>2500</maxRecords>
76
+ <verbosity>true</verbosity>
77
+ <testQuery>
78
+ <ra>123.4</ra>
79
+ <dec>45.2</dec>
80
+ <sr>23.2</sr>
81
+ <verb>2</verb>
82
+ <catalog>myCatalog</catalog>
83
+ <extras>param1=blah1&amp;param2=blah2</extras>
84
+ </testQuery>
85
+ </capability>
86
+ </resource>
@@ -0,0 +1,22 @@
1
+ require 'test/unit'
2
+ require 'voruby/resources/conesearch/conesearch_v0_3'
3
+
4
+ include VORuby::Resources::ConeSearch::V0_3
5
+
6
+ class ConeSearchTest < Test::Unit::TestCase
7
+ def setup
8
+ assert_nothing_raised {
9
+ @res = ConeSearch.load_from_file('test/resources/conesearch/conesearch_v0_3.xml')
10
+ }
11
+ end
12
+
13
+ def test_capability
14
+ assert_equal(180, @res.capability.max_sr)
15
+ assert_equal(100, @res.capability.max_records)
16
+ assert_equal(false, @res.capability.verbosity)
17
+ end
18
+
19
+ def test_interface
20
+ assert_equal('http://archive.stsci.edu/copernicus/search.php?', @res.interfaces[0].access_url.value.to_s)
21
+ end
22
+ end
@@ -0,0 +1,24 @@
1
+ require 'test/unit'
2
+ require 'voruby/resources/conesearch/conesearch_v1_0'
3
+
4
+ include VORuby::Resources::ConeSearch::V1_0
5
+
6
+ class ConeSearchTest < Test::Unit::TestCase
7
+ def setup
8
+ assert_nothing_raised {
9
+ @res = Service.load_from_file('test/resources/conesearch/conesearch_v1_0.xml')
10
+ }
11
+ end
12
+
13
+ def test_capabilities
14
+ assert_equal(54.0, @res.capabilities[0].max_sr)
15
+ assert_equal(2500, @res.capabilities[0].max_records)
16
+ assert_equal(true, @res.capabilities[0].verbosity)
17
+ assert_equal(123.4, @res.capabilities[0].test_query.ra)
18
+ assert_equal(45.2, @res.capabilities[0].test_query.dec)
19
+ assert_equal(23.2, @res.capabilities[0].test_query.sr)
20
+ assert_equal(2, @res.capabilities[0].test_query.verb)
21
+ assert_equal('myCatalog', @res.capabilities[0].test_query.catalog)
22
+ assert_equal('param1=blah1&param2=blah2', @res.capabilities[0].test_query.extras)
23
+ end
24
+ end
@@ -0,0 +1,32 @@
1
+ <Resource xmlns:q1="http://www.ivoa.net/xml/OpenSkyNode/v0.1" xsi:type="q1:OpenSkyNode" updated="2005-04-08">
2
+ <title xmlns="http://www.ivoa.net/xml/VOResource/v0.10">Galaxy Evolution Explorer</title>
3
+ <shortName xmlns="http://www.ivoa.net/xml/VOResource/v0.10">GALEX</shortName>
4
+ <identifier xmlns="http://www.ivoa.net/xml/VOResource/v0.10">ivo://archive.stsci.edu/galex/SKYNODE</identifier>
5
+ <curation xmlns="http://www.ivoa.net/xml/VOResource/v0.10">
6
+ <publisher>STScI</publisher>
7
+ <version>V1.0</version>
8
+ </curation>
9
+ <content xmlns="http://www.ivoa.net/xml/VOResource/v0.10">
10
+ <subject>SkyNode</subject>
11
+ <subject>OpenSkyNode</subject>
12
+ <subject>Galaxy</subject>
13
+ <subject>Star</subject>
14
+ <subject>Evolution</subject>
15
+ <subject>GALEX</subject>
16
+ <description>GALEX Open SkyNode. The Galaxy Evolution Explorer (GALEX), a NASA Small Explorer mission, is performing the first all-sky, deep imaging and spectroscopic ultraviolet surveys in space. The prime goal of GALEX is to study star formation in galaxies and its evolution with time.
17
+ </description>
18
+ <contentLevel>General</contentLevel>
19
+ </content>
20
+ <interface xmlns:q2="http://www.ivoa.net/xml/VODataService/v0.5"
21
+ xsi:type="q2:ParamHTTP" xmlns="http://www.ivoa.net/xml/VOResource/v0.10">
22
+ <accessURL use="full">http://galex.stsci.edu/skynode/ogalex/nodeb.asmx</accessURL>
23
+ </interface>
24
+ <q1:capability>
25
+ <q1:Compliance>FULL</q1:Compliance>
26
+ <q1:Latitude>0</q1:Latitude>
27
+ <q1:Longitude>0</q1:Longitude>
28
+ <q1:MaxRecords>0</q1:MaxRecords>
29
+ <q1:PrimaryTable>Photoprimary</q1:PrimaryTable>
30
+ <q1:PrimaryKey>objid</q1:PrimaryKey>
31
+ </q1:capability>
32
+ </Resource>
@@ -0,0 +1,31 @@
1
+ require 'test/unit'
2
+ require 'voruby/resources/openskynode/openskynode_v0_1'
3
+
4
+ include VORuby::Resources::OpenSkyNode::V0_1
5
+
6
+ class OpenSkyNodeTest < Test::Unit::TestCase
7
+ def setup
8
+ assert_nothing_raised {
9
+ @res = OpenSkyNode.load_from_file('test/resources/openskynode/open_sky_node_v0_1.xml')
10
+ }
11
+ end
12
+
13
+ def test_content
14
+ assert_equal('SkyNode', @res.content.subjects[0].value)
15
+ assert_equal('Evolution', @res.content.subjects[4].value)
16
+ end
17
+
18
+ def test_interface
19
+ assert_equal('full', @res.interfaces[0].access_url.use)
20
+ assert_equal('http://galex.stsci.edu/skynode/ogalex/nodeb.asmx', @res.interfaces[0].access_url.value.to_s)
21
+ end
22
+
23
+ def test_capability
24
+ assert_equal('FULL', @res.capability.compliance)
25
+ assert_equal(0, @res.capability.latitude)
26
+ assert_equal(0, @res.capability.longitude)
27
+ assert_equal(0, @res.capability.max_records)
28
+ assert_equal('Photoprimary', @res.capability.primary_table)
29
+ assert_equal('objid', @res.capability.primary_key)
30
+ end
31
+ end
@@ -0,0 +1,36 @@
1
+ <Resource xmlns:q23="http://www.ivoa.net/xml/SIA/v0.7" xsi:type="q23:SimpleImageAccess" updated="2005-08-01">
2
+ <title xmlns="http://www.ivoa.net/xml/VOResource/v0.10">Spitzer First Look Survey (FLS) -- NOAO Extragalactic -- R</title>
3
+ <shortName xmlns="http://www.ivoa.net/xml/VOResource/v0.10">FLS_MAIN_R</shortName>
4
+ <identifier xmlns="http://www.ivoa.net/xml/VOResource/v0.10">ivo://irsa.ipac/FLS_MAIN_R</identifier>
5
+ <curation xmlns="http://www.ivoa.net/xml/VOResource/v0.10">
6
+ <publisher>NASA/IPAC Infrared Science Archive</publisher>
7
+ <contributor>NOT PROVIDED</contributor>
8
+ <version>NOT PROVIDED</version>
9
+ </curation>
10
+ <content xmlns="http://www.ivoa.net/xml/VOResource/v0.10">
11
+ <description>
12
+ The Spitzer First Look Survey has obtained approximately 30 pointings with the NOAO MOSAIC camera on the Kitt Peak 4m telescope covering the entire extragalactic First Look Survey region in the R-band. Available to the public are image FITS files, bad pixel maps, exposure maps and source catalogs of each pointing.
13
+ </description>
14
+ <referenceURL>http://irsa.ipac.caltech.edu/data/SPITZER/FLS_MAIN_R</referenceURL>
15
+ <contentLevel>Research</contentLevel>
16
+ </content>
17
+ <q23:capability>
18
+ <q23:imageServiceType>Cutout</q23:imageServiceType>
19
+ <q23:maxQueryRegionSize>
20
+ <q23:long>0</q23:long>
21
+ <q23:lat>0</q23:lat>
22
+ </q23:maxQueryRegionSize>
23
+
24
+ <q23:maxImageExtent>
25
+ <q23:long>0</q23:long>
26
+ <q23:lat>0</q23:lat>
27
+ </q23:maxImageExtent>
28
+ <q23:maxImageSize>
29
+ <q23:long>0</q23:long>
30
+ <q23:lat>0</q23:lat>
31
+
32
+ </q23:maxImageSize>
33
+ <q23:maxFileSize>0</q23:maxFileSize>
34
+ <q23:maxRecords>0</q23:maxRecords>
35
+ </q23:capability>
36
+ </Resource>
@@ -0,0 +1,122 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <resource xsi:type="Service"
3
+ xmlns:vr="http://www.ivoa.net/xml/VOResource/v1.0"
4
+ xmlns:sia="http://www.ivoa.net/xml/SIA/v1.0"
5
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6
+ xsi:schemaLocation="http://www.ivoa.net/xml/VOResource/v1.0
7
+ http://www.ivoa.net/xml/VOResource/v1.0"
8
+ created="2006-08-14T08:00:00"
9
+ updated="2006-08-14T13:26:00">
10
+
11
+ <validationLevel validatedBy="ivo://noao.edu/">2</validationLevel>
12
+ <validationLevel validatedBy="ivo://ncsa.uiuc.edu/">3</validationLevel>
13
+
14
+ <title>NCSA Radio Astronomy Imaging</title>
15
+ <shortName>NCSA-RAI</shortName>
16
+ <identifier>ivo://rai.ncsa/RAI</identifier>
17
+
18
+ <curation>
19
+ <publisher ivo-id="ivo://ncsa.uiuc/NCSA">
20
+ National Center for Supercomputing Applications
21
+ </publisher>
22
+ <creator>
23
+ <name> Dr. Richard Crutcher </name>
24
+ <logo>
25
+ http://rai.ncsa.uiuc.edu/rai.jpg
26
+ </logo>
27
+ </creator>
28
+ <creator>
29
+ <name> David Gasson </name>
30
+ <logo>
31
+ http://www.noao.edu/rai.jpg
32
+ </logo>
33
+ </creator>
34
+ <contributor>Dave Bell</contributor>
35
+ <contributor>Chris Miller</contributor>
36
+ <date>1993-01-01T02:34:45</date>
37
+ <date>2006-08-14T12:25:23</date>
38
+ <version>1.1</version>
39
+ <contact>
40
+ <name>Dr. Raymond Plante</name>
41
+ <email>rplante@ncsa.uiuc.edu</email>
42
+ </contact>
43
+ <contact>
44
+ <name>David Gasson</name>
45
+ <email>dgasson@noao.edu</email>
46
+ <address>950 N. Cherry Avenue, Tucson, AZ 85719 USA</address>
47
+ <telephone>+1-520-318-8381</telephone>
48
+ </contact>
49
+ </curation>
50
+
51
+ <content>
52
+ <subject>radio astronomy</subject>
53
+ <subject>data repositories</subject>
54
+ <subject>digital libraries</subject>
55
+ <subject>grid-based processing</subject>
56
+ <description>
57
+ The Radio Astronomy Imaging Group at the National Center for
58
+ Supercomputing Applications is focused on applying
59
+ high-performance computing to astronomical research. Our
60
+ projects include the NCSA Astronomy Digital Image Library,
61
+ the BIMA Data Archive, the BIMA Image Pipeline, and the
62
+ National Virtual Observatory.
63
+ </description>
64
+ <referenceURL>http://rai.ncsa.uiuc.edu/</referenceURL>
65
+ <source format="bibcode">1989ApJ...342L..71R</source>
66
+ <type>Organisation</type>
67
+ <type>Archive</type>
68
+ <type>Survey</type>
69
+ <contentLevel>Elementary Education</contentLevel>
70
+ <contentLevel>Middle School Education</contentLevel>
71
+ <contentLevel>General</contentLevel>
72
+ <relationship>
73
+ <relationshipType>Relationship 1</relationshipType>
74
+ <relatedResource>http://blah</relatedResource>
75
+ <relatedResource>http://blah2</relatedResource>
76
+ </relationship>
77
+ <relationship>
78
+ <relationshipType>Relationship 2</relationshipType>
79
+ <relatedResource>http://blah3</relatedResource>
80
+ </relationship>
81
+ </content>
82
+
83
+ <rights>secure</rights>
84
+ <rights>public</rights>
85
+
86
+ <capability xsi:type="sia:SimpleImageAccess">
87
+ <validationLevel validatedBy="ivo://noao.edu/">1</validationLevel>
88
+ <validationLevel validatedBy="ivo://ncsa.uiuc.edu/">3</validationLevel>
89
+ <description>This is a fake capability signifying nothing.</description>
90
+ <imageServiceType>Cutout</imageServiceType>
91
+ <maxQueryRegionSize><long>23.1</long><lat>9.0</lat></maxQueryRegionSize>
92
+ <maxImageExtent><long>43.2</long><lat>16.9</lat></maxImageExtent>
93
+ <maxImageSize><long>2501</long><lat>1234</lat></maxImageSize>
94
+ <maxFileSize>2500</maxFileSize>
95
+ <maxRecords>1000</maxRecords>
96
+ <testQuery>
97
+ <pos><long>23.2</long><lat>16.5</lat></pos>
98
+ <size><long>345.8</long><lat>234.6</lat></size>
99
+ <verb>2</verb>
100
+ <extras>param1=blah&amp;param2=blah2</extras>
101
+ </testQuery>
102
+ </capability>
103
+
104
+ <facility>Facility 1</facility>
105
+ <facility>Facility 2</facility>
106
+
107
+ <instrument>MOSA</instrument>
108
+ <instrument>MOSAIC</instrument>
109
+
110
+ <table role="out">
111
+ <name>Fake catalog</name>
112
+ <description>This is a fake catalog</description>
113
+ <column>
114
+ <dataType>string</dataType>
115
+ <name>StringCol</name>
116
+ <description>A string in a column</description>
117
+ </column>
118
+ <column std="true">
119
+ <dataType arraysize="2x2">float</dataType>
120
+ </column>
121
+ </table>
122
+ </resource>
@@ -0,0 +1,24 @@
1
+ require 'test/unit'
2
+ require 'voruby/resources/sia/sia_v0_7'
3
+
4
+ include VORuby::Resources::SIA::V0_7
5
+
6
+ class SimpleImageAccessTest < Test::Unit::TestCase
7
+ def setup
8
+ assert_nothing_raised {
9
+ @res = SimpleImageAccess.load_from_file('test/resources/sia/simple_image_access_v0_7.xml')
10
+ }
11
+ end
12
+
13
+ def test_capability
14
+ assert_equal('Cutout', @res.capability.image_service_type.value)
15
+ assert_equal(0, @res.capability.max_query_region_size.long)
16
+ assert_equal(0, @res.capability.max_query_region_size.lat)
17
+ assert_equal(0, @res.capability.max_image_extent.long)
18
+ assert_equal(0, @res.capability.max_image_extent.lat)
19
+ assert_equal(0, @res.capability.max_image_size.lat)
20
+ assert_equal(0, @res.capability.max_image_size.long)
21
+ assert_equal(0, @res.capability.max_file_size)
22
+ assert_equal(0, @res.capability.max_records)
23
+ end
24
+ end
@@ -0,0 +1,29 @@
1
+ require 'test/unit'
2
+ require 'voruby/resources/sia/sia_v1_0'
3
+
4
+ include VORuby::Resources::SIA::V1_0
5
+
6
+ class SimpleImageAccessTest < Test::Unit::TestCase
7
+ def setup
8
+ assert_nothing_raised {
9
+ @res = Service.load_from_file('test/resources/sia/simple_image_access_v1_0.xml')
10
+ }
11
+ end
12
+
13
+ def test_capability
14
+ assert_equal('Cutout', @res.capabilities[0].image_service_type.value)
15
+ assert_equal(23.1, @res.capabilities[0].max_query_region_size.long)
16
+ assert_equal(9.0, @res.capabilities[0].max_query_region_size.lat)
17
+ assert_equal(43.2, @res.capabilities[0].max_image_extent.long)
18
+ assert_equal(16.9, @res.capabilities[0].max_image_extent.lat)
19
+ assert_equal(2501, @res.capabilities[0].max_image_size.long)
20
+ assert_equal(1234, @res.capabilities[0].max_image_size.lat)
21
+ assert_equal(1000, @res.capabilities[0].max_records)
22
+ assert_equal(23.2, @res.capabilities[0].test_query.pos.long)
23
+ assert_equal(16.5, @res.capabilities[0].test_query.pos.lat)
24
+ assert_equal(345.8, @res.capabilities[0].test_query.size.long)
25
+ assert_equal(234.6, @res.capabilities[0].test_query.size.lat)
26
+ assert_equal(2, @res.capabilities[0].test_query.verb)
27
+ assert_equal('param1=blah&param2=blah2', @res.capabilities[0].test_query.extras)
28
+ end
29
+ end