Closed acka47 closed 4 years ago
From 4393 entries with NWBib ID in Wikidata, 396 have an AGS: https://w.wiki/5PG
I noticed that we also have to take into account P440 (Kreisschlüssel). We have 92 of those: https://w.wiki/5Pf
This makes 488 items with a key which is actually a good coverage. Narrowing this down on types that should actually have an AGS (Regierungsbezirke, Landkreise, Gemeinden, Städte without an end date), we actually only get back the Regierungsbezirke. Here is a list of those entries missing an AGS or Kreisschlüssel that should (mostly) actually have one: https://w.wiki/5U3
The Regierungsbezirke neither have a Kreisschlüssel nor a Gemeindeschlüssel which makes sense. Nonetheless, one can build a key for the Regierungsbezirke by just taking the first three numbers. About the syntax (from Wikipedia, my emphasis):
Der Amtliche Gemeindeschlüssel (AGS) besteht aus insgesamt acht Schlüsselstellen, die sich wie folgt zusammensetzen:
- Die ersten beiden Schlüssel bezeichnen das Bundesland (siehe untenstehende Tabelle).
- Der dritte bis fünfte Schlüssel identifiziert den Landkreis bzw. die kreisfreie Stadt, dem die Gemeinde angehört. Die ersten fünf Stellen werden daher auch als Kreisschlüssel bezeichnet. Dabei zeigt die dritte Schlüsselstelle bei Ländern, in denen Regierungsbezirke bestehen oder in der Vergangenheit bestanden haben, in der Regel den Bezirk an, während sie in anderen Ländern 0 ist. (...)
- Die letzten drei Schlüssel schließlich unterscheiden die Gemeinden innerhalb eines Landkreises. Bei kreisfreien Städten stehen an dieser Stelle drei Nullen.
AGS and KGS Gemeinden and Kreise have already been added to the SKOS file with https://github.com/hbz/nwbib/commit/f14873999b115475761d7041bacc93a460a5d439. This leaves the three-digit codes for the Regierungsbezirke to be added to the file (see previous comment).
Then we will have to think how to add the notation to the lobid data.
Documenting the following here to have it all in one place.
I added the notations for Regierungsbezirke manually with https://github.com/hbz/lobid-vocabs/pull/99/commits/4a68d9add1e9f1b0d870d113417ca9eacae9b75c and @fsteeg asked:
Should these not be added as P439/P440 (AGS/KS) in Wikidata instead? With our current implementation, these notations are removed upon regenerating the SKOS file, since the Wikidata entries have no AGS/KS.
Good to know that this will be overwritten. As these are neither Gemeinden nor Kreise but Regierungsbezirke, they officially do not have a AGS or KS and a "Regierungsbezirksschlüssel" does not exist, see https://github.com/hbz/lobid-vocabs/issues/89#issuecomment-507225870.
However, there is the "Regionalschlüssel" and although it is usually characterized as "12-stelliger Schlüssel" (see e.g. here) it is used in Wikidata with less digits, e.g. Bayern has Regionalschlüssel
09
).To make a long story short: I added the Regionalschlüssel to the Regierungsbezirke and we should also add it as notation to the SKOS file but only when no ags or ks is present. (There are few Wikidata entries with NWBib ID – and it might be more in the future – that have more than one Schlüssel, see https://w.wiki/8C4.)
With problems like https://github.com/hbz/nwbib/issues/490 and NWbib editors saying that they will have to fake some keys for older Kreise (email by H.F. from 2019-05-02) we will probably have to set up an additional way to configure notations anyway. I looked for a way to add the notation as qualifier in Wikidata but didn't find anything. As last resort, we could propose a property or we set up a configuration file in the git repo...
I think we still have to merge https://github.com/hbz/nwbib/commit/76501aa330c4bc68d0b18285879132786b5ea01b into master in order to be able to close this issue, don't we, @fsteeg ?
Most recent deployment:
https://test.nwbib.de/spatial https://test.nwbib.de/spatial?t=download
As requested on 2019-05-01 by H.F. via email:
We will have to get the AGS into the SKOS file using
skos:notation
. however, we will probably also have to add it to lobid-resources data as I assume tht they will want the notations to be shown in the detail view of a resource...