osmlab / name-suggestion-index

Canonical common brand names, operators, transit and flags for OpenStreetMap.
https://nsi.guide
BSD 3-Clause "New" or "Revised" License
712 stars 872 forks source link

Dynamically generate contact information as part of the NSI Hints from Wikidata #9156

Closed balporig closed 10 months ago

balporig commented 10 months ago

The current hints in iD and other supported editors are great but a when creating new POIs a tedious step is adding contact information like websites, phones and socials over and over again. Besides phones, websites and social usually are static between chain/operator branches. Also, just as before with the cannonical names, this can bring some more consistency and remove the contributor burden to maintain one more thing.

Given that most NSI entries have brand:wikidata or operator:wikidata and the contact information is already fetched from Wikidata when generating dist/wikidata.json in the identities and officialWebsites keys, why not use them to add to the existing entry tags (merge) for each one of those:

"tags":  {
  "website": "",
  "contact:facebook": "",
  "contact:instagram": "",
  ....
}

For e.g. let's pick this operator from operators/amenity/drinking_water.json

    {
      "displayName": "City of Denton",
      "id": "cityofdenton-6aaee1",
      "locationSet": {
        "include": ["us-tx.geojson"]
      },
      "tags": {
        "amenity": "drinking_water",
        "operator": "City of Denton",
        "operator:type": "government",
        "operator:wikidata": "Q128306"
      }
    },

this is what we have fetched in wikidata.json for Q128306

    "Q128306": {
      "description": "city in Denton County, Texas, United States",
      "identities": {"website": "https://www.cityofdenton.com/"},
      "label": "Denton",
      "officialWebsites": ["https://www.cityofdenton.com/"]
    },

so we end up with

    {
      "displayName": "City of Denton",
      "id": "cityofdenton-6aaee1",
      "locationSet": {
        "include": ["us-tx.geojson"]
      },
      "tags": {
        "amenity": "drinking_water",
        "operator": "City of Denton",
        "operator:type": "government",
        "operator:wikidata": "Q128306",
        "website": "https://www.cityofdenton.com/"
      }
    },

This is offline only transformation with the data we already have and probably will require minimal to no changes in the editors. The transformation can be added to run on each release so that the information is up-to-date.

1ec5 commented 10 months ago

Contact information is rarely consistent across a large brand. In particular, a franchisor often has one website and one set of social media accounts, while each franchisee might have a different set. And even though the franchisee can be tagged as the operator, it might have different contact information depending on the brand or from store location to store location. In the U.S., this is the case with almost every car dealership that’s part of a dealer group. Similarly, many restaurants that are part of the same chain have their own Facebook pages in order to advertise local promotions.

If what you want to tag is how to contact the operator or the brand, rather than the individual POI itself, that would be e.g., operator:website and brand:facebook. But these things aren’t usually tagged because they’re too tangential to OSM; a data consumer might as well look it up on Wikidata.

arch0345 commented 10 months ago

As @1ec5 mentioned, urls found on the Wikidata item would have a brand/operator prefix to distinguish them from contact details of the specific location. Unfortunately we don't plan on supporting tags like brand:website that can be fetched from Wikidata, see https://github.com/osmlab/name-suggestion-index/issues/5275#issuecomment-905798587