Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Figure out how to handle translated names. #1

Open
xivk opened this issue May 15, 2019 · 4 comments
Open

Figure out how to handle translated names. #1

xivk opened this issue May 15, 2019 · 4 comments

Comments

@xivk
Copy link
Contributor

xivk commented May 15, 2019

In OSM we have name:nl name:fr etc... for language specific names. We need to figure out how to properly include them in the tiles.

@hdelva
Copy link
Contributor

hdelva commented May 22, 2019

Could this work?

{
	"@context": {
		"osm:hasAlternativeNames": {
			"@container": "@language"
		}
	},
	"@graph": [
		{
			"osm:name": "example name",
			"osm:hasAlternativeNames": {
				"nl": "voorbeeldnaam",
				"fr": "exemple de nom"
			} 
		}
	]
}

The language keys must conform to bcp47 according to the JSON-LD spec. That's a format requirement though, ontology-wise I think the osm:hasAlternativeNames definition will be identical to the existing osm:name one, except for the 'alternative' bit.

Would this make sense from an OSM point of view though? From what I can tell, there are elements with a name:nl tag but no name tag -- so can we safely call them alternative names? And perhaps even more interesting, are those specific names used for anything other than languages? I think geonames for example also has some historical names, does OSM have those as well?

@xivk
Copy link
Contributor Author

xivk commented May 23, 2019

This solution looks OK but maybe hasAlternativeNames is not a very good solution because OSM also has the alt_name tag representing alternative/local names for certain places/roads ;-)

It is best practice to include a default name tag first and only then do translations. The name tag is always assumed to be the local name, the name actually seen on the signs on the streets. name:nl is the dutch translation, it should not contain alternative names.

Also, OSM has no validation mechanism, only error detection after the edits already happened. Usually mappers will fix mistakes but only after a while. So anything that can go wrong has probably gone wrong before so if you look at the data try to see what is most commonly done and what is in the wiki.

I think we can use the above approach but perhaps use something like osm:hasTranslatedNames ?

@xivk
Copy link
Contributor Author

xivk commented May 23, 2019

Also, more info about translated names are here:

https://wiki.openstreetmap.org/wiki/Multilingual_names#Belgium

It seems the language codes used are these:

http://www.loc.gov/standards/iso639-2/php/code_list.php

I have no idea how that compares to bcp47

@hdelva
Copy link
Contributor

hdelva commented May 23, 2019

That wiki page also explains name:left and name:right tags, how do we handle these? Those aren't even alternative names, it's just the Belgian urban planning that's seeping into OSM. Do we just send these to a hasTag property instead?

Apart from that, I think there's another challenge in mapping the OSM data to a JSON-LD 'language map'. Together with the issues raised in #2, maybe a config file like that isn't the way to go -- but I'm not sure what would be better. RML might be expressive enough, or maybe we should just drop the config file entirely and do everything in the tile generation code?

BCP 47 shouldn't be an issue I think. It seems to be an extension of ISO 639, unless I'm missing some subtle differences.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants