{"id":21116781,"url":"https://github.com/molybdenum-99/whatis","last_synced_at":"2025-10-12T14:08:51.333Z","repository":{"id":56898125,"uuid":"112954038","full_name":"molybdenum-99/whatis","owner":"molybdenum-99","description":"WhatIs.this: simple entity resolution through Wikipedia","archived":false,"fork":false,"pushed_at":"2023-01-22T01:54:47.000Z","size":3615,"stargazers_count":18,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-29T07:33:06.520Z","etag":null,"topics":["entity-resolution","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":null,"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":"2017-12-03T18:50:21.000Z","updated_at":"2023-04-15T18:35:10.000Z","dependencies_parsed_at":"2023-02-12T14:01:22.635Z","dependency_job_id":null,"html_url":"https://github.com/molybdenum-99/whatis","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/molybdenum-99/whatis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/molybdenum-99%2Fwhatis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/molybdenum-99%2Fwhatis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/molybdenum-99%2Fwhatis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/molybdenum-99%2Fwhatis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/molybdenum-99","download_url":"https://codeload.github.com/molybdenum-99/whatis/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/molybdenum-99%2Fwhatis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278633400,"owners_count":26019338,"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","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["entity-resolution","wikipedia"],"created_at":"2024-11-20T02:34:27.990Z","updated_at":"2025-10-12T14:08:51.316Z","avatar_url":"https://github.com/molybdenum-99.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WhatIs.this\n\n[![Gem Version](https://badge.fury.io/rb/whatis.svg)](http://badge.fury.io/rb/whatis)\n[![Build Status](https://travis-ci.org/molybdenum-99/whatis.svg?branch=master)](https://travis-ci.org/molybdenum-99/whatis)\n\n**WhatIs.this** is a quick probe for the meaning and metadata of concepts through Wikipedia.\n\n## Showcase\n\n```ruby\nrequire 'whatis'\n\nsparta = WhatIs.this('Sparta')\n# =\u003e #\u003cThisIs Sparta [img] {37.081944,22.423611}\u003e\nsparta.coordinates\n# =\u003e #\u003cGeo::Coord 37.081944,22.423611\u003e\nsparta.image\n# =\u003e \"https://upload.wikimedia.org/wikipedia/commons/6/6c/Sparta_territory.jpg\"\n\nsparta.describe\n# =\u003e Sparta\n#            title: \"Sparta\"\n#      description: \"city-state in ancient Greece\"\n#      coordinates: #\u003cGeo::Coord 37.081944,22.423611\u003e\n#          extract: \"Sparta (Doric Greek: ; Attic Greek: ) was a prominent city-state in ancient Greece.\"\n#            image: \"https://upload.wikimedia.org/wikipedia/commons/6/6c/Sparta_territory.jpg\"\n\n# Fetch additional information: categories \u0026 translations:\nsparta = WhatIs.this('Sparta', categories: true, languages: 'el')\n# =\u003e #\u003cThisIs Sparta/Αρχαία Σπάρτη, 7 categories [img] {37.081944,22.423611}\u003e\nsparta.describe\n# =\u003e Sparta\n#            title: \"Sparta\"\n#      description: \"city-state in ancient Greece\"\n#      coordinates: #\u003cGeo::Coord 37.081944,22.423611\u003e\n#       categories: [\"Former countries in Europe\", \"Former populated places in Greece\", \"Locations in Greek mythology\", \"Populated places in Laconia\", \"Sparta\", \"States and territories disestablished in the 2nd century BC\", \"States and territories established in the 11th century BC\"]\n#        languages: {\"el\"=\u003e#\u003cThisIs::Link el:Αρχαία Σπάρτη\u003e}\n#          extract: \"Sparta (Doric Greek: ; Attic Greek: ) was a prominent city-state in ancient Greece.\"\n#            image: \"https://upload.wikimedia.org/wikipedia/commons/6/6c/Sparta_territory.jpg\"\n\nsparta.languages['el'].resolve\n# =\u003e #\u003cThisIs Αρχαία Σπάρτη [img]\u003e\n\n# Multiple entities at once:\nWhatIs.these('Paris', 'Berlin', 'Rome', 'Athens')\n# =\u003e {\n#   \"Paris\"=\u003e#\u003cThisIs Paris [img] {48.856700,2.350800}\u003e,\n#   \"Berlin\"=\u003e#\u003cThisIs Berlin [img] {52.516667,13.388889}\u003e,\n#   \"Rome\"=\u003e#\u003cThisIs Rome [img] {41.900000,12.500000}\u003e,\n#   \"Athens\"=\u003e#\u003cThisIs Athens [img] {37.983972,23.727806}\u003e\n# }\n```\n## Applications\n\nThe gem is intended to be a simple tool for entities resolution/normalization. Possible usages:\n\n* You have a lot of user-entered answers to \"What city are you from\". Through `WhatIs.these` it is\n  pretty easy to resolve them to \"canonical\" city name (e.g. \"Warsaw\", \"Warszawa\", \"Warsaw, Poland\" =\u003e\n  \"Warsaw\") and map locations;\n* Quick check on user-entered cultural objects, \"what is it\";\n* Canonical Wikipedia-powered translations of toponyms, movie titles and historical people;\n* ...and so-on.\n\n## Features/problems\n\n* Fetches Wikipedia data by entity names: canonical title, geographical coordinates, main page image,\n  the first phrase, short entity description from Wikidata;\n* Optionally fetches links to other Wikipedia languages and list of page categories;\n* Fetches any number of Wikipedia pages in minimal number of API requests (50-page batches);\n  * Note that despite this optimization, Wikipedia API responses are not very small, so resolving,\n    say, 1000 entities, will errrm _take some time_;\n* Works with any language version of Wikipedia:\n```ruby\nWhatIs[:de].this('München')\n# =\u003e #\u003cThisIs München [img] {48.137222,11.575556}\u003e\n```\n* Handles not found pages and allows to search them in place:\n```ruby\ng = WhatIs.this('Guardians Of The Galaxy') # Wikipedia pages is case-sensitive\n# =\u003e #\u003cThisIs::NotFound Guardians Of The Galaxy\u003e\ng.search(3)\n# =\u003e [#\u003cThisIs::Ambigous Guardians of the Galaxy (11 options)\u003e, #\u003cThisIs Guardians of the Galaxy (film)\u003e, #\u003cThisIs Guardians of the Galaxy Vol. 2\u003e]\n```\n* Handles disambiguation pages:\n```ruby\ng = WhatIs.this('Guardians of the Galaxy')\n# =\u003e #\u003cThisIs::Ambigous Guardians of the Galaxy (11 options)\u003e\ng.describe\n# =\u003e Guardians of the Galaxy: ambigous (11 options)\n#      #\u003cThisIs::Link Marvel Comics teams/Guardians of the Galaxy (1969 team)\u003e: Guardians of the Galaxy (1969 team), the original 31st-century team from an alternative timeline of the Marvel Universe (Earth-691)\n#      #\u003cThisIs::Link Marvel Comics teams/Guardians of the Galaxy (2008 team)\u003e: Guardians of the Galaxy (2008 team), the modern version of the team formed in the aftermath of Annihilation: Conquest\n#    \u003c...skip...\u003e\n#      Usage: .variants[0].resolve, .resolve_all\ng.variants[1].resolve(categories: true)\n# =\u003e #\u003cThisIs Guardians of the Galaxy (2008 team), 13 categories\u003e\n```\n* Provides command-line tool:\n```\n$ whatis Paris Berlin Rome\nParis: Paris {48.856700,2.350800} - capital city of France\nBerlin: Berlin {52.516667,13.388889} - capital city of Germany\nRome: Rome {41.900000,12.500000} - capital city of Italy\n\n$ whatis --help\nUsage: `whatis [options] title1, title2, title3\n\nOptions:\n    -l, --language CODE              Which language Wikipedia to ask, 2-letter code. \"en\" by default\n    -t, --languages [CODE]           Without argument, fetches all translations for entity.\n                                     With argument (two-letter code) fetches only one translation.\n                                     By default, no translations are fetched.\n        --categories                 Whether to fetch entity categories\n    -f, --format FORMAT              Output format: one line per entity (\"short\"), several lines per\n                                     entity (\"long\"), or \"json\". Default is \"short\".\n    -h, --help                       Show this message\n```\n\n### Note on disambiguation pages\n\nUnfortunately, Wikipedia does not provide a consistent way to tell disambiguation pages from others,\nthe only way is to know is to see the page's categories (different for different languages). Therefore,\ncurrently, disambiguation works currently for English, Ukrainian, Russian and Belorussian. Feel free\nto contribute disambiguation categories for your language versions!\n\n## Usage\n\n`gem install whatis` or add `gem \"whatis\"` to your `Gemfile`.\n\nThen use it as library (see docs for [WhatIs](www.rubydoc.info/gems/whatis/WhatIs) and its methods)\nor command-line tool (try `$ whatis --help`).\n\n## How it works\n\n`WhatIs.this` is a small brother of large [reality](https://github.com/molybdenum-99/reality). Under\nthe hood, it uses [infoboxer](https://github.com/molybdenum-99/infoboxer) semantic Wikipedia client.\n\nMost of the information is taken from API response metadata, but for some features (ambiguities\nresolution), Wikipedia page is actually parsed.\n\nUnlike `reality` (which tries to be _comprehensive_), `WhatIs.this` tries to be as simple yet useful,\nas possible.\n\n## Author\n\n[Victor Shepelev](http://zverok.github.io)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmolybdenum-99%2Fwhatis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmolybdenum-99%2Fwhatis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmolybdenum-99%2Fwhatis/lists"}