aboutsummaryrefslogtreecommitdiffstats
path: root/extra/wikipedia/stats_template.txt
blob: fda994f8c8f63606fc7febd97280da24f8a04ffc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

export CITEFILE=enwiki-YYYYMMDD-pages-articles.citations.json.gz

# total number of articles processed
zcat $CITEFILE | wc -l

# articles with one or more refs
zcat $CITEFILE | rg '"CitationClass"' | wc -l

# total number of refs
zcat $CITEFILE | jq '.refs[].CitationClass' -r | wc -l

# refs by type
zcat $CITEFILE | jq '.refs[].CitationClass' -r | sort | uniq -c | sort -nr

# identifiers present
zcat $CITEFILE | jq '.refs[] | select(.ID_list != null) | .ID_list | keys[]' -r | sort | uniq -c | sort -nr

# refs with URL, by type
zcat $CITEFILE | jq '.refs[] | select(.URL != null) | .CitationClass' -r | sort | uniq -c | sort -nr

# refs with URL, by type
zcat $CITEFILE | jq '.refs[] | select(.ArchiveURL != null) | .CitationClass' -r | sort | uniq -c | sort -nr