Browse files

schema and attributes are now fetched in one go for performance reasons.

fixed a bug where a resource couldn't be retrieved when it doesn't have master, reverse AND value attributes. (e.g. /en/armin_wolf)
  • Loading branch information...
1 parent c11eb10 commit 388436a58b28f8dda8fb1c38c85e12bff8ace872 michael committed Jul 12, 2009
Showing with 1,004 additions and 979 deletions.
  1. +1 −0 examples/artist.rb
  2. +1 −1 ken.gemspec
  3. +31 −4 lib/ken.rb
  4. +26 −27 lib/ken/resource.rb
  5. +1 −1 test/fixtures/music_artist.json
  6. +935 −938 test/fixtures/the_police.json
  7. +2 −2 test/integration/ken_test.rb
  8. +7 −6 test/unit/attribute_test.rb
View
1 examples/artist.rb
@@ -4,6 +4,7 @@
EXAMPLES_ROOT = Pathname(__FILE__).dirname.expand_path
require EXAMPLES_ROOT.parent + 'lib/ken'
+Ken::Logger.new(STDOUT, :info)
Ken::Session.new('http://www.freebase.com', 'ma', 'xxxxx')
resource = Ken.get('/en/the_police')
View
2 ken.gemspec
@@ -6,7 +6,7 @@ Gem::Specification.new do |s|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["michael"]
- s.date = %q{2009-07-08}
+ s.date = %q{2009-07-11}
s.email = %q{ma[at]zive[dot]at}
s.extra_rdoc_files = [
"LICENSE",
View
35 lib/ken.rb
@@ -39,8 +39,8 @@ module Ken
# executed. maybe this is fine, maybe not,
# this needs to be discussed.
- QUERY = query = {
- # :id => id, # needs to be updated in instance mehtod
+ FETCH_DATA_QUERY = {
+ # :id => id, # needs to be merge!d in instance method
:name => nil,
:"ken:type" => [{
:id => nil,
@@ -53,9 +53,36 @@ module Ken
:reverse_property => nil,
:master_property => nil,
}]
- }]
+ }],
+ :"/type/reflect/any_master" => [
+ {
+ :id => nil,
+ :link => nil,
+ :name => nil,
+ :optional => true
+ }
+ ],
+ :"/type/reflect/any_reverse" => [
+ {
+ :id => nil,
+ :link => nil,
+ :name => nil,
+ :optional => true
+ }
+ ],
+ :"/type/reflect/any_value" => [
+ {
+ :link => nil,
+ :value => nil,
+ :optional => true
+ # TODO: support multiple language
+ # :lang => "/lang/en",
+ # :type => "/type/text"
+ }
+ ]
}
+
# Executes an Mql Query against the Freebase API and returns the result as
# a <tt>Collection</tt> of <tt>Resources</tt>.
#
@@ -89,7 +116,7 @@ def self.all(options = {})
# @api public
def self.get(id)
assert_kind_of 'id', id, String
- result = Ken.session.mqlread(QUERY.merge!(:id => id))
+ result = Ken.session.mqlread(FETCH_DATA_QUERY.merge!(:id => id))
raise ResourceNotFound unless result
Ken::Resource.new(result)
end
View
53 lib/ken/resource.rb
@@ -2,7 +2,7 @@ module Ken
class Resource
include Extlib::Assertions
- FETCH_SCHEMA_QUERY = {
+ FETCH_DATA_QUERY = {
# :id => id, # needs to be merge!d in instance method
:name => nil,
:"ken:type" => [{
@@ -12,31 +12,32 @@ class Resource
:id => nil,
:name => nil,
:expected_type => nil,
- :unique => nil
+ :unique => nil,
+ :reverse_property => nil,
+ :master_property => nil,
}]
- }]
- }
-
- FETCH_ATTRIBUTES_QUERY = {
- # :id => id # needs to be merg!d in instance method
+ }],
:"/type/reflect/any_master" => [
{
:id => nil,
:link => nil,
- :name => nil
+ :name => nil,
+ :optional => true
}
],
:"/type/reflect/any_reverse" => [
{
:id => nil,
:link => nil,
- :name => nil
+ :name => nil,
+ :optional => true
}
],
:"/type/reflect/any_value" => [
{
:link => nil,
- :value => nil
+ :value => nil,
+ :optional => true
# TODO: support multiple language
# :lang => "/lang/en",
# :type => "/type/text"
@@ -47,8 +48,8 @@ class Resource
# initializes a resource using a json result
def initialize(data)
assert_kind_of 'data', data, Hash
- # intialize lazy if there is no type supplied
@schema_loaded, @attributes_loaded, @data = false, false, data
+ @data_fechted = data["/type/reflect/any_master"] != nil
end
# resource id
@@ -114,51 +115,49 @@ def schema_loaded?
def attributes_loaded?
@attributes_loaded
end
+ # returns true if json data is already loaded
+ # @api public
+ def data_fetched?
+ @data_fetched
+ end
private
- # executes the fetch attributes query in order to load the full set if attributes
+ # executes the fetch data query in order to load the full set of types, properties and attributes
# more info at http://lists.freebase.com/pipermail/developers/2007-December/001022.html
# @api private
- def fetch_attributes
- Ken.session.mqlread(FETCH_ATTRIBUTES_QUERY.merge!(:id => id))
+ def fetch_data
+ return @data if @data["/type/reflect/any_master"]
+ @data = Ken.session.mqlread(FETCH_DATA_QUERY.merge!(:id => id))
end
# loads the full set of attributes using reflection
# information is extracted from master, value and reverse attributes
# @api private
def load_attributes!
- data = @data["ken:attribute"] || fetch_attributes
+ fetch_data unless data_fetched?
# master & value attributes
- raw_attributes = Ken::Util.convert_hash(data["/type/reflect/any_master"])
- raw_attributes.merge!(Ken::Util.convert_hash(data["/type/reflect/any_value"]))
+ raw_attributes = Ken::Util.convert_hash(@data["/type/reflect/any_master"])
+ raw_attributes.merge!(Ken::Util.convert_hash(@data["/type/reflect/any_value"]))
@attributes = {}
raw_attributes.each_pair do |a, d|
properties.select { |p| p.id == a}.each do |p|
@attributes[p.id] = Ken::Attribute.create(d, p)
end
end
-
# reverse properties
- raw_attributes = Ken::Util.convert_hash(data["/type/reflect/any_reverse"])
+ raw_attributes = Ken::Util.convert_hash(@data["/type/reflect/any_reverse"])
raw_attributes.each_pair do |a, d|
properties.select { |p| p.master_property == a}.each do |p|
@attributes[p.id] = Ken::Attribute.create(d, p)
end
end
-
@attributes_loaded = true
end
- # executes the fetch schema query in order to load all schema information
- # @api private
- def fetch_schema
- Ken.session.mqlread(FETCH_SCHEMA_QUERY.merge!(:id => id))["ken:type"]
- end
-
# loads the resource's metainfo
# @api private
def load_schema!
- @data["ken:type"] ||= fetch_schema
+ fetch_data unless data_fetched?
@types = Ken::Collection.new(@data["ken:type"].map { |type| Ken::Type.new(type) })
@schema_loaded = true
end
View
2 test/fixtures/music_artist.json
@@ -7,7 +7,7 @@
"expected_type" : "/location/location",
"id" : "/music/artist/origin",
"name" : "Place Musical Career Began",
- "unique" : null
+ "unique" :true
},
{
"expected_type" : "/type/datetime",
View
1,873 test/fixtures/the_police.json
@@ -1,940 +1,937 @@
{
- "id" : "/en/the_police",
- "name" : "The Police",
- "ken:type" : [
- {
- "id": "/music/artist",
- "name": "Musical Artist",
- "properties": [
- {
- "expected_type": "/location/location",
- "id": "/music/artist/origin",
- "master_property": null,
- "name": "Place Musical Career Began",
- "reverse_property": null,
- "unique": true
- },
- {
- "expected_type": "/type/datetime",
- "id": "/music/artist/active_start",
- "master_property": null,
- "name": "Active as Musical Artist (start)",
- "reverse_property": null,
- "unique": true
- },
- {
- "expected_type": "/type/datetime",
- "id": "/music/artist/active_end",
- "master_property": null,
- "name": "Active as Musical Artist (end)",
- "reverse_property": null,
- "unique": true
- },
- {
- "expected_type": "/music/genre",
- "id": "/music/artist/genre",
- "master_property": null,
- "name": "Musical Genres",
- "reverse_property": "/music/genre/artists",
- "unique": false
- },
- {
- "expected_type": "/music/record_label",
- "id": "/music/artist/label",
- "master_property": null,
- "name": "Record Labels",
- "reverse_property": "/music/record_label/artist",
- "unique": null
- },
- {
- "expected_type": "/music/artist",
- "id": "/music/artist/similar_artist",
- "master_property": null,
- "name": "Similar Artists",
- "reverse_property": "/music/artist/artist_similar",
- "unique": null
- },
- {
- "expected_type": "/common/webpage",
- "id": "/music/artist/home_page",
- "master_property": null,
- "name": "Musical Artist Home Page",
- "reverse_property": null,
- "unique": null
- },
- {
- "expected_type": "/common/webpage",
- "id": "/music/artist/acquire_webpage",
- "master_property": null,
- "name": "Web Page for Music",
- "reverse_property": null,
- "unique": null
- },
- {
- "expected_type": "/music/album",
- "id": "/music/artist/album",
- "master_property": "/music/album/artist",
- "name": "Albums",
- "reverse_property": null,
- "unique": null
- },
- {
- "expected_type": "/music/recording_contribution",
- "id": "/music/artist/contribution",
- "master_property": "/music/recording_contribution/contributor",
- "name": "Album Contributions",
- "reverse_property": null,
- "unique": null
- },
- {
- "expected_type": "/music/track",
- "id": "/music/artist/track",
- "master_property": "/music/track/artist",
- "name": "Tracks Recorded",
- "reverse_property": null,
- "unique": null
- },
- {
- "expected_type": "/music/artist",
- "id": "/music/artist/artist_similar",
- "master_property": "/music/artist/similar_artist",
- "name": "Similar Musical Artists",
- "reverse_property": null,
- "unique": null
- },
- {
- "expected_type": "/music/track_contribution",
- "id": "/music/artist/track_contributions",
- "master_property": "/music/track_contribution/contributor",
- "name": "Track Contributions",
- "reverse_property": null,
- "unique": null
- },
- {
- "expected_type": "/music/instrument",
- "id": "/music/artist/instruments_played",
- "master_property": null,
- "name": "Instruments Played",
- "reverse_property": "/music/instrument/instrumentalists",
- "unique": null
- },
- {
- "expected_type": "/music/voice",
- "id": "/music/artist/vocal_range",
- "master_property": null,
- "name": "Vocal Range",
- "reverse_property": "/music/voice/singers",
- "unique": null
- },
- {
- "expected_type": "/music/concert_tour",
- "id": "/music/artist/concert_tours",
- "master_property": "/music/concert_tour/artist",
- "name": "Concert Tours",
- "reverse_property": null,
- "unique": false
- }
- ]
- },
- {
- "id": "/common/topic",
- "name": "Topic",
- "properties": [
- {
- "expected_type": "/type/text",
- "id": "/common/topic/alias",
- "master_property": null,
- "name": "Also known as",
- "reverse_property": null,
- "unique": null
- },
- {
- "expected_type": "/common/document",
- "id": "/common/topic/article",
- "master_property": null,
- "name": "article",
- "reverse_property": null,
- "unique": null
- },
- {
- "expected_type": "/common/image",
- "id": "/common/topic/image",
- "master_property": null,
- "name": "image",
- "reverse_property": "/common/image/appears_in_topic_gallery",
- "unique": null
- },
- {
- "expected_type": "/common/webpage",
- "id": "/common/topic/webpage",
- "master_property": null,
- "name": "Web Link(s)",
- "reverse_property": null,
- "unique": null
- }
- ]
- },
- {
- "id": "/music/producer",
- "name": "Record Producer",
- "properties": [
- {
- "expected_type": "/music/album",
- "id": "/music/producer/albums_produced",
- "master_property": "/music/album/producer",
- "name": "Albums Produced",
- "reverse_property": null,
- "unique": null
- },
- {
- "expected_type": "/music/track",
- "id": "/music/producer/tracks_produced",
- "master_property": "/music/track/producer",
- "name": "Tracks produced",
- "reverse_property": null,
- "unique": false
- }
- ]
- },
- {
- "id": "/music/musical_group",
- "name": "Musical Group",
- "properties": [{
- "expected_type": "/music/group_membership",
- "id": "/music/musical_group/member",
- "master_property": "/music/group_membership/group",
- "name": "Members Of Musical Group",
- "reverse_property": null,
- "unique": null
- }]
- },
- {
- "id": "/broadcast/artist",
- "name": "Broadcast Artist",
- "properties": [{
- "expected_type": "/broadcast/content",
- "id": "/broadcast/artist/content",
- "master_property": "/broadcast/content/artist",
- "name": "Content",
- "reverse_property": null,
- "unique": null
- }]
- },
- {
- "id": "/award/award_winner",
- "name": "Award Winner",
- "properties": [{
- "expected_type": "/award/award_honor",
- "id": "/award/award_winner/awards_won",
- "master_property": "/award/award_honor/award_winner",
- "name": "Awards Won",
- "reverse_property": null,
- "unique": null
- }]
- }
- ],
- "ken:attribute" : {
- "/type/reflect/any_master": [
- {
- "id": "/boot/all_permission",
- "link": "/type/object/permission",
- "name": "Global Write Permission"
- },
- {
- "id": "/guid/9202a8c04000641f800000000006df25",
- "link": "/common/topic/article",
- "name": null
- },
- {
- "id": "/music/artist",
- "link": "/type/object/type",
- "name": "Musical Artist"
- },
- {
- "id": "/common/topic",
- "link": "/type/object/type",
- "name": "Topic"
- },
- {
- "id": "/guid/9202a8c04000641f8000000003921d3c",
- "link": "/common/topic/webpage",
- "name": "Discogs entry"
- },
- {
- "id": "/wikipedia/images/en_id/982873",
- "link": "/common/topic/image",
- "name": null
- },
- {
- "id": "/en/rock_music",
- "link": "/music/artist/genre",
- "name": "Rock music"
- },
- {
- "id": "/en/ska",
- "link": "/music/artist/genre",
- "name": "Ska"
- },
- {
- "id": "/en/reggae",
- "link": "/music/artist/genre",
- "name": "Reggae"
- },
- {
- "id": "/en/london",
- "link": "/music/artist/origin",
- "name": "London"
- },
- {
- "id": "/music/producer",
- "link": "/type/object/type",
- "name": "Record Producer"
- },
- {
- "id": "/music/musical_group",
- "link": "/type/object/type",
- "name": "Musical Group"
- },
- {
- "id": "/guid/9202a8c04000641f80000000072a23e1",
- "link": "/common/topic/webpage",
- "name": null
- },
- {
- "id": "/en/new_wave",
- "link": "/music/artist/genre",
- "name": "New Wave"
- },
- {
- "id": "/en/a_m_records",
- "link": "/music/artist/label",
- "name": "A&amp;M Records"
- },
- {
- "id": "/en/polydor_records",
- "link": "/music/artist/label",
- "name": "Polydor Records"
- },
- {
- "id": "/en/illegal_records",
- "link": "/music/artist/label",
- "name": "Illegal Records"
- },
- {
- "id": "/en/post-punk",
- "link": "/music/artist/genre",
- "name": "Post-punk"
- },
- {
- "id": "/guid/9202a8c04000641f80000000082147dd",
- "link": "/common/topic/webpage",
- "name": null
- },
- {
- "id": "/wikipedia/images/commons_id/3520500",
- "link": "/common/topic/image",
- "name": "The Police performing live on August 1, 2007 at Madison Square Garden, New York."
- },
- {
- "id": "/broadcast/artist",
- "link": "/type/object/type",
- "name": "Broadcast Artist"
- },
- {
- "id": "/en/electric_guitar",
- "link": "/music/artist/instruments_played",
- "name": "Electric guitar"
- },
- {
- "id": "/en/drum",
- "link": "/music/artist/instruments_played",
- "name": "Drum"
- },
- {
- "id": "/en/universal_music_group",
- "link": "/music/artist/label",
- "name": "Universal Music Group"
- },
- {
- "id": "/award/award_winner",
- "link": "/type/object/type",
- "name": "Award Winner"
- },
- {
- "id": "/en/pop_rock",
- "link": "/music/artist/genre",
- "name": "Pop rock"
- },
- {
- "id": "/en/sting",
- "link": "/music/artist/similar_artist",
- "name": "Sting"
- }
- ],
- "/type/reflect/any_reverse": [
- {
- "id": "/en/outlandos_damour",
- "link": "/music/album/artist",
- "name": "Outlandos d'Amour"
- },
- {
- "id": "/en/reggatta_de_blanc",
- "link": "/music/album/artist",
- "name": "Reggatta de Blanc"
- },
- {
- "id": "/en/zenyatta_mondatta",
- "link": "/music/album/artist",
- "name": "Zenyatta Mondatta"
- },
- {
- "id": "/guid/9202a8c04000641f800000000017dab4",
- "link": "/music/album/artist",
- "name": "Ghost in the Machine"
- },
- {
- "id": "/guid/9202a8c04000641f8000000002f9e349",
- "link": "/music/album/artist",
- "name": "Synchronicity"
- },
- {
- "id": "/en/every_breath_you_take_the_singles",
- "link": "/music/album/artist",
- "name": "Every Breath You Take: The Singles"
- },
- {
- "id": "/guid/9202a8c04000641f8000000002f9e3ca",
- "link": "/music/album/artist",
- "name": "Greatest Hits"
- },
- {
- "id": "/en/message_in_a_box_the_complete_recordings",
- "link": "/music/album/artist",
- "name": "Message in a Box: The Complete Recordings"
- },
- {
- "id": "/guid/9202a8c04000641f8000000002f9e2df",
- "link": "/music/album/artist",
- "name": "Live!"
- },
- {
- "id": "/en/every_breath_you_take_the_classics",
- "link": "/music/album/artist",
- "name": "Every Breath You Take: The Classics"
- },
- {
- "id": "/guid/9202a8c04000641f8000000002f9e3a7",
- "link": "/music/album/artist",
- "name": "Their Greatest Hits"
- },
- {
- "id": "/guid/9202a8c04000641f8000000002f9e2cf",
- "link": "/music/album/artist",
- "name": "Can't Stand Losing You"
- },
- {
- "id": "/en/roxanne_97_puff_daddy_remix",
- "link": "/music/album/artist",
- "name": "Roxanne '97 (Puff Daddy remix)"
- },
- {
- "id": "/en/roxanne_97",
- "link": "/music/album/artist",
- "name": "Roxanne '97"
- },
- {
- "id": "/guid/9202a8c04000641f800000000128acd5",
- "link": "/music/track/artist",
- "name": "Message in a Bottle"
- },
- {
- "id": "/guid/9202a8c04000641f800000000128acdc",
- "link": "/music/track/artist",
- "name": "Can't Stand Losing You"
- },
- {
- "id": "/guid/9202a8c04000641f800000000128acea",
- "link": "/music/track/artist",
- "name": "Every Breath You Take"
- },
- {
- "id": "/guid/9202a8c04000641f800000000128acf8",
- "link": "/music/track/artist",
- "name": "Walking on the Moon"
- },
- {
- "id": "/guid/9202a8c04000641f800000000128ad0d",
- "link": "/music/track/artist",
- "name": "Every Little Thing She Does Is Magic"
- },
- {
- "id": "/guid/9202a8c04000641f800000000128ad14",
- "link": "/music/track/artist",
- "name": "De Do Do Do, De Da Da Da"
- },
- {
- "id": "/guid/9202a8c04000641f800000000128ad3e",
- "link": "/music/track/artist",
- "name": "Don't Stand So Close to Me"
- },
- {
- "id": "/guid/9202a8c04000641f800000000128ad45",
- "link": "/music/track/artist",
- "name": "Roxanne"
- },
- {
- "id": "/guid/9202a8c04000641f800000000128ad4c",
- "link": "/music/track/artist",
- "name": "Roxanne '97 (Puff Daddy remix)"
- },
- {
- "id": "/guid/9202a8c04000641f80000000012dba61",
- "link": "/music/track/artist",
- "name": "Every Breath You Take"
- },
- {
- "id": "/guid/9202a8c04000641f80000000012dde95",
- "link": "/music/track/artist",
- "name": "Message in a Bottle"
- },
- {
- "id": "/guid/9202a8c04000641f80000000012dde9c",
- "link": "/music/track/artist",
- "name": "Can't Stand Losing You"
- },
- {
- "id": "/guid/9202a8c04000641f80000000012ddeaa",
- "link": "/music/track/artist",
- "name": "Every Breath You Take"
- },
- {
- "id": "/guid/9202a8c04000641f80000000012ddeb1",
- "link": "/music/track/artist",
- "name": "Walking on The Moon"
- },
- {
- "id": "/guid/9202a8c04000641f80000000012ddebf",
- "link": "/music/track/artist",
- "name": "Every Little Thing She Does Is Magic"
- },
- {
- "id": "/guid/9202a8c04000641f80000000012ddee9",
- "link": "/music/track/artist",
- "name": "Don't Stand So Close to Me"
- },
- {
- "id": "/guid/9202a8c04000641f80000000012ddef0",
- "link": "/music/track/artist",
- "name": "Roxanne"
- },
- {
- "id": "/guid/9202a8c04000641f80000000012ddef7",
- "link": "/music/track/artist",
- "name": "Roxanne '97 (Puff Daddy remix)"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001338a15",
- "link": "/music/track/artist",
- "name": "Message in a Bottle"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001338a1c",
- "link": "/music/track/artist",
- "name": "Can't Stand Losing You"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001338a2a",
- "link": "/music/track/artist",
- "name": "Every Breath You Take"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001338a38",
- "link": "/music/track/artist",
- "name": "Walking on the Moon"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001338a4d",
- "link": "/music/track/artist",
- "name": "Every Little Thing She Does Is Magic"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001338a54",
- "link": "/music/track/artist",
- "name": "De Do Do Do, De Da Da Da"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001338a7e",
- "link": "/music/track/artist",
- "name": "Don't Stand So Close to Me"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001338a85",
- "link": "/music/track/artist",
- "name": "Roxanne"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001423459",
- "link": "/music/track/artist",
- "name": "Don't Stand So Close to Me"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001474145",
- "link": "/music/track/artist",
- "name": "Message in a Bottle"
- },
- {
- "id": "/guid/9202a8c04000641f800000000147414c",
- "link": "/music/track/artist",
- "name": "Can't Stand Losing You"
- },
- {
- "id": "/guid/9202a8c04000641f800000000147415a",
- "link": "/music/track/artist",
- "name": "Every Breath You Take"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001474168",
- "link": "/music/track/artist",
- "name": "Walking on the Moon"
- },
- {
- "id": "/guid/9202a8c04000641f800000000147417d",
- "link": "/music/track/artist",
- "name": "Every Little Thing She Does Is Magic"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001474184",
- "link": "/music/track/artist",
- "name": "De Do Do Do, De Da Da Da"
- },
- {
- "id": "/guid/9202a8c04000641f80000000014741ae",
- "link": "/music/track/artist",
- "name": "Don't Stand So Close to Me"
- },
- {
- "id": "/guid/9202a8c04000641f80000000014741b5",
- "link": "/music/track/artist",
- "name": "Roxanne"
- },
- {
- "id": "/guid/9202a8c04000641f80000000014741bc",
- "link": "/music/track/artist",
- "name": "So Lonely"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001477682",
- "link": "/music/track/artist",
- "name": "Every Little Thing She Does Is Magic"
- },
- {
- "id": "/guid/9202a8c04000641f80000000014c6e37",
- "link": "/music/track/artist",
- "name": "Don't Stand So Close"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001555d7d",
- "link": "/music/track/artist",
- "name": "Walking on the Moon"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001594b89",
- "link": "/music/track/artist",
- "name": "Message in a Bottle"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001594b90",
- "link": "/music/track/artist",
- "name": "Can't Stand Losing You"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001594b9e",
- "link": "/music/track/artist",
- "name": "Every Breath You Take"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001594bac",
- "link": "/music/track/artist",
- "name": "Walking on the Moon"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001594bc1",
- "link": "/music/track/artist",
- "name": "Every Little Thing She Does Is Magic"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001594bc8",
- "link": "/music/track/artist",
- "name": "De Do Do Do De Da Da Da"
- },
- {
- "id": "/guid/9202a8c04000641f80000000015de479",
- "link": "/music/track/artist",
- "name": "Driven to Tears"
- },
- {
- "id": "/guid/9202a8c04000641f80000000016088e7",
- "link": "/music/track/artist",
- "name": "Every Breath You Take"
- },
- {
- "id": "/guid/9202a8c04000641f800000000163c1eb",
- "link": "/music/track/artist",
- "name": "Don't Stand So Close to Me"
- },
- {
- "id": "/guid/9202a8c04000641f800000000166c542",
- "link": "/music/track/artist",
- "name": "So Lonely"
- },
- {
- "id": "/guid/9202a8c04000641f800000000166ddfa",
- "link": "/music/track/artist",
- "name": "Synchronicity II"
- },
- {
- "id": "/guid/9202a8c04000641f80000000016a7432",
- "link": "/music/track/artist",
- "name": "Every Breath You Take"
- },
- {
- "id": "/guid/9202a8c04000641f80000000016f672b",
- "link": "/music/track/artist",
- "name": "Every Breath You Take"
- },
- {
- "id": "/guid/9202a8c04000641f800000000170d706",
- "link": "/music/track/artist",
- "name": "Every Breath You Take"
- },
- {
- "id": "/guid/9202a8c04000641f80000000017c7193",
- "link": "/music/track/artist",
- "name": "Can't Stand Losing You"
- },
- {
- "id": "/guid/9202a8c04000641f80000000017f93ec",
- "link": "/music/track/artist",
- "name": "Roxanne"
- },
- {
- "id": "/guid/9202a8c04000641f800000000187d519",
- "link": "/music/track/artist",
- "name": "De Do Do"
- },
- {
- "id": "/guid/9202a8c04000641f80000000018b6033",
- "link": "/music/track/artist",
- "name": "Every Breath You Take"
- },
- {
- "id": "/guid/9202a8c04000641f80000000018dc967",
- "link": "/music/track/artist",
- "name": "Don't Stand So Close to Me"
- },
- {
- "id": "/guid/9202a8c04000641f800000000196011e",
- "link": "/music/track/artist",
- "name": "Every Breath You Take"
- },
- {
- "id": "/guid/9202a8c04000641f80000000019ad096",
- "link": "/music/track/artist",
- "name": "Every Little Thing She Does Is Magic"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001a3fbb1",
- "link": "/music/track/artist",
- "name": "Every Breath You Take"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001a51770",
- "link": "/music/track/artist",
- "name": "Driven to Tears"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001a6f0e0",
- "link": "/music/track/artist",
- "name": "How Stupid Mr. Bates"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001a6f0ee",
- "link": "/music/track/artist",
- "name": "I Burn For You"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001a6f118",
- "link": "/music/track/artist",
- "name": "A Kind of Loving"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001b3c3b5",
- "link": "/music/track/artist",
- "name": "Roxanne"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001b4384d",
- "link": "/music/track/artist",
- "name": "Nothing Achieving"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001b8d03f",
- "link": "/music/track/artist",
- "name": "Roxanne"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001bbfa9a",
- "link": "/music/track/artist",
- "name": "Fall Out"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001bf6fa1",
- "link": "/music/track/artist",
- "name": "Every Breath You Take"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001d17cc8",
- "link": "/music/track/artist",
- "name": "Message in a Bottle"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001d17e96",
- "link": "/music/track/artist",
- "name": "Every Breath You Take"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001d2d0b8",
- "link": "/music/track/artist",
- "name": "Message in a Bottle"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001d80ea3",
- "link": "/music/track/artist",
- "name": "King of Pain"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001d93d32",
- "link": "/music/track/artist",
- "name": "Every Little Thing She Does Is Magic"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001e3eb1f",
- "link": "/music/track/artist",
- "name": "Every Little Thing She Does Is Magic"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001ee5178",
- "link": "/music/track/artist",
- "name": "Message in a Bottle"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001f5a4ad",
- "link": "/music/track/artist",
- "name": "Every Breath You Take"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001f835c3",
- "link": "/music/track/artist",
- "name": "Every Breath You Take"
- },
- {
- "id": "/guid/9202a8c04000641f8000000001ff4227",
- "link": "/music/track/artist",
- "name": "Every Breath You Take"
- },
- {
- "id": "/guid/9202a8c04000641f800000000200cc5e",
- "link": "/music/track/artist",
- "name": "Every Little Thing She Does Is Magic"
- },
- {
- "id": "/guid/9202a8c04000641f8000000002041324",
- "link": "/music/track/artist",
- "name": "Every Breath You Take"
- },
- {
- "id": "/guid/9202a8c04000641f800000000206f5f8",
- "link": "/music/track/artist",
- "name": "Every Breath You Take"
- },
- {
- "id": "/guid/9202a8c04000641f80000000021147c7",
- "link": "/music/track/artist",
- "name": "Message in a Bottle"
- },
- {
- "id": "/guid/9202a8c04000641f80000000021147ce",
- "link": "/music/track/artist",
- "name": "Can't Stand Losing You"
- },
- {
- "id": "/guid/9202a8c04000641f80000000021147dc",
- "link": "/music/track/artist",
- "name": "Every Breath You Take"
- }
- ],
- "/type/reflect/any_value": [
- {
- "link": "/type/object/name",
- "value": "The Police"
- },
- {
- "link": "/type/object/name",
- "value": "The Police"
- },
- {
- "link": "/type/object/name",
- "value": "The Police"
- },
- {
- "link": "/type/object/name",
- "value": "The Police"
- },
- {
- "link": "/type/object/name",
- "value": "\u30dd\u30ea\u30b9 (\u30d0\u30f3\u30c9)"
- },
- {
- "link": "/type/object/name",
- "value": "The Police"
- },
- {
- "link": "/music/artist/active_start",
- "value": "1977-01"
- },
- {
- "link": "/type/object/name",
- "value": "The Police"
- },
- {
- "link": "/type/object/name",
- "value": "The Police"
- },
- {
- "link": "/type/object/name",
- "value": "The Police"
- },
- {
- "link": "/type/object/name",
- "value": "The Police"
- },
- {
- "link": "/type/object/name",
- "value": "\u05d4\u05e4\u05d5\u05dc\u05d9\u05e1"
- },
- {
- "link": "/common/topic/alias",
- "value": "Sting &amp; The Police"
- },
- {
- "link": "/type/object/name",
- "value": "\u0e40\u0e14\u0e2d\u0e30 \u0e42\u0e1e\u0e25\u0e34\u0e0b"
- },
- {
- "link": "/music/artist/active_end",
- "value": "1986"
- }
- ],
- "id": "/en/the_police"
- }
+ "/type/reflect/any_master": [
+ {
+ "id": "/boot/all_permission",
+ "link": "/type/object/permission",
+ "name": "Global Write Permission"
+ },
+ {
+ "id": "/guid/9202a8c04000641f800000000006df25",
+ "link": "/common/topic/article",
+ "name": null
+ },
+ {
+ "id": "/music/artist",
+ "link": "/type/object/type",
+ "name": "Musical Artist"
+ },
+ {
+ "id": "/common/topic",
+ "link": "/type/object/type",
+ "name": "Topic"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000003921d3c",
+ "link": "/common/topic/webpage",
+ "name": "Discogs entry"
+ },
+ {
+ "id": "/wikipedia/images/en_id/982873",
+ "link": "/common/topic/image",
+ "name": null
+ },
+ {
+ "id": "/en/rock_music",
+ "link": "/music/artist/genre",
+ "name": "Rock music"
+ },
+ {
+ "id": "/en/ska",
+ "link": "/music/artist/genre",
+ "name": "Ska"
+ },
+ {
+ "id": "/en/reggae",
+ "link": "/music/artist/genre",
+ "name": "Reggae"
+ },
+ {
+ "id": "/en/london",
+ "link": "/music/artist/origin",
+ "name": "London"
+ },
+ {
+ "id": "/music/producer",
+ "link": "/type/object/type",
+ "name": "Record Producer"
+ },
+ {
+ "id": "/music/musical_group",
+ "link": "/type/object/type",
+ "name": "Musical Group"
+ },
+ {
+ "id": "/guid/9202a8c04000641f80000000072a23e1",
+ "link": "/common/topic/webpage",
+ "name": null
+ },
+ {
+ "id": "/en/new_wave",
+ "link": "/music/artist/genre",
+ "name": "New Wave"
+ },
+ {
+ "id": "/en/a_m_records",
+ "link": "/music/artist/label",
+ "name": "A&amp;M Records"
+ },
+ {
+ "id": "/en/polydor_records",
+ "link": "/music/artist/label",
+ "name": "Polydor Records"
+ },
+ {
+ "id": "/en/illegal_records",
+ "link": "/music/artist/label",
+ "name": "Illegal Records"
+ },
+ {
+ "id": "/en/post-punk",
+ "link": "/music/artist/genre",
+ "name": "Post-punk"
+ },
+ {
+ "id": "/guid/9202a8c04000641f80000000082147dd",
+ "link": "/common/topic/webpage",
+ "name": null
+ },
+ {
+ "id": "/wikipedia/images/commons_id/3520500",
+ "link": "/common/topic/image",
+ "name": "The Police performing live on August 1, 2007 at Madison Square Garden, New York."
+ },
+ {
+ "id": "/broadcast/artist",
+ "link": "/type/object/type",
+ "name": "Broadcast Artist"
+ },
+ {
+ "id": "/en/electric_guitar",
+ "link": "/music/artist/instruments_played",
+ "name": "Electric guitar"
+ },
+ {
+ "id": "/en/drum",
+ "link": "/music/artist/instruments_played",
+ "name": "Drum"
+ },
+ {
+ "id": "/en/universal_music_group",
+ "link": "/music/artist/label",
+ "name": "Universal Music Group"
+ },
+ {
+ "id": "/award/award_winner",
+ "link": "/type/object/type",
+ "name": "Award Winner"
+ },
+ {
+ "id": "/en/pop_rock",
+ "link": "/music/artist/genre",
+ "name": "Pop rock"
+ },
+ {
+ "id": "/en/sting",
+ "link": "/music/artist/similar_artist",
+ "name": "Sting"
+ }
+ ],
+ "/type/reflect/any_reverse": [
+ {
+ "id": "/en/outlandos_damour",
+ "link": "/music/album/artist",
+ "name": "Outlandos d'Amour"
+ },
+ {
+ "id": "/en/reggatta_de_blanc",
+ "link": "/music/album/artist",
+ "name": "Reggatta de Blanc"
+ },
+ {
+ "id": "/en/zenyatta_mondatta",
+ "link": "/music/album/artist",
+ "name": "Zenyatta Mondatta"
+ },
+ {
+ "id": "/guid/9202a8c04000641f800000000017dab4",
+ "link": "/music/album/artist",
+ "name": "Ghost in the Machine"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000002f9e349",
+ "link": "/music/album/artist",
+ "name": "Synchronicity"
+ },
+ {
+ "id": "/en/every_breath_you_take_the_singles",
+ "link": "/music/album/artist",
+ "name": "Every Breath You Take: The Singles"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000002f9e3ca",
+ "link": "/music/album/artist",
+ "name": "Greatest Hits"
+ },
+ {
+ "id": "/en/message_in_a_box_the_complete_recordings",
+ "link": "/music/album/artist",
+ "name": "Message in a Box: The Complete Recordings"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000002f9e2df",
+ "link": "/music/album/artist",
+ "name": "Live!"
+ },
+ {
+ "id": "/en/every_breath_you_take_the_classics",
+ "link": "/music/album/artist",
+ "name": "Every Breath You Take: The Classics"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000002f9e3a7",
+ "link": "/music/album/artist",
+ "name": "Their Greatest Hits"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000002f9e2cf",
+ "link": "/music/album/artist",
+ "name": "Can't Stand Losing You"
+ },
+ {
+ "id": "/en/roxanne_97_puff_daddy_remix",
+ "link": "/music/album/artist",
+ "name": "Roxanne '97 (Puff Daddy remix)"
+ },
+ {
+ "id": "/en/roxanne_97",
+ "link": "/music/album/artist",
+ "name": "Roxanne '97"
+ },
+ {
+ "id": "/guid/9202a8c04000641f800000000128acd5",
+ "link": "/music/track/artist",
+ "name": "Message in a Bottle"
+ },
+ {
+ "id": "/guid/9202a8c04000641f800000000128acdc",
+ "link": "/music/track/artist",
+ "name": "Can't Stand Losing You"
+ },
+ {
+ "id": "/guid/9202a8c04000641f800000000128acea",
+ "link": "/music/track/artist",
+ "name": "Every Breath You Take"
+ },
+ {
+ "id": "/guid/9202a8c04000641f800000000128acf8",
+ "link": "/music/track/artist",
+ "name": "Walking on the Moon"
+ },
+ {
+ "id": "/guid/9202a8c04000641f800000000128ad0d",
+ "link": "/music/track/artist",
+ "name": "Every Little Thing She Does Is Magic"
+ },
+ {
+ "id": "/guid/9202a8c04000641f800000000128ad14",
+ "link": "/music/track/artist",
+ "name": "De Do Do Do, De Da Da Da"
+ },
+ {
+ "id": "/guid/9202a8c04000641f800000000128ad3e",
+ "link": "/music/track/artist",
+ "name": "Don't Stand So Close to Me"
+ },
+ {
+ "id": "/guid/9202a8c04000641f800000000128ad45",
+ "link": "/music/track/artist",
+ "name": "Roxanne"
+ },
+ {
+ "id": "/guid/9202a8c04000641f800000000128ad4c",
+ "link": "/music/track/artist",
+ "name": "Roxanne '97 (Puff Daddy remix)"
+ },
+ {
+ "id": "/guid/9202a8c04000641f80000000012dba61",
+ "link": "/music/track/artist",
+ "name": "Every Breath You Take"
+ },
+ {
+ "id": "/guid/9202a8c04000641f80000000012dde95",
+ "link": "/music/track/artist",
+ "name": "Message in a Bottle"
+ },
+ {
+ "id": "/guid/9202a8c04000641f80000000012dde9c",
+ "link": "/music/track/artist",
+ "name": "Can't Stand Losing You"
+ },
+ {
+ "id": "/guid/9202a8c04000641f80000000012ddeaa",
+ "link": "/music/track/artist",
+ "name": "Every Breath You Take"
+ },
+ {
+ "id": "/guid/9202a8c04000641f80000000012ddeb1",
+ "link": "/music/track/artist",
+ "name": "Walking on The Moon"
+ },
+ {
+ "id": "/guid/9202a8c04000641f80000000012ddebf",
+ "link": "/music/track/artist",
+ "name": "Every Little Thing She Does Is Magic"
+ },
+ {
+ "id": "/guid/9202a8c04000641f80000000012ddee9",
+ "link": "/music/track/artist",
+ "name": "Don't Stand So Close to Me"
+ },
+ {
+ "id": "/guid/9202a8c04000641f80000000012ddef0",
+ "link": "/music/track/artist",
+ "name": "Roxanne"
+ },
+ {
+ "id": "/guid/9202a8c04000641f80000000012ddef7",
+ "link": "/music/track/artist",
+ "name": "Roxanne '97 (Puff Daddy remix)"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001338a15",
+ "link": "/music/track/artist",
+ "name": "Message in a Bottle"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001338a1c",
+ "link": "/music/track/artist",
+ "name": "Can't Stand Losing You"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001338a2a",
+ "link": "/music/track/artist",
+ "name": "Every Breath You Take"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001338a38",
+ "link": "/music/track/artist",
+ "name": "Walking on the Moon"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001338a4d",
+ "link": "/music/track/artist",
+ "name": "Every Little Thing She Does Is Magic"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001338a54",
+ "link": "/music/track/artist",
+ "name": "De Do Do Do, De Da Da Da"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001338a7e",
+ "link": "/music/track/artist",
+ "name": "Don't Stand So Close to Me"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001338a85",
+ "link": "/music/track/artist",
+ "name": "Roxanne"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001423459",
+ "link": "/music/track/artist",
+ "name": "Don't Stand So Close to Me"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001474145",
+ "link": "/music/track/artist",
+ "name": "Message in a Bottle"
+ },
+ {
+ "id": "/guid/9202a8c04000641f800000000147414c",
+ "link": "/music/track/artist",
+ "name": "Can't Stand Losing You"
+ },
+ {
+ "id": "/guid/9202a8c04000641f800000000147415a",
+ "link": "/music/track/artist",
+ "name": "Every Breath You Take"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001474168",
+ "link": "/music/track/artist",
+ "name": "Walking on the Moon"
+ },
+ {
+ "id": "/guid/9202a8c04000641f800000000147417d",
+ "link": "/music/track/artist",
+ "name": "Every Little Thing She Does Is Magic"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001474184",
+ "link": "/music/track/artist",
+ "name": "De Do Do Do, De Da Da Da"
+ },
+ {
+ "id": "/guid/9202a8c04000641f80000000014741ae",
+ "link": "/music/track/artist",
+ "name": "Don't Stand So Close to Me"
+ },
+ {
+ "id": "/guid/9202a8c04000641f80000000014741b5",
+ "link": "/music/track/artist",
+ "name": "Roxanne"
+ },
+ {
+ "id": "/guid/9202a8c04000641f80000000014741bc",
+ "link": "/music/track/artist",
+ "name": "So Lonely"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001477682",
+ "link": "/music/track/artist",
+ "name": "Every Little Thing She Does Is Magic"
+ },
+ {
+ "id": "/guid/9202a8c04000641f80000000014c6e37",
+ "link": "/music/track/artist",
+ "name": "Don't Stand So Close"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001555d7d",
+ "link": "/music/track/artist",
+ "name": "Walking on the Moon"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001594b89",
+ "link": "/music/track/artist",
+ "name": "Message in a Bottle"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001594b90",
+ "link": "/music/track/artist",
+ "name": "Can't Stand Losing You"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001594b9e",
+ "link": "/music/track/artist",
+ "name": "Every Breath You Take"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001594bac",
+ "link": "/music/track/artist",
+ "name": "Walking on the Moon"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001594bc1",
+ "link": "/music/track/artist",
+ "name": "Every Little Thing She Does Is Magic"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001594bc8",
+ "link": "/music/track/artist",
+ "name": "De Do Do Do De Da Da Da"
+ },
+ {
+ "id": "/guid/9202a8c04000641f80000000015de479",
+ "link": "/music/track/artist",
+ "name": "Driven to Tears"
+ },
+ {
+ "id": "/guid/9202a8c04000641f80000000016088e7",
+ "link": "/music/track/artist",
+ "name": "Every Breath You Take"
+ },
+ {
+ "id": "/guid/9202a8c04000641f800000000163c1eb",
+ "link": "/music/track/artist",
+ "name": "Don't Stand So Close to Me"
+ },
+ {
+ "id": "/guid/9202a8c04000641f800000000166c542",
+ "link": "/music/track/artist",
+ "name": "So Lonely"
+ },
+ {
+ "id": "/guid/9202a8c04000641f800000000166ddfa",
+ "link": "/music/track/artist",
+ "name": "Synchronicity II"
+ },
+ {
+ "id": "/guid/9202a8c04000641f80000000016a7432",
+ "link": "/music/track/artist",
+ "name": "Every Breath You Take"
+ },
+ {
+ "id": "/guid/9202a8c04000641f80000000016f672b",
+ "link": "/music/track/artist",
+ "name": "Every Breath You Take"
+ },
+ {
+ "id": "/guid/9202a8c04000641f800000000170d706",
+ "link": "/music/track/artist",
+ "name": "Every Breath You Take"
+ },
+ {
+ "id": "/guid/9202a8c04000641f80000000017c7193",
+ "link": "/music/track/artist",
+ "name": "Can't Stand Losing You"
+ },
+ {
+ "id": "/guid/9202a8c04000641f80000000017f93ec",
+ "link": "/music/track/artist",
+ "name": "Roxanne"
+ },
+ {
+ "id": "/guid/9202a8c04000641f800000000187d519",
+ "link": "/music/track/artist",
+ "name": "De Do Do"
+ },
+ {
+ "id": "/guid/9202a8c04000641f80000000018b6033",
+ "link": "/music/track/artist",
+ "name": "Every Breath You Take"
+ },
+ {
+ "id": "/guid/9202a8c04000641f80000000018dc967",
+ "link": "/music/track/artist",
+ "name": "Don't Stand So Close to Me"
+ },
+ {
+ "id": "/guid/9202a8c04000641f800000000196011e",
+ "link": "/music/track/artist",
+ "name": "Every Breath You Take"
+ },
+ {
+ "id": "/guid/9202a8c04000641f80000000019ad096",
+ "link": "/music/track/artist",
+ "name": "Every Little Thing She Does Is Magic"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001a3fbb1",
+ "link": "/music/track/artist",
+ "name": "Every Breath You Take"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001a51770",
+ "link": "/music/track/artist",
+ "name": "Driven to Tears"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001a6f0e0",
+ "link": "/music/track/artist",
+ "name": "How Stupid Mr. Bates"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001a6f0ee",
+ "link": "/music/track/artist",
+ "name": "I Burn For You"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001a6f118",
+ "link": "/music/track/artist",
+ "name": "A Kind of Loving"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001b3c3b5",
+ "link": "/music/track/artist",
+ "name": "Roxanne"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001b4384d",
+ "link": "/music/track/artist",
+ "name": "Nothing Achieving"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001b8d03f",
+ "link": "/music/track/artist",
+ "name": "Roxanne"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001bbfa9a",
+ "link": "/music/track/artist",
+ "name": "Fall Out"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001bf6fa1",
+ "link": "/music/track/artist",
+ "name": "Every Breath You Take"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001d17cc8",
+ "link": "/music/track/artist",
+ "name": "Message in a Bottle"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001d17e96",
+ "link": "/music/track/artist",
+ "name": "Every Breath You Take"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001d2d0b8",
+ "link": "/music/track/artist",
+ "name": "Message in a Bottle"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001d80ea3",
+ "link": "/music/track/artist",
+ "name": "King of Pain"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001d93d32",
+ "link": "/music/track/artist",
+ "name": "Every Little Thing She Does Is Magic"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001e3eb1f",
+ "link": "/music/track/artist",
+ "name": "Every Little Thing She Does Is Magic"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001ee5178",
+ "link": "/music/track/artist",
+ "name": "Message in a Bottle"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001f5a4ad",
+ "link": "/music/track/artist",
+ "name": "Every Breath You Take"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001f835c3",
+ "link": "/music/track/artist",
+ "name": "Every Breath You Take"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000001ff4227",
+ "link": "/music/track/artist",
+ "name": "Every Breath You Take"
+ },
+ {
+ "id": "/guid/9202a8c04000641f800000000200cc5e",
+ "link": "/music/track/artist",
+ "name": "Every Little Thing She Does Is Magic"
+ },
+ {
+ "id": "/guid/9202a8c04000641f8000000002041324",
+ "link": "/music/track/artist",
+ "name": "Every Breath You Take"
+ },
+ {
+ "id": "/guid/9202a8c04000641f800000000206f5f8",
+ "link": "/music/track/artist",
+ "name": "Every Breath You Take"
+ },
+ {
+ "id": "/guid/9202a8c04000641f80000000021147c7",
+ "link": "/music/track/artist",
+ "name": "Message in a Bottle"
+ },
+ {
+ "id": "/guid/9202a8c04000641f80000000021147ce",
+ "link": "/music/track/artist",
+ "name": "Can't Stand Losing You"
+ },
+ {
+ "id": "/guid/9202a8c04000641f80000000021147dc",
+ "link": "/music/track/artist",
+ "name": "Every Breath You Take"
+ }
+ ],
+ "/type/reflect/any_value": [
+ {
+ "link": "/type/object/name",
+ "value": "The Police"
+ },
+ {
+ "link": "/type/object/name",
+ "value": "The Police"
+ },
+ {
+ "link": "/type/object/name",
+ "value": "The Police"
+ },
+ {
+ "link": "/type/object/name",
+ "value": "The Police"
+ },
+ {
+ "link": "/type/object/name",
+ "value": "ポリス (バンド)"
+ },
+ {
+ "link": "/type/object/name",
+ "value": "The Police"
+ },
+ {
+ "link": "/music/artist/active_start",
+ "value": "1977-01"
+ },
+ {
+ "link": "/type/object/name",
+ "value": "The Police"
+ },
+ {
+ "link": "/type/object/name",
+ "value": "The Police"
+ },
+ {
+ "link": "/type/object/name",
+ "value": "The Police"
+ },
+ {
+ "link": "/type/object/name",
+ "value": "The Police"
+ },
+ {
+ "link": "/type/object/name",
+ "value": "הפוליס"
+ },
+ {
+ "link": "/common/topic/alias",
+ "value": "Sting &amp; The Police"
+ },
+ {
+ "link": "/type/object/name",
+ "value": "เดอะ โพลิซ"
+ },
+ {
+ "link": "/music/artist/active_end",
+ "value": "1986"
+ }
+ ],
+ "id": "/en/the_police",
+ "ken:type": [
+ {
+ "id": "/music/artist",
+ "name": "Musical Artist",
+ "properties": [
+ {
+ "expected_type": "/location/location",
+ "id": "/music/artist/origin",
+ "master_property": null,
+ "name": "Place Musical Career Began",
+ "reverse_property": null,
+ "unique": true
+ },
+ {
+ "expected_type": "/type/datetime",
+ "id": "/music/artist/active_start",
+ "master_property": null,
+ "name": "Active as Musical Artist (start)",
+ "reverse_property": null,
+ "unique": true
+ },
+ {
+ "expected_type": "/type/datetime",
+ "id": "/music/artist/active_end",
+ "master_property": null,
+ "name": "Active as Musical Artist (end)",
+ "reverse_property": null,
+ "unique": true
+ },
+ {
+ "expected_type": "/music/genre",
+ "id": "/music/artist/genre",
+ "master_property": null,
+ "name": "Musical Genres",
+ "reverse_property": "/music/genre/artists",
+ "unique": false
+ },
+ {
+ "expected_type": "/music/record_label",
+ "id": "/music/artist/label",
+ "master_property": null,
+ "name": "Record Labels",
+ "reverse_property": "/music/record_label/artist",
+ "unique": null
+ },
+ {
+ "expected_type": "/music/artist",
+ "id": "/music/artist/similar_artist",
+ "master_property": null,
+ "name": "Similar Artists",
+ "reverse_property": "/music/artist/artist_similar",
+ "unique": null
+ },
+ {
+ "expected_type": "/common/webpage",
+ "id": "/music/artist/home_page",
+ "master_property": null,
+ "name": "Musical Artist Home Page",
+ "reverse_property": null,
+ "unique": null
+ },
+ {
+ "expected_type": "/common/webpage",
+ "id": "/music/artist/acquire_webpage",
+ "master_property": null,
+ "name": "Web Page for Music",
+ "reverse_property": null,
+ "unique": null
+ },
+ {
+ "expected_type": "/music/album",
+ "id": "/music/artist/album",
+ "master_property": "/music/album/artist",
+ "name": "Albums",
+ "reverse_property": null,
+ "unique": null
+ },
+ {
+ "expected_type": "/music/recording_contribution",
+ "id": "/music/artist/contribution",
+ "master_property": "/music/recording_contribution/contributor",
+ "name": "Album Contributions",
+ "reverse_property": null,
+ "unique": null
+ },
+ {
+ "expected_type": "/music/track",
+ "id": "/music/artist/track",
+ "master_property": "/music/track/artist",
+ "name": "Tracks Recorded",
+ "reverse_property": null,
+ "unique": null
+ },
+ {
+ "expected_type": "/music/artist",
+ "id": "/music/artist/artist_similar",
+ "master_property": "/music/artist/similar_artist",
+ "name": "Similar Musical Artists",
+ "reverse_property": null,
+ "unique": null
+ },
+ {
+ "expected_type": "/music/track_contribution",
+ "id": "/music/artist/track_contributions",
+ "master_property": "/music/track_contribution/contributor",
+ "name": "Track Contributions",
+ "reverse_property": null,
+ "unique": null
+ },
+ {
+ "expected_type": "/music/instrument",
+ "id": "/music/artist/instruments_played",
+ "master_property": null,
+ "name": "Instruments Played",
+ "reverse_property": "/music/instrument/instrumentalists",
+ "unique": null
+ },
+ {
+ "expected_type": "/music/voice",
+ "id": "/music/artist/vocal_range",
+ "master_property": null,
+ "name": "Vocal Range",
+ "reverse_property": "/music/voice/singers",
+ "unique": null
+ },
+ {
+ "expected_type": "/music/concert_tour",
+ "id": "/music/artist/concert_tours",
+ "master_property": "/music/concert_tour/artist",
+ "name": "Concert Tours",
+ "reverse_property": null,
+ "unique": false
+ }
+ ]
+ },
+ {
+ "id": "/common/topic",
+ "name": "Topic",
+ "properties": [
+ {
+ "expected_type": "/type/text",
+ "id": "/common/topic/alias",
+ "master_property": null,
+ "name": "Also known as",
+ "reverse_property": null,
+ "unique": null
+ },
+ {
+ "expected_type": "/common/document",
+ "id": "/common/topic/article",
+ "master_property": null,
+ "name": "article",
+ "reverse_property": null,
+ "unique": null
+ },
+ {
+ "expected_type": "/common/image",
+ "id": "/common/topic/image",
+ "master_property": null,
+ "name": "image",
+ "reverse_property": "/common/image/appears_in_topic_gallery",
+ "unique": null
+ },
+ {
+ "expected_type": "/common/webpage",
+ "id": "/common/topic/webpage",
+ "master_property": null,
+ "name": "Web Link(s)",
+ "reverse_property": null,
+ "unique": null
+ }
+ ]
+ },
+ {
+ "id": "/music/producer",
+ "name": "Record Producer",
+ "properties": [
+ {
+ "expected_type": "/music/album",
+ "id": "/music/producer/albums_produced",
+ "master_property": "/music/album/producer",
+ "name": "Albums Produced",
+ "reverse_property": null,
+ "unique": null
+ },
+ {
+ "expected_type": "/music/track",
+ "id": "/music/producer/tracks_produced",
+ "master_property": "/music/track/producer",
+ "name": "Tracks produced",
+ "reverse_property": null,
+ "unique": false
+ }
+ ]
+ },
+ {
+ "id": "/music/musical_group",
+ "name": "Musical Group",
+ "properties": [{
+ "expected_type": "/music/group_membership",
+ "id": "/music/musical_group/member",
+ "master_property": "/music/group_membership/group",
+ "name": "Members Of Musical Group",
+ "reverse_property": null,
+ "unique": null
+ }]
+ },
+ {
+ "id": "/broadcast/artist",
+ "name": "Broadcast Artist",
+ "properties": [{
+ "expected_type": "/broadcast/content",
+ "id": "/broadcast/artist/content",
+ "master_property": "/broadcast/content/artist",
+ "name": "Content",
+ "reverse_property": null,
+ "unique": null
+ }]
+ },
+ {
+ "id": "/award/award_winner",
+ "name": "Award Winner",
+ "properties": [{
+ "expected_type": "/award/award_honor",
+ "id": "/award/award_winner/awards_won",
+ "master_property": "/award/award_honor/award_winner",
+ "name": "Awards Won",
+ "reverse_property": null,
+ "unique": null
+ }]
+ }
+ ],
+ "name": "The Police"
}
View
4 test/integration/ken_test.rb
@@ -22,7 +22,7 @@ class KenTest < Test::Unit::TestCase
resources.should be_kind_of(Ken::Collection)
resources.first.should be_kind_of(Ken::Resource)
end
-
+
should "work with a limit specified" do
resources = Ken.all(:name => "Apple", :limit => 3)
resources.length.should == 3
@@ -48,7 +48,7 @@ class KenTest < Test::Unit::TestCase
],
:type => "/film/film"
}
-
+
resources = Ken.all(query)
resources.length.should == 3
resources.first.name.should == "Star Wars Episode IV: A New Hope"
View
13 test/unit/attribute_test.rb
@@ -5,18 +5,19 @@ class AttributeTest < Test::Unit::TestCase
setup do
data = load_fixture('the_police')
@the_police = Ken::Resource.new(data)
-
- @attribute = @unique_value_attribute = @the_police.attributes[2] # /music/artist/active_start
- @unique_object_attribute = @the_police.attributes[12] # /music/artist/origin
- @non_unique_value_attribute = @the_police.attributes[9] # /common/topic/alias
- @non_unique_object_attribute = @the_police.attributes[5] # /music/artist/album
+
+ @attribute = @unique_value_attribute = @the_police.views[0].active_start
+ @unique_object_attribute = @the_police.views[0].origin
+ @unique_object_attribute.unique?
+ @non_unique_value_attribute = @the_police.views[1].alias
+ @non_unique_object_attribute = @the_police.views[0].album
end
should "should have values" do
@attribute.should have(1).values
@non_unique_object_attribute.should have(14).values
end
-
+
context "with unique value type" do
should "be unique and no object_type" do