abrupt 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +22 -0
  3. data/.rubocop.yml +16 -0
  4. data/.travis.yml +34 -0
  5. data/Gemfile +4 -0
  6. data/Guardfile +51 -0
  7. data/LICENSE.txt +22 -0
  8. data/README.md +36 -0
  9. data/Rakefile +7 -0
  10. data/abrupt.gemspec +41 -0
  11. data/assets/rules/datatypes/cax-RequiredFormElement.ttl +34 -0
  12. data/assets/rules/datatypes/cax-readability.ttl +18 -0
  13. data/assets/rules/datatypes/cax-required.ttl +15 -0
  14. data/assets/rules/list/prp-hasState.ttl +10 -0
  15. data/assets/rules/production/non_required_form_element.ttl +24 -0
  16. data/assets/rules/production/state_has_no_html_element.ttl +21 -0
  17. data/assets/schema/schema.json +49 -0
  18. data/assets/schema/v1/complexity.json +142 -0
  19. data/assets/schema/v1/input.json +1136 -0
  20. data/assets/schema/v1/link.json +41 -0
  21. data/assets/schema/v1/picture.json +47 -0
  22. data/assets/schema/v1/readability.json +51 -0
  23. data/assets/schema/v1/subject.json +88 -0
  24. data/assets/voc/tbox.ttl +1632 -0
  25. data/bin/abrupt +63 -0
  26. data/doc/paper/listings/datatype_rule.ttl +0 -0
  27. data/doc/paper/listings/description_logic_infered.ttl +3 -0
  28. data/doc/paper/listings/description_logic_rule.ttl +15 -0
  29. data/doc/paper/listings/inconsistency_rule.ttl +0 -0
  30. data/doc/paper/listings/limitations.ttl +10 -0
  31. data/doc/paper/listings/production_rule.ttl +0 -0
  32. data/doc/paper/listings/propositional_logic_infered.ttl +6 -0
  33. data/doc/paper/listings/propositional_logic_rule.ttl +15 -0
  34. data/doc/paper/listings/unique_nested_uris.ttl +10 -0
  35. data/doc/paper/literature.bib +56 -0
  36. data/doc/paper/main.tex +322 -0
  37. data/doc/poster/Poster.key +0 -0
  38. data/doc/poster/Poster.pdf +0 -0
  39. data/doc/poster/poster.indd +0 -0
  40. data/doc/poster/resources/graph.graffle +0 -0
  41. data/doc/poster/resources/graph.png +0 -0
  42. data/doc/poster/resources/graph_crop.png +0 -0
  43. data/lib/abrupt.rb +90 -0
  44. data/lib/abrupt/converter.rb +130 -0
  45. data/lib/abrupt/crawler.rb +125 -0
  46. data/lib/abrupt/service/absolute_url.rb +32 -0
  47. data/lib/abrupt/service/base.rb +75 -0
  48. data/lib/abrupt/service/complexity.rb +27 -0
  49. data/lib/abrupt/service/input.rb +15 -0
  50. data/lib/abrupt/service/link.rb +15 -0
  51. data/lib/abrupt/service/picture.rb +19 -0
  52. data/lib/abrupt/service/readability.rb +26 -0
  53. data/lib/abrupt/service/subject.rb +19 -0
  54. data/lib/abrupt/transformation/base.rb +145 -0
  55. data/lib/abrupt/transformation/client/base.rb +8 -0
  56. data/lib/abrupt/transformation/client/page_view.rb +27 -0
  57. data/lib/abrupt/transformation/client/visit.rb +56 -0
  58. data/lib/abrupt/transformation/client/visitor.rb +19 -0
  59. data/lib/abrupt/transformation/website/base.rb +8 -0
  60. data/lib/abrupt/transformation/website/complexity.rb +20 -0
  61. data/lib/abrupt/transformation/website/input.rb +42 -0
  62. data/lib/abrupt/transformation/website/link.rb +27 -0
  63. data/lib/abrupt/transformation/website/picture.rb +26 -0
  64. data/lib/abrupt/transformation/website/readability.rb +15 -0
  65. data/lib/abrupt/transformation/website/subject.rb +22 -0
  66. data/lib/abrupt/version.rb +7 -0
  67. data/spec/cassettes/Abrupt_Crawler/outputs_correct_hash.yml +91250 -0
  68. data/spec/converter_spec.rb +34 -0
  69. data/spec/crawler_spec.rb +11 -0
  70. data/spec/factories/crawled_hashes.rb +468 -0
  71. data/spec/fixtures/rikscha-mainz.owl +17456 -0
  72. data/spec/fixtures/rikscha.ohneBilder.2013-04-30_2013-08-17.xml +51759 -0
  73. data/spec/fixtures/rikscha.ohneBilder.2013-04-30_2013-08-17_min.xml +81 -0
  74. data/spec/fixtures/rikscha_Result.xml +11594 -0
  75. data/spec/fixtures/rikscha_Result_min.xml +574 -0
  76. data/spec/spec_helper.rb +26 -0
  77. data/spec/transformation/base_spec.rb +18 -0
  78. data/spec/transformation/website/complexity_spec.rb +188 -0
  79. data/spec/transformation/website/input_spec.rb +181 -0
  80. data/spec/transformation/website/link_spec.rb +13 -0
  81. data/spec/transformation/website/picture_spec.rb +20 -0
  82. data/spec/transformation/website/readability_spec.rb +22 -0
  83. data/spec/transformation/website/subject_spec.rb +40 -0
  84. metadata +424 -0
@@ -0,0 +1,22 @@
1
+ require_relative '../base_spec'
2
+
3
+ describe Abrupt::Transformation::Website::Readability do
4
+ it_should_behave_like 'convertable object' do
5
+ let(:expected_values) do
6
+ [{ readability: 5.288413836478,
7
+ syllables: 395,
8
+ words: 225,
9
+ numberOfLinks: 12,
10
+ bigwords: 48,
11
+ sentences: 53,
12
+ language: 'de' },
13
+ { readability: 5.1171449882608,
14
+ syllables: 399,
15
+ words: 226,
16
+ numberOfLinks: 13,
17
+ bigwords: 46,
18
+ sentences: 49,
19
+ language: 'de' }]
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,40 @@
1
+ require_relative '../base_spec'
2
+
3
+ describe Abrupt::Transformation::Website::Subject do
4
+ it_should_behave_like 'convertable object' do
5
+ let(:expected_values) do
6
+ [{ words: %w(unterbreiten document),
7
+ subjects: { Liste__Sprache_: '3',
8
+ Portal_Abk: '3',
9
+ R: '3',
10
+ Begriffskl: '3',
11
+ Portal_Kommunikation_als_Thema: '3',
12
+ Abk: '3',
13
+ Liste__Abk: '3',
14
+ Kofferwort: '3',
15
+ Zeitliche_Systematik: '3',
16
+ Liste: '3',
17
+ Einzelwort: '3' },
18
+ wordlimit: '20',
19
+ classLimit: 17,
20
+ language: 'de',
21
+ depth: 3 },
22
+ { words: %w(input google),
23
+ subjects: { Liste__Sprache_: '3',
24
+ Portal_Abk: '3',
25
+ R: '3',
26
+ Begriffskl: '3',
27
+ Portal_Kommunikation_als_Thema: '3',
28
+ Abk: '3',
29
+ Liste__Abk: '3',
30
+ Kofferwort: '3',
31
+ Zeitliche_Systematik: '3',
32
+ Liste: '3',
33
+ Einzelwort: '3' },
34
+ wordlimit: '20',
35
+ classLimit: 18,
36
+ language: 'de',
37
+ depth: 3 }]
38
+ end
39
+ end
40
+ end
metadata ADDED
@@ -0,0 +1,424 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: abrupt
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Manuel Dudda
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-01-27 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rest-client
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.7'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: nokogiri
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.6'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.6'
41
+ - !ruby/object:Gem::Dependency
42
+ name: addressable
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '2.3'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '2.3'
55
+ - !ruby/object:Gem::Dependency
56
+ name: commander
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '4.2'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '4.2'
69
+ - !ruby/object:Gem::Dependency
70
+ name: gyoku
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.2'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.2'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rdf
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '1.1'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '1.1'
97
+ - !ruby/object:Gem::Dependency
98
+ name: linkeddata
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '1.1'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '1.1'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rdf-rdfxml
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '1.1'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '1.1'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rdf-raptor
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '1.2'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '1.2'
139
+ - !ruby/object:Gem::Dependency
140
+ name: json-schema
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '2.4'
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '2.4'
153
+ - !ruby/object:Gem::Dependency
154
+ name: activesupport
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '4.1'
160
+ type: :runtime
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '4.1'
167
+ - !ruby/object:Gem::Dependency
168
+ name: bundler
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '1.6'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: '1.6'
181
+ - !ruby/object:Gem::Dependency
182
+ name: rake
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: '10.3'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: '10.3'
195
+ - !ruby/object:Gem::Dependency
196
+ name: rubocop
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - "~>"
200
+ - !ruby/object:Gem::Version
201
+ version: '0.26'
202
+ type: :development
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - "~>"
207
+ - !ruby/object:Gem::Version
208
+ version: '0.26'
209
+ - !ruby/object:Gem::Dependency
210
+ name: rspec
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - "~>"
214
+ - !ruby/object:Gem::Version
215
+ version: '3.1'
216
+ type: :development
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - "~>"
221
+ - !ruby/object:Gem::Version
222
+ version: '3.1'
223
+ - !ruby/object:Gem::Dependency
224
+ name: vcr
225
+ requirement: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - "~>"
228
+ - !ruby/object:Gem::Version
229
+ version: '2.9'
230
+ type: :development
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ requirements:
234
+ - - "~>"
235
+ - !ruby/object:Gem::Version
236
+ version: '2.9'
237
+ - !ruby/object:Gem::Dependency
238
+ name: webmock
239
+ requirement: !ruby/object:Gem::Requirement
240
+ requirements:
241
+ - - "~>"
242
+ - !ruby/object:Gem::Version
243
+ version: '1.20'
244
+ type: :development
245
+ prerelease: false
246
+ version_requirements: !ruby/object:Gem::Requirement
247
+ requirements:
248
+ - - "~>"
249
+ - !ruby/object:Gem::Version
250
+ version: '1.20'
251
+ - !ruby/object:Gem::Dependency
252
+ name: codeclimate-test-reporter
253
+ requirement: !ruby/object:Gem::Requirement
254
+ requirements:
255
+ - - "~>"
256
+ - !ruby/object:Gem::Version
257
+ version: '0.4'
258
+ type: :development
259
+ prerelease: false
260
+ version_requirements: !ruby/object:Gem::Requirement
261
+ requirements:
262
+ - - "~>"
263
+ - !ruby/object:Gem::Version
264
+ version: '0.4'
265
+ - !ruby/object:Gem::Dependency
266
+ name: factory_girl
267
+ requirement: !ruby/object:Gem::Requirement
268
+ requirements:
269
+ - - "~>"
270
+ - !ruby/object:Gem::Version
271
+ version: '4.5'
272
+ type: :development
273
+ prerelease: false
274
+ version_requirements: !ruby/object:Gem::Requirement
275
+ requirements:
276
+ - - "~>"
277
+ - !ruby/object:Gem::Version
278
+ version: '4.5'
279
+ - !ruby/object:Gem::Dependency
280
+ name: guard-rspec
281
+ requirement: !ruby/object:Gem::Requirement
282
+ requirements:
283
+ - - "~>"
284
+ - !ruby/object:Gem::Version
285
+ version: '4.5'
286
+ type: :development
287
+ prerelease: false
288
+ version_requirements: !ruby/object:Gem::Requirement
289
+ requirements:
290
+ - - "~>"
291
+ - !ruby/object:Gem::Version
292
+ version: '4.5'
293
+ description: Tools for the AbRUPt project.
294
+ email:
295
+ - dudda@paij.de
296
+ executables:
297
+ - abrupt
298
+ extensions: []
299
+ extra_rdoc_files: []
300
+ files:
301
+ - ".gitignore"
302
+ - ".rubocop.yml"
303
+ - ".travis.yml"
304
+ - Gemfile
305
+ - Guardfile
306
+ - LICENSE.txt
307
+ - README.md
308
+ - Rakefile
309
+ - abrupt.gemspec
310
+ - assets/rules/datatypes/cax-RequiredFormElement.ttl
311
+ - assets/rules/datatypes/cax-readability.ttl
312
+ - assets/rules/datatypes/cax-required.ttl
313
+ - assets/rules/list/prp-hasState.ttl
314
+ - assets/rules/production/non_required_form_element.ttl
315
+ - assets/rules/production/state_has_no_html_element.ttl
316
+ - assets/schema/schema.json
317
+ - assets/schema/v1/complexity.json
318
+ - assets/schema/v1/input.json
319
+ - assets/schema/v1/link.json
320
+ - assets/schema/v1/picture.json
321
+ - assets/schema/v1/readability.json
322
+ - assets/schema/v1/subject.json
323
+ - assets/voc/tbox.ttl
324
+ - bin/abrupt
325
+ - doc/paper/listings/datatype_rule.ttl
326
+ - doc/paper/listings/description_logic_infered.ttl
327
+ - doc/paper/listings/description_logic_rule.ttl
328
+ - doc/paper/listings/inconsistency_rule.ttl
329
+ - doc/paper/listings/limitations.ttl
330
+ - doc/paper/listings/production_rule.ttl
331
+ - doc/paper/listings/propositional_logic_infered.ttl
332
+ - doc/paper/listings/propositional_logic_rule.ttl
333
+ - doc/paper/listings/unique_nested_uris.ttl
334
+ - doc/paper/literature.bib
335
+ - doc/paper/main.tex
336
+ - doc/poster/Poster.key
337
+ - doc/poster/Poster.pdf
338
+ - doc/poster/poster.indd
339
+ - doc/poster/resources/graph.graffle
340
+ - doc/poster/resources/graph.png
341
+ - doc/poster/resources/graph_crop.png
342
+ - lib/abrupt.rb
343
+ - lib/abrupt/converter.rb
344
+ - lib/abrupt/crawler.rb
345
+ - lib/abrupt/service/absolute_url.rb
346
+ - lib/abrupt/service/base.rb
347
+ - lib/abrupt/service/complexity.rb
348
+ - lib/abrupt/service/input.rb
349
+ - lib/abrupt/service/link.rb
350
+ - lib/abrupt/service/picture.rb
351
+ - lib/abrupt/service/readability.rb
352
+ - lib/abrupt/service/subject.rb
353
+ - lib/abrupt/transformation/base.rb
354
+ - lib/abrupt/transformation/client/base.rb
355
+ - lib/abrupt/transformation/client/page_view.rb
356
+ - lib/abrupt/transformation/client/visit.rb
357
+ - lib/abrupt/transformation/client/visitor.rb
358
+ - lib/abrupt/transformation/website/base.rb
359
+ - lib/abrupt/transformation/website/complexity.rb
360
+ - lib/abrupt/transformation/website/input.rb
361
+ - lib/abrupt/transformation/website/link.rb
362
+ - lib/abrupt/transformation/website/picture.rb
363
+ - lib/abrupt/transformation/website/readability.rb
364
+ - lib/abrupt/transformation/website/subject.rb
365
+ - lib/abrupt/version.rb
366
+ - spec/cassettes/Abrupt_Crawler/outputs_correct_hash.yml
367
+ - spec/converter_spec.rb
368
+ - spec/crawler_spec.rb
369
+ - spec/factories/crawled_hashes.rb
370
+ - spec/fixtures/rikscha-mainz.owl
371
+ - spec/fixtures/rikscha.ohneBilder.2013-04-30_2013-08-17.xml
372
+ - spec/fixtures/rikscha.ohneBilder.2013-04-30_2013-08-17_min.xml
373
+ - spec/fixtures/rikscha_Result.xml
374
+ - spec/fixtures/rikscha_Result_min.xml
375
+ - spec/spec_helper.rb
376
+ - spec/transformation/base_spec.rb
377
+ - spec/transformation/website/complexity_spec.rb
378
+ - spec/transformation/website/input_spec.rb
379
+ - spec/transformation/website/link_spec.rb
380
+ - spec/transformation/website/picture_spec.rb
381
+ - spec/transformation/website/readability_spec.rb
382
+ - spec/transformation/website/subject_spec.rb
383
+ homepage: https://github.com/manuel84/abrupt
384
+ licenses:
385
+ - MIT
386
+ metadata: {}
387
+ post_install_message:
388
+ rdoc_options: []
389
+ require_paths:
390
+ - lib
391
+ required_ruby_version: !ruby/object:Gem::Requirement
392
+ requirements:
393
+ - - ">="
394
+ - !ruby/object:Gem::Version
395
+ version: '0'
396
+ required_rubygems_version: !ruby/object:Gem::Requirement
397
+ requirements:
398
+ - - ">="
399
+ - !ruby/object:Gem::Version
400
+ version: '0'
401
+ requirements: []
402
+ rubyforge_project:
403
+ rubygems_version: 2.4.3
404
+ signing_key:
405
+ specification_version: 4
406
+ summary: Tools for the AbRUPt project.
407
+ test_files:
408
+ - spec/cassettes/Abrupt_Crawler/outputs_correct_hash.yml
409
+ - spec/converter_spec.rb
410
+ - spec/crawler_spec.rb
411
+ - spec/factories/crawled_hashes.rb
412
+ - spec/fixtures/rikscha-mainz.owl
413
+ - spec/fixtures/rikscha.ohneBilder.2013-04-30_2013-08-17.xml
414
+ - spec/fixtures/rikscha.ohneBilder.2013-04-30_2013-08-17_min.xml
415
+ - spec/fixtures/rikscha_Result.xml
416
+ - spec/fixtures/rikscha_Result_min.xml
417
+ - spec/spec_helper.rb
418
+ - spec/transformation/base_spec.rb
419
+ - spec/transformation/website/complexity_spec.rb
420
+ - spec/transformation/website/input_spec.rb
421
+ - spec/transformation/website/link_spec.rb
422
+ - spec/transformation/website/picture_spec.rb
423
+ - spec/transformation/website/readability_spec.rb
424
+ - spec/transformation/website/subject_spec.rb