klacointe/wikidata-client

Invalid extraction of BC dates

Closed this issue · 1 comments

[3] pry(main)> i = Wikidata::Item.find('Q7463501')                                                                                                                                                                                             
=> <Wikidata::Item id: Q7463501, title: "Lower Paleolithic">
[4] pry(main)> i.start_date
=> #<Wikidata::Property::Time:0x007fdfc5110740
 @property=
  {"id"=>"Q7463501$d6247f70-4dcf-afcd-81af-6e20f0d85c3a",
   "mainsnak"=>
    {"snaktype"=>"value",
     "property"=>"P580",
     "datatype"=>"time",
     "datavalue"=>{"value"=>{"time"=>"-00002500000-01-01T00:00:00Z", "timezone"=>0, "before"=>0, "after"=>0, "precision"=>4, "calendarmodel"=>"http://www.wikidata.org/entity/Q1985727"}, "type"=>"time"}},
   "qualifiers"=>
    {"P518"=>[{"hash"=>"34768c4845167709a7bcf6a10da46bf1bd0b7232", "snaktype"=>"value", "property"=>"P518", "datatype"=>"wikibase-item", "datavalue"=>{"value"=>{"entity-type"=>"item", "numeric-id"=>15}, "type"=>"wikibase-entityid"}}]},
   "qualifiers-order"=>["P518"],
   "type"=>"statement",
   "rank"=>"normal"}>
[5] pry(main)> i.start_date.date
=> Sat, 01 Jan 2500000 00:00:00 +0000