michael-ken 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/lib/ken/resource.rb CHANGED
@@ -4,28 +4,141 @@ module Ken
4
4
  def initialize(data)
5
5
  return nil unless data
6
6
  raise "error" unless data.kind_of?(Hash)
7
-
7
+
8
+ # intialize lazy if there is no type supplied
9
+ @schema_loaded = false
10
+ @attributes_loaded = false
8
11
  @data = data
12
+
9
13
  self
10
14
  end
11
15
 
12
- # access type info
13
- # api public
14
- def types
15
- Ken::Collection.new(@data["type"].map { |type| Ken::Type.new(type) })
16
+ def schema_loaded?
17
+ @schema_loaded
18
+ end
19
+
20
+ def attributes_loaded?
21
+ @attributes_loaded
22
+ end
23
+
24
+ def fetch_attributes
25
+ # fetching all objects regardless of the type
26
+ # check this http://lists.freebase.com/pipermail/developers/2007-December/001022.html
27
+
28
+ query = {
29
+ :"/type/reflect/any_master" => [
30
+ {
31
+ :id => nil,
32
+ :link => nil,
33
+ :name => nil
34
+ }
35
+ ],
36
+ :"/type/reflect/any_reverse" => [
37
+ {
38
+ :id => nil,
39
+ :link => nil,
40
+ :name => nil
41
+ }
42
+ ],
43
+ :"/type/reflect/any_value" => [
44
+ {
45
+ :link => nil,
46
+ :value => nil
47
+ # :lang => "/lang/en",
48
+ # :type => "/type/text"
49
+ }
50
+ ],
51
+ :id => id
52
+ }
53
+
54
+ Ken.session.mqlread(query)
55
+ end
56
+
57
+ def load_attributes!
58
+ data = @data["attribute"] || fetch_attributes
59
+
60
+ # master & value attributes
61
+ raw_attributes = Ken::Util.convert_hash(data["/type/reflect/any_master"])
62
+ raw_attributes.merge!(Ken::Util.convert_hash(data["/type/reflect/any_value"]))
63
+ @attributes = {}
64
+ raw_attributes.each_pair do |a, d|
65
+ properties.select { |p| p.id == a}.each do |p|
66
+ @attributes[p.id] = Ken::Attribute.create(d, p)
67
+ end
68
+ end
69
+
70
+ # reverse properties
71
+ raw_attributes = Ken::Util.convert_hash(data["/type/reflect/any_reverse"])
72
+ raw_attributes.each_pair do |a, d|
73
+ properties.select { |p| p.master_property == a}.each do |p|
74
+ @attributes[p.id] = Ken::Attribute.create(d, p)
75
+ end
76
+ end
77
+
78
+ @attributes_loaded = true
79
+ end
80
+
81
+ def fetch_schema
82
+ query = {
83
+ :id => id,
84
+ :name => nil,
85
+ :type => [{
86
+ :id => nil,
87
+ :name => nil,
88
+ :properties => [{
89
+ :id => nil,
90
+ :name => nil,
91
+ :expected_type => nil,
92
+ :unique => nil
93
+ }]
94
+ }]
95
+ }
96
+
97
+ Ken.session.mqlread(query)["type"]
98
+ end
99
+
100
+ # loads the resources metainfo
101
+ def load_schema!
102
+ @data["type"] ||= fetch_schema
103
+ @types = Ken::Collection.new(@data["type"].map { |type| Ken::Type.new(type) })
104
+ @schema_loaded = true
16
105
  end
17
106
 
18
- # api public
107
+ # @api public
19
108
  def id
20
- @data["id"]
109
+ @data["id"] || ""
21
110
  end
22
111
 
23
- # api public
112
+ # @api public
24
113
  def name
25
- @data["name"] if @data["name"]
114
+ @data["name"] || ""
115
+ end
116
+
117
+ # @api public
118
+ def to_s
119
+ name || id || ""
120
+ end
121
+
122
+ # @api public
123
+ def inspect
124
+ result = "#<Resource id=\"#{id}\" name=\"#{name || "nil"}\">"
125
+ end
126
+
127
+ # returns all assigned types
128
+ # @api public
129
+ def types
130
+ load_schema! unless schema_loaded?
131
+ @types
132
+ end
133
+
134
+ # returns all available vies based on the assigned types
135
+ # @api public
136
+ def views
137
+ @views ||= Ken::Collection.new(types.map { |type| Ken::View.new(self, type) })
26
138
  end
27
139
 
28
140
  # returns all the properties from all assigned types
141
+ # @api public
29
142
  def properties
30
143
  @properties = Ken::Collection.new
31
144
  types.each do |type|
@@ -34,27 +147,12 @@ module Ken
34
147
  @properties
35
148
  end
36
149
 
37
- # eg. read_attribute("/music/artist/origin")
38
- # or the shurtcut version read_attribute("origin")
39
- # api public
40
- def read_attribute(attr_name)
41
- properties.each do |prop|
42
- if prop.id == attr_name || prop.id.split('/').last == attr_name
43
- # query the value
44
- query = {
45
- :id => id,
46
- prop.id.to_sym => nil
47
- }
48
-
49
- # fetch attribute
50
- result = Ken.session.mqlread(query)
51
-
52
- # TODO: return either a simple type ruby equivalent or an object type -> Ken::Resource
53
- return result[prop.id]
54
- else
55
- return nil
56
- end
57
- end # properties.each
58
- end # read_attrribute
150
+ # returns all attributes for every type the resource is an instance from
151
+ # @api public
152
+ def attributes
153
+ load_attributes! unless attributes_loaded?
154
+ @attributes.values
155
+ end
156
+
59
157
  end # class Resource
60
158
  end # module Ken
data/lib/ken/session.rb CHANGED
@@ -16,7 +16,6 @@ module Ken
16
16
  end
17
17
  end
18
18
 
19
-
20
19
  # partially taken from chris eppstein's freebase api
21
20
  # http://github.com/chriseppstein/freebase/tree
22
21
  class Session
@@ -85,7 +84,6 @@ module Ken
85
84
 
86
85
  # will always return the converted ruby hash (from json)
87
86
  inner['result']
88
-
89
87
  end # mqlread
90
88
 
91
89
  protected
data/lib/ken/type.rb CHANGED
@@ -10,16 +10,29 @@ module Ken
10
10
  end
11
11
 
12
12
  # access property info
13
+ # @api public
13
14
  def properties
14
15
  Ken::Collection.new(@data["properties"].map { |property| Ken::Property.new(property, self) })
15
16
  end
16
17
 
18
+ # @api public
17
19
  def id
18
20
  @data["id"]
19
21
  end
20
-
22
+
23
+ # @api public
21
24
  def name
22
25
  @data["name"]
23
26
  end
27
+
28
+ # @api public
29
+ def to_s
30
+ name || id || ""
31
+ end
32
+
33
+ # @api public
34
+ def inspect
35
+ result = "#<Type id=\"#{id}\" name=\"#{name || "nil"}\">"
36
+ end
24
37
  end
25
38
  end
data/lib/ken/util.rb ADDED
@@ -0,0 +1,23 @@
1
+ module Ken
2
+ module Util
3
+ # magic hash conversion
4
+ def convert_hash(source)
5
+ result = {}
6
+ source.each do |item|
7
+ result[item["link"]] ? result[item["link"]] << { "id" => item["id"], "name" => item["name"], "value" => item["value"] } : result[item["link"]] = [] << { "id" => item["id"], "name" => item["name"], "value" => item["value"] }
8
+ end
9
+ result
10
+ end
11
+ module_function :convert_hash
12
+ end
13
+ end
14
+
15
+ class Object
16
+ # nice for debugging
17
+ # usage: print_call_stack(:method_name, 2, 10)
18
+ def print_call_stack(from = 2, to = nil, html = false)
19
+ (from..(to ? to : caller.length)).each do |idx|
20
+ p "[#{idx}]: #{caller[idx]}#{html ? '<br />' : ''}"
21
+ end
22
+ end
23
+ end
data/lib/ken/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ken
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
data/lib/ken/view.rb ADDED
@@ -0,0 +1,43 @@
1
+ # provides an interface to view a resource as a specific type
2
+ # provides an interface for working with attributes, properties
3
+ module Ken
4
+ class View
5
+ # initializes a resource by json result
6
+ def initialize(resource, type)
7
+ raise "error" unless resource.kind_of?(Ken::Resource)
8
+ raise "error" unless type.kind_of?(Ken::Type)
9
+
10
+ @resource = resource # belongs to a resource
11
+ @type = type # belongs to a type
12
+ self
13
+ end
14
+
15
+ # @api public
16
+ def to_s
17
+ @type.to_s
18
+ end
19
+
20
+ # @api public
21
+ def type
22
+ @type
23
+ end
24
+
25
+ # @api public
26
+ def inspect
27
+ result = "#<View type=\"#{type.id || "nil"}\">"
28
+ end
29
+
30
+ # returns attributes which are member of the view's type
31
+ # @api public
32
+ def attributes
33
+ @resource.attributes.select { |a| a.property.type == @type}
34
+ end
35
+
36
+ # returns properties which are member of the view's type
37
+ # @api public
38
+ def properties
39
+ @resource.properties.select { |p| p.type == @type}
40
+ end
41
+
42
+ end
43
+ end
@@ -0,0 +1,102 @@
1
+ {
2
+ "id" : "/music/artist",
3
+ "name" : "Musical Artist",
4
+ "properties" : [
5
+ {
6
+ "expected_type" : "/location/location",
7
+ "id" : "/music/artist/origin",
8
+ "name" : "Place Musical Career Began",
9
+ "unique" : null
10
+ },
11
+ {
12
+ "expected_type" : "/type/datetime",
13
+ "id" : "/music/artist/active_start",
14
+ "name" : "Active as Musical Artist (start)",
15
+ "unique" : true
16
+ },
17
+ {
18
+ "expected_type" : "/type/datetime",
19
+ "id" : "/music/artist/active_end",
20
+ "name" : "Active as Musical Artist (end)",
21
+ "unique" : true
22
+ },
23
+ {
24
+ "expected_type" : "/music/genre",
25
+ "id" : "/music/artist/genre",
26
+ "name" : "Musical Genres",
27
+ "unique" : null
28
+ },
29
+ {
30
+ "expected_type" : "/music/record_label",
31
+ "id" : "/music/artist/label",
32
+ "name" : "Record Labels",
33
+ "unique" : null
34
+ },
35
+ {
36
+ "expected_type" : "/music/artist",
37
+ "id" : "/music/artist/similar_artist",
38
+ "name" : "Similar Artists",
39
+ "unique" : null
40
+ },
41
+ {
42
+ "expected_type" : "/common/webpage",
43
+ "id" : "/music/artist/home_page",
44
+ "name" : "Musical Artist Home Page",
45
+ "unique" : null
46
+ },
47
+ {
48
+ "expected_type" : "/common/webpage",
49
+ "id" : "/music/artist/acquire_webpage",
50
+ "name" : "Web Page for Music",
51
+ "unique" : null
52
+ },
53
+ {
54
+ "expected_type" : "/music/album",
55
+ "id" : "/music/artist/album",
56
+ "name" : "Albums",
57
+ "unique" : null
58
+ },
59
+ {
60
+ "expected_type" : "/music/recording_contribution",
61
+ "id" : "/music/artist/contribution",
62
+ "name" : "Album Contributions",
63
+ "unique" : null
64
+ },
65
+ {
66
+ "expected_type" : "/music/track",
67
+ "id" : "/music/artist/track",
68
+ "name" : "Tracks Recorded",
69
+ "unique" : null
70
+ },
71
+ {
72
+ "expected_type" : "/music/artist",
73
+ "id" : "/music/artist/artist_similar",
74
+ "name" : "Similar Musical Artists",
75
+ "unique" : null
76
+ },
77
+ {
78
+ "expected_type" : "/music/track_contribution",
79
+ "id" : "/music/artist/track_contributions",
80
+ "name" : "Track Contributions",
81
+ "unique" : null
82
+ },
83
+ {
84
+ "expected_type" : "/music/instrument",
85
+ "id" : "/music/artist/instruments_played",
86
+ "name" : "Instruments Played",
87
+ "unique" : null
88
+ },
89
+ {
90
+ "expected_type" : "/music/voice",
91
+ "id" : "/music/artist/vocal_range",
92
+ "name" : "Vocal Range",
93
+ "unique" : null
94
+ },
95
+ {
96
+ "expected_type" : "/music/concert_tour",
97
+ "id" : "/music/artist/concert_tours",
98
+ "name" : "Concert Tours",
99
+ "unique" : false
100
+ }
101
+ ]
102
+ }
@@ -0,0 +1,891 @@
1
+ {
2
+ "id" : "/en/the_police",
3
+ "name" : "The Police",
4
+ "type" : [
5
+ {
6
+ "id" : "/music/artist",
7
+ "name" : "Musical Artist",
8
+ "properties" : [
9
+ {
10
+ "expected_type" : "/location/location",
11
+ "id" : "/music/artist/origin",
12
+ "name" : "Place Musical Career Began",
13
+ "unique" : null
14
+ },
15
+ {
16
+ "expected_type" : "/type/datetime",
17
+ "id" : "/music/artist/active_start",
18
+ "name" : "Active as Musical Artist (start)",
19
+ "unique" : true
20
+ },
21
+ {
22
+ "expected_type" : "/type/datetime",
23
+ "id" : "/music/artist/active_end",
24
+ "name" : "Active as Musical Artist (end)",
25
+ "unique" : true
26
+ },
27
+ {
28
+ "expected_type" : "/music/genre",
29
+ "id" : "/music/artist/genre",
30
+ "name" : "Musical Genres",
31
+ "unique" : null
32
+ },
33
+ {
34
+ "expected_type" : "/music/record_label",
35
+ "id" : "/music/artist/label",
36
+ "name" : "Record Labels",
37
+ "unique" : null
38
+ },
39
+ {
40
+ "expected_type" : "/music/artist",
41
+ "id" : "/music/artist/similar_artist",
42
+ "name" : "Similar Artists",
43
+ "unique" : null
44
+ },
45
+ {
46
+ "expected_type" : "/common/webpage",
47
+ "id" : "/music/artist/home_page",
48
+ "name" : "Musical Artist Home Page",
49
+ "unique" : null
50
+ },
51
+ {
52
+ "expected_type" : "/common/webpage",
53
+ "id" : "/music/artist/acquire_webpage",
54
+ "name" : "Web Page for Music",
55
+ "unique" : null
56
+ },
57
+ {
58
+ "expected_type" : "/music/album",
59
+ "id" : "/music/artist/album",
60
+ "name" : "Albums",
61
+ "unique" : null
62
+ },
63
+ {
64
+ "expected_type" : "/music/recording_contribution",
65
+ "id" : "/music/artist/contribution",
66
+ "name" : "Album Contributions",
67
+ "unique" : null
68
+ },
69
+ {
70
+ "expected_type" : "/music/track",
71
+ "id" : "/music/artist/track",
72
+ "name" : "Tracks Recorded",
73
+ "unique" : null
74
+ },
75
+ {
76
+ "expected_type" : "/music/artist",
77
+ "id" : "/music/artist/artist_similar",
78
+ "name" : "Similar Musical Artists",
79
+ "unique" : null
80
+ },
81
+ {
82
+ "expected_type" : "/music/track_contribution",
83
+ "id" : "/music/artist/track_contributions",
84
+ "name" : "Track Contributions",
85
+ "unique" : null
86
+ },
87
+ {
88
+ "expected_type" : "/music/instrument",
89
+ "id" : "/music/artist/instruments_played",
90
+ "name" : "Instruments Played",
91
+ "unique" : null
92
+ },
93
+ {
94
+ "expected_type" : "/music/voice",
95
+ "id" : "/music/artist/vocal_range",
96
+ "name" : "Vocal Range",
97
+ "unique" : null
98
+ },
99
+ {
100
+ "expected_type" : "/music/concert_tour",
101
+ "id" : "/music/artist/concert_tours",
102
+ "name" : "Concert Tours",
103
+ "unique" : false
104
+ }
105
+ ]
106
+ },
107
+ {
108
+ "id" : "/common/topic",
109
+ "name" : "Topic",
110
+ "properties" : [
111
+ {
112
+ "expected_type" : "/type/text",
113
+ "id" : "/common/topic/alias",
114
+ "name" : "Also known as",
115
+ "unique" : null
116
+ },
117
+ {
118
+ "expected_type" : "/common/document",
119
+ "id" : "/common/topic/article",
120
+ "name" : "article",
121
+ "unique" : null
122
+ },
123
+ {
124
+ "expected_type" : "/common/image",
125
+ "id" : "/common/topic/image",
126
+ "name" : "image",
127
+ "unique" : null
128
+ },
129
+ {
130
+ "expected_type" : "/common/webpage",
131
+ "id" : "/common/topic/webpage",
132
+ "name" : "Web Link(s)",
133
+ "unique" : null
134
+ }
135
+ ]
136
+ },
137
+ {
138
+ "id" : "/music/producer",
139
+ "name" : "Record Producer",
140
+ "properties" : [
141
+ {
142
+ "expected_type" : "/music/album",
143
+ "id" : "/music/producer/albums_produced",
144
+ "name" : "Albums Produced",
145
+ "unique" : null
146
+ },
147
+ {
148
+ "expected_type" : "/music/track",
149
+ "id" : "/music/producer/tracks_produced",
150
+ "name" : "Tracks produced",
151
+ "unique" : false
152
+ }
153
+ ]
154
+ },
155
+ {
156
+ "id" : "/music/musical_group",
157
+ "name" : "Musical Group",
158
+ "properties" : [
159
+ {
160
+ "expected_type" : "/music/group_membership",
161
+ "id" : "/music/musical_group/member",
162
+ "name" : "Members Of Musical Group",
163
+ "unique" : null
164
+ }
165
+ ]
166
+ },
167
+ {
168
+ "id" : "/broadcast/artist",
169
+ "name" : "Broadcast Artist",
170
+ "properties" : [
171
+ {
172
+ "expected_type" : "/broadcast/content",
173
+ "id" : "/broadcast/artist/content",
174
+ "name" : "Content",
175
+ "unique" : null
176
+ }
177
+ ]
178
+ },
179
+ {
180
+ "id" : "/award/award_winner",
181
+ "name" : "Award Winner",
182
+ "properties" : [
183
+ {
184
+ "expected_type" : "/award/award_honor",
185
+ "id" : "/award/award_winner/awards_won",
186
+ "name" : "Awards Won",
187
+ "unique" : null
188
+ }
189
+ ]
190
+ }
191
+ ],
192
+ "attribute" : {
193
+ "/type/reflect/any_master" : [
194
+ {
195
+ "id" : "/boot/all_permission",
196
+ "link" : "/type/object/permission",
197
+ "name" : "Global Write Permission"
198
+ },
199
+ {
200
+ "id" : "/guid/9202a8c04000641f800000000006df25",
201
+ "link" : "/common/topic/article",
202
+ "name" : null
203
+ },
204
+ {
205
+ "id" : "/music/artist",
206
+ "link" : "/type/object/type",
207
+ "name" : "Musical Artist"
208
+ },
209
+ {
210
+ "id" : "/common/topic",
211
+ "link" : "/type/object/type",
212
+ "name" : "Topic"
213
+ },
214
+ {
215
+ "id" : "/guid/9202a8c04000641f8000000003921d3c",
216
+ "link" : "/common/topic/webpage",
217
+ "name" : "Discogs entry"
218
+ },
219
+ {
220
+ "id" : "/wikipedia/images/en_id/982873",
221
+ "link" : "/common/topic/image",
222
+ "name" : null
223
+ },
224
+ {
225
+ "id" : "/en/rock_music",
226
+ "link" : "/music/artist/genre",
227
+ "name" : "Rock music"
228
+ },
229
+ {
230
+ "id" : "/en/ska",
231
+ "link" : "/music/artist/genre",
232
+ "name" : "Ska"
233
+ },
234
+ {
235
+ "id" : "/en/reggae",
236
+ "link" : "/music/artist/genre",
237
+ "name" : "Reggae"
238
+ },
239
+ {
240
+ "id" : "/en/london",
241
+ "link" : "/music/artist/origin",
242
+ "name" : "London"
243
+ },
244
+ {
245
+ "id" : "/music/producer",
246
+ "link" : "/type/object/type",
247
+ "name" : "Record Producer"
248
+ },
249
+ {
250
+ "id" : "/music/musical_group",
251
+ "link" : "/type/object/type",
252
+ "name" : "Musical Group"
253
+ },
254
+ {
255
+ "id" : "/guid/9202a8c04000641f80000000072a23e1",
256
+ "link" : "/common/topic/webpage",
257
+ "name" : null
258
+ },
259
+ {
260
+ "id" : "/en/new_wave",
261
+ "link" : "/music/artist/genre",
262
+ "name" : "New Wave"
263
+ },
264
+ {
265
+ "id" : "/en/a_m_records",
266
+ "link" : "/music/artist/label",
267
+ "name" : "A&amp;M Records"
268
+ },
269
+ {
270
+ "id" : "/en/polydor_records",
271
+ "link" : "/music/artist/label",
272
+ "name" : "Polydor Records"
273
+ },
274
+ {
275
+ "id" : "/en/illegal_records",
276
+ "link" : "/music/artist/label",
277
+ "name" : "Illegal Records"
278
+ },
279
+ {
280
+ "id" : "/en/post-punk",
281
+ "link" : "/music/artist/genre",
282
+ "name" : "Post-punk"
283
+ },
284
+ {
285
+ "id" : "/guid/9202a8c04000641f80000000082147dd",
286
+ "link" : "/common/topic/webpage",
287
+ "name" : null
288
+ },
289
+ {
290
+ "id" : "/wikipedia/images/commons_id/3520500",
291
+ "link" : "/common/topic/image",
292
+ "name" : "The Police performing live on August 1, 2007 at Madison Square Garden, New York."
293
+ },
294
+ {
295
+ "id" : "/broadcast/artist",
296
+ "link" : "/type/object/type",
297
+ "name" : "Broadcast Artist"
298
+ },
299
+ {
300
+ "id" : "/en/electric_guitar",
301
+ "link" : "/music/artist/instruments_played",
302
+ "name" : "Electric guitar"
303
+ },
304
+ {
305
+ "id" : "/en/drum",
306
+ "link" : "/music/artist/instruments_played",
307
+ "name" : "Drum"
308
+ },
309
+ {
310
+ "id" : "/en/universal_music_group",
311
+ "link" : "/music/artist/label",
312
+ "name" : "Universal Music Group"
313
+ },
314
+ {
315
+ "id" : "/award/award_winner",
316
+ "link" : "/type/object/type",
317
+ "name" : "Award Winner"
318
+ },
319
+ {
320
+ "id" : "/en/pop_rock",
321
+ "link" : "/music/artist/genre",
322
+ "name" : "Pop rock"
323
+ }
324
+ ],
325
+ "/type/reflect/any_reverse" : [
326
+ {
327
+ "id" : "/en/outlandos_damour",
328
+ "link" : "/music/album/artist",
329
+ "name" : "Outlandos d'Amour"
330
+ },
331
+ {
332
+ "id" : "/en/reggatta_de_blanc",
333
+ "link" : "/music/album/artist",
334
+ "name" : "Reggatta de Blanc"
335
+ },
336
+ {
337
+ "id" : "/en/zenyatta_mondatta",
338
+ "link" : "/music/album/artist",
339
+ "name" : "Zenyatta Mondatta"
340
+ },
341
+ {
342
+ "id" : "/guid/9202a8c04000641f800000000017dab4",
343
+ "link" : "/music/album/artist",
344
+ "name" : "Ghost in the Machine"
345
+ },
346
+ {
347
+ "id" : "/guid/9202a8c04000641f8000000002f9e349",
348
+ "link" : "/music/album/artist",
349
+ "name" : "Synchronicity"
350
+ },
351
+ {
352
+ "id" : "/en/every_breath_you_take_the_singles",
353
+ "link" : "/music/album/artist",
354
+ "name" : "Every Breath You Take: The Singles"
355
+ },
356
+ {
357
+ "id" : "/guid/9202a8c04000641f8000000002f9e3ca",
358
+ "link" : "/music/album/artist",
359
+ "name" : "Greatest Hits"
360
+ },
361
+ {
362
+ "id" : "/en/message_in_a_box_the_complete_recordings",
363
+ "link" : "/music/album/artist",
364
+ "name" : "Message in a Box: The Complete Recordings"
365
+ },
366
+ {
367
+ "id" : "/guid/9202a8c04000641f8000000002f9e2df",
368
+ "link" : "/music/album/artist",
369
+ "name" : "Live!"
370
+ },
371
+ {
372
+ "id" : "/en/every_breath_you_take_the_classics",
373
+ "link" : "/music/album/artist",
374
+ "name" : "Every Breath You Take: The Classics"
375
+ },
376
+ {
377
+ "id" : "/guid/9202a8c04000641f8000000002f9e3a7",
378
+ "link" : "/music/album/artist",
379
+ "name" : "Their Greatest Hits"
380
+ },
381
+ {
382
+ "id" : "/guid/9202a8c04000641f8000000002f9e2cf",
383
+ "link" : "/music/album/artist",
384
+ "name" : "Can't Stand Losing You"
385
+ },
386
+ {
387
+ "id" : "/en/roxanne_97_puff_daddy_remix",
388
+ "link" : "/music/album/artist",
389
+ "name" : "Roxanne '97 (Puff Daddy remix)"
390
+ },
391
+ {
392
+ "id" : "/en/roxanne_97",
393
+ "link" : "/music/album/artist",
394
+ "name" : "Roxanne '97"
395
+ },
396
+ {
397
+ "id" : "/guid/9202a8c04000641f800000000128acd5",
398
+ "link" : "/music/track/artist",
399
+ "name" : "Message in a Bottle"
400
+ },
401
+ {
402
+ "id" : "/guid/9202a8c04000641f800000000128acdc",
403
+ "link" : "/music/track/artist",
404
+ "name" : "Can't Stand Losing You"
405
+ },
406
+ {
407
+ "id" : "/guid/9202a8c04000641f800000000128acea",
408
+ "link" : "/music/track/artist",
409
+ "name" : "Every Breath You Take"
410
+ },
411
+ {
412
+ "id" : "/guid/9202a8c04000641f800000000128acf8",
413
+ "link" : "/music/track/artist",
414
+ "name" : "Walking on the Moon"
415
+ },
416
+ {
417
+ "id" : "/guid/9202a8c04000641f800000000128ad0d",
418
+ "link" : "/music/track/artist",
419
+ "name" : "Every Little Thing She Does Is Magic"
420
+ },
421
+ {
422
+ "id" : "/guid/9202a8c04000641f800000000128ad14",
423
+ "link" : "/music/track/artist",
424
+ "name" : "De Do Do Do, De Da Da Da"
425
+ },
426
+ {
427
+ "id" : "/guid/9202a8c04000641f800000000128ad3e",
428
+ "link" : "/music/track/artist",
429
+ "name" : "Don't Stand So Close to Me"
430
+ },
431
+ {
432
+ "id" : "/guid/9202a8c04000641f800000000128ad45",
433
+ "link" : "/music/track/artist",
434
+ "name" : "Roxanne"
435
+ },
436
+ {
437
+ "id" : "/guid/9202a8c04000641f800000000128ad4c",
438
+ "link" : "/music/track/artist",
439
+ "name" : "Roxanne '97 (Puff Daddy remix)"
440
+ },
441
+ {
442
+ "id" : "/guid/9202a8c04000641f80000000012dba61",
443
+ "link" : "/music/track/artist",
444
+ "name" : "Every Breath You Take"
445
+ },
446
+ {
447
+ "id" : "/guid/9202a8c04000641f80000000012dde95",
448
+ "link" : "/music/track/artist",
449
+ "name" : "Message in a Bottle"
450
+ },
451
+ {
452
+ "id" : "/guid/9202a8c04000641f80000000012dde9c",
453
+ "link" : "/music/track/artist",
454
+ "name" : "Can't Stand Losing You"
455
+ },
456
+ {
457
+ "id" : "/guid/9202a8c04000641f80000000012ddeaa",
458
+ "link" : "/music/track/artist",
459
+ "name" : "Every Breath You Take"
460
+ },
461
+ {
462
+ "id" : "/guid/9202a8c04000641f80000000012ddeb1",
463
+ "link" : "/music/track/artist",
464
+ "name" : "Walking on The Moon"
465
+ },
466
+ {
467
+ "id" : "/guid/9202a8c04000641f80000000012ddebf",
468
+ "link" : "/music/track/artist",
469
+ "name" : "Every Little Thing She Does Is Magic"
470
+ },
471
+ {
472
+ "id" : "/guid/9202a8c04000641f80000000012ddee9",
473
+ "link" : "/music/track/artist",
474
+ "name" : "Don't Stand So Close to Me"
475
+ },
476
+ {
477
+ "id" : "/guid/9202a8c04000641f80000000012ddef0",
478
+ "link" : "/music/track/artist",
479
+ "name" : "Roxanne"
480
+ },
481
+ {
482
+ "id" : "/guid/9202a8c04000641f80000000012ddef7",
483
+ "link" : "/music/track/artist",
484
+ "name" : "Roxanne '97 (Puff Daddy remix)"
485
+ },
486
+ {
487
+ "id" : "/guid/9202a8c04000641f8000000001338a15",
488
+ "link" : "/music/track/artist",
489
+ "name" : "Message in a Bottle"
490
+ },
491
+ {
492
+ "id" : "/guid/9202a8c04000641f8000000001338a1c",
493
+ "link" : "/music/track/artist",
494
+ "name" : "Can't Stand Losing You"
495
+ },
496
+ {
497
+ "id" : "/guid/9202a8c04000641f8000000001338a2a",
498
+ "link" : "/music/track/artist",
499
+ "name" : "Every Breath You Take"
500
+ },
501
+ {
502
+ "id" : "/guid/9202a8c04000641f8000000001338a38",
503
+ "link" : "/music/track/artist",
504
+ "name" : "Walking on the Moon"
505
+ },
506
+ {
507
+ "id" : "/guid/9202a8c04000641f8000000001338a4d",
508
+ "link" : "/music/track/artist",
509
+ "name" : "Every Little Thing She Does Is Magic"
510
+ },
511
+ {
512
+ "id" : "/guid/9202a8c04000641f8000000001338a54",
513
+ "link" : "/music/track/artist",
514
+ "name" : "De Do Do Do, De Da Da Da"
515
+ },
516
+ {
517
+ "id" : "/guid/9202a8c04000641f8000000001338a7e",
518
+ "link" : "/music/track/artist",
519
+ "name" : "Don't Stand So Close to Me"
520
+ },
521
+ {
522
+ "id" : "/guid/9202a8c04000641f8000000001338a85",
523
+ "link" : "/music/track/artist",
524
+ "name" : "Roxanne"
525
+ },
526
+ {
527
+ "id" : "/guid/9202a8c04000641f8000000001423459",
528
+ "link" : "/music/track/artist",
529
+ "name" : "Don't Stand So Close to Me"
530
+ },
531
+ {
532
+ "id" : "/guid/9202a8c04000641f8000000001474145",
533
+ "link" : "/music/track/artist",
534
+ "name" : "Message in a Bottle"
535
+ },
536
+ {
537
+ "id" : "/guid/9202a8c04000641f800000000147414c",
538
+ "link" : "/music/track/artist",
539
+ "name" : "Can't Stand Losing You"
540
+ },
541
+ {
542
+ "id" : "/guid/9202a8c04000641f800000000147415a",
543
+ "link" : "/music/track/artist",
544
+ "name" : "Every Breath You Take"
545
+ },
546
+ {
547
+ "id" : "/guid/9202a8c04000641f8000000001474168",
548
+ "link" : "/music/track/artist",
549
+ "name" : "Walking on the Moon"
550
+ },
551
+ {
552
+ "id" : "/guid/9202a8c04000641f800000000147417d",
553
+ "link" : "/music/track/artist",
554
+ "name" : "Every Little Thing She Does Is Magic"
555
+ },
556
+ {
557
+ "id" : "/guid/9202a8c04000641f8000000001474184",
558
+ "link" : "/music/track/artist",
559
+ "name" : "De Do Do Do, De Da Da Da"
560
+ },
561
+ {
562
+ "id" : "/guid/9202a8c04000641f80000000014741ae",
563
+ "link" : "/music/track/artist",
564
+ "name" : "Don't Stand So Close to Me"
565
+ },
566
+ {
567
+ "id" : "/guid/9202a8c04000641f80000000014741b5",
568
+ "link" : "/music/track/artist",
569
+ "name" : "Roxanne"
570
+ },
571
+ {
572
+ "id" : "/guid/9202a8c04000641f80000000014741bc",
573
+ "link" : "/music/track/artist",
574
+ "name" : "So Lonely"
575
+ },
576
+ {
577
+ "id" : "/guid/9202a8c04000641f8000000001477682",
578
+ "link" : "/music/track/artist",
579
+ "name" : "Every Little Thing She Does Is Magic"
580
+ },
581
+ {
582
+ "id" : "/guid/9202a8c04000641f80000000014c6e37",
583
+ "link" : "/music/track/artist",
584
+ "name" : "Don't Stand So Close"
585
+ },
586
+ {
587
+ "id" : "/guid/9202a8c04000641f8000000001555d7d",
588
+ "link" : "/music/track/artist",
589
+ "name" : "Walking on the Moon"
590
+ },
591
+ {
592
+ "id" : "/guid/9202a8c04000641f8000000001594b89",
593
+ "link" : "/music/track/artist",
594
+ "name" : "Message in a Bottle"
595
+ },
596
+ {
597
+ "id" : "/guid/9202a8c04000641f8000000001594b90",
598
+ "link" : "/music/track/artist",
599
+ "name" : "Can't Stand Losing You"
600
+ },
601
+ {
602
+ "id" : "/guid/9202a8c04000641f8000000001594b9e",
603
+ "link" : "/music/track/artist",
604
+ "name" : "Every Breath You Take"
605
+ },
606
+ {
607
+ "id" : "/guid/9202a8c04000641f8000000001594bac",
608
+ "link" : "/music/track/artist",
609
+ "name" : "Walking on the Moon"
610
+ },
611
+ {
612
+ "id" : "/guid/9202a8c04000641f8000000001594bc1",
613
+ "link" : "/music/track/artist",
614
+ "name" : "Every Little Thing She Does Is Magic"
615
+ },
616
+ {
617
+ "id" : "/guid/9202a8c04000641f8000000001594bc8",
618
+ "link" : "/music/track/artist",
619
+ "name" : "De Do Do Do De Da Da Da"
620
+ },
621
+ {
622
+ "id" : "/guid/9202a8c04000641f80000000015de479",
623
+ "link" : "/music/track/artist",
624
+ "name" : "Driven to Tears"
625
+ },
626
+ {
627
+ "id" : "/guid/9202a8c04000641f80000000016088e7",
628
+ "link" : "/music/track/artist",
629
+ "name" : "Every Breath You Take"
630
+ },
631
+ {
632
+ "id" : "/guid/9202a8c04000641f800000000163c1eb",
633
+ "link" : "/music/track/artist",
634
+ "name" : "Don't Stand So Close to Me"
635
+ },
636
+ {
637
+ "id" : "/guid/9202a8c04000641f800000000166c542",
638
+ "link" : "/music/track/artist",
639
+ "name" : "So Lonely"
640
+ },
641
+ {
642
+ "id" : "/guid/9202a8c04000641f800000000166ddfa",
643
+ "link" : "/music/track/artist",
644
+ "name" : "Synchronicity II"
645
+ },
646
+ {
647
+ "id" : "/guid/9202a8c04000641f80000000016a7432",
648
+ "link" : "/music/track/artist",
649
+ "name" : "Every Breath You Take"
650
+ },
651
+ {
652
+ "id" : "/guid/9202a8c04000641f80000000016f672b",
653
+ "link" : "/music/track/artist",
654
+ "name" : "Every Breath You Take"
655
+ },
656
+ {
657
+ "id" : "/guid/9202a8c04000641f800000000170d706",
658
+ "link" : "/music/track/artist",
659
+ "name" : "Every Breath You Take"
660
+ },
661
+ {
662
+ "id" : "/guid/9202a8c04000641f80000000017c7193",
663
+ "link" : "/music/track/artist",
664
+ "name" : "Can't Stand Losing You"
665
+ },
666
+ {
667
+ "id" : "/guid/9202a8c04000641f80000000017f93ec",
668
+ "link" : "/music/track/artist",
669
+ "name" : "Roxanne"
670
+ },
671
+ {
672
+ "id" : "/guid/9202a8c04000641f800000000187d519",
673
+ "link" : "/music/track/artist",
674
+ "name" : "De Do Do"
675
+ },
676
+ {
677
+ "id" : "/guid/9202a8c04000641f80000000018b6033",
678
+ "link" : "/music/track/artist",
679
+ "name" : "Every Breath You Take"
680
+ },
681
+ {
682
+ "id" : "/guid/9202a8c04000641f80000000018dc967",
683
+ "link" : "/music/track/artist",
684
+ "name" : "Don't Stand So Close to Me"
685
+ },
686
+ {
687
+ "id" : "/guid/9202a8c04000641f800000000196011e",
688
+ "link" : "/music/track/artist",
689
+ "name" : "Every Breath You Take"
690
+ },
691
+ {
692
+ "id" : "/guid/9202a8c04000641f80000000019ad096",
693
+ "link" : "/music/track/artist",
694
+ "name" : "Every Little Thing She Does Is Magic"
695
+ },
696
+ {
697
+ "id" : "/guid/9202a8c04000641f8000000001a3fbb1",
698
+ "link" : "/music/track/artist",
699
+ "name" : "Every Breath You Take"
700
+ },
701
+ {
702
+ "id" : "/guid/9202a8c04000641f8000000001a51770",
703
+ "link" : "/music/track/artist",
704
+ "name" : "Driven to Tears"
705
+ },
706
+ {
707
+ "id" : "/guid/9202a8c04000641f8000000001a6f0e0",
708
+ "link" : "/music/track/artist",
709
+ "name" : "How Stupid Mr. Bates"
710
+ },
711
+ {
712
+ "id" : "/guid/9202a8c04000641f8000000001a6f0ee",
713
+ "link" : "/music/track/artist",
714
+ "name" : "I Burn For You"
715
+ },
716
+ {
717
+ "id" : "/guid/9202a8c04000641f8000000001a6f118",
718
+ "link" : "/music/track/artist",
719
+ "name" : "A Kind of Loving"
720
+ },
721
+ {
722
+ "id" : "/guid/9202a8c04000641f8000000001b3c3b5",
723
+ "link" : "/music/track/artist",
724
+ "name" : "Roxanne"
725
+ },
726
+ {
727
+ "id" : "/guid/9202a8c04000641f8000000001b4384d",
728
+ "link" : "/music/track/artist",
729
+ "name" : "Nothing Achieving"
730
+ },
731
+ {
732
+ "id" : "/guid/9202a8c04000641f8000000001b8d03f",
733
+ "link" : "/music/track/artist",
734
+ "name" : "Roxanne"
735
+ },
736
+ {
737
+ "id" : "/guid/9202a8c04000641f8000000001bbfa9a",
738
+ "link" : "/music/track/artist",
739
+ "name" : "Fall Out"
740
+ },
741
+ {
742
+ "id" : "/guid/9202a8c04000641f8000000001bf6fa1",
743
+ "link" : "/music/track/artist",
744
+ "name" : "Every Breath You Take"
745
+ },
746
+ {
747
+ "id" : "/guid/9202a8c04000641f8000000001d17cc8",
748
+ "link" : "/music/track/artist",
749
+ "name" : "Message in a Bottle"
750
+ },
751
+ {
752
+ "id" : "/guid/9202a8c04000641f8000000001d17e96",
753
+ "link" : "/music/track/artist",
754
+ "name" : "Every Breath You Take"
755
+ },
756
+ {
757
+ "id" : "/guid/9202a8c04000641f8000000001d2d0b8",
758
+ "link" : "/music/track/artist",
759
+ "name" : "Message in a Bottle"
760
+ },
761
+ {
762
+ "id" : "/guid/9202a8c04000641f8000000001d80ea3",
763
+ "link" : "/music/track/artist",
764
+ "name" : "King of Pain"
765
+ },
766
+ {
767
+ "id" : "/guid/9202a8c04000641f8000000001d93d32",
768
+ "link" : "/music/track/artist",
769
+ "name" : "Every Little Thing She Does Is Magic"
770
+ },
771
+ {
772
+ "id" : "/guid/9202a8c04000641f8000000001e3eb1f",
773
+ "link" : "/music/track/artist",
774
+ "name" : "Every Little Thing She Does Is Magic"
775
+ },
776
+ {
777
+ "id" : "/guid/9202a8c04000641f8000000001ee5178",
778
+ "link" : "/music/track/artist",
779
+ "name" : "Message in a Bottle"
780
+ },
781
+ {
782
+ "id" : "/guid/9202a8c04000641f8000000001f5a4ad",
783
+ "link" : "/music/track/artist",
784
+ "name" : "Every Breath You Take"
785
+ },
786
+ {
787
+ "id" : "/guid/9202a8c04000641f8000000001f835c3",
788
+ "link" : "/music/track/artist",
789
+ "name" : "Every Breath You Take"
790
+ },
791
+ {
792
+ "id" : "/guid/9202a8c04000641f8000000001ff4227",
793
+ "link" : "/music/track/artist",
794
+ "name" : "Every Breath You Take"
795
+ },
796
+ {
797
+ "id" : "/guid/9202a8c04000641f800000000200cc5e",
798
+ "link" : "/music/track/artist",
799
+ "name" : "Every Little Thing She Does Is Magic"
800
+ },
801
+ {
802
+ "id" : "/guid/9202a8c04000641f8000000002041324",
803
+ "link" : "/music/track/artist",
804
+ "name" : "Every Breath You Take"
805
+ },
806
+ {
807
+ "id" : "/guid/9202a8c04000641f800000000206f5f8",
808
+ "link" : "/music/track/artist",
809
+ "name" : "Every Breath You Take"
810
+ },
811
+ {
812
+ "id" : "/guid/9202a8c04000641f80000000021147c7",
813
+ "link" : "/music/track/artist",
814
+ "name" : "Message in a Bottle"
815
+ },
816
+ {
817
+ "id" : "/guid/9202a8c04000641f80000000021147ce",
818
+ "link" : "/music/track/artist",
819
+ "name" : "Can't Stand Losing You"
820
+ },
821
+ {
822
+ "id" : "/guid/9202a8c04000641f80000000021147dc",
823
+ "link" : "/music/track/artist",
824
+ "name" : "Every Breath You Take"
825
+ }
826
+ ],
827
+ "/type/reflect/any_value" : [
828
+ {
829
+ "link" : "/type/object/name",
830
+ "value" : "The Police"
831
+ },
832
+ {
833
+ "link" : "/type/object/name",
834
+ "value" : "The Police"
835
+ },
836
+ {
837
+ "link" : "/type/object/name",
838
+ "value" : "The Police"
839
+ },
840
+ {
841
+ "link" : "/type/object/name",
842
+ "value" : "The Police"
843
+ },
844
+ {
845
+ "link" : "/type/object/name",
846
+ "value" : "ポリス (バンド)"
847
+ },
848
+ {
849
+ "link" : "/type/object/name",
850
+ "value" : "The Police"
851
+ },
852
+ {
853
+ "link" : "/music/artist/active_start",
854
+ "value" : "1977-01"
855
+ },
856
+ {
857
+ "link" : "/type/object/name",
858
+ "value" : "The Police"
859
+ },
860
+ {
861
+ "link" : "/type/object/name",
862
+ "value" : "The Police"
863
+ },
864
+ {
865
+ "link" : "/type/object/name",
866
+ "value" : "The Police"
867
+ },
868
+ {
869
+ "link" : "/type/object/name",
870
+ "value" : "The Police"
871
+ },
872
+ {
873
+ "link" : "/type/object/name",
874
+ "value" : "הפוליס"
875
+ },
876
+ {
877
+ "link" : "/common/topic/alias",
878
+ "value" : "Sting &amp; The Police"
879
+ },
880
+ {
881
+ "link" : "/type/object/name",
882
+ "value" : "เดอะ โพลิซ"
883
+ },
884
+ {
885
+ "link" : "/music/artist/active_end",
886
+ "value" : "1986"
887
+ }
888
+ ],
889
+ "id" : "/en/the_police"
890
+ }
891
+ }