Versionen im Vergleich

Schlüssel

  • Diese Zeile wurde hinzugefügt.
  • Diese Zeile wurde entfernt.
  • Formatierung wurde geändert.

Datum des CBS-Abzugs: 20222024-1107-01

Dieser Bericht wurde automatisiert mit R Markdown erstellt. Der pica-rs-Code für die Abfrage aller Tc-Sätze und der R-Code für die Berechnung der Ausgabetabelle können durch Aufklappen der Codeblöcke eingesehen werden.

Von allen Datensätzen mit 002@.0 == 'Tc' ohne 050C.a =^ 'GND-kein-Schlagwort' werden die Unterfelder $2 und $4 der PICA+-Felder 022P, 028P, 029P, 030P, 041P und 065P ausgelesen und die IDN-Anzahlen für alle Kombinationen der Werte {‘agrovoc’, ‘lcsh’, ‘ram’, ‘mesh’, ‘stw’, ‘thesoz’, ‘embne’, ‘nsbncf’, ‘tpro’} in $2 und {‘ftaa’, ‘ftae’, ‘ftai’, ‘ftao’, ‘ftau’, ‘ftob’, ‘ftub’, ‘ftvb’, ‘ftnu’} in $4 berechnet.

Eine äquivalente Abfrage in der WinIBW für den ersten Rückgabewert lautete f bbg tc crt ( agrovoc and ftaa)-ftaa NOT rdb GND-kein-Schlagwort*.

Codeblock
languagebash
collapsetrue
#!/bin/bash

set -euo pipefail
# set -x

# https://wiki.dnb.de/displaypages/GND/1.+Mappings+GND+-+Fremdthesauri,
# https://wiki.dnb.de/display/GND/5.+Datenformat+GND+-+Crosskonkordanzen+zu+externen+Thesauri
viewpage.action?pageId=263851158

dnb_dump=/srv/aen-data/pica/T.dat

# Tc-Sätze "f bbg Tc NOT rdb GND-kein-Schlagwort*"
pica filter -s "002@.0 == 'Tc'" --not "050C.a =^ 'GND-kein-Schlagwort'" $dnb_dump -o Tc.dat

# 028P (700) - "p" - Person
# 029P (710) - "b" - Körperschaft
# 030P (711) - "f" - Konferenz
# 022P (730) - "u" - Einheitstitel
# 041P (750) - "s" - Sachbegriff
# 065P (751) - "g" - Geografikum

pica filter -s "028P.4?" Tc.dat |
pica select -H "IDN, Feld, Thesaurus, Relation" \
"003@.0, '028P', 028P{2, 4}" \
--where "028P.4?" Tc.dat -o Tc.csv

# ohne Header anhängen
pica filter -s "029P.4?" Tc.dat |
pica select "003@.0, '029P', 029P{2, 4}" >> Tc.csv

pica filter -s--where "030P029P.4?" Tc.dat | --append -o Tc.csv
pica select "003@.0, '030P', 030P{2, 4}" >> Tc.csv

pica filter -s--where "022P030P.4?" Tc.dat | --append -o Tc.csv
pica select "003@.0, '022P', 022P{2, 4}" >> Tc.csv

pica filter -s--where "041P022P.4?" Tc.dat | --append -o Tc.csv
pica select "003@.0, '041P', 041P{2, 4}" >> Tc.csv

pica filter -s--where "065P041P.4?" Tc.dat | --append -o Tc.csv
pica select "003@.0, '065P', 065P{2, 4}" >>--where "065P.4?" Tc.dat --append -o Tc.csv

Anzahl der Tc-Sätze gruppiert nach Thesaurus und Relation:

Codeblock
languagenone
collapsetrue
# Crosskonkordanzen einlesen
ck <- read_csv('Tc.csv', col_types = 'cccc')

# Wertebereiche gemäß Wiki-Seiten definieren
thesauri <- read_csv('Thesauri.csv', col_types = 'cc')
relationen <- read_csv('Relationen.csv', col_types = 'cc')

# Crosskonkordanzen filtern und zählen
rslt1 <- ck %>%
  filter(Thesaurus %in% thesauri$Code & Relation %in% relationen$Code) %>%
  mutate(
    Thesaurus = factor(Thesaurus, 
                       levels = thesauri$Code, labels = thesauri$Thesaurus),
    Relation  = factor(Relation,
                       levels = relationen$Code, labels = relationen$Relation)
  ) %>% # auch alle leeren Levels jeweils mit Anzahl 0 anzeigen
  group_by(Thesaurus, Relation, .drop = FALSE) %>% 
  # jede Kombination (Thesaurus, Relation) je IDN nur einmal zählen
  summarise(n = n_distinct(IDN)) %>%
  pivot_wider(id_cols = Relation, names_from = Thesaurus, values_from = n)

# Summe
rslt2 <- data.frame(Relation = factor('GESAMT'), 
                    rslt1 %>% select(-Relation) %>% summarise_all(.funs = sum))
colnames(rslt2) <- colnames(rslt1)

# Formatierte Ausgabetabelle
rbind(rslt1, rslt2) %>% 
  mutate_at(.vars = setdiff(colnames(.), 'Relation'), .funs = ~ formatC(
    ., format = 'd', big.mark = '.', decimal.mark = ',')) %>%
  knitr::kable(align = c('l', rep('r', ncol(.)-1)))
RelationAGROVOCLCSHRAMEAUMeSHSTWTheSozEMBNENSoggT-PRO
Äquivalenz (ftaa)
43
90
74
46.
564
533
73
45.
260
18736
8.791
0
97
103
11
13.
260
0408.
564
6172
exakte Äquivalenz (ftae)5.
497
490
330
713
298
666
4
6.
628
123
0
5.7647.
342
339172236
inexakte Äquivalenz (ftai)5
152
487
169
405
188
3590205
0
550329
ODER-Äquivalenz (ftao)
51
4
16
123
15
54650060
0
8
UND-Äquivalenz (ftau)1.2932.
844
304
5
4.
107
660116
402
4141.
609
608100
Oberbegriff-Relation (ftob)2.12700547.
733
8842.
918
946000
Unterbegriff-Relation (ftub)18300
11
12
360
376387000
Verwandter-Begriff-Relation (ftvb)
770
76900
13
113.
585
736927
923
000
Null-Relation (ftnu)168
17
18.
953
35819.
402
8860
818
512
872
885
0
210
GESAMT10.
137
129
95
68.
859
518
98
70.
251
858
5
6.
111
776
21
18.
689
68614.
353
400
11
13.
278
6168.
590
64375