rtm 0.1.6 → 0.2.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.
Files changed (146) hide show
  1. data/DISCLAIMER +10 -33
  2. data/LICENSE +201 -0
  3. data/README +3 -3
  4. data/lib/rtm.rb +148 -74
  5. data/lib/rtm/axes.rb +295 -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 +58 -0
  17. data/lib/rtm/extensions.rb +11 -1
  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 +18 -0
  22. data/lib/rtm/io/from_xtm2_libxml.rb +2 -1
  23. data/lib/rtm/io/ontopia_io.rb +25 -0
  24. data/lib/rtm/io/tmapix.rb +234 -0
  25. data/lib/rtm/io/to_hash.rb +116 -0
  26. data/lib/rtm/io/to_jtm.rb +53 -103
  27. data/lib/rtm/io/to_rdf.rb +30 -0
  28. data/lib/rtm/io/to_string.rb +8 -6
  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 +29 -98
  32. data/lib/rtm/navigation.rb +37 -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 +162 -0
  44. data/lib/rtm/navigation/topic/traverse.rb +51 -0
  45. data/lib/rtm/navigation/topic/types.rb +107 -0
  46. data/lib/rtm/psi.rb +33 -2
  47. data/lib/rtm/sugar.rb +34 -0
  48. data/lib/rtm/sugar/association/hash_access.rb +46 -0
  49. data/lib/rtm/sugar/occurrence/dynamic_value.rb +75 -0
  50. data/lib/rtm/{pimp_my_api.rb → sugar/occurrence/externalize.rb} +3 -0
  51. data/lib/rtm/sugar/role/counterparts.rb +133 -46
  52. data/lib/rtm/sugar/topic/characteristics.rb +126 -12
  53. data/lib/rtm/sugar/topic/counterparts.rb +130 -7
  54. data/lib/rtm/sugar/topic/hash_access.rb +140 -30
  55. data/lib/rtm/sugar/topic/scoped.rb +65 -0
  56. data/lib/rtm/sugar/topic/topic_ref.rb +35 -0
  57. data/lib/rtm/sugar/topic/typed.rb +159 -0
  58. data/lib/rtm/sugar/typed/types.rb +38 -0
  59. data/lib/rtm/validation.rb +8 -5
  60. data/lib/rtm/version.rb +18 -0
  61. data/spec/helpers/spec_exampleexamplegroup.rb +14 -0
  62. data/spec/rtm/axes/association_spec.rb +88 -0
  63. data/spec/rtm/axes/associations_spec.rb +60 -0
  64. data/spec/rtm/axes/assocs_names_occs_spec.rb +9 -0
  65. data/spec/rtm/axes/characteristic_spec.rb +90 -0
  66. data/spec/rtm/axes/characteristics_spec.rb +85 -0
  67. data/spec/rtm/axes/string_spec.rb +145 -0
  68. data/spec/rtm/axes/strings_spec.rb +168 -0
  69. data/spec/rtm/axes/topic_spec.rb +124 -0
  70. data/spec/rtm/axes/topics_spec.rb +103 -0
  71. data/spec/rtm/base_spec.rb +32 -0
  72. data/spec/rtm/io/tmapix_spec.rb +85 -0
  73. data/spec/rtm/navigation/association/players_spec.rb +58 -0
  74. data/spec/rtm/navigation/association_spec.rb +52 -0
  75. data/spec/rtm/navigation/name/atomify_spec.rb +27 -0
  76. data/spec/rtm/navigation/name/characteristics_spec.rb +34 -0
  77. data/spec/rtm/navigation/name_spec.rb +52 -0
  78. data/spec/rtm/navigation/occurrence/atomify_spec.rb +27 -0
  79. data/spec/rtm/navigation/occurrence/characteristics_spec.rb +34 -0
  80. data/spec/rtm/navigation/occurrence_spec.rb +52 -0
  81. data/spec/rtm/navigation/string_spec.rb +51 -0
  82. data/spec/rtm/navigation/topic/characteristics_spec.rb +55 -0
  83. data/spec/rtm/navigation/topic/indicators_spec.rb +43 -0
  84. data/spec/rtm/navigation/topic/items_spec.rb +44 -0
  85. data/spec/rtm/navigation/topic/locators_spec.rb +44 -0
  86. data/spec/rtm/navigation/topic/players_spec.rb +48 -0
  87. data/spec/rtm/navigation/topic/scope_spec.rb +41 -0
  88. data/spec/rtm/navigation/topic/supertypes_spec.rb +376 -0
  89. data/spec/rtm/navigation/topic/traverse_spec.rb +64 -0
  90. data/spec/rtm/navigation/topic/types_spec.rb +195 -0
  91. data/spec/rtm/navigation/topic_spec.rb +153 -0
  92. data/spec/rtm/sugar/association/hash_access_spec.rb +55 -0
  93. data/spec/rtm/sugar/occurrence/dynamic_value_spec.rb +16 -0
  94. data/spec/rtm/sugar/role/counterparts_spec.rb +191 -0
  95. data/spec/rtm/sugar/topic/characteristics_spec.rb +318 -0
  96. data/spec/rtm/sugar/topic/counterparts_spec.rb +184 -0
  97. data/spec/rtm/sugar/topic/hash_access_spec.rb +234 -0
  98. data/spec/rtm/sugar/topic/scoped_spec.rb +131 -0
  99. data/spec/rtm/sugar/topic/topic_ref_spec.rb +44 -0
  100. data/spec/rtm/sugar/topic/typed_spec.rb +155 -0
  101. data/spec/rtm/sugar/typed/types_spec.rb +24 -0
  102. data/spec/rtm/tmapi/core/association_spec.rb +169 -0
  103. data/spec/rtm/tmapi/core/construct_spec.rb +25 -0
  104. data/spec/rtm/tmapi/core/name_spec.rb +85 -0
  105. data/spec/rtm/tmapi/core/occurrence_spec.rb +96 -0
  106. data/spec/rtm/tmapi/core/reifiable_spec.rb +168 -0
  107. data/spec/rtm/tmapi/core/role_spec.rb +73 -0
  108. data/spec/rtm/tmapi/core/scoped_spec.rb +403 -0
  109. data/spec/rtm/tmapi/core/topic_map_spec.rb +648 -0
  110. data/spec/rtm/tmapi/core/topic_spec.rb +992 -0
  111. data/spec/rtm/tmapi/core/typed_spec.rb +112 -0
  112. data/spec/rtm/tmapi/core/variant_spec.rb +52 -0
  113. data/spec/rtm/tmapi/ext/java_util_set_spec.rb +34 -0
  114. data/spec/rtm/tmapi_spec.rb +44 -0
  115. data/spec/rtm/utils/sparql_spec.rb +26 -0
  116. data/spec/rtm_spec.rb +94 -0
  117. data/spec/spec_helper.rb +23 -0
  118. data/test/base_unit_test.rb +161 -0
  119. data/test/{base_test.rb → base_unit_test_tmapi.rb} +46 -43
  120. metadata +122 -66
  121. data/COPYRIGHT +0 -4
  122. data/lib/Rakefile.rb +0 -42
  123. data/lib/activetopicmaps.rb +0 -278
  124. data/lib/rtm/backend/active_record.rb +0 -58
  125. data/lib/rtm/backend/active_record/001_initial_schema.rb +0 -116
  126. data/lib/rtm/backend/active_record/association_and_role.rb +0 -33
  127. data/lib/rtm/backend/active_record/locators.rb +0 -55
  128. data/lib/rtm/backend/active_record/name_variant_occurrence.rb +0 -45
  129. data/lib/rtm/backend/active_record/quaaxtm2rtm.rb +0 -113
  130. data/lib/rtm/backend/active_record/quaaxtm2rtmviews.rb +0 -134
  131. data/lib/rtm/backend/active_record/set_wrapper.rb +0 -98
  132. data/lib/rtm/backend/active_record/tm_construct.rb +0 -62
  133. data/lib/rtm/backend/active_record/tm_delegator.rb +0 -345
  134. data/lib/rtm/backend/active_record/tm_set_delegator.rb +0 -195
  135. data/lib/rtm/backend/active_record/tmdm.rb +0 -298
  136. data/lib/rtm/backend/active_record/topic.rb +0 -87
  137. data/lib/rtm/backend/active_record/topic_map.rb +0 -314
  138. data/lib/rtm/backend/active_record/traverse_associations.rb +0 -87
  139. data/lib/rtm/base.rb +0 -92
  140. data/lib/rtm/connect.rb +0 -92
  141. data/lib/rtm/core_ext.rb +0 -6
  142. data/lib/rtm/io/from_xtm2.rb +0 -263
  143. data/lib/rtm/merging/merging.rb +0 -307
  144. data/lib/rtm/sugar/topic/identifier_direct.rb +0 -11
  145. data/lib/rtm/sugar/topic/predefined_associations.rb +0 -42
  146. data/lib/run_main_project.rb +0 -16
@@ -1,33 +0,0 @@
1
- module RTM::AR
2
- class Association < Reifiable
3
- include RTM::Association
4
- wrapper_cache
5
-
6
- parent :topic_map
7
- property :type, :aka => [:ty,:t], :rw => true, :type => :Topic, :wrap => true
8
- property_set :scope, :type => :Topic, :wrap => true
9
- property_set :roles, :aka => [:r, :association_roles], :type => :AssociationRole, :wrap => true,
10
- :create => :role, :create_aka => [:cr, :create_association_role],
11
- :create_args => [ {:name => :player, :type => :Topic}, {:name => :type, :type => :Topic}]
12
-
13
- property_set :role_players, :aka => [:players, :rp, :pl], :type => :Topic, :wrap => true
14
- property_set :role_types, :aka => [:types, :rt], :type => :Topic, :wrap => true
15
-
16
- equality [:scope, :type, :roles]
17
- end
18
-
19
- class AssociationRole < Reifiable
20
- include RTM::AssociationRole
21
- wrapper_cache
22
-
23
- parent :association
24
- property :player, :aka => [:pl,:topic], :rw => true, :type => :Topic, :wrap => true
25
- property :type, :aka => [:ty,:t], :rw => true, :type => :Topic, :wrap => true
26
-
27
- require 'rtm/sugar/role/counterparts'
28
- include RTM::Sugar::Role::Counterparts
29
-
30
- equality [:type, :player, :parent]
31
- end
32
- Role = AssociationRole
33
- end
@@ -1,55 +0,0 @@
1
- module RTM::AR
2
- class Locator < TMDelegator
3
- include RTM::Locator
4
-
5
- delegate :+
6
- delegate :-
7
- #delegate :==
8
- delegate :id
9
-
10
- delegate :get
11
- delegate :hash
12
- delegate :resolve_relative
13
- delegate :to_s, :to => :reference
14
- delegate :to_uri
15
- delegate :uri
16
- delegate :reference, :rw => true, :save => true
17
- alias :value :reference
18
- alias :value= :reference=
19
- alias :v :reference
20
- alias :v= :reference=
21
-
22
- equality [:reference]
23
-
24
- def self.wrap(obj)
25
- return nil unless obj
26
- raise "Double wrapping" if obj.respond_to?(:__getobj__)
27
- case obj.class.name
28
- when "RTM::AR::TMDM::ItemIdentifier"
29
- ItemIdentifier.wrap(obj)
30
- when "RTM::AR::TMDM::SubjectIdentifier"
31
- SubjectIdentifier.wrap(obj)
32
- when "RTM::AR::TMDM::SubjectLocator"
33
- SubjectLocator.wrap(obj)
34
- else
35
- raise "Can't wrap object. Class for wrapping #{obj.class} unknown (object: #{obj})"
36
- end
37
- end
38
- end
39
-
40
- class ItemIdentifier < Locator
41
- include RTM::ItemIdentifier
42
- wrapper_cache
43
- property :topic_map_construct, :type => :TopicMapConstruct, :wrap => true
44
- end
45
- class SubjectIdentifier < Locator
46
- include RTM::SubjectIdentifier
47
- wrapper_cache
48
- property :topic, :type => :Topic, :wrap => true
49
- end
50
- class SubjectLocator < Locator
51
- include RTM::SubjectLocator
52
- wrapper_cache
53
- property :topic, :type => :Topic, :wrap => true
54
- end
55
- end
@@ -1,45 +0,0 @@
1
- module RTM::AR
2
- class TopicName < Reifiable
3
- include RTM::TopicName
4
- wrapper_cache
5
-
6
- parent :topic
7
- property :type, :aka => [:ty,:t], :rw => true, :type => :Topic, :wrap => true
8
- property_set :scope, :type => :Topic, :wrap => true
9
-
10
- property_set :variants, :aka => :vs, :type => :Variant, :wrap => true,
11
- :create => :variant, :create_aka => :cv,
12
- :create_args => [ {:name => :value, :type => [:String, :Locator]}, {:name => :scope, :type => :Collection}]
13
-
14
- property :value, :rw => true, :type => :String, :aka => :v
15
-
16
- equality [:value, :type, :scope, :parent]
17
- end
18
- Name = TopicName
19
-
20
- class Variant < Reifiable
21
- include RTM::Variant
22
- wrapper_cache
23
-
24
- parent :topic_name, :aka => :name
25
- property :value, :rw => true, :type => :String, :aka => :v
26
- property :datatype, :rw => true, :type => :Locator #, :wrap => true
27
- property_set :scope, :type => :Topic, :wrap => true
28
-
29
- equality [:value, :datatype, :scope, :parent]
30
- end
31
-
32
- class Occurrence < Reifiable
33
- include RTM::Occurrence
34
- wrapper_cache
35
-
36
- parent :topic
37
- property :value, :rw => true, :type => :String, :aka => :v
38
- property :datatype, :rw => true, :type => :String
39
-
40
- property_set :scope, :type => :Topic, :wrap => true
41
- property :type, :aka => [:ty,:t], :rw => true, :type => :Topic, :wrap => true
42
-
43
- equality [:value, :datatype, :scope, :type, :parent]
44
- end
45
- end
@@ -1,113 +0,0 @@
1
- require 'active_record'
2
-
3
-
4
- module RTM
5
- module AR
6
- module TMDM
7
- class Topic < ActiveRecord::Base;end
8
- class ItemIdentifier < ActiveRecord::Base
9
- belongs_to :topic_map_construct
10
- end
11
- class SubjectIdentifier < ActiveRecord::Base
12
- belongs_to :topic
13
- end
14
-
15
- class SubjectLocator < ActiveRecord::Base
16
- belongs_to :topic
17
- end
18
-
19
- class QuaaxTM2RTM < ActiveRecord::Migration
20
- def self.up
21
- rename_table("qtm_topicmap", "topic_maps" )
22
- rename_column("topic_maps", "baselocator", "base_locator")
23
-
24
- rename_table("qtm_topic", "topics")
25
- rename_column("topics", "topicmap_id", "topic_map_id")
26
-
27
- add_column :topics, :reified_id, :integer
28
- add_column :topics, :reified_type, :string
29
-
30
- rename_table "qtm_association", "associations"
31
- rename_column "associations", "type_id", "ttype_id"
32
- rename_column "associations", "topicmap_id", "topic_map_id"
33
-
34
- rename_table "qtm_assocrole", "association_roles"
35
- rename_column "association_roles", "type_id", "ttype_id"
36
- rename_column "association_roles", "reference", "topic_id"
37
-
38
- rename_table "qtm_topicname", "topic_names"
39
- rename_column "topic_names", "type_id", "ttype_id"
40
-
41
- rename_table "qtm_occurrence", "occurrences"
42
- rename_column "occurrences", "type_id", "ttype_id"
43
-
44
- rename_table "qtm_variant", "variants"
45
- rename_column "variants", "topicname_id", "topic_name_id"
46
-
47
- rename_table "qtm_topicmapconstructref", "item_identifiers"
48
- rename_column "item_identifiers", "locator", "reference"
49
- add_column :item_identifiers, :topic_map_id, :integer
50
- ItemIdentifier.reset_column_information
51
- ItemIdentifier.find(:all).each do |si|
52
- si.update_attribute :topic_map_id, si.topic_map_construct.topic_map_id
53
- end
54
-
55
- create_table :item_identifiers do |t|
56
- t.column :topic_map_id, :integer, :null => false
57
- t.column :reference, :string, :null => false
58
- t.column :topic_map_construct_id, :integer
59
- t.column :topic_map_construct_type, :string
60
- end
61
- SubjectIdentifier.reset_column_information
62
- SubjectIdentifier.find(:all).each do |si|
63
- si.update_attribute :topic_map_id, si.topic.topic_map_id
64
- end
65
-
66
- rename_table "qtm_subjectidentifier", "subject_identifiers"
67
- rename_column :subject_identifiers, "locator", "reference"
68
- add_column :subject_identifiers, :topic_map_id, :integer
69
-
70
- SubjectIdentifier.reset_column_information
71
- SubjectIdentifier.find(:all).each do |si|
72
- si.update_attribute :topic_map_id, si.topic.topic_map_id
73
- end
74
-
75
- rename_table "qtm_subjectlocator", "subject_locators"
76
- rename_column :subject_locators, "locator", "reference"
77
- add_column :subject_locators, :topic_map_id, :integer
78
-
79
- Topic.reset_column_information
80
- SubjectLocator.reset_column_information
81
- SubjectLocator.find(:all).each do |si|
82
- si.update_attribute :topic_map_id, si.topic.topic_map_id
83
- end
84
-
85
- create_table :scoped_objects_topics do |t|
86
- t.column :scoped_object_id, :integer
87
- t.column :scoped_object_type, :string
88
- t.column :topic_id, :integer
89
- end
90
-
91
- # TODO: instance of
92
- # scope
93
- # reifier
94
- end
95
-
96
- def self.down
97
- raise "not supported"
98
- end
99
-
100
- end
101
- end
102
- end
103
- end
104
-
105
- #if __FILE__ == $0
106
- # puts "Generating SQLite3 Databse tmdm.sqlite3."
107
- # ActiveRecord::Base.establish_connection(
108
- # :adapter => "sqlite3",
109
- # :database => "tmdm.sqlite3"
110
- # )
111
- # RTM::AR::TMDM::QuaaxTM2RTM.migrate(:up)
112
- #end
113
-
@@ -1,134 +0,0 @@
1
- require 'active_record'
2
-
3
-
4
- module RTM
5
- module AR
6
- module TMDM
7
- class Topic < ActiveRecord::Base;end
8
- class ItemIdentifier < ActiveRecord::Base
9
- belongs_to :topic_map_construct
10
- end
11
- class SubjectIdentifier < ActiveRecord::Base
12
- belongs_to :topic
13
- end
14
-
15
- class SubjectLocator < ActiveRecord::Base
16
- belongs_to :topic
17
- end
18
-
19
- class QuaaxTM2RTMViews < ActiveRecord::Migration
20
- def self.up
21
- create_view "topic_maps", "select id, baselocator from qtm_topicmap" do |t|
22
- t.column :id
23
- t.column :base_locator
24
- end
25
-
26
- create_view "topics", "select id, topicmap_id, null, null from qtm_topic" do |t|
27
- t.column :id
28
- t.column :topic_map_id
29
- t.column :reified_id
30
- t.column :reified_type
31
- end
32
-
33
- create_view "associations", "select id, topicmap_id, type_id from qtm_association" do |t|
34
- t.column :id
35
- t.column :topic_map_id
36
- t.column :ttype_id
37
- end
38
-
39
- create_view "association_roles", "select id, association_id, type_id, reference from qtm_assocrole" do |t|
40
- t.column :id
41
- t.column :association_id
42
- t.column :ttype_id
43
- t.column :topic_id
44
- end
45
-
46
- create_view "topic_names", "select id, topic_id, type_id, value from qtm_topicname" do |t|
47
- t.column :id
48
- t.column :topic_id
49
- t.column :ttype_id
50
- t.column :value
51
- end
52
-
53
- create_view "occurrence", "select id, topic_id, type_id, value, datatype from qtm_occurrence" do |t|
54
- t.column :id
55
- t.column :topic_id
56
- t.column :ttype_id
57
- t.column :value
58
- t.column :datatype
59
- end
60
-
61
- create_view "variants", "select id, topicname_id, value, datatype from qtm_variant" do |t|
62
- t.column :id
63
- t.column :topic_name_id
64
- t.column :value
65
- t.column :datatype
66
- end
67
-
68
- rename_table "qtm_topicmapconstructref", "item_identifiers"
69
- rename_column "item_identifiers", "locator", "reference"
70
- add_column :item_identifiers, :topic_map_id, :integer
71
- ItemIdentifier.reset_column_information
72
- ItemIdentifier.find(:all).each do |si|
73
- si.update_attribute :topic_map_id, si.topic_map_construct.topic_map_id
74
- end
75
-
76
- create_table :item_identifiers do |t|
77
- t.column :topic_map_id, :integer, :null => false
78
- t.column :reference, :string, :null => false
79
- t.column :topic_map_construct_id, :integer
80
- t.column :topic_map_construct_type, :string
81
- end
82
- SubjectIdentifier.reset_column_information
83
- SubjectIdentifier.find(:all).each do |si|
84
- si.update_attribute :topic_map_id, si.topic.topic_map_id
85
- end
86
-
87
- rename_table "qtm_subjectidentifier", "subject_identifiers"
88
- rename_column :subject_identifiers, "locator", "reference"
89
- add_column :subject_identifiers, :topic_map_id, :integer
90
-
91
- SubjectIdentifier.reset_column_information
92
- SubjectIdentifier.find(:all).each do |si|
93
- si.update_attribute :topic_map_id, si.topic.topic_map_id
94
- end
95
-
96
- rename_table "qtm_subjectlocator", "subject_locators"
97
- rename_column :subject_locators, "locator", "reference"
98
- add_column :subject_locators, :topic_map_id, :integer
99
-
100
- Topic.reset_column_information
101
- SubjectLocator.reset_column_information
102
- SubjectLocator.find(:all).each do |si|
103
- si.update_attribute :topic_map_id, si.topic.topic_map_id
104
- end
105
-
106
- create_table :scoped_objects_topics do |t|
107
- t.column :scoped_object_id, :integer
108
- t.column :scoped_object_type, :string
109
- t.column :topic_id, :integer
110
- end
111
-
112
- # TODO: instance of
113
- # scope
114
- # reifier
115
- end
116
-
117
- def self.down
118
- raise "not supported"
119
- end
120
-
121
- end
122
- end
123
- end
124
- end
125
-
126
- #if __FILE__ == $0
127
- # puts "Generating SQLite3 Databse tmdm.sqlite3."
128
- # ActiveRecord::Base.establish_connection(
129
- # :adapter => "sqlite3",
130
- # :database => "tmdm.sqlite3"
131
- # )
132
- # RTM::AR::TMDM::QuaaxTM2RTM.migrate(:up)
133
- #end
134
-
@@ -1,98 +0,0 @@
1
- module RTM::AR
2
- class Topics < TMSetDelegator
3
- def wrap(obj)
4
- Topic.wrap(obj)
5
- end
6
- end
7
- class TopicMapConstructs < TMSetDelegator
8
- def wrap(obj)
9
- TopicMapConstruct.wrap(obj)
10
- end
11
- end
12
- class Associations < TMSetDelegator
13
- def wrap(obj)
14
- Association.wrap(obj)
15
- end
16
- end
17
- class TopicNames < TMSetDelegator
18
- def wrap(obj)
19
- TopicName.wrap(obj)
20
- end
21
- end
22
- class Occurrences < TMSetDelegator
23
- def wrap(obj)
24
- Occurrence.wrap(obj)
25
- end
26
- end
27
- class AssociationRoles < TMSetDelegator
28
- def wrap(obj)
29
- AssociationRole.wrap(obj)
30
- end
31
- end
32
- class Reifiables < TMSetDelegator
33
- def wrap(obj)
34
- TopicMapConstruct.wrap(obj)
35
- end
36
- end
37
- class Variants < TMSetDelegator
38
- def wrap(obj)
39
- Variant.wrap(obj)
40
- end
41
- end
42
- class TopicMaps < TMSetDelegator
43
- def [](obj)
44
- # support for getting topic_map by base_locator
45
- if obj.is_a? String
46
- # return wrap(__getobj__.find { |tm| tm.base_locator == obj })
47
- return wrap(TMDM::TopicMap.find_by_base_locator(obj))
48
- end
49
- # normal index retrieval
50
- super
51
- end
52
-
53
- def wrap(obj)
54
- TopicMap.wrap(obj)
55
- end
56
- end
57
- class Locators < TMSetDelegator
58
- def [](obj)
59
- # support for getting locators by reference
60
- if obj.is_a? String
61
- return wrap(__getobj__.find { |tm| tm.reference == obj })
62
- end
63
- # normal index retrieval
64
- super
65
- end
66
- def wrap(obj)
67
- return nil unless obj
68
- return obj if obj.respond_to? :__getobj__
69
- case obj.class.name
70
- when "RTM::AR::TMDM::ItemIdentifier"
71
- ItemIdentifier.wrap(obj)
72
- when "RTM::AR::TMDM::SubjectIdentifier"
73
- SubjectIdentifier.wrap(obj)
74
- when "RTM::AR::TMDM::SubjectLocator"
75
- SubjectLocator.wrap(obj)
76
- else
77
- Locator.wrap(obj)
78
- end
79
- end
80
- end
81
-
82
- class ItemIdentifiers < Locators
83
- def wrap(obj)
84
- ItemIdentifier.wrap(obj)
85
- end
86
- end
87
- class SubjectIdentifiers < Locators
88
- def wrap(obj)
89
- SubjectIdentifier.wrap(obj)
90
- end
91
-
92
- end
93
- class SubjectLocators < Locators
94
- def wrap(obj)
95
- SubjectLocator.wrap(obj)
96
- end
97
- end
98
- end