hbz / lobid-vocabs

General lobid vocabulary and controlled term lists.
https://skohub.io/hbz/lobid-vocabs/heads/master
6 stars 9 forks source link

Add AGS as notation #89

Closed acka47 closed 4 years ago

acka47 commented 5 years ago

As requested on 2019-05-01 by H.F. via email:

Die beiden NWBib-Redaktionen haben jetzt eine inhaltliche Lösung gefunden, die Verwaltungsgliederung weitgehend und sehr konsistent mit Notationen zu versehen. Wir möchten dabei gerne auf eine Lösung zurückgreifen, die in der amtlichen Statistik und Verwaltungspraxis der deutschen Länder und Kommunen eingeführt ist und auch in Wikidatasätze Eingang gefunden hat. Verwendung finden soll der sog. Amtliche Gemeindeschlüssel (vgl. Wikipedia-Artikel; Datei via Google-Suche. Wir haben die NRW-Schlüssel auch extrahiert). Mit dem AGS ist der Kernbereich unserer Verwaltungsgliederung (Städte und Gemeinden) erfasst. Aus den bibliothekarisch akzeptablen hierarchisch strukturierten Schlüsseln für die Gemeinden, die zu NWBib-Notationen werden sollen, lassen sich die auch die Notationen für die Regierungsbezirke und die Kreise einfach extrapolieren. Stadtbezirke und Ortsteile würden wir wie bislang alphabetisch den Städten und Gemeinden unterordnen

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...

acka47 commented 5 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

acka47 commented 5 years ago

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.
acka47 commented 5 years ago

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.

acka47 commented 5 years ago

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.

I responded here and here:

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...

acka47 commented 4 years ago

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 ?

fsteeg commented 4 years ago

Deployed to test:

https://raw.githubusercontent.com/hbz/lobid-vocabs/89-rs/nwbib/nwbib-spatial.ttl https://test.nwbib.de/spatial

fsteeg commented 4 years ago

Most recent deployment:

https://test.nwbib.de/spatial https://test.nwbib.de/spatial?t=download