wikidata-client 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +2 -0
  3. data/.travis.yml +7 -0
  4. data/Gemfile +7 -0
  5. data/Gemfile.lock +69 -0
  6. data/LICENCE +21 -0
  7. data/README.md +180 -0
  8. data/Rakefile +5 -0
  9. data/config/mapping.yml +19 -0
  10. data/config/settings.yml +4 -0
  11. data/lib/wikidata.rb +39 -0
  12. data/lib/wikidata/client.rb +36 -0
  13. data/lib/wikidata/config.rb +23 -0
  14. data/lib/wikidata/entity.rb +83 -0
  15. data/lib/wikidata/item.rb +41 -0
  16. data/lib/wikidata/property.rb +29 -0
  17. data/lib/wikidata/property/base.rb +16 -0
  18. data/lib/wikidata/property/globe_coordinate.rb +13 -0
  19. data/lib/wikidata/property/string.rb +6 -0
  20. data/lib/wikidata/property/time.rb +66 -0
  21. data/lib/wikidata/property/url.rb +6 -0
  22. data/lib/wikidata/resource.rb +69 -0
  23. data/lib/wikidata/response.rb +31 -0
  24. data/lib/wikidata/search_response.rb +35 -0
  25. data/lib/wikidata/version.rb +3 -0
  26. data/spec/fixtures/vcr/Wikidata_Entity/properties/entities/should_allow_to_return_only_entities_ids_from_a_key.yml +160 -0
  27. data/spec/fixtures/vcr/Wikidata_Entity/properties/entities/should_allow_to_return_only_entities_ids_from_an_id.yml +160 -0
  28. data/spec/fixtures/vcr/Wikidata_Entity/properties/entities/should_return_entities_property_from_a_key_children_here_.yml +518 -0
  29. data/spec/fixtures/vcr/Wikidata_Entity/properties/entities/should_return_entities_property_from_an_id_P40_for_children_here_.yml +516 -0
  30. data/spec/fixtures/vcr/Wikidata_Entity/properties/properties/of_type_date/should_return_Time_from_a_a_key_date_of_birth_here_.yml +162 -0
  31. data/spec/fixtures/vcr/Wikidata_Entity/properties/properties/of_type_date/should_return_Time_from_a_property_id_P569_for_date_of_birth_here_.yml +162 -0
  32. data/spec/fixtures/vcr/Wikidata_Entity/properties/properties/of_type_globe_coordinate/should_return_GlobeCoordinate_from_a_key_coordinate_location_here_.yml +58 -0
  33. data/spec/fixtures/vcr/Wikidata_Entity/properties/properties/of_type_globe_coordinate/should_return_GlobeCoordinate_from_a_property_id_P625_for_coordinate_location_here_.yml +58 -0
  34. data/spec/fixtures/vcr/Wikidata_Entity/properties/properties/of_type_string/should_return_String_from_a_key_freebase_identifier_here_.yml +160 -0
  35. data/spec/fixtures/vcr/Wikidata_Entity/properties/properties/of_type_string/should_return_String_from_a_property_id_P646_for_freebase_identifier_here_.yml +160 -0
  36. data/spec/fixtures/vcr/Wikidata_Entity/properties/properties/of_type_url/should_return_Url_from_a_key_official_website_here_.yml +78 -0
  37. data/spec/fixtures/vcr/Wikidata_Entity/properties/properties/of_type_url/should_return_Url_from_a_property_id_P856_for_official_website_here_.yml +78 -0
  38. data/spec/fixtures/vcr/Wikidata_Entity/properties/should_return_aliases.yml +176 -0
  39. data/spec/fixtures/vcr/Wikidata_Entity/properties/should_return_descriptions.yml +178 -0
  40. data/spec/fixtures/vcr/Wikidata_Entity/properties/should_return_id.yml +176 -0
  41. data/spec/fixtures/vcr/Wikidata_Entity/properties/should_return_labels.yml +176 -0
  42. data/spec/fixtures/vcr/Wikidata_Entity/properties/should_return_sitelinks.yml +176 -0
  43. data/spec/fixtures/vcr/Wikidata_Entity/properties/should_return_url.yml +178 -0
  44. data/spec/fixtures/vcr/Wikidata_Item/_find_/should_find_by_id.yml +319 -0
  45. data/spec/fixtures/vcr/Wikidata_Item/_find_/should_find_by_ids.yml +441 -0
  46. data/spec/fixtures/vcr/Wikidata_Item/_find_/should_find_by_title.yml +319 -0
  47. data/spec/fixtures/vcr/Wikidata_Item/_find_/should_find_by_titles.yml +441 -0
  48. data/spec/fixtures/vcr/Wikidata_Item/_find_/should_return_nil_if_item_not_found.yml +58 -0
  49. data/spec/fixtures/vcr/Wikidata_Item/_search/should_fetch_all_all_items_of_the_collection.yml +656 -0
  50. data/spec/fixtures/vcr/Wikidata_Item/_search/should_return_a_response_with_an_empty_array_of_results_if_search_missing.yml +57 -0
  51. data/spec/fixtures/vcr/Wikidata_Item/_search/should_return_an_array_of_Wikidata_Item.yml +654 -0
  52. data/spec/fixtures/vcr/Wikidata_Item/_search/should_return_the_next_page_offset.yml +123 -0
  53. data/spec/fixtures/vcr/Wikidata_Item/_search/should_return_the_total_number_of_hits.yml +123 -0
  54. data/spec/spec_helper.rb +28 -0
  55. data/spec/wikidata/client_spec.rb +4 -0
  56. data/spec/wikidata/entity_spec.rb +139 -0
  57. data/spec/wikidata/item_spec.rb +64 -0
  58. data/spec/wikidata/property/time_spec.rb +61 -0
  59. data/spec/wikidata_spec.rb +20 -0
  60. data/wikidata-client.gemspec +27 -0
  61. metadata +262 -0
@@ -0,0 +1,41 @@
1
+ module Wikidata
2
+ class Item < Entity
3
+ DEFAULT_QUERIES = {
4
+ search: {
5
+ action: 'query',
6
+ list: 'search',
7
+ sroffset: 0,
8
+ srlimit: 10
9
+ },
10
+ find: {
11
+ action: 'wbgetentities',
12
+ sites: 'enwiki'
13
+ }
14
+ }.freeze
15
+
16
+ class << self
17
+ def find ids, query = {}
18
+ q = DEFAULT_QUERIES[:find]
19
+ .merge( query )
20
+ .merge( ids: Array(ids).join('|') )
21
+ Wikidata::Client.new( q ).response.tap do |resp|
22
+ return resp.results.first unless ids.is_a?(Array)
23
+ end
24
+ end
25
+
26
+ def find_by_title titles, query = {}
27
+ q = DEFAULT_QUERIES[:find]
28
+ .merge( query )
29
+ .merge( titles: Array(titles).join('|') )
30
+ Wikidata::Client.new( q ).response.tap do |resp|
31
+ return resp.results.first unless titles.is_a?(Array)
32
+ end
33
+ end
34
+
35
+ def search search, query = {}
36
+ q = DEFAULT_QUERIES[:search].merge( srsearch: search ).merge(query)
37
+ Wikidata::Client.new( q ).response
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,29 @@
1
+ module Wikidata
2
+ module Property
3
+ def self.build attribute
4
+ return if attribute.mainsnak.snaktype == "somevalue"
5
+ case attribute.mainsnak.datatype
6
+ when 'string'
7
+ Wikidata::Property::String.new attribute
8
+ when 'time'
9
+ Wikidata::Property::Time.new attribute
10
+ when 'globe-coordinate'
11
+ Wikidata::Property::GlobeCoordinate.new attribute
12
+ when 'url'
13
+ Wikidata::Property::Url.new attribute
14
+ when 'wikibase-item'
15
+ # TODO Handle other types
16
+ # http://www.wikidata.org/wiki/Wikidata:Glossary#Entities.2C_items.2C_properties_and_queries
17
+ case attribute.mainsnak.datavalue.value['entity-type']
18
+ when 'item'
19
+ prefix = 'Q'
20
+ else
21
+ raise "Unkown wikibase-item entity-type #{attribute.mainsnak.datatype.value['entity-type']}"
22
+ end
23
+ Wikidata::Item.find "#{prefix}#{attribute.mainsnak.datavalue.value['numeric-id']}"
24
+ else
25
+ raise "Unkown property type #{attribute.mainsnak.datatype}"
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,16 @@
1
+ module Wikidata
2
+ module Property
3
+
4
+ class Base
5
+ attr_reader :property
6
+
7
+ def initialize property
8
+ @property = Hashie::Mash.new(property)
9
+ end
10
+
11
+ def value
12
+ property.mainsnak.datavalue.value
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,13 @@
1
+ module Wikidata
2
+ module Property
3
+ class GlobeCoordinate < Wikidata::Property::Base
4
+ def latitude
5
+ value.latitude
6
+ end
7
+
8
+ def longitude
9
+ value.longitude
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,6 @@
1
+ module Wikidata
2
+ module Property
3
+ class String < Wikidata::Property::Base
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,66 @@
1
+ module Wikidata
2
+ module Property
3
+ class Time < Wikidata::Property::Base
4
+ DATE_PRECISION = {
5
+ 0 => 1_000_000_000 * 365 * 24 * 3600,
6
+ 1 => 100_000_000 * 365 * 24 * 3600,
7
+ 2 => 10_000_000 * 365 * 24 * 3600,
8
+ 3 => 1_000_000 * 365 * 24 * 3600,
9
+ 4 => 100_000 * 365 * 24 * 3600,
10
+ 5 => 10_000 * 365 * 24 * 3600,
11
+ 6 => 1000 * 365 * 24 * 3600,
12
+ 7 => 100 * 365 * 24 * 3600,
13
+ 8 => 10 * 365 * 24 * 3600,
14
+ 9 => 365 * 24 * 3600,
15
+ 10 => 30 * 24 * 3600,
16
+ 11 => 24 * 3600,
17
+ 12 => 3600,
18
+ 13 => 60,
19
+ 14 => 1
20
+ }.freeze
21
+
22
+ def date
23
+ return @_date if @_date
24
+ d = Hash[[:year, :month, :day, :hour, :min, :sec].zip(
25
+ value.time.scan(/\d*/).reject!{|e| e == ""}.map(&:to_i)
26
+ )]
27
+ [:month, :day].each do |k|
28
+ d[k] = (d[k] == 0 ? 1 : d[k])
29
+ end
30
+ @_date ||= DateTime.new *d.values
31
+ end
32
+
33
+ def timestamp
34
+ date.to_time.utc.to_i
35
+ end
36
+
37
+ def precision
38
+ DATE_PRECISION[value.precision.to_i]
39
+ end
40
+
41
+ def after
42
+ value.after
43
+ end
44
+
45
+ def before
46
+ value.before
47
+ end
48
+
49
+ def range
50
+ return @_range if @_range
51
+ from = before > 0 ?
52
+ timestamp - (before.to_i * precision) : timestamp
53
+ to = after > 0 ?
54
+ timestamp + (after.to_i * precision) : timestamp
55
+
56
+ # Make sure we respect wikidata precision in case we have after/before to 0
57
+ if (min_to = timestamp + precision) > to
58
+ min_to_date = ::Time.at(min_to)
59
+ to = DateTime.new(min_to_date.year, min_to_date.month, min_to_date.day, 23, 59, 59).to_time.utc.to_i
60
+ end
61
+
62
+ @_range ||= (::Time.at(from).utc.to_datetime..::Time::at(to).utc.to_datetime)
63
+ end
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,6 @@
1
+ module Wikidata
2
+ module Property
3
+ class Url < Wikidata::Property::Base
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,69 @@
1
+ module Wikidata
2
+ class Resource
3
+ attr_accessor :item
4
+ delegate :claims_for_property_id, to: :item
5
+
6
+ def initialize item
7
+ return unless item.data_hash
8
+ @item = item
9
+ end
10
+
11
+ def name
12
+ return @_name if @_name
13
+ %w{fr en}.each do |l|
14
+ @_name ||= item.labels[l].value if item.data_hash[:labels] && item.labels[l]
15
+ @_name ||= item.sitelinks["#{l}wiki"].title if item.data_hash[:sitelinks] && item.sitelinks["#{l}wiki"]
16
+ end
17
+ @_name
18
+ end
19
+
20
+ def url
21
+ Gaston.wikidata.item_url.gsub(':id', item.id)
22
+ end
23
+
24
+ Gaston.wikidata.accessors.each do |k|
25
+ define_method k do
26
+ item.data_hash[k]
27
+ end
28
+ end
29
+
30
+ Gaston.wikidata.mapping.resources.each do |k, code|
31
+ define_method k do
32
+ property code
33
+ end
34
+ define_method "#{k}_id" do
35
+ property_id code
36
+ end
37
+ end
38
+ Gaston.wikidata.mapping.collections.each do |k, code|
39
+ define_method k do
40
+ properties code
41
+ end
42
+ define_method "#{k}_ids" do
43
+ property_ids code
44
+ end
45
+ end
46
+
47
+ def properties code
48
+ claims_for_property_id(code).map {|a| Wikidata::Attribute.build a }
49
+ end
50
+
51
+ def property code
52
+ properties(code).first
53
+ end
54
+
55
+ def property_ids code
56
+ claims_for_property_id(code).map do |a|
57
+ begin
58
+ "Q#{a.mainsnak.value.data_hash['numeric-id']}"
59
+ rescue
60
+ nil
61
+ end
62
+ end.compact
63
+ end
64
+
65
+ def property_id code
66
+ property_ids(code).first
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,31 @@
1
+ module Wikidata
2
+ class Response
3
+ extend Forwardable
4
+
5
+ def_delegators :results, :size
6
+
7
+ def initialize raw
8
+ @raw = raw
9
+ end
10
+
11
+ def results
12
+ return [] if empty?
13
+ @_results ||= raw_results.map{|r| Wikidata::Item.new(r) }
14
+ end
15
+
16
+ def empty?
17
+ @_empty ||= @raw.body['entities'].nil?
18
+ end
19
+
20
+ def inspect
21
+ "<#{self.class} results: #{results.inspect}>"
22
+ end
23
+
24
+ protected
25
+
26
+ def raw_results
27
+ return [] if empty?
28
+ @raw.body['entities'].values
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,35 @@
1
+ module Wikidata
2
+ class SearchResponse < Response
3
+
4
+ def results
5
+ return [] if empty?
6
+ @_results ||= Wikidata::Item.find(raw_ids).results
7
+ end
8
+
9
+ def empty?
10
+ @_empty ||= @raw.body['query'].nil?
11
+ end
12
+
13
+ def total_hits
14
+ return if empty?
15
+ @raw.body['query']['searchinfo']['totalhits']
16
+ end
17
+
18
+ def next_page_offset
19
+ return if empty?
20
+ @raw.body['query-continue']['search']['sroffset']
21
+ end
22
+
23
+ protected
24
+
25
+ def raw_ids
26
+ return if empty?
27
+ @raw.body['query']['search'].map{|r| r['title'] }
28
+ end
29
+
30
+ def raw_results
31
+ return [] if empty?
32
+ @raw.body['query']['search']
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,3 @@
1
+ module Wikidata
2
+ VERSION = "0.0.1".freeze
3
+ end
@@ -0,0 +1,160 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://www.wikidata.org/w/api.php?action=wbgetentities&format=json&sites=enwiki&titles=Homer%20Simpson
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.0
12
+ Expect:
13
+ - ''
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Server:
20
+ - Apache
21
+ X-Content-Type-Options:
22
+ - nosniff
23
+ Cache-Control:
24
+ - private
25
+ X-Frame-Options:
26
+ - DENY
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Vary:
30
+ - Accept-Encoding,X-Use-HHVM
31
+ X-Varnish:
32
+ - 2061994774, 3152394624, 3674650400
33
+ Via:
34
+ - 1.1 varnish, 1.1 varnish, 1.1 varnish
35
+ Transfer-Encoding:
36
+ - chunked
37
+ Date:
38
+ - Mon, 29 Sep 2014 09:07:19 GMT
39
+ Age:
40
+ - '0'
41
+ Connection:
42
+ - keep-alive
43
+ X-Cache:
44
+ - cp1068 miss (0), amssq48 miss (0), amssq60 frontend miss (0)
45
+ X-Analytics:
46
+ - php=zend
47
+ Set-Cookie:
48
+ - GeoIP=FR:Sainte-luce-sur-loire:47.2500:-1.5000:v4; Path=/; Domain=.wikidata.org
49
+ body:
50
+ encoding: ASCII-8BIT
51
+ string: '{"entities":{"Q7810":{"pageid":9056,"ns":0,"title":"Q7810","lastrevid":159661784,"modified":"2014-09-25T12:26:51Z","id":"Q7810","type":"item","aliases":{"de":[{"language":"de","value":"Homer
52
+ J. Simpsons"},{"language":"de","value":"Homer Jay Simpson"},{"language":"de","value":"Captain
53
+ Albern"},{"language":"de","value":"Max Power"},{"language":"de","value":"Dancin\u2019
54
+ Homer"},{"language":"de","value":"Andreas T. aus Happyhill"},{"language":"de","value":"Colonel
55
+ Homer"},{"language":"de","value":"Mr. Schneepflug"},{"language":"de","value":"Brian
56
+ McGee"},{"language":"de","value":"Mr. Thompson"},{"language":"de","value":"der
57
+ Bierbaron"},{"language":"de","value":"Arthur N. aus Rosenburg"},{"language":"de","value":"Mr.
58
+ X"},{"language":"de","value":"El Homo"},{"language":"de","value":"Elvis Jagger
59
+ Abdul-Jabbar"},{"language":"de","value":"Tortenmann"},{"language":"de","value":"Homer
60
+ Sanchez"},{"language":"de","value":"Homie"},{"language":"de","value":"Admiral
61
+ Adonis"},{"language":"de","value":"Commander Cool"}],"en":[{"language":"en","value":"Homer
62
+ Jay Simpson"}],"it":[{"language":"it","value":"Homer J. Simpson"}]},"labels":{"it":{"language":"it","value":"Homer
63
+ Simpson"},"fr":{"language":"fr","value":"Homer Simpson"},"en":{"language":"en","value":"Homer
64
+ Simpson"},"de":{"language":"de","value":"Homer Simpson"},"af":{"language":"af","value":"Homer
65
+ Simpson"},"ast":{"language":"ast","value":"Homer Simpson"},"az":{"language":"az","value":"Homer
66
+ Simpson"},"bar":{"language":"bar","value":"Homer Simpson"},"be":{"language":"be","value":"\u0413\u0430\u043c\u0435\u0440
67
+ \u0421\u0456\u043c\u043f\u0441\u0430\u043d"},"bg":{"language":"bg","value":"\u0425\u043e\u0443\u043c\u044a\u0440
68
+ \u0421\u0438\u043c\u043f\u0441\u044a\u043d"},"bo":{"language":"bo","value":"\u0f67\u0f7c\u0f60\u0f7c\u0f0b\u0f58\u0f62\u0f0b\u0f66\u0f72\u0f58\u0f0b\u0f56\u0f74\u0f0b\u0f66\u0f53\u0f0d"},"bs":{"language":"bs","value":"Homer
69
+ Simpson"},"ca":{"language":"ca","value":"Homer Simpson"},"cs":{"language":"cs","value":"Homer
70
+ Simpson"},"cy":{"language":"cy","value":"Homer Simpson"},"da":{"language":"da","value":"Homer
71
+ Simpson"},"en-ca":{"language":"en-ca","value":"Homer Simpson"},"en-gb":{"language":"en-gb","value":"Homer
72
+ Simpson"},"es":{"language":"es","value":"Homer Simpson"},"et":{"language":"et","value":"Homer
73
+ Simpson"},"eu":{"language":"eu","value":"Homer Simpson"},"fa":{"language":"fa","value":"\u0647\u0648\u0645\u0631
74
+ \u0633\u06cc\u0645\u067e\u0633\u0648\u0646"},"fi":{"language":"fi","value":"Homer
75
+ Simpson"},"ga":{"language":"ga","value":"Homer Simpson"},"gl":{"language":"gl","value":"Homer
76
+ Simpson"},"he":{"language":"he","value":"\u05d4\u05d5\u05de\u05e8 \u05e1\u05d9\u05de\u05e4\u05e1\u05d5\u05df"},"hr":{"language":"hr","value":"Homer
77
+ Simpson"},"hu":{"language":"hu","value":"Homer Simpson"},"hy":{"language":"hy","value":"\u0540\u0578\u0574\u0565\u0580
78
+ \u054d\u056b\u0574\u057a\u057d\u0578\u0576"},"id":{"language":"id","value":"Homer
79
+ Simpson"},"is":{"language":"is","value":"H\u00f3mer Simpson"},"ja":{"language":"ja","value":"\u30db\u30fc\u30de\u30fc\u30fb\u30b7\u30f3\u30d7\u30bd\u30f3"},"ka":{"language":"ka","value":"\u10f0\u10dd\u10db\u10d4\u10e0
80
+ \u10e1\u10d8\u10db\u10de\u10e1\u10dd\u10dc\u10d8"},"ko":{"language":"ko","value":"\ud638\uba38
81
+ \uc2ec\uc2a8"},"lb":{"language":"lb","value":"Homer Simpson"},"lv":{"language":"lv","value":"Hom\u0113rs
82
+ Simpsons"},"mr":{"language":"mr","value":"\u0939\u094b\u092e\u0930 \u0938\u093f\u092e\u094d\u092a\u094d\u0938\u0928"},"nah":{"language":"nah","value":"Homer
83
+ Simpson"},"ne":{"language":"ne","value":"\u0939\u094b\u092e\u0930 \u0938\u093f\u092e\u094d\u092a\u094d\u0938\u0928"},"nl":{"language":"nl","value":"Homer
84
+ Simpson"},"oc":{"language":"oc","value":"Homer Simpson"},"pi":{"language":"pi","value":"\u0939\u094b\u092e\u0930
85
+ \u0938\u093f\u092e\u094d\u092a\u094d\u0938\u0928"},"pl":{"language":"pl","value":"Homer
86
+ Simpson"},"pt":{"language":"pt","value":"Homer Simpson"},"pt-br":{"language":"pt-br","value":"Homer
87
+ Simpson"},"ro":{"language":"ro","value":"Homer Simpson"},"ru":{"language":"ru","value":"\u0413\u043e\u043c\u0435\u0440
88
+ \u0421\u0438\u043c\u043f\u0441\u043e\u043d"},"sa":{"language":"sa","value":"\u0939\u094b\u092e\u0930
89
+ \u0938\u093f\u092e\u094d\u092a\u094d\u0938\u0928"},"scn":{"language":"scn","value":"Homer
90
+ Simpson"},"sh":{"language":"sh","value":"Homer Simpson"},"sk":{"language":"sk","value":"Homer
91
+ Simpson"},"sq":{"language":"sq","value":"Homer Simpson"},"sr":{"language":"sr","value":"\u0425\u043e\u043c\u0435\u0440
92
+ \u040f\u0435\u0458 \u0421\u0438\u043c\u043f\u0441\u043e\u043d"},"sv":{"language":"sv","value":"Homer
93
+ Simpson"},"th":{"language":"th","value":"\u0e42\u0e2e\u0e40\u0e21\u0e2d\u0e23\u0e4c
94
+ \u0e0b\u0e34\u0e21\u0e1b\u0e4c\u0e2a\u0e31\u0e19"},"tr":{"language":"tr","value":"Homer
95
+ Simpson"},"uk":{"language":"uk","value":"\u0413\u043e\u043c\u0435\u0440 \u0421\u0456\u043c\u043f\u0441\u043e\u043d"},"vi":{"language":"vi","value":"Homer
96
+ Simpson"},"war":{"language":"war","value":"Homer Simpson"},"zh":{"language":"zh","value":"\u970d\u9ed8\u00b7\u8f9b\u666e\u68ee"},"gn":{"language":"gn","value":"Homer
97
+ Simpson"},"lt":{"language":"lt","value":"Homer Simpson"},"nb":{"language":"nb","value":"Homer
98
+ Simpson"},"ar":{"language":"ar","value":"\u0647\u0648\u0645\u0631 \u0633\u064a\u0645\u0628\u0633\u0648\u0646"},"ckb":{"language":"ckb","value":"\u06be\u06c6\u0645\u06d5\u0631
99
+ \u0633\u06cc\u0645\u067e\u0633\u06c6\u0646"},"nn":{"language":"nn","value":"Homer
100
+ Simpson"},"eo":{"language":"eo","value":"Homer Simpson"}},"descriptions":{"it":{"language":"it","value":"protagonista
101
+ della serie I Simpson"},"de":{"language":"de","value":"Figur der Simpsons"},"ru":{"language":"ru","value":"\u0433\u043b\u0430\u0432\u043d\u044b\u0439
102
+ \u0433\u0435\u0440\u043e\u0439 \u043c\u0443\u043b\u044c\u0442\u0441\u0435\u0440\u0438\u0430\u043b\u0430
103
+ \u00ab\u0421\u0438\u043c\u043f\u0441\u043e\u043d\u044b\u00bb"},"es":{"language":"es","value":"personaje
104
+ de dibujos animados"},"en":{"language":"en","value":"fictional character from
105
+ The Simpsons franchise"},"fr":{"language":"fr","value":"personnage de la s\u00e9rie
106
+ t\u00e9l\u00e9vis\u00e9e Les Simpson"},"nl":{"language":"nl","value":"personage
107
+ uit The Simpsons"}},"claims":{"P7":[{"id":"Q7810$2eb0aa51-40cb-3312-5b5d-777a34b3be23","mainsnak":{"snaktype":"value","property":"P7","datatype":"wikibase-item","datavalue":{"value":{"entity-type":"item","numeric-id":2340973},"type":"wikibase-entityid"}},"type":"statement","rank":"normal"}],"P345":[{"id":"q7810$D52517F8-64C0-498F-BD1F-2665DADE3A34","mainsnak":{"snaktype":"value","property":"P345","datatype":"string","datavalue":{"value":"ch0003002","type":"string"}},"type":"statement","rank":"preferred"}],"P26":[{"id":"q7810$7A080AE2-BE0B-4D9E-8B8C-6C1D5FD5C838","mainsnak":{"snaktype":"value","property":"P26","datatype":"wikibase-item","datavalue":{"value":{"entity-type":"item","numeric-id":7828},"type":"wikibase-entityid"}},"type":"statement","rank":"normal"}],"P21":[{"id":"q7810$EBCB4B01-C592-44E7-9DB8-F090E62074E2","mainsnak":{"snaktype":"value","property":"P21","datatype":"wikibase-item","datavalue":{"value":{"entity-type":"item","numeric-id":6581097},"type":"wikibase-entityid"}},"type":"statement","rank":"normal"}],"P40":[{"id":"q7810$2B9F1E2C-7583-4DD8-8CEB-F367FC0641E1","mainsnak":{"snaktype":"value","property":"P40","datatype":"wikibase-item","datavalue":{"value":{"entity-type":"item","numeric-id":5480},"type":"wikibase-entityid"}},"type":"statement","rank":"normal"},{"id":"q7810$A6DC727E-3642-470C-BD93-6707640CD90C","mainsnak":{"snaktype":"value","property":"P40","datatype":"wikibase-item","datavalue":{"value":{"entity-type":"item","numeric-id":5846},"type":"wikibase-entityid"}},"type":"statement","rank":"normal"},{"id":"q7810$E580F297-F30A-4680-BA5C-3559041E3B0F","mainsnak":{"snaktype":"value","property":"P40","datatype":"wikibase-item","datavalue":{"value":{"entity-type":"item","numeric-id":7834},"type":"wikibase-entityid"}},"type":"statement","rank":"normal"}],"P22":[{"id":"q7810$571A84C2-93C0-48E3-8DD3-A92A7D57BEA9","mainsnak":{"snaktype":"value","property":"P22","datatype":"wikibase-item","datavalue":{"value":{"entity-type":"item","numeric-id":842104},"type":"wikibase-entityid"}},"type":"statement","rank":"normal"}],"P25":[{"id":"q7810$46038435-4D85-46AB-90CE-5555ACD71760","mainsnak":{"snaktype":"value","property":"P25","datatype":"wikibase-item","datavalue":{"value":{"entity-type":"item","numeric-id":1641818},"type":"wikibase-entityid"}},"type":"statement","rank":"normal"}],"P19":[{"id":"q7810$F3E8C187-B8F2-4096-B15E-C4168F90CE42","mainsnak":{"snaktype":"value","property":"P19","datatype":"wikibase-item","datavalue":{"value":{"entity-type":"item","numeric-id":151076},"type":"wikibase-entityid"}},"type":"statement","rank":"normal"}],"P434":[{"id":"q7810$7604e6cb-443a-65f9-2ab3-70db024360af","mainsnak":{"snaktype":"value","property":"P434","datatype":"string","datavalue":{"value":"109a53ec-73e7-44e8-81cd-484114849a02","type":"string"}},"type":"statement","rank":"normal"}],"P373":[{"id":"q7810$1511B4E7-E94C-45FA-8DF5-07616B0B2A86","mainsnak":{"snaktype":"novalue","property":"P373"},"type":"statement","rank":"normal"}],"P27":[{"id":"Q7810$3C8AEBB8-9F14-4E4C-B386-FFAFBDBC9F46","mainsnak":{"snaktype":"value","property":"P27","datatype":"wikibase-item","datavalue":{"value":{"entity-type":"item","numeric-id":30},"type":"wikibase-entityid"}},"type":"statement","rank":"normal"}],"P646":[{"id":"Q7810$8F38CA22-CBE7-45D0-A02D-B2D5950B6648","mainsnak":{"snaktype":"value","property":"P646","datatype":"string","datavalue":{"value":"/m/0h545","type":"string"}},"type":"statement","rank":"normal","references":[{"hash":"b923b0d68beb300866b87ead39f61e63ec30d8af","snaks":{"P248":[{"snaktype":"value","property":"P248","datatype":"wikibase-item","datavalue":{"value":{"entity-type":"item","numeric-id":15241312},"type":"wikibase-entityid"}}],"P577":[{"snaktype":"value","property":"P577","datatype":"time","datavalue":{"value":{"time":"+00000002013-10-28T00:00:00Z","timezone":0,"before":0,"after":0,"precision":11,"calendarmodel":"http://www.wikidata.org/entity/Q1985727"},"type":"time"}}]},"snaks-order":["P248","P577"]}]}],"P569":[{"id":"Q7810$B87E9E15-38ED-4A83-B7A5-0EA872EC98EE","mainsnak":{"snaktype":"value","property":"P569","datatype":"time","datavalue":{"value":{"time":"+00000001956-06-18T00:00:00Z","timezone":0,"before":0,"after":0,"precision":11,"calendarmodel":"http://www.wikidata.org/entity/Q1985727"},"type":"time"}},"type":"statement","rank":"normal"}],"P31":[{"id":"Q7810$ae77588c-491b-63c1-7bc0-3f902811f72a","mainsnak":{"snaktype":"value","property":"P31","datatype":"wikibase-item","datavalue":{"value":{"entity-type":"item","numeric-id":15632617},"type":"wikibase-entityid"}},"type":"statement","rank":"normal"}],"P1441":[{"id":"Q7810$0B70914E-EA32-4B54-AF9F-08CA8716557C","mainsnak":{"snaktype":"value","property":"P1441","datatype":"wikibase-item","datavalue":{"value":{"entity-type":"item","numeric-id":886},"type":"wikibase-entityid"}},"type":"statement","rank":"normal"}]},"sitelinks":{"afwiki":{"site":"afwiki","title":"Homer
108
+ Simpson","badges":[]},"arwiki":{"site":"arwiki","title":"\u0647\u0648\u0645\u0631
109
+ \u0633\u064a\u0645\u0628\u0633\u0648\u0646","badges":[]},"astwiki":{"site":"astwiki","title":"Homer
110
+ Simpson","badges":[]},"azwiki":{"site":"azwiki","title":"Homer Simpson","badges":[]},"azwikiquote":{"site":"azwikiquote","title":"Homer
111
+ Simpson","badges":[]},"barwiki":{"site":"barwiki","title":"Homer Simpson","badges":[]},"bewiki":{"site":"bewiki","title":"\u0413\u0430\u043c\u0435\u0440
112
+ \u0421\u0456\u043c\u043f\u0441\u0430\u043d","badges":[]},"bgwiki":{"site":"bgwiki","title":"\u0425\u043e\u0443\u043c\u044a\u0440
113
+ \u0421\u0438\u043c\u043f\u0441\u044a\u043d","badges":[]},"bowiki":{"site":"bowiki","title":"\u0f67\u0f7c\u0f60\u0f7c\u0f0b\u0f58\u0f62\u0f0b\u0f66\u0f72\u0f58\u0f0b\u0f56\u0f74\u0f0b\u0f66\u0f53\u0f0d","badges":[]},"bswiki":{"site":"bswiki","title":"Homer
114
+ Simpson","badges":[]},"bswikiquote":{"site":"bswikiquote","title":"Homer Simpson","badges":[]},"cawiki":{"site":"cawiki","title":"Homer
115
+ Simpson","badges":[]},"ckbwiki":{"site":"ckbwiki","title":"\u06be\u06c6\u0645\u06d5\u0631
116
+ \u0633\u06cc\u0645\u067e\u0633\u06c6\u0646","badges":[]},"cswiki":{"site":"cswiki","title":"Homer
117
+ Simpson","badges":[]},"cywiki":{"site":"cywiki","title":"Homer Simpson","badges":[]},"dawiki":{"site":"dawiki","title":"Homer
118
+ Simpson","badges":[]},"dawikiquote":{"site":"dawikiquote","title":"Homer Simpson","badges":[]},"dewiki":{"site":"dewiki","title":"Homer
119
+ Simpson","badges":[]},"enwiki":{"site":"enwiki","title":"Homer Simpson","badges":["Q17437796"]},"eowikiquote":{"site":"eowikiquote","title":"Homer
120
+ Simpson","badges":[]},"eswiki":{"site":"eswiki","title":"Homer Simpson","badges":["Q17437796"]},"eswikiquote":{"site":"eswikiquote","title":"Homer
121
+ J. Simpson","badges":[]},"etwiki":{"site":"etwiki","title":"Homer Simpson","badges":[]},"euwiki":{"site":"euwiki","title":"Homer
122
+ Simpson","badges":[]},"fawiki":{"site":"fawiki","title":"\u0647\u0648\u0645\u0631
123
+ \u0633\u06cc\u0645\u067e\u0633\u0648\u0646","badges":[]},"fiwiki":{"site":"fiwiki","title":"Homer
124
+ Simpson","badges":[]},"fiwikiquote":{"site":"fiwikiquote","title":"Homer Simpson","badges":[]},"frwiki":{"site":"frwiki","title":"Homer
125
+ Simpson","badges":["Q17437798"]},"gawiki":{"site":"gawiki","title":"Homer
126
+ Simpson","badges":[]},"glwiki":{"site":"glwiki","title":"Homer Simpson","badges":[]},"gnwiki":{"site":"gnwiki","title":"Homer
127
+ Simpson","badges":[]},"hewiki":{"site":"hewiki","title":"\u05d4\u05d5\u05de\u05e8
128
+ \u05e1\u05d9\u05de\u05e4\u05e1\u05d5\u05df","badges":[]},"hewikiquote":{"site":"hewikiquote","title":"\u05d4\u05d5\u05de\u05e8
129
+ \u05e1\u05d9\u05de\u05e4\u05e1\u05d5\u05df","badges":[]},"hrwiki":{"site":"hrwiki","title":"Homer
130
+ Simpson","badges":[]},"huwiki":{"site":"huwiki","title":"Homer Simpson","badges":[]},"hywiki":{"site":"hywiki","title":"\u0540\u0578\u0574\u0565\u0580
131
+ \u054d\u056b\u0574\u057a\u057d\u0578\u0576","badges":[]},"idwiki":{"site":"idwiki","title":"Homer
132
+ Simpson","badges":[]},"iswiki":{"site":"iswiki","title":"H\u00f3mer Simpson","badges":[]},"itwiki":{"site":"itwiki","title":"Homer
133
+ Simpson","badges":["Q17437796"]},"itwikiquote":{"site":"itwikiquote","title":"Homer
134
+ Simpson","badges":[]},"jawiki":{"site":"jawiki","title":"\u30db\u30fc\u30de\u30fc\u30fb\u30b7\u30f3\u30d7\u30bd\u30f3","badges":[]},"kawiki":{"site":"kawiki","title":"\u10f0\u10dd\u10db\u10d4\u10e0
135
+ \u10e1\u10d8\u10db\u10de\u10e1\u10dd\u10dc\u10d8","badges":[]},"kowiki":{"site":"kowiki","title":"\ud638\uba38
136
+ \uc2ec\uc2a8","badges":[]},"lbwiki":{"site":"lbwiki","title":"Homer Simpson","badges":[]},"ltwiki":{"site":"ltwiki","title":"Homer
137
+ Simpson","badges":[]},"lvwiki":{"site":"lvwiki","title":"Hom\u0113rs Simpsons","badges":[]},"mrwiki":{"site":"mrwiki","title":"\u0939\u094b\u092e\u0930
138
+ \u0938\u093f\u092e\u094d\u092a\u094d\u0938\u0928","badges":[]},"nahwiki":{"site":"nahwiki","title":"Homer
139
+ Simpson","badges":[]},"newiki":{"site":"newiki","title":"\u0939\u094b\u092e\u0930
140
+ \u0938\u093f\u092e\u094d\u092a\u094d\u0938\u0928","badges":[]},"nlwiki":{"site":"nlwiki","title":"Homer
141
+ Simpson","badges":[]},"nowiki":{"site":"nowiki","title":"Homer Simpson","badges":[]},"nowikiquote":{"site":"nowikiquote","title":"Homer
142
+ Simpson","badges":[]},"ocwiki":{"site":"ocwiki","title":"Homer Simpson","badges":[]},"piwiki":{"site":"piwiki","title":"\u0939\u094b\u092e\u0930
143
+ \u0938\u093f\u092e\u094d\u092a\u094d\u0938\u0928","badges":[]},"plwiki":{"site":"plwiki","title":"Homer
144
+ Simpson","badges":[]},"plwikiquote":{"site":"plwikiquote","title":"Homer Simpson","badges":[]},"ptwiki":{"site":"ptwiki","title":"Homer
145
+ Simpson","badges":[]},"rowiki":{"site":"rowiki","title":"Homer Simpson","badges":[]},"ruwiki":{"site":"ruwiki","title":"\u0413\u043e\u043c\u0435\u0440
146
+ \u0421\u0438\u043c\u043f\u0441\u043e\u043d","badges":[]},"ruwikiquote":{"site":"ruwikiquote","title":"\u0413\u043e\u043c\u0435\u0440
147
+ \u0421\u0438\u043c\u043f\u0441\u043e\u043d","badges":[]},"sawiki":{"site":"sawiki","title":"\u0939\u094b\u092e\u0930
148
+ \u0938\u093f\u092e\u094d\u092a\u094d\u0938\u0928","badges":[]},"scnwiki":{"site":"scnwiki","title":"Homer
149
+ Simpson","badges":[]},"shwiki":{"site":"shwiki","title":"Homer Simpson","badges":[]},"simplewiki":{"site":"simplewiki","title":"Homer
150
+ Simpson","badges":[]},"skwiki":{"site":"skwiki","title":"Homer Simpson","badges":[]},"sqwiki":{"site":"sqwiki","title":"Homer
151
+ Simpson","badges":[]},"srwiki":{"site":"srwiki","title":"\u0425\u043e\u043c\u0435\u0440
152
+ \u040f\u0435\u0458 \u0421\u0438\u043c\u043f\u0441\u043e\u043d","badges":["Q17437798"]},"svwiki":{"site":"svwiki","title":"Homer
153
+ Simpson","badges":[]},"svwikiquote":{"site":"svwikiquote","title":"Homer Simpson","badges":[]},"thwiki":{"site":"thwiki","title":"\u0e42\u0e2e\u0e40\u0e21\u0e2d\u0e23\u0e4c
154
+ \u0e0b\u0e34\u0e21\u0e1b\u0e4c\u0e2a\u0e31\u0e19","badges":[]},"trwiki":{"site":"trwiki","title":"Homer
155
+ Simpson","badges":[]},"trwikiquote":{"site":"trwikiquote","title":"Homer Simpson","badges":[]},"ukwiki":{"site":"ukwiki","title":"\u0413\u043e\u043c\u0435\u0440
156
+ \u0421\u0456\u043c\u043f\u0441\u043e\u043d","badges":[]},"viwiki":{"site":"viwiki","title":"Homer
157
+ Simpson","badges":[]},"warwiki":{"site":"warwiki","title":"Homer Simpson","badges":[]},"zhwiki":{"site":"zhwiki","title":"\u970d\u9ed8\u00b7\u8f9b\u666e\u68ee","badges":["Q17437798"]}}}},"success":1}'
158
+ http_version:
159
+ recorded_at: Mon, 29 Sep 2014 09:07:19 GMT
160
+ recorded_with: VCR 2.9.3