wikidata-diff-analyzer 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -12
- data/README.md +5 -4
- data/lib/wikidata/diff/analyzer/version.rb +1 -1
- data/lib/wikidata/diff/analyzer.rb +0 -16
- data/lib/wikidata/diff/large_batches_analyzer.rb +0 -1
- data/wikidata-diff-analyzer.gemspec +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26977ede877056aed781db63e598954ebcd274ea07958f2b75aebcbf0356b3e2
|
4
|
+
data.tar.gz: dd750db5d4b6586bca95133ccc05abd5f30eac7f18ecd021817d77128a30fcbc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9743c0e26386fbc08e7669525ced6ebd12358691a788cf76e004407b1cad575be6e7525d640954a91a148f60c11e5c732e00c975253f8f9a2088b43dc4934a1e
|
7
|
+
data.tar.gz: 249f1591b28199205e560943d6ec710c7cb8c597325842d584b4f31bb83335920db912570c7cd25f4a7a0a0aa1467ff2189cfc8cc4f934eeb6eeda2a46878595
|
data/Gemfile.lock
CHANGED
@@ -1,15 +1,13 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
wikidata-diff-analyzer (0.1.
|
5
|
-
json
|
6
|
-
open-uri
|
4
|
+
wikidata-diff-analyzer (0.1.1)
|
5
|
+
json (~> 2.1)
|
7
6
|
|
8
7
|
GEM
|
9
8
|
remote: https://rubygems.org/
|
10
9
|
specs:
|
11
10
|
ast (2.4.2)
|
12
|
-
date (3.3.3)
|
13
11
|
diff-lcs (1.5.0)
|
14
12
|
domain_name (0.5.20190701)
|
15
13
|
unf (>= 0.0.5, < 1.0.0)
|
@@ -29,10 +27,6 @@ GEM
|
|
29
27
|
faraday-cookie_jar (~> 0.0, >= 0.0.6)
|
30
28
|
faraday_middleware (~> 0.10, >= 0.10.0)
|
31
29
|
multipart-post (2.3.0)
|
32
|
-
open-uri (0.3.0)
|
33
|
-
stringio
|
34
|
-
time
|
35
|
-
uri
|
36
30
|
parallel (1.23.0)
|
37
31
|
parser (3.2.2.1)
|
38
32
|
ast (~> 2.4.1)
|
@@ -66,14 +60,10 @@ GEM
|
|
66
60
|
rubocop-ast (1.28.1)
|
67
61
|
parser (>= 3.2.1.0)
|
68
62
|
ruby-progressbar (1.13.0)
|
69
|
-
stringio (3.0.6)
|
70
|
-
time (0.2.2)
|
71
|
-
date
|
72
63
|
unf (0.1.4)
|
73
64
|
unf_ext
|
74
65
|
unf_ext (0.0.8.2)
|
75
66
|
unicode-display_width (2.4.2)
|
76
|
-
uri (0.12.1)
|
77
67
|
|
78
68
|
PLATFORMS
|
79
69
|
x86_64-linux
|
data/README.md
CHANGED
@@ -138,11 +138,11 @@ Here's the full output structure:
|
|
138
138
|
}
|
139
139
|
# the total stats of all diffs
|
140
140
|
{
|
141
|
-
:claims_added=>
|
141
|
+
:claims_added=>1,
|
142
142
|
:claims_removed=>1,
|
143
|
-
:claims_changed=>
|
144
|
-
:references_added=>
|
145
|
-
:references_removed=>
|
143
|
+
:claims_changed=>1,
|
144
|
+
:references_added=>0,
|
145
|
+
:references_removed=>1,
|
146
146
|
:references_changed=>0,
|
147
147
|
:qualifiers_added=>1,
|
148
148
|
:qualifiers_removed=>1,
|
@@ -161,6 +161,7 @@ Here's the full output structure:
|
|
161
161
|
:sitelinks_changed=>0
|
162
162
|
}
|
163
163
|
|
164
|
+
|
164
165
|
```
|
165
166
|
|
166
167
|
|
@@ -79,21 +79,5 @@ module WikidataDiffAnalyzer
|
|
79
79
|
end
|
80
80
|
end
|
81
81
|
|
82
|
-
# edge = [0, 123, 456, 1803628651]
|
83
|
-
# revision_ids = [1765004817]
|
84
|
-
# revision_idss = [1780106722, 1903003546, 1902995129, 1596238100, 1898156691]
|
85
|
-
# revisions =[0, 123, 456, 1780106722, 1596238100, 1898156691, 1895908644, 622872009, 1901195499, 1902995129, 1903003546, 1863882476, 535078533]
|
86
|
-
|
87
|
-
# Generate an array of 500 random revision IDs
|
88
|
-
random_revids = Array.new(500) { rand(1_000_000_000..2_000_000_000) }
|
89
|
-
example = [0, 123, 622872009, 1903003546, 1902995129]
|
90
|
-
# Analyze the revisions
|
91
|
-
result = WikidataDiffAnalyzer.analyze(example)
|
92
|
-
puts "final result"
|
93
|
-
puts result[:diffs_analyzed_count] # Prints the count of analyzed diffs
|
94
|
-
puts result[:diffs_not_analyzed] # Prints the list of revision IDs not analyzed
|
95
|
-
puts result[:diffs] # Prints the detailed analysis of each diff (Key is the revision ID)
|
96
|
-
puts result[:total] # Prints the total stats of all diffs
|
97
|
-
|
98
82
|
|
99
83
|
|
@@ -8,7 +8,6 @@ class LargeBatchesAnalyzer
|
|
8
8
|
|
9
9
|
|
10
10
|
revision_ids_batches = revision_ids.each_slice(batch_size).to_a
|
11
|
-
puts "Handling revision_ids_batches: #{revision_ids_batches.length}"
|
12
11
|
revision_ids_batches.each do |batch|
|
13
12
|
parsed_contents = Api.get_revision_contents(batch)
|
14
13
|
if parsed_contents
|
@@ -30,6 +30,7 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.bindir = "exe"
|
31
31
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
32
32
|
spec.require_paths = ["lib"]
|
33
|
+
spec.files.reject! { |f| File.extname(f) == '.gem' }
|
33
34
|
|
34
35
|
# Adding the dependencies
|
35
36
|
spec.add_dependency 'json', '~> 2.1'
|