Skip to content
Máté Gyöngyösi edited this page Oct 7, 2024 · 33 revisions

This page is an overview of how to contribute to the Name Suggestion Index, and an introduction to the project's file hierarchy.

Project layout

The Name Suggestion Index currently indexes items in these general categories, also known within the NSI as trees:

  • brands - Branded businesses like restaurants, banks, fuel stations, shops identified by brand/brand:wikidata tags
  • operators - Organizations like post offices, police departments, hospitals identified by operator/operator:wikidata tags
  • flags - Flagpoles hoisting common kinds of flags (national, regional, religious, advertising) identified by flag:wikidata tag
  • transit - Transit networks (bus, rail, ferry, etc.) and related infrastructure identified by network/network:wikidata tags

The data/* folder contains all of the raw index files, known as category files. These files are organized in a tree/key/value path:

  • tree - The highest level of organization - each tree contains categories that follow a similar approach to naming and linking to Wikidata.
  • key - An OpenStreetMap tree key (e.g. "amenity")
  • value - An OpenStreetMap tag value (e.g. "fast_food")

Each tree/key/value combination has its own category file, containing all the items that share an OpenStreetMap key/value tag. For example:

  • data/
    • brands/amenity/fast_food.json
    • brands/shop/supermarket.json
    • operators/amenity/post_office.json
    • flags/man_made/flagpole.json
    • transit/route/bus.json
    • and so on…

Many more details about the project layout and how entries are structured in each category file can be found in Category Files.

Common ways to help

Other ways to contribute

Editing existing entries

If there is an issue with an existing entry, or if something is missing from an existing entry, you are encouraged to submit an issue or pull request to bring attention to the problem. Pull requests are the recommended method; they are generally processed much faster by project maintainers than issues. For assistance with editing existing entries, please see Item Property Reference.

Be sure to follow the guidelines regarding the NSI Collector project when renaming or merging existing entries.

Generic name filtering

Some of the common names in the index with few tags beyond their name might not actually be names of brands, flags, operators, or transit networks; instead, they might just be generic words or phrases. Project maintainers generally filter these generic names out as time goes on, but there may still be some stragglers present. New ones may also be added to the index after an import from the NSI Collector project. These generic words or phrases should be removed from the index, so they are not suggested to mappers.

For example, "Универмаг" is just a Russian word for "department store":

"path": "brands/shop/department_store",
"items": [
  
  {
    "displayName": "Универмаг",
    "id": "универмаг-d5eaac",
    "locationSet": { "include": ["ru"] },
    "tags": {
      "brand": "Универмаг",
      "name": "Универмаг",
      "shop": "department_store"
    }
  },
  

To remove generic names from the index:

  1. Delete the item's entry from the appropriate category file, in this case data/brands/shop/department_store.json
  2. Add the name to the file's exclude list in the category properties. If it is a purely generic name like the example above, it should be added to the "generic" array. If it is an actual but otherwise nondescript name, it should be added to the "named" array.
  3. If you have a local copy of the project for development, you can run the build script before submitting a pull request to check if the generic name was successfully added to the exclude list. If the edit was properly performed, the name will not be put back into the category file (e.g., data/brands/shop/department_store.json) post-build. This step is recommended but optional, so don't worry if you don't have a local copy of the project.
  4. Once everything looks OK, submit a pull request with your changes.

Home

For Contributors

Contributing to the index

Advanced Topics

For Developers

Information for developers using the name-suggestion-index in another project.

For Maintainers

Information for maintainers, including how to clone and build the project.

 

Clone this wiki locally