molybdenum-99/reality

Idea: Default to Wikidata label search if no Wikipedia article found

Holek opened this issue · 3 comments

Holek commented
> pip = Reality::Entity.new("Piper Club")
=> #<Reality::Entity?(Piper Club)>
> pip.describe
-------------------------------
#<Reality::Entity?(Piper Club)>
-------------------------------
=> nil

That's because Piper Club article currently exists only in Italian Wikipedia, but its Wikidata item is full of statements that could be imported.

61bc9ea Did it! (Only for singular entities though, not for entity lists. Will fix it later.)

Also added some useful predicates for your case. In current master it is:

pip = Reality::Entity('Piper Club')
# => #<Reality::Entity(Piper Club)> 
pip.describe
# ------------------------------
# #<Reality::Entity(Piper Club)>
# ------------------------------
#             coord: #<Reality::Geo::Coord(41°55′8″N,12°30′4″E)>
#        located_in: #<Reality::Entity?(Rome)>
#  official_website: "http://www.piperclub.it/"
#    street_address: "Via Tagliamento 9"
#  twitter_username: "piperclubroma"
Holek commented

👏 Bravo!

Added list loading fallback too, now in master. Will came in next release, in 1-2 weeks. So, closing the issue now.