molybdenum-99 / reality

Comprehensive data proxy to knowledge about real world
MIT License
817 stars 43 forks source link

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

Closed Holek closed 8 years ago

Holek commented 8 years ago
> 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.

zverok commented 8 years ago

https://github.com/molybdenum-99/reality/commit/61bc9ead50d38d87f6468db27069bc015f85fe01 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 8 years ago

:clap: Bravo!

zverok commented 8 years ago

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