{"id":13586927,"url":"https://github.com/molybdenum-99/reality","last_synced_at":"2025-05-15T15:03:41.977Z","repository":{"id":56891308,"uuid":"47512659","full_name":"molybdenum-99/reality","owner":"molybdenum-99","description":"Comprehensive data proxy to knowledge about real world","archived":false,"fork":false,"pushed_at":"2023-01-21T03:08:52.000Z","size":5865,"stargazers_count":813,"open_issues_count":18,"forks_count":43,"subscribers_count":26,"default_branch":"master","last_synced_at":"2024-05-12T05:02:48.997Z","etag":null,"topics":["api","experimental","knowledge","opendata","wikipedia"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/molybdenum-99.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-06T20:32:52.000Z","updated_at":"2024-05-06T19:05:00.000Z","dependencies_parsed_at":"2023-02-12T07:46:56.804Z","dependency_job_id":null,"html_url":"https://github.com/molybdenum-99/reality","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/molybdenum-99%2Freality","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/molybdenum-99%2Freality/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/molybdenum-99%2Freality/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/molybdenum-99%2Freality/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/molybdenum-99","download_url":"https://codeload.github.com/molybdenum-99/reality/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247721898,"owners_count":20985084,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","experimental","knowledge","opendata","wikipedia"],"created_at":"2024-08-01T15:05:54.700Z","updated_at":"2025-04-07T20:09:23.749Z","avatar_url":"https://github.com/molybdenum-99.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"Reality\n=======\n\n[![Gem Version](https://badge.fury.io/rb/reality.svg)](http://badge.fury.io/rb/reality)\n[![Join the chat at https://gitter.im/molybdenum-99/reality](https://badges.gitter.im/molybdenum-99/reality.svg)](https://gitter.im/molybdenum-99/reality?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n**Reality** is experimental Ruby library/set of libraries to provide uniform query access to heterogenous\nweb API, with accent on real-world knowledge ones. It emphasizes simplicity of data access and\ninteroperability of data from various sources.\n\nThe ultimate goal is to make the world inspectable and computable.\n\nSome demos:\n\n```ruby\nrequire 'reality' # the core library\nrequire 'reality/miracles' # some demo-friendly shortcuts\n\n# wikipedia\n\n# single entry\ncm = Reality.wikipedia.get('Chiang Mai')\n# =\u003e #\u003cReality::Entity wikipedia:en://Chiang Mai\u003e\n\ncm.describe\n# =\u003e #\u003cReality::Entity wikipedia:en://Chiang Mai\u003e\n#                   meta.title: Chiang Mai\n#                     meta.url: https://en.wikipedia.org/wiki/Chiang_Mai\n#                   meta.image: https://upload.wikimedia.org/wikipedia/commons/7/76/Chiang_Mai_City.png\n# ....\n#                  native_name: เชียงใหม่\n# ....\n#             subdivision_type: Country\n#             subdivision_name: \u003cwikipedia:en://Thailand\u003e\n#            subdivision_type1: \u003cwikipedia:en://Provinces of Thailand (Province)\u003e\n#            subdivision_name1: \u003cwikipedia:en://Chiang Mai Province\u003e\n#            subdivision_type2: \u003cwikipedia:en://Amphoe\u003e\n#            subdivision_name2: \u003cwikipedia:en://Mueang Chiang Mai District (Mueang Chiang Mai)\u003e\n#                 leader_title: Mayor\n#                  leader_name: Tatsanai Puranupakorn\n#               area_total_km2: 40.22km²\n#               area_metro_km2: 2,905km²\n#             population_as_of: 2017\n#             population_total: 131,091people\n# ....\n#                   utc_offset: +07:00\n#                  coordinates: 18°47'43\"N 98°59'55\"E\n# .....\n\n# navigation through data\ncm.subdivision_name.describe\n# =\u003e #\u003cReality::Entity wikipedia:en://Thailand\u003e\n#               meta.title: Thailand\n#                 meta.url: https://en.wikipedia.org/wiki/Thailand\n#               meta.image: https://upload.wikimedia.org/wikipedia/commons/a/a9/Flag_of_Thailand.svg\n#              native_name: {native name:th|ราชอาณาจักรไทย}, {lang:th-Latn|Ratcha-anachak Thai}\n#               image_flag: \u003cwikipedia:en://File:Flag of Thailand.svg\u003e\n#               image_coat: \u003cwikipedia:en://File:Garuda Emblem of Thailand.svg\u003e\n#          national_anthem: \u003cwikipedia:en://Thai National Anthem (Phleng Chat Thai)\u003e, ({lang-en:\"Thai National Anthem\"}),\n#             royal_anthem: \u003cwikipedia:en://Sansoen Phra Barami\u003e, ({lang-en:\"Glorify His prestige\"}),\n#                image_map: \u003cwikipedia:en://File:Location Thailand ASEAN.svg\u003e\n# ....\n#                  capital: \u003cwikipedia:en://Bangkok\u003e\n#              coordinates: 13°45'0\"N 100°29'0\"E\n# ....\n\n# lists of entities\ncities = Reality.wikipedia.query(category: 'Cities and towns in Thailand').all\n# =\u003e [#\u003cReality::Link wikipedia:en://Amnat Charoen\u003e, #\u003cReality::Link wikipedia:en://Bueng Kan\u003e, #\u003cReality::Link wikipedia:en://Buriram\u003e, #\u003cReality::Link wikipedia:en://Cha-am District\u003e, #\u003cReality::Link wikipedia:en://Chai Nat\u003e, #\u003cReality::Link wikipedia:en://Chai Prakan\u003e, #\u003cReality::Link wikipedia:en://Chaiyaphum\u003e, #\u003cReality::Link wikipedia:en://Chiang Dao Subdistrict\u003e, #\u003cReality::Link wikipedia:en://Chiang Mai\u003e, ...\ncities.first.population_total\n# =\u003e #\u003cReality::Measure 26,118 people\u003e\n\n# Wikidata (structured Wikipedia-alike data storage)\ncm2 = Reality.wikidata.query(label: 'Chiang Mai').first\n# =\u003e #\u003cReality::Link wikidata://Q52028 (Chiang Mai)\u003e\ncm2.describe\n# =\u003e #\u003cReality::Entity wikidata://Q52028\u003e\n#                                  meta.id: Q52028\n#                               meta.label: Chiang Mai\n#                         meta.description: city in Chiang Mai province, Thailand\n#  ...\n#                              instance of: \u003cwikidata://Q15141632 (Thesaban Nakhon)\u003e, \u003cwikidata://Q1549591 (big city)\u003e\n#  ...\n#                              sister city: \u003cwikidata://Q819613 (Uozu)\u003e, \u003cwikidata://Q128186 (Saitama Prefecture)\u003e, \u003cwikidata://Q182852 (Kunming)\u003e, \u003cwikidata://Q42956 (Harbin)\u003e\n#                              GeoNames ID: 1153671\n#            category for people born here: \u003cwikidata://Q8078994\u003e\n# category for films shot at this location: \u003cwikidata://Q7140299 (Category:Films shot in Chiang Mai)\u003e\n#        category for people who died here: \u003cwikidata://Q27062063\u003e\n#        Encyclopædia Britannica Online ID: place/Chiang-Mai\n# ...\n\n# Interaction Wikipedia→Wikidata:\ncm = Reality.wikipedia.get('Chiang Mai')\ncm['meta.wikidata'].load.describe\n# =\u003e #\u003cReality::Entity wikidata://Q52028\u003e\n#    meta.id: Q52028\n# meta.title: Q52028\n# meta.label: Chiang Mai\n# ...\n\n# Wikipedia→OpenStreetMap\nReality.osm.query(around: cm, radius: 30_000, aerodrome: 'international').all\n# =\u003e [#\u003cReality::Link osm://way(90429204) (Chiang Mai International Airport)\u003e]\n\n# Wikipedia→OpenWeatherMap\nReality.open_weather_map.query(at: cm).first.describe\n# =\u003e #\u003cReality::Entity openweathermap://1153671\u003e\n#       temp: 33°C\n#   pressure: 1,007hPa\n#   humidity: 55%\n#   temp_min: 33°C\n#   temp_max: 33°C\n# visibility: 10000\n# wind_speed: 4.6m/s\n#   wind_deg: 160°\n# clouds_all: 40\n#  timestamp: 2018-05-27 13:00:00 +0300\n#    country: TH\n#    sunrise: 2018-05-27 01:46:48 +0300\n#     sunset: 2018-05-27 14:55:42 +0300\n#       name: Chiang Mai\n#      coord: 18°48'0\"N 99°0'0\"E\n```\n\n**!!!IMPORTANT!!!** This is **pre-release** of new, completely rewritten version. Previos version\nturned to be a (nice-looking) dead end. It still can be found at [old-prototype](https://github.com/molybdenum-99/reality/tree/old-prototype-branch)\nbranch, and installed as a gem version 0.0.5.\n\nCurrent state is very WIP subject to lot of changes\n\nSee also the explanatory [presentation](https://docs.google.com/presentation/d/1I4mznHUBhVVDxWfO2DRzxP4wNhs9Mmtx09SizLqIbaE/edit?usp=sharing)\nand [video](https://www.youtube.com/watch?v=x9GePP3B0oE), made at RubyConfIndia 2018.\n\nStay tuned for large and important updates!\n\n## Credits\n\n* [Victor Shepelev](https://zverok.github.io) [@zverok](https://github.com/zverok);\n* Sergii Mostovyi [@smostovoy](https://github.com/smostovoy);\n* [Valentino Stoll](http://www.awesomevibe.com/) [@codenamev](https://github.com/codenamev);\n* [Several great contributors](https://github.com/molybdenum-99/reality/graphs/contributors).\n\nDevelopment of first version was sponsored by\n[2015 Ruby Association Grant](http://www.ruby.or.jp/en/news/20160406.html).\n\nInitial idea is inspired by \"integrated data\" of\n[Wolfram Language](http://reference.wolfram.com/language/).\n\n## License\n\n[MIT](https://github.com/molybdenum-99/reality/blob/master/LICENSE.txt)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmolybdenum-99%2Freality","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmolybdenum-99%2Freality","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmolybdenum-99%2Freality/lists"}