Giter Site home page Giter Site logo

reality's Introduction

Reality

Reality is a gem (in its early development stage) for easy and convenient recieving data on various real-life knowledge entities. It uses open data sources (only Wikipedia and DBPedia currently, but more of them planned) and makes data accessible to novices, experimentators and hobbyists.

Now, at earliest version possible, Reality provides access only to world countries data:

# One country
ar = Reality.country('Argentina')
ar.area # => #<Reality::Measure(2,780,400 km²)>
ar.capital # => Buenos Aires
ar.leaders['President'] # => Mauricio Macri

# List of countries:
countries = Reality.countries.to_a
# CAUTION tooks like ~2 min to load on modern Internet & CPU.

countries.
  select{|c| c.continent == 'Africa'}.
  reject{|c| !c.gdp || (c.gdp / c.population).amount > 5_000}.
  map(:area).inject(:+)
# => #<Reality::Measure(22,412,893 km²)>

# or, with loading from wikipedia only relevant countries:
Reality.countries.where(continent: 'Africa').
  reject{|c| !c.gdp || (c.gdp / c.population).amount > 5_000}.
  map(:area).inject(:+)

Rough examples of what the library is supposed to do eventually, can be seen at showcase draft.

Roadmap

  • World countries: first example of Wikipedia -> easy data translation;
  • Generic named measure concept and arithmetics;
  • Usage of Wikipedia as a query engine like "countries with population larger than", proxied via "List of countries by population");
  • More of related entities, starting from city, and interaction with countries (like "cities of this country" and more);
  • Generic entity concept;
  • Evaluation of usage of DBPedia as a query engine;
  • Wrappers for most common and most interesting data types (like people, famous places, music bands, movies, and so on) from Wikipedia;
  • Extending Reality sources to other open data sources, like OpenStreetMap, OpenWeatherMap, OpenExchange and so on;
  • Extending Reality calculations to real world time and space, like "calculate sunset at concrete date for concrete city and convert it to my timezone", or "calculate distance between those two places" and so on;
  • Integration with means of pretty output (like RMagick and IRuby Notebooks);
  • ....

Authors

Development sponsored by 2015 Ruby Association Grant.

Initial idea is inspired by "integrated data" of Wolfram Language.

License

MIT

reality's People

Contributors

smostovoy avatar zverok avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.