rtm 0.1.6 → 0.2

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 (163) hide show
  1. data/DISCLAIMER +10 -33
  2. data/LICENSE +201 -0
  3. data/README +32 -3
  4. data/lib/rtm.rb +126 -74
  5. data/lib/rtm/axes.rb +298 -0
  6. data/lib/rtm/axes/association.rb +76 -0
  7. data/lib/rtm/axes/associations.rb +96 -0
  8. data/lib/rtm/axes/assocs_names_occs.rb +56 -0
  9. data/lib/rtm/axes/characteristic.rb +68 -0
  10. data/lib/rtm/axes/characteristics.rb +93 -0
  11. data/lib/rtm/axes/string.rb +76 -0
  12. data/lib/rtm/axes/strings.rb +87 -0
  13. data/lib/rtm/axes/topic.rb +233 -0
  14. data/lib/rtm/axes/topics.rb +280 -0
  15. data/lib/rtm/{backward_compatibility.rb → deprecated/index_property_set.rb} +3 -0
  16. data/lib/rtm/engine.rb +101 -0
  17. data/lib/rtm/extensions.rb +65 -5
  18. data/lib/rtm/{locator_helpers.rb → helpers/locator.rb} +15 -4
  19. data/lib/rtm/{helpers.rb → helpers/no_output.rb} +3 -0
  20. data/lib/rtm/helpers/uri.rb +13 -0
  21. data/lib/rtm/io.rb +19 -0
  22. data/lib/rtm/io/from_xtm2_libxml.rb +2 -1
  23. data/lib/rtm/io/tmapix_from.rb +155 -0
  24. data/lib/rtm/io/tmapix_to.rb +223 -0
  25. data/lib/rtm/io/to_hash.rb +154 -0
  26. data/lib/rtm/io/to_jtm.rb +53 -103
  27. data/lib/rtm/io/to_rdf.rb +45 -0
  28. data/lib/rtm/io/to_string.rb +21 -8
  29. data/lib/rtm/io/to_xtm1.rb +6 -4
  30. data/lib/rtm/io/to_xtm2.rb +10 -8
  31. data/lib/rtm/io/to_yaml.rb +59 -100
  32. data/lib/rtm/navigation.rb +23 -0
  33. data/lib/rtm/navigation/association/players.rb +25 -0
  34. data/lib/rtm/navigation/name/atomify.rb +19 -0
  35. data/lib/rtm/navigation/name/characteristics.rb +33 -0
  36. data/lib/rtm/navigation/occurrence/atomify.rb +19 -0
  37. data/lib/rtm/navigation/occurrence/characteristics.rb +33 -0
  38. data/lib/rtm/navigation/topic/characteristics.rb +33 -0
  39. data/lib/rtm/navigation/topic/indicators.rb +31 -0
  40. data/lib/rtm/navigation/topic/items.rb +31 -0
  41. data/lib/rtm/navigation/topic/locators.rb +31 -0
  42. data/lib/rtm/navigation/topic/players.rb +27 -0
  43. data/lib/rtm/navigation/topic/supertypes.rb +166 -0
  44. data/lib/rtm/navigation/topic/traverse.rb +51 -0
  45. data/lib/rtm/navigation/topic/types.rb +109 -0
  46. data/lib/rtm/psi.rb +39 -2
  47. data/lib/rtm/sugar.rb +47 -0
  48. data/lib/rtm/sugar/association/hash_access.rb +46 -0
  49. data/lib/rtm/sugar/occurrence/dynamic_value.rb +58 -0
  50. data/lib/rtm/sugar/occurrence/external.rb +53 -0
  51. data/lib/rtm/sugar/reifiable/reifier.rb +21 -0
  52. data/lib/rtm/sugar/role/counterparts.rb +139 -46
  53. data/lib/rtm/sugar/topic/best_name.rb +74 -0
  54. data/lib/rtm/sugar/topic/characteristics.rb +126 -12
  55. data/lib/rtm/sugar/topic/counterparts.rb +145 -10
  56. data/lib/rtm/sugar/topic/hash_access.rb +140 -30
  57. data/lib/rtm/sugar/topic/scoped.rb +114 -0
  58. data/lib/rtm/sugar/topic/topic_ref.rb +86 -0
  59. data/lib/rtm/sugar/topic/typed.rb +207 -0
  60. data/lib/rtm/sugar/topic_map/query_cache.rb +66 -0
  61. data/lib/rtm/sugar/topic_map/themes.rb +53 -0
  62. data/lib/rtm/sugar/typed/types.rb +38 -0
  63. data/lib/rtm/validation.rb +7 -4
  64. data/lib/rtm/version.rb +30 -0
  65. data/spec/helpers/spec_exampleexamplegroup.rb +14 -0
  66. data/spec/rtm/axes/association_spec.rb +88 -0
  67. data/spec/rtm/axes/associations_spec.rb +60 -0
  68. data/spec/rtm/axes/assocs_names_occs_spec.rb +9 -0
  69. data/spec/rtm/axes/characteristic_spec.rb +90 -0
  70. data/spec/rtm/axes/characteristics_spec.rb +85 -0
  71. data/spec/rtm/axes/string_spec.rb +145 -0
  72. data/spec/rtm/axes/strings_spec.rb +168 -0
  73. data/spec/rtm/axes/topic_spec.rb +124 -0
  74. data/spec/rtm/axes/topics_spec.rb +103 -0
  75. data/spec/rtm/base_spec.rb +32 -0
  76. data/spec/rtm/io/tmapix_from_spec.rb +76 -0
  77. data/spec/rtm/io/tmapix_to_spec.rb +159 -0
  78. data/spec/rtm/io/to_hash_spec.rb +90 -0
  79. data/spec/rtm/io/to_rdf_spec.rb +37 -0
  80. data/spec/rtm/io/to_string_spec.rb +122 -0
  81. data/spec/rtm/io/to_yaml_spec.rb +89 -0
  82. data/spec/rtm/navigation/association/players_spec.rb +58 -0
  83. data/spec/rtm/navigation/association_spec.rb +52 -0
  84. data/spec/rtm/navigation/name/atomify_spec.rb +27 -0
  85. data/spec/rtm/navigation/name/characteristics_spec.rb +34 -0
  86. data/spec/rtm/navigation/name_spec.rb +52 -0
  87. data/spec/rtm/navigation/occurrence/atomify_spec.rb +27 -0
  88. data/spec/rtm/navigation/occurrence/characteristics_spec.rb +34 -0
  89. data/spec/rtm/navigation/occurrence_spec.rb +52 -0
  90. data/spec/rtm/navigation/string_spec.rb +51 -0
  91. data/spec/rtm/navigation/topic/characteristics_spec.rb +55 -0
  92. data/spec/rtm/navigation/topic/indicators_spec.rb +43 -0
  93. data/spec/rtm/navigation/topic/items_spec.rb +44 -0
  94. data/spec/rtm/navigation/topic/locators_spec.rb +44 -0
  95. data/spec/rtm/navigation/topic/players_spec.rb +48 -0
  96. data/spec/rtm/navigation/topic/scope_spec.rb +41 -0
  97. data/spec/rtm/navigation/topic/supertypes_spec.rb +376 -0
  98. data/spec/rtm/navigation/topic/traverse_spec.rb +64 -0
  99. data/spec/rtm/navigation/topic/types_spec.rb +195 -0
  100. data/spec/rtm/navigation/topic_spec.rb +153 -0
  101. data/spec/rtm/sugar/association/hash_access_spec.rb +55 -0
  102. data/spec/rtm/sugar/occurrence/dynamic_value_spec.rb +171 -0
  103. data/spec/rtm/sugar/occurrence/external_spec.rb +129 -0
  104. data/spec/rtm/sugar/reifiable/reifier_spec.rb +41 -0
  105. data/spec/rtm/sugar/role/counterparts_spec.rb +193 -0
  106. data/spec/rtm/sugar/topic/best_name_spec.rb +25 -0
  107. data/spec/rtm/sugar/topic/characteristics_spec.rb +333 -0
  108. data/spec/rtm/sugar/topic/counterparts_spec.rb +224 -0
  109. data/spec/rtm/sugar/topic/hash_access_spec.rb +234 -0
  110. data/spec/rtm/sugar/topic/scoped_spec.rb +195 -0
  111. data/spec/rtm/sugar/topic/topic_ref_spec.rb +44 -0
  112. data/spec/rtm/sugar/topic/typed_spec.rb +217 -0
  113. data/spec/rtm/sugar/topic_map/themes_spec.rb +67 -0
  114. data/spec/rtm/sugar/typed/types_spec.rb +24 -0
  115. data/spec/rtm/tmapi/core/association_spec.rb +169 -0
  116. data/spec/rtm/tmapi/core/construct_spec.rb +25 -0
  117. data/spec/rtm/tmapi/core/datatype_aware_spec.rb +236 -0
  118. data/spec/rtm/tmapi/core/name_spec.rb +270 -0
  119. data/spec/rtm/tmapi/core/occurrence_spec.rb +53 -0
  120. data/spec/rtm/tmapi/core/reifiable_spec.rb +168 -0
  121. data/spec/rtm/tmapi/core/role_spec.rb +73 -0
  122. data/spec/rtm/tmapi/core/scoped_spec.rb +441 -0
  123. data/spec/rtm/tmapi/core/topic_map_spec.rb +716 -0
  124. data/spec/rtm/tmapi/core/topic_spec.rb +1468 -0
  125. data/spec/rtm/tmapi/core/typed_spec.rb +112 -0
  126. data/spec/rtm/tmapi/core/variant_spec.rb +52 -0
  127. data/spec/rtm/tmapi/ext/java_util_set_spec.rb +34 -0
  128. data/spec/rtm/tmapi_spec.rb +44 -0
  129. data/spec/rtm/utils/sparql_spec.rb +26 -0
  130. data/spec/rtm_spec.rb +93 -0
  131. data/spec/spec_helper.rb +28 -0
  132. data/test/javalibs/junit-4.5.jar +0 -0
  133. data/test/javalibs/tmapi-2.0-tests.jar +0 -0
  134. data/test/tmapi_tests.rb +25 -0
  135. metadata +169 -65
  136. data/COPYRIGHT +0 -4
  137. data/lib/Rakefile.rb +0 -42
  138. data/lib/activetopicmaps.rb +0 -278
  139. data/lib/rtm/backend/active_record.rb +0 -58
  140. data/lib/rtm/backend/active_record/001_initial_schema.rb +0 -116
  141. data/lib/rtm/backend/active_record/association_and_role.rb +0 -33
  142. data/lib/rtm/backend/active_record/locators.rb +0 -55
  143. data/lib/rtm/backend/active_record/name_variant_occurrence.rb +0 -45
  144. data/lib/rtm/backend/active_record/quaaxtm2rtm.rb +0 -113
  145. data/lib/rtm/backend/active_record/quaaxtm2rtmviews.rb +0 -134
  146. data/lib/rtm/backend/active_record/set_wrapper.rb +0 -98
  147. data/lib/rtm/backend/active_record/tm_construct.rb +0 -62
  148. data/lib/rtm/backend/active_record/tm_delegator.rb +0 -345
  149. data/lib/rtm/backend/active_record/tm_set_delegator.rb +0 -195
  150. data/lib/rtm/backend/active_record/tmdm.rb +0 -298
  151. data/lib/rtm/backend/active_record/topic.rb +0 -87
  152. data/lib/rtm/backend/active_record/topic_map.rb +0 -314
  153. data/lib/rtm/backend/active_record/traverse_associations.rb +0 -87
  154. data/lib/rtm/base.rb +0 -92
  155. data/lib/rtm/connect.rb +0 -92
  156. data/lib/rtm/core_ext.rb +0 -6
  157. data/lib/rtm/io/from_xtm2.rb +0 -263
  158. data/lib/rtm/merging/merging.rb +0 -307
  159. data/lib/rtm/pimp_my_api.rb +0 -28
  160. data/lib/rtm/sugar/topic/identifier_direct.rb +0 -11
  161. data/lib/rtm/sugar/topic/predefined_associations.rb +0 -42
  162. data/lib/run_main_project.rb +0 -16
  163. data/test/base_test.rb +0 -162
@@ -0,0 +1,112 @@
1
+ # Copyright: Copyright 2009 Topic Maps Lab, University of Leipzig.
2
+ # License: Apache License, Version 2.0
3
+
4
+ require File.dirname(__FILE__) + '/../../../spec_helper'
5
+
6
+ module RTM::Typed
7
+ describe self do
8
+ before(:each) do
9
+ @tm = get_used_tm_sys_tm
10
+ end
11
+ after(:each) do
12
+ @tm.close
13
+ end
14
+ describe "#type" do
15
+ before(:each) do
16
+ @topic = @tm.create_topic_by("Uni_Leipzig")
17
+ @testname = @topic.create_name("test_type","Universität Leipzig")
18
+ end
19
+ it "for all instances of Typed this should give back the type" do
20
+ @testname.type.should == @tm.get("test_type")
21
+ end
22
+ it "should following the TMDM give back all instances of supertypes"
23
+ end
24
+
25
+ describe "#type=" do
26
+ before(:each) do
27
+ topic = @tm.get!("child")
28
+ @name = topic.create_name("Child")
29
+ @name.should be_a_kind_of RTM::Name
30
+ @occ = topic.create_occurrence("height","small")
31
+ @occ.should be_a_kind_of RTM::Occurrence
32
+ @assoc = @tm.create_association("mother_child")
33
+ @assoc.should be_a_kind_of RTM::Association
34
+ @role = @assoc.create_role("child","Hans")
35
+ @role.should be_a_kind_of RTM::Role
36
+ end
37
+ it "should set the type if the Construct is a Role and identifier a String" do
38
+ previous_type = @role.type
39
+ @role.type = "infant"
40
+ @role.type.should_not == previous_type
41
+ @role.type.should == @tm.get("infant")
42
+ end
43
+ it "should set the type if the Construct is a Role and identifier a Locator" do
44
+ previous_type = @role.type
45
+ @role.type = @tm.create_locator("infant")
46
+ @role.type.should_not == previous_type
47
+ @role.type.should == @tm.get("infant")
48
+ end
49
+ it "should set the type if the Construct is a Role and identifier a Topic" do
50
+ previous_type = @role.type
51
+ @role.type = @tm.get!("infant")
52
+ @role.type.should_not == previous_type
53
+ @role.type.should == @tm.get("infant")
54
+ end
55
+ it "should set the type if the Construct is an Association and identifier a String" do
56
+ previous_type = @assoc.type
57
+ @assoc.type = "mother-infant"
58
+ @assoc.type.should_not == previous_type
59
+ @assoc.type.should == @tm.get("mother-infant")
60
+ end
61
+ it "should set the type if the Construct is an Association and identifier a Locator" do
62
+ previous_type = @assoc.type
63
+ @assoc.type = @tm.create_locator("mother-infant")
64
+ @assoc.type.should_not == previous_type
65
+ @assoc.type.should == @tm.get("mother-infant")
66
+ end
67
+ it "should set the type if the Construct is an Association and identifier a Topic" do
68
+ previous_type = @assoc.type
69
+ @assoc.type = @tm.get!("mother-infant")
70
+ @assoc.type.should_not == previous_type
71
+ @assoc.type.should == @tm.get("mother-infant")
72
+ end
73
+ it "should set the type if the Construct is a Name and identifier a String" do
74
+ previous_type = @name.type
75
+ @name.type = "infant"
76
+ @name.type.should_not == previous_type
77
+ @name.type.should == @tm.get("infant")
78
+ end
79
+ it "should set the type if the Construct is a Name and identifier a Locator" do
80
+ previous_type = @name.type
81
+ @name.type = @tm.create_locator("infant")
82
+ @name.type.should_not == previous_type
83
+ @name.type.should == @tm.get("infant")
84
+ end
85
+ it "should set the type if the Construct is a Name and identifier a Topic" do
86
+ previous_type = @name.type
87
+ @name.type = @tm.get!("infant")
88
+ @name.type.should_not == previous_type
89
+ @name.type.should == @tm.get("infant")
90
+ end
91
+ it "should set the type if the Construct is an Occurrence and identifier a String" do
92
+ previous_type = @occ.type
93
+ @occ.type = "size"
94
+ @occ.type.should_not == previous_type
95
+ @occ.type.should == @tm.get("size")
96
+ end
97
+ it "should set the type if the Construct is an Occurrence and identifier a Locator" do
98
+ previous_type = @occ.type
99
+ @occ.type = @tm.create_locator("size")
100
+ @occ.type.should_not == previous_type
101
+ @occ.type.should == @tm.get("size")
102
+ end
103
+ it "should set the type if the Construct is an Occurrence and identifier a Topic" do
104
+ previous_type = @occ.type
105
+ @occ.type = @tm.get!("size")
106
+ @occ.type.should_not == previous_type
107
+ @occ.type.should == @tm.get("size")
108
+ end
109
+ end
110
+
111
+ end
112
+ end
@@ -0,0 +1,52 @@
1
+ # Copyright: Copyright 2009 Topic Maps Lab, University of Leipzig.
2
+ # License: Apache License, Version 2.0
3
+
4
+ require File.dirname(__FILE__) + '/../../../spec_helper'
5
+
6
+ module RTM::Variant
7
+
8
+ describe self do
9
+ before(:each) do
10
+ @tm = get_used_tm_sys_tm
11
+ end
12
+ after(:each) do
13
+ @tm.close
14
+ end
15
+
16
+ describe "#parent" do
17
+ it "should give back Name to which the Variant belongs" do
18
+ topic = @tm.create_topic_by("sub:ident")
19
+ topic.should be_a_kind_of RTM::Topic
20
+ @tm.get("sub:ident").should be_a_kind_of RTM::Topic
21
+
22
+ scope = @tm.create_topic_by("englisch")
23
+ scope.should be_a_kind_of RTM::Topic
24
+ @tm.get("englisch").should be_a_kind_of RTM::Topic
25
+
26
+ testname = topic.create_name("Deutschland")
27
+ testname.should be_a_kind_of RTM::Name
28
+ testvariant = testname.create_variant("Germany", [scope])
29
+ testvariant.should be_a_kind_of RTM::Variant
30
+ testvariant.parent.should == testname
31
+ end
32
+ end
33
+
34
+ describe "#remove" do
35
+ before(:each) do
36
+ @topic1 = @tm.get!("topic1")
37
+ @name1 = @topic1.create_name("firstname","Hans")
38
+ @name2 = @topic1.create_name("lastname","Meier")
39
+ @variant1 = @name1.create_variant("Hansi",["alias"])
40
+ @variant2 = @name1.create_variant("Bubi",["endearment"])
41
+ end
42
+ it "should remove this Variant from the container (Name)" do
43
+ @name1.should have(2).variants
44
+ @variant1.remove
45
+ @name1.should have(1).variants
46
+ @variant2.remove
47
+ @name1.should have(0).variants
48
+ end
49
+ end
50
+
51
+ end # of describe self
52
+ end # of module
@@ -0,0 +1,34 @@
1
+ # Copyright: Copyright 2009 Topic Maps Lab, University of Leipzig.
2
+ # License: Apache License, Version 2.0
3
+
4
+ require File.dirname(__FILE__) + '/../../../spec_helper'
5
+
6
+ if RUBY_PLATFORM =~ /java/
7
+ module Java::JavaLang::Iterable
8
+ describe self do
9
+ before(:each) do
10
+ @tm = get_used_tm_sys_tm
11
+ end
12
+ it "should respond to :first" do
13
+ java.util.HashSet.new.should respond_to(:first)
14
+ end
15
+ describe "#first" do
16
+ it "should give back one containee of the Iterable" do
17
+ topic = @tm.get!("Person")
18
+ names = [topic.create_name("Name1"), topic.create_name("Name2"), topic.create_name("Name3")]
19
+ topic.names.should be_a_kind_of Enumerable
20
+ lambda{topic.names.first}.should_not raise_error
21
+ names.should include topic.names.first
22
+ end
23
+ it "should give back nil if the Set is empty" do
24
+ topic = @tm.get!("Person")
25
+ set = topic.occurrences
26
+ set.should be_empty
27
+ set.should be_a_kind_of(Enumerable)
28
+ set.first.should be_nil
29
+ end
30
+
31
+ end
32
+ end # of describe self
33
+ end
34
+ end
@@ -0,0 +1,44 @@
1
+ # Copyright: Copyright 2009 Topic Maps Lab, University of Leipzig.
2
+ # License: Apache License, Version 2.0
3
+
4
+ require File.dirname(__FILE__) + '/../spec_helper'
5
+
6
+ module RTM
7
+ class TMAPI
8
+ describe self do
9
+
10
+ describe "#create" do
11
+ before(:all) do
12
+ @connection = RTM.connect(:implementation => implementation_for_spec)
13
+ end
14
+ it "should create a topic map given a base locator (String)" do
15
+ tm = @connection.create("a:b")
16
+ tm.should be_a_kind_of RTM::TopicMap
17
+ end
18
+ it "should create a topic map given a base locator (Locator)" do
19
+ loc = @connection.create_locator("a:b")
20
+ tm = @connection.create(loc)
21
+ tm.should be_a_kind_of RTM::TopicMap
22
+ end
23
+ it "should be allowed to call create_topic_map also" do
24
+ @connection.method(:create).should == @connection.method(:create_topic_map)
25
+ end
26
+ it "should be allowed to call createTopicMap also" do
27
+ @connection.method(:create).should == @connection.method(:createTopicMap)
28
+ end
29
+ end
30
+
31
+ describe "#create_locator" do
32
+ before(:all) do
33
+ @connection = RTM.connect(:implementation => implementation_for_spec)
34
+ end
35
+ it "should create a locator given a String reference" do
36
+ locator = @connection.create_locator("a:b")
37
+ locator.should be_a_kind_of RTM::Locator
38
+ locator.reference.should == "a:b"
39
+ end
40
+ end
41
+
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,26 @@
1
+ # Copyright: Copyright 2009 Topic Maps Lab, University of Leipzig.
2
+ # License: Apache License, Version 2.0
3
+
4
+ require File.dirname(__FILE__) + '/../../spec_helper'
5
+ #
6
+ # if implementation_for_spec == :sesametm
7
+ #
8
+ # module RTM::TopicMap
9
+ # describe self do
10
+ # before(:each) do
11
+ # @tm = get_used_tm_sys_tm
12
+ # end
13
+ # after(:each) do
14
+ # @tm.close
15
+ # end
16
+ # describe "#input" do
17
+ # it "should be called" do
18
+ # @tm.should respond_to(:input)
19
+ # @tm.input("")
20
+ # end
21
+ # end
22
+ #
23
+ # end
24
+ # end
25
+ #
26
+ # end
@@ -0,0 +1,93 @@
1
+ # Copyright: Copyright 2009 Topic Maps Lab, University of Leipzig.
2
+ # License: Apache License, Version 2.0
3
+
4
+ require File.dirname(__FILE__) + '/spec_helper'
5
+
6
+ describe RTM do
7
+ # describe "#[]" do
8
+ # it "should be empty if no TopicMapSystems are created" do
9
+ # RTM[].should be_empty
10
+ # end Fails since already reated tms are found
11
+ # end
12
+ describe "#connect" do
13
+ it "should have a TMAPI engine as default backend" do
14
+ tms_tmapi = RTM.connect(:implementation => implementation_for_spec)
15
+ tms_tmapi.should be_a_kind_of RTM::JavaTMAPI
16
+ tms_tmapi.should be_a_kind_of org.tmapi.core.TopicMapSystem
17
+ end
18
+ it "should allow multiple backends of the same kind in case of TMAPI" do
19
+ if RTM[implementation_for_spec]
20
+ number_of_already_existing_connections = RTM[implementation_for_spec].length
21
+ else
22
+ number_of_already_existing_connections = 0
23
+ end
24
+ tms1 = RTM.connect(:implementation => implementation_for_spec)
25
+ tms2 = RTM.connect(:implementation => implementation_for_spec)
26
+ tms1.should_not == tms2
27
+ number_of_already_existing_connections.should == RTM[implementation_for_spec].length - 2
28
+ end
29
+ # if ar_available?
30
+ # it "should allow only one classic RTM Active Record connection" do
31
+ # pending "extract active record specs to be run only by activerecord"
32
+ # false.should be true # early exit
33
+ # tmsar1 = RTM.connect :implementation => :activerecord
34
+ # RTM[:activerecord].size.should == 1
35
+ # tmsar2 = RTM.connect :implementation => :activerecord
36
+ # pending
37
+ # RTM[:activerecord].size.should == 1
38
+ # tmsar2.should == tmsar1
39
+ # tmsar1.should be_a_kind_of RTM::TopicMapSystem
40
+ # tmsar1.should_not be_a_kind_of RTM::JavaTMAPI
41
+ # tmsar1.should_not be_a_kind_of org.tmapi.core.TopicMapSystem
42
+ # end
43
+ # end
44
+ end
45
+
46
+ describe "#connections" do
47
+ it "should give back a Hash containing all connections if some exist" do
48
+ connections = RTM.connections
49
+ connections.should be_a_kind_of Hash
50
+ #TODO how to test this?
51
+ end
52
+ end
53
+
54
+ describe "#[]" do
55
+ # TODO
56
+ end
57
+
58
+ end
59
+
60
+ # if ar_available?
61
+ # describe RTM::AR do
62
+ # require File.dirname(__FILE__) + '/../test/base_unit_test.rb'
63
+ # require 'test/unit/ui/console/testrunner'
64
+ #
65
+ # it "should run the UNIT base_test without errors" do
66
+ # test_connect = BaseTest.new "test_connect"
67
+ # res1 = Test::Unit::UI::Console::TestRunner.run test_connect
68
+ # res1.error_count.should == 0
69
+ # res1.failure_count.should == 0
70
+ # test_sugar_hash_access = BaseTest.new "test_sugar_hash_access"
71
+ # res2 = Test::Unit::UI::Console::TestRunner.run test_sugar_hash_access
72
+ # res2.error_count.should == 0
73
+ # res2.failure_count.should == 0
74
+ # end
75
+ # end
76
+ # end
77
+
78
+ # describe "TMAPI with old base_test" do
79
+ # require "spec/old_base_unit_test_tmapi.rb"
80
+ # require 'test/unit/ui/console/testrunner'
81
+ # it "should run the UNIT base_test without errors for the TMAPI, too" do
82
+ # pending "first is not supported for Java::GnuTrove::THashSet" do
83
+ # test_connect = BaseTest.new "test_connect"
84
+ # res1 = Test::Unit::UI::Console::TestRunner.run test_connect
85
+ # res1.error_count.should == 0
86
+ # res1.failure_count.should == 0
87
+ # test_sugar_hash_access = BaseTest.new "test_sugar_hash_access"
88
+ # res2 = Test::Unit::UI::Console::TestRunner.run test_sugar_hash_access
89
+ # res2.error_count.should == 0
90
+ # res2.failure_count.should == 0
91
+ # end
92
+ # end
93
+ # end
@@ -0,0 +1,28 @@
1
+ # Copyright: Copyright 2009 Topic Maps Lab, University of Leipzig.
2
+ # License: Apache License, Version 2.0
3
+
4
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), "/../lib")
5
+
6
+ require 'spec'
7
+ require 'rtm'
8
+
9
+ def implementation_for_spec
10
+ engine = ENV['RTM_IMPLEMENTATION'] && ENV['RTM_IMPLEMENTATION'].to_sym || :ontopia # if env is nil, the "normal progress will go on" # TODO: remove ontopia, as it should be chosen by connect by default
11
+ end
12
+ def get_used_tm_sys
13
+ RTM.connect(:implementation => implementation_for_spec)
14
+ end
15
+
16
+ def get_used_tm_sys_tm
17
+ @basis = get_used_tm_sys
18
+ tm = @basis.create("http://www.topicmapslab.de/")
19
+ if (implementation_for_spec == :hatana)
20
+ tm.merge_in(RTM.connect(:implementation => :ontopia).create("http://www.topicmapslab.de/"))
21
+ end
22
+ # tm.enable_query_cache
23
+ return tm
24
+ end
25
+
26
+ def ar_available?
27
+ !Gem.source_index.find_name('activerecord').empty?
28
+ end
@@ -0,0 +1,25 @@
1
+ # Copyright: Copyright 2009 Topic Maps Lab, University of Leipzig.
2
+ # License: Apache License, Version 2.0
3
+
4
+ $: << File.join(File.dirname(__FILE__), "/../lib")
5
+
6
+ Dir[File.join(File.dirname(__FILE__), '/javalibs/*.jar')].each {|file| require file }
7
+
8
+ require 'rtm'
9
+
10
+ class TMAPITests
11
+
12
+ def initialize(engine)
13
+ RTM.connect(:implementation => engine)
14
+ run_tests_for_backend
15
+ end
16
+
17
+ def run_tests_for_backend
18
+ Java::OrgTmapi::AllTests.main([].to_java(Java::JavaLang::String))
19
+ end
20
+
21
+ end
22
+
23
+ engine = ENV['RTM_IMPLEMENTATION'] && ENV['RTM_IMPLEMENTATION'].to_sym || :ontopia
24
+
25
+ TMAPITests.new(engine)
metadata CHANGED
@@ -1,39 +1,56 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rtm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: "0.2"
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Bock
8
+ - Arnim Bleier
9
+ - Uta Schulze
10
+ - Daniel Exner
8
11
  autorequire:
9
12
  bindir: bin
10
13
  cert_chain: []
11
14
 
12
- date: 2009-02-05 00:00:00 +01:00
15
+ date: 2010-02-21 00:00:00 +01:00
13
16
  default_executable:
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: activerecord
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: 2.1.0
24
- version:
25
- - !ruby/object:Gem::Dependency
26
- name: activesupport
27
- type: :runtime
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: 2.1.0
34
- version:
35
- description: Ruby Topic Maps is a Topic Maps engine written in Ruby.
36
- email: bb--rtm-gem@bockb.de
17
+ dependencies: []
18
+
19
+ description: |-
20
+ === Ruby Topic Maps (RTM)
21
+ RTM is a Topic Maps engine written in Ruby. See http://rtm.topicmapslab.de/ for instructions.
22
+ Several backends and extensions are available as separate gems.
23
+
24
+ ==== Overview
25
+ From a developer's perspective, RTM is a schema-less database management system.
26
+ The Topic Maps standard (described below) on which RTM is based provides a way of creating a self-describing schema just by using it.
27
+
28
+ ==== Topic Maps
29
+ Topic Maps is an international industry standard (ISO13250) for interchangeably representing information
30
+ about the structure of information resources used to define topics, and the relationships between topics.
31
+ A set of one or more interrelated documents that employs the notation defined by this International Standard is called a topic map.
32
+ A topic map defines a multidimensional topic space - a space in which the locations are topics,
33
+ and in which the distances between topics are measurable in terms of the number of intervening topics
34
+ which must be visited in order to get from one topic to another, and the kinds of relationships that define
35
+ the path from one topic to another, if any, through the intervening topics, if any.
36
+ In addition, information objects can have properties, as well as values for those properties, assigned to them.
37
+ The Topic Maps Data Model which is used in this implementation can be found on http://www.isotopicmaps.org/sam/sam-model/.
38
+
39
+ ==== Backends
40
+ [rtm-ontopia] JRuby only, recommended,
41
+ uses Ontopia: http://code.google.com/p/ontopia/
42
+ [rtm-tinytim] JRuby only,
43
+ uses TinyTiM: http://tinytim.sourceforge.net/
44
+ [rtm-activerecord] uses a custom ActiveRecord schema
45
+
46
+ ==== Extensions
47
+ [rtm-tmql] Adds support for the Topic Maps Query Language (TMQL), http://isotopicmaps.org/tmql/
48
+ [rtm-tmcl] Adds support for the Topic Maps Constraint Language (TMCL), http://isotopicmaps.org/tmcl/
49
+
50
+ ====
51
+ [Copyright] Copyright 2009 Topic Maps Lab, University of Leipzig.
52
+ [License] Apache License, Version 2.0
53
+ email: rtm+rtm-gem-20100221@topicmapslab.de
37
54
  executables: []
38
55
 
39
56
  extensions: []
@@ -41,56 +58,145 @@ extensions: []
41
58
  extra_rdoc_files: []
42
59
 
43
60
  files:
44
- - lib/activetopicmaps.rb
45
- - lib/Rakefile.rb
46
- - lib/rtm/backend/active_record/001_initial_schema.rb
47
- - lib/rtm/backend/active_record/association_and_role.rb
48
- - lib/rtm/backend/active_record/locators.rb
49
- - lib/rtm/backend/active_record/name_variant_occurrence.rb
50
- - lib/rtm/backend/active_record/quaaxtm2rtm.rb
51
- - lib/rtm/backend/active_record/quaaxtm2rtmviews.rb
52
- - lib/rtm/backend/active_record/set_wrapper.rb
53
- - lib/rtm/backend/active_record/tm_construct.rb
54
- - lib/rtm/backend/active_record/tm_delegator.rb
55
- - lib/rtm/backend/active_record/tm_set_delegator.rb
56
- - lib/rtm/backend/active_record/tmdm.rb
57
- - lib/rtm/backend/active_record/topic.rb
58
- - lib/rtm/backend/active_record/topic_map.rb
59
- - lib/rtm/backend/active_record/traverse_associations.rb
60
- - lib/rtm/backend/active_record.rb
61
- - lib/rtm/backward_compatibility.rb
62
- - lib/rtm/base.rb
63
- - lib/rtm/connect.rb
64
- - lib/rtm/core_ext.rb
61
+ - lib/rtm/axes/association.rb
62
+ - lib/rtm/axes/associations.rb
63
+ - lib/rtm/axes/assocs_names_occs.rb
64
+ - lib/rtm/axes/characteristic.rb
65
+ - lib/rtm/axes/characteristics.rb
66
+ - lib/rtm/axes/string.rb
67
+ - lib/rtm/axes/strings.rb
68
+ - lib/rtm/axes/topic.rb
69
+ - lib/rtm/axes/topics.rb
70
+ - lib/rtm/axes.rb
71
+ - lib/rtm/deprecated/index_property_set.rb
72
+ - lib/rtm/engine.rb
65
73
  - lib/rtm/extensions.rb
66
- - lib/rtm/helpers.rb
67
- - lib/rtm/io/from_xtm2.rb
74
+ - lib/rtm/helpers/locator.rb
75
+ - lib/rtm/helpers/no_output.rb
76
+ - lib/rtm/helpers/uri.rb
68
77
  - lib/rtm/io/from_xtm2_libxml.rb
78
+ - lib/rtm/io/tmapix_from.rb
79
+ - lib/rtm/io/tmapix_to.rb
80
+ - lib/rtm/io/to_hash.rb
69
81
  - lib/rtm/io/to_jtm.rb
82
+ - lib/rtm/io/to_rdf.rb
70
83
  - lib/rtm/io/to_string.rb
71
84
  - lib/rtm/io/to_xtm1.rb
72
85
  - lib/rtm/io/to_xtm2.rb
73
86
  - lib/rtm/io/to_yaml.rb
74
- - lib/rtm/locator_helpers.rb
75
- - lib/rtm/merging/merging.rb
76
- - lib/rtm/pimp_my_api.rb
87
+ - lib/rtm/io.rb
88
+ - lib/rtm/navigation/association/players.rb
89
+ - lib/rtm/navigation/name/atomify.rb
90
+ - lib/rtm/navigation/name/characteristics.rb
91
+ - lib/rtm/navigation/occurrence/atomify.rb
92
+ - lib/rtm/navigation/occurrence/characteristics.rb
93
+ - lib/rtm/navigation/topic/characteristics.rb
94
+ - lib/rtm/navigation/topic/indicators.rb
95
+ - lib/rtm/navigation/topic/items.rb
96
+ - lib/rtm/navigation/topic/locators.rb
97
+ - lib/rtm/navigation/topic/players.rb
98
+ - lib/rtm/navigation/topic/supertypes.rb
99
+ - lib/rtm/navigation/topic/traverse.rb
100
+ - lib/rtm/navigation/topic/types.rb
101
+ - lib/rtm/navigation.rb
77
102
  - lib/rtm/psi.rb
103
+ - lib/rtm/sugar/association/hash_access.rb
104
+ - lib/rtm/sugar/occurrence/dynamic_value.rb
105
+ - lib/rtm/sugar/occurrence/external.rb
106
+ - lib/rtm/sugar/reifiable/reifier.rb
78
107
  - lib/rtm/sugar/role/counterparts.rb
108
+ - lib/rtm/sugar/topic/best_name.rb
79
109
  - lib/rtm/sugar/topic/characteristics.rb
80
110
  - lib/rtm/sugar/topic/counterparts.rb
81
111
  - lib/rtm/sugar/topic/hash_access.rb
82
- - lib/rtm/sugar/topic/identifier_direct.rb
83
- - lib/rtm/sugar/topic/predefined_associations.rb
112
+ - lib/rtm/sugar/topic/scoped.rb
113
+ - lib/rtm/sugar/topic/topic_ref.rb
114
+ - lib/rtm/sugar/topic/typed.rb
115
+ - lib/rtm/sugar/topic_map/query_cache.rb
116
+ - lib/rtm/sugar/topic_map/themes.rb
117
+ - lib/rtm/sugar/typed/types.rb
118
+ - lib/rtm/sugar.rb
84
119
  - lib/rtm/validation.rb
120
+ - lib/rtm/version.rb
85
121
  - lib/rtm.rb
86
- - lib/run_main_project.rb
87
- - test/base_test.rb
88
- - COPYRIGHT
122
+ - spec/helpers/spec_exampleexamplegroup.rb
123
+ - spec/rtm/axes/association_spec.rb
124
+ - spec/rtm/axes/associations_spec.rb
125
+ - spec/rtm/axes/assocs_names_occs_spec.rb
126
+ - spec/rtm/axes/characteristic_spec.rb
127
+ - spec/rtm/axes/characteristics_spec.rb
128
+ - spec/rtm/axes/string_spec.rb
129
+ - spec/rtm/axes/strings_spec.rb
130
+ - spec/rtm/axes/topic_spec.rb
131
+ - spec/rtm/axes/topics_spec.rb
132
+ - spec/rtm/base_spec.rb
133
+ - spec/rtm/io/tmapix_from_spec.rb
134
+ - spec/rtm/io/tmapix_to_spec.rb
135
+ - spec/rtm/io/to_hash_spec.rb
136
+ - spec/rtm/io/to_rdf_spec.rb
137
+ - spec/rtm/io/to_string_spec.rb
138
+ - spec/rtm/io/to_yaml_spec.rb
139
+ - spec/rtm/navigation/association/players_spec.rb
140
+ - spec/rtm/navigation/association_spec.rb
141
+ - spec/rtm/navigation/name/atomify_spec.rb
142
+ - spec/rtm/navigation/name/characteristics_spec.rb
143
+ - spec/rtm/navigation/name_spec.rb
144
+ - spec/rtm/navigation/occurrence/atomify_spec.rb
145
+ - spec/rtm/navigation/occurrence/characteristics_spec.rb
146
+ - spec/rtm/navigation/occurrence_spec.rb
147
+ - spec/rtm/navigation/string_spec.rb
148
+ - spec/rtm/navigation/topic/characteristics_spec.rb
149
+ - spec/rtm/navigation/topic/indicators_spec.rb
150
+ - spec/rtm/navigation/topic/items_spec.rb
151
+ - spec/rtm/navigation/topic/locators_spec.rb
152
+ - spec/rtm/navigation/topic/players_spec.rb
153
+ - spec/rtm/navigation/topic/scope_spec.rb
154
+ - spec/rtm/navigation/topic/supertypes_spec.rb
155
+ - spec/rtm/navigation/topic/traverse_spec.rb
156
+ - spec/rtm/navigation/topic/types_spec.rb
157
+ - spec/rtm/navigation/topic_spec.rb
158
+ - spec/rtm/sugar/association/hash_access_spec.rb
159
+ - spec/rtm/sugar/occurrence/dynamic_value_spec.rb
160
+ - spec/rtm/sugar/occurrence/external_spec.rb
161
+ - spec/rtm/sugar/reifiable/reifier_spec.rb
162
+ - spec/rtm/sugar/role/counterparts_spec.rb
163
+ - spec/rtm/sugar/topic/best_name_spec.rb
164
+ - spec/rtm/sugar/topic/characteristics_spec.rb
165
+ - spec/rtm/sugar/topic/counterparts_spec.rb
166
+ - spec/rtm/sugar/topic/hash_access_spec.rb
167
+ - spec/rtm/sugar/topic/scoped_spec.rb
168
+ - spec/rtm/sugar/topic/topic_ref_spec.rb
169
+ - spec/rtm/sugar/topic/typed_spec.rb
170
+ - spec/rtm/sugar/topic_map/themes_spec.rb
171
+ - spec/rtm/sugar/typed/types_spec.rb
172
+ - spec/rtm/tmapi/core/association_spec.rb
173
+ - spec/rtm/tmapi/core/construct_spec.rb
174
+ - spec/rtm/tmapi/core/datatype_aware_spec.rb
175
+ - spec/rtm/tmapi/core/name_spec.rb
176
+ - spec/rtm/tmapi/core/occurrence_spec.rb
177
+ - spec/rtm/tmapi/core/reifiable_spec.rb
178
+ - spec/rtm/tmapi/core/role_spec.rb
179
+ - spec/rtm/tmapi/core/scoped_spec.rb
180
+ - spec/rtm/tmapi/core/topic_map_spec.rb
181
+ - spec/rtm/tmapi/core/topic_spec.rb
182
+ - spec/rtm/tmapi/core/typed_spec.rb
183
+ - spec/rtm/tmapi/core/variant_spec.rb
184
+ - spec/rtm/tmapi/ext/java_util_set_spec.rb
185
+ - spec/rtm/tmapi_spec.rb
186
+ - spec/rtm/utils/sparql_spec.rb
187
+ - spec/rtm_spec.rb
188
+ - spec/spec_helper.rb
189
+ - test/tmapi_tests.rb
190
+ - test/javalibs/junit-4.5.jar
191
+ - test/javalibs/tmapi-2.0-tests.jar
192
+ - LICENSE
89
193
  - DISCLAIMER
90
194
  - README
91
- has_rdoc: false
92
- homepage: http://rtm.rubyforge.org/
93
- post_install_message:
195
+ has_rdoc: true
196
+ homepage: http://rtm.topicmapslab.de/
197
+ licenses: []
198
+
199
+ post_install_message: "You have successfully installed RTM. Please be aware you need to install a backend implementation to use it. Examples: rtm-ontopia, rtm-tinytim, rtm-activerecord"
94
200
  rdoc_options: []
95
201
 
96
202
  require_paths:
@@ -107,14 +213,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
213
  - !ruby/object:Gem::Version
108
214
  version: "0"
109
215
  version:
110
- requirements:
111
- - json_pure >= 1.1.2
112
- - sqlite3-ruby >= 1.2.2
113
- - libxml-ruby >= 0.6.0
216
+ requirements: []
217
+
114
218
  rubyforge_project: rtm
115
- rubygems_version: 1.3.1
219
+ rubygems_version: 1.3.5
116
220
  signing_key:
117
- specification_version: 2
221
+ specification_version: 3
118
222
  summary: Ruby Topic Maps is a Topic Maps engine written in Ruby.
119
223
  test_files: []
120
224