abrupt 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/abrupt.gemspec +1 -1
- data/assets/voc/tbox.ttl +21 -31
- data/bin/abrupt +2 -2
- data/lib/abrupt.rb +4 -3
- data/lib/abrupt/converter.rb +1 -2
- data/lib/abrupt/transformation/client/visit.rb +2 -2
- data/lib/abrupt/transformation/website/complexity.rb +19 -0
- data/lib/abrupt/version.rb +1 -1
- data/spec/transformation/website/complexity_spec.rb +6 -6
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dfa91b55285d5f4c8443a962506e11bb027cded2
|
4
|
+
data.tar.gz: d79ad95acdf78a381f4a82d4d3ef1117a7ff2d45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a8777dea0a494156fd8d6ed4e96eebe2245d70620b915e52483a80d4a960b0d411d3c31fd72d84ef0332adcf62f787ac632bdcb399b6971a81bfe3c2c557077
|
7
|
+
data.tar.gz: 59475021e5ead1a628c64244ae194131eae9ab718c98de664ea24bf881038ec6c51fa7dc9682aedc9cd7ee1117f6f8e3df499b47b023d101e0534ad58f939456
|
data/abrupt.gemspec
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
|
|
7
7
|
spec.name = 'abrupt'
|
8
8
|
spec.version = Abrupt::VERSION
|
9
9
|
spec.authors = ['Manuel Dudda']
|
10
|
-
spec.email = ['dudda@
|
10
|
+
spec.email = ['manuel.dudda@gmail.com']
|
11
11
|
spec.summary = 'Tools for the AbRUPt project.'
|
12
12
|
spec.description = 'Tools for the AbRUPt project.'
|
13
13
|
spec.homepage = 'https://github.com/manuel84/abrupt'
|
data/assets/voc/tbox.ttl
CHANGED
@@ -495,26 +495,6 @@
|
|
495
495
|
|
496
496
|
|
497
497
|
|
498
|
-
### http://wba.cs.hs-rm.de/AbRUPt/paragrahpsWithTooLongLines
|
499
|
-
|
500
|
-
:paragrahpsWithTooLongLines rdf:type owl:DatatypeProperty ;
|
501
|
-
|
502
|
-
rdfs:domain :Page ;
|
503
|
-
|
504
|
-
rdfs:range xsd:integer .
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
### http://wba.cs.hs-rm.de/AbRUPt/textNodesWithLowContrast
|
509
|
-
|
510
|
-
:textNodesWithLowContrast rdf:type owl:DatatypeProperty ;
|
511
|
-
|
512
|
-
rdfs:domain :Page ;
|
513
|
-
|
514
|
-
rdfs:range xsd:integer .
|
515
|
-
|
516
|
-
|
517
|
-
|
518
498
|
### http://wba.cs.hs-rm.de/AbRUPt/bigwords
|
519
499
|
|
520
500
|
:bigwords rdf:type owl:DatatypeProperty ;
|
@@ -1015,6 +995,16 @@
|
|
1015
995
|
|
1016
996
|
|
1017
997
|
|
998
|
+
### http://wba.cs.hs-rm.de/AbRUPt/paragrahpsWithTooLongLines
|
999
|
+
|
1000
|
+
:paragrahpsWithTooLongLines rdf:type owl:DatatypeProperty ;
|
1001
|
+
|
1002
|
+
rdfs:domain :Page ;
|
1003
|
+
|
1004
|
+
rdfs:range xsd:integer .
|
1005
|
+
|
1006
|
+
|
1007
|
+
|
1018
1008
|
### http://wba.cs.hs-rm.de/AbRUPt/phpsessionid
|
1019
1009
|
|
1020
1010
|
:phpsessionid rdf:type owl:DatatypeProperty ;
|
@@ -1063,16 +1053,6 @@
|
|
1063
1053
|
|
1064
1054
|
|
1065
1055
|
|
1066
|
-
### http://wba.cs.hs-rm.de/AbRUPt/ratios
|
1067
|
-
|
1068
|
-
:ratios rdf:type owl:DatatypeProperty ;
|
1069
|
-
|
1070
|
-
rdfs:domain :Page ;
|
1071
|
-
|
1072
|
-
rdfs:range xsd:string .
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1076
1056
|
### http://wba.cs.hs-rm.de/AbRUPt/readability
|
1077
1057
|
|
1078
1058
|
:readability rdf:type owl:DatatypeProperty ;
|
@@ -1193,6 +1173,16 @@
|
|
1193
1173
|
|
1194
1174
|
|
1195
1175
|
|
1176
|
+
### http://wba.cs.hs-rm.de/AbRUPt/textNodesWithLowContrast
|
1177
|
+
|
1178
|
+
:textNodesWithLowContrast rdf:type owl:DatatypeProperty ;
|
1179
|
+
|
1180
|
+
rdfs:domain :Page ;
|
1181
|
+
|
1182
|
+
rdfs:range xsd:integer .
|
1183
|
+
|
1184
|
+
|
1185
|
+
|
1196
1186
|
### http://wba.cs.hs-rm.de/AbRUPt/textReadingTime
|
1197
1187
|
|
1198
1188
|
:textReadingTime rdf:type owl:DatatypeProperty ;
|
@@ -1257,7 +1247,7 @@
|
|
1257
1247
|
|
1258
1248
|
rdfs:domain :Visit ;
|
1259
1249
|
|
1260
|
-
rdfs:range xsd:
|
1250
|
+
rdfs:range xsd:double .
|
1261
1251
|
|
1262
1252
|
|
1263
1253
|
|
data/bin/abrupt
CHANGED
@@ -15,7 +15,7 @@ class AbruptApp
|
|
15
15
|
|
16
16
|
command :crawl do |c|
|
17
17
|
c.syntax = 'abrupt crawl [options]'
|
18
|
-
c.description = 'Crawls a website'
|
18
|
+
c.description = 'Crawls a website [BETA!]'
|
19
19
|
c.option '-nofollow', "don't follow links"
|
20
20
|
c.option '--lang STRING', String, 'language'
|
21
21
|
c.option '--services STRING', Array, 'riscpl'
|
@@ -27,7 +27,7 @@ class AbruptApp
|
|
27
27
|
end
|
28
28
|
|
29
29
|
command :convert do |c|
|
30
|
-
c.syntax = 'abrupt convert src_crawled_data src_user_data [options]'
|
30
|
+
c.syntax = 'abrupt convert src_crawled_data [src_user_data] [options]'
|
31
31
|
c.description = 'Converts and merges xml files to owl'
|
32
32
|
c.option '--format STRING', String, 'Specifies the output format, possible [turtle|rdfxml|ntriples] (default=turtle)'
|
33
33
|
c.option '--output STRING', String, 'Specifies an output file'
|
data/lib/abrupt.rb
CHANGED
@@ -7,11 +7,11 @@ require 'pp'
|
|
7
7
|
# Extension for String class
|
8
8
|
class String
|
9
9
|
def remove_last_slashes
|
10
|
-
gsub(
|
10
|
+
gsub(%r{([\/]*)$}, '')
|
11
11
|
end
|
12
12
|
|
13
13
|
def append_last_slash
|
14
|
-
gsub(
|
14
|
+
gsub(%r{([^\/])$}, '\1/')
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
@@ -75,7 +75,8 @@ module Abrupt
|
|
75
75
|
def self.convert(file, *args)
|
76
76
|
converter = Converter.instance
|
77
77
|
assertions = args.last[:assertions].split ','
|
78
|
-
|
78
|
+
assertions.delete 'website' if args.count <= 1
|
79
|
+
converter.init(args.last) # options
|
79
80
|
append file, args.first, assertions
|
80
81
|
converter.result
|
81
82
|
end
|
data/lib/abrupt/converter.rb
CHANGED
@@ -110,8 +110,7 @@ module Abrupt
|
|
110
110
|
time = ::Abrupt.format_time(page[:entertime])
|
111
111
|
Transformation::Client::Base.subclasses.each do |transformer_class|
|
112
112
|
transformer = transformer_class.new(visitor.parent_uri + visitor.uri,
|
113
|
-
['Visit', time], page
|
114
|
-
)
|
113
|
+
['Visit', time], page)
|
115
114
|
add_to_result transformer.add_individuals
|
116
115
|
end
|
117
116
|
end
|
@@ -57,8 +57,8 @@ module Abrupt
|
|
57
57
|
leavetime = Abrupt.parse_time(@values[:leavetime])
|
58
58
|
enterteime = Abrupt.parse_time(@values[:entertime])
|
59
59
|
return unless leavetime && enterteime # maybe no recognized leavetime
|
60
|
-
visit_duration = (leavetime - enterteime).to_f # in seconds
|
61
|
-
add_data_property('visitDuration', visit_duration)
|
60
|
+
visit_duration = (leavetime - enterteime).to_f.round(8) # in seconds
|
61
|
+
add_data_property('visitDuration', visit_duration) if visit_duration > 0.0
|
62
62
|
end
|
63
63
|
end
|
64
64
|
end
|
@@ -12,6 +12,7 @@ module Abrupt
|
|
12
12
|
@values[keyname][:vicramComplexity] =
|
13
13
|
@values[keyname][:vicram].delete(:complexity)
|
14
14
|
add_contrast_properties
|
15
|
+
add_ratio_properties
|
15
16
|
@values[keyname].delete :vicram
|
16
17
|
super
|
17
18
|
end
|
@@ -24,6 +25,24 @@ module Abrupt
|
|
24
25
|
end
|
25
26
|
@values[keyname].delete :contrast
|
26
27
|
end
|
28
|
+
|
29
|
+
def add_ratio_properties
|
30
|
+
ratios = @values[keyname].delete :ratios
|
31
|
+
add_page_sizes(ratios[:pageSize]) if ratios[:pageSize]
|
32
|
+
add_img_tag_infos(ratios[:img_Tag]) if ratios[:img_Tag]
|
33
|
+
end
|
34
|
+
|
35
|
+
def add_page_sizes(page_size)
|
36
|
+
page_size.each do |type, value|
|
37
|
+
add_data_property(type, value)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def add_img_tag_infos(img_tag)
|
42
|
+
img_tag.each do |type, value|
|
43
|
+
add_data_property(type, value)
|
44
|
+
end
|
45
|
+
end
|
27
46
|
end
|
28
47
|
end
|
29
48
|
end
|
data/lib/abrupt/version.rb
CHANGED
@@ -3,9 +3,9 @@ require_relative '../base_spec'
|
|
3
3
|
describe Abrupt::Transformation::Website::Complexity do
|
4
4
|
it_should_behave_like 'convertable object' do
|
5
5
|
let(:expected_values) do
|
6
|
-
[{ contrast: { _1: { A_tag_With_Low_Contrast:
|
7
|
-
TextNodes_With_Low_Contrast:
|
8
|
-
paragrahps_with_too_long_lines:
|
6
|
+
[{ contrast: { _1: { A_tag_With_Low_Contrast: 0,
|
7
|
+
TextNodes_With_Low_Contrast: 0,
|
8
|
+
paragrahps_with_too_long_lines: 0 } },
|
9
9
|
vizweb: { numberOfLeaves: 1,
|
10
10
|
textArea: '0',
|
11
11
|
numberOfTextGroups: 0,
|
@@ -93,9 +93,9 @@ describe Abrupt::Transformation::Website::Complexity do
|
|
93
93
|
img_Tag: { img_Area_in_pixel_squared: 2730,
|
94
94
|
img_document_tag_percentage: 0.94267955801105,
|
95
95
|
img_document_tag_ratio: 106.08058608059 } } },
|
96
|
-
{ contrast: { _1: { A_tag_With_Low_Contrast:
|
97
|
-
TextNodes_With_Low_Contrast:
|
98
|
-
paragrahps_with_too_long_lines:
|
96
|
+
{ contrast: { _1: { A_tag_With_Low_Contrast: 1,
|
97
|
+
TextNodes_With_Low_Contrast: 1,
|
98
|
+
paragrahps_with_too_long_lines: 0 } },
|
99
99
|
vizweb: { numberOfLeaves: 17,
|
100
100
|
textArea: '0.0074666341145833',
|
101
101
|
numberOfTextGroups: 1,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: abrupt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manuel Dudda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -292,7 +292,7 @@ dependencies:
|
|
292
292
|
version: '4.5'
|
293
293
|
description: Tools for the AbRUPt project.
|
294
294
|
email:
|
295
|
-
- dudda@
|
295
|
+
- manuel.dudda@gmail.com
|
296
296
|
executables:
|
297
297
|
- abrupt
|
298
298
|
extensions: []
|
@@ -409,7 +409,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
409
409
|
version: '0'
|
410
410
|
requirements: []
|
411
411
|
rubyforge_project:
|
412
|
-
rubygems_version: 2.4.
|
412
|
+
rubygems_version: 2.4.6
|
413
413
|
signing_key:
|
414
414
|
specification_version: 4
|
415
415
|
summary: Tools for the AbRUPt project.
|