fsp_harvester 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec_status +52 -52
- data/Gemfile.lock +3 -3
- data/lib/fsp_harvester/version.rb +1 -1
- data/lib/fsp_harvester.rb +4 -4
- data/lib/fsp_metadata_external_tools.rb +3 -3
- data/lib/fsp_metadata_harvester.rb +3 -3
- data/lib/fsp_metadata_parser.rb +8 -8
- data/lib/metadata_object.rb +12 -0
- data/lib/signposting_tests.rb +9 -9
- data/lib/warnings.json +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96405252194bfb8df419e61c17f113648e8bd254c034577107d8be161ed4753d
|
4
|
+
data.tar.gz: 62117a821bcea28d3ee06ccccf085a3b3150b7f33e1b67594c1d21b5ce23d345
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d30011cfd562b090d6a08895d0ac004d8f9c4aafbe0dc4ff75be282f896c8ae6b83b5fd826db731fc248486657d66df89fd2500df9f38c1045d6fa201296a46b
|
7
|
+
data.tar.gz: 3064bf42a8a83ac6a89cae8635eeebcb71d22d1a923672f8379e7122e97eac527af46a710a4714b235a3671c93ea1142b2aa44bb907aa1a072918e43c31373e0
|
data/.rspec_status
CHANGED
@@ -1,55 +1,55 @@
|
|
1
1
|
example_id | status | run_time |
|
2
2
|
---------------------------------- | ------ | --------------- |
|
3
|
-
./spec/cite-as_spec.rb[1:1:1] | passed | 1.
|
4
|
-
./spec/cite-as_spec.rb[1:1:2] | passed | 0.
|
5
|
-
./spec/cite-as_spec.rb[1:1:3] | passed | 0.
|
6
|
-
./spec/cite-as_spec.rb[1:1:4] | passed | 1.
|
7
|
-
./spec/cite-as_spec.rb[1:1:5] | passed | 2.
|
8
|
-
./spec/cite-as_spec.rb[1:1:6] | passed | 1.
|
9
|
-
./spec/cite-as_spec.rb[1:1:7] | passed | 2.
|
10
|
-
./spec/cite-as_spec.rb[1:1:8] | passed | 1.
|
11
|
-
./spec/cite-as_spec.rb[1:1:9] | passed | 2.
|
12
|
-
./spec/cite-as_spec.rb[1:1:10] | passed | 1.
|
13
|
-
./spec/cite-as_spec.rb[1:1:11] | passed | 2.
|
14
|
-
./spec/cite-as_spec.rb[1:1:12] | passed |
|
15
|
-
./spec/cite-as_spec.rb[1:1:13] | passed | 2.
|
3
|
+
./spec/cite-as_spec.rb[1:1:1] | passed | 1.05 seconds |
|
4
|
+
./spec/cite-as_spec.rb[1:1:2] | passed | 0.98315 seconds |
|
5
|
+
./spec/cite-as_spec.rb[1:1:3] | passed | 0.67905 seconds |
|
6
|
+
./spec/cite-as_spec.rb[1:1:4] | passed | 1.3 seconds |
|
7
|
+
./spec/cite-as_spec.rb[1:1:5] | passed | 2.13 seconds |
|
8
|
+
./spec/cite-as_spec.rb[1:1:6] | passed | 1.47 seconds |
|
9
|
+
./spec/cite-as_spec.rb[1:1:7] | passed | 2.35 seconds |
|
10
|
+
./spec/cite-as_spec.rb[1:1:8] | passed | 1.69 seconds |
|
11
|
+
./spec/cite-as_spec.rb[1:1:9] | passed | 2.34 seconds |
|
12
|
+
./spec/cite-as_spec.rb[1:1:10] | passed | 1.66 seconds |
|
13
|
+
./spec/cite-as_spec.rb[1:1:11] | passed | 2.36 seconds |
|
14
|
+
./spec/cite-as_spec.rb[1:1:12] | passed | 1.65 seconds |
|
15
|
+
./spec/cite-as_spec.rb[1:1:13] | passed | 2.37 seconds |
|
16
16
|
./spec/cite-as_spec.rb[1:1:14] | passed | 1.68 seconds |
|
17
|
-
./spec/cite-as_spec.rb[1:1:15] | passed | 1.
|
18
|
-
./spec/cite-as_spec.rb[1:1:16] | passed | 1.
|
19
|
-
./spec/cite-as_spec.rb[1:1:17] | passed |
|
20
|
-
./spec/cite-as_spec.rb[1:1:18] | passed |
|
21
|
-
./spec/cite-as_spec.rb[1:1:19] | passed | 1.
|
22
|
-
./spec/cite-as_spec.rb[1:1:20] | passed | 1.
|
23
|
-
./spec/cite-as_spec.rb[1:1:21] | passed | 1.
|
24
|
-
./spec/cite-as_spec.rb[1:1:22] | passed |
|
25
|
-
./spec/cite-as_spec.rb[1:1:23] | passed |
|
26
|
-
./spec/cite-as_spec.rb[1:1:24] | failed | 1.
|
27
|
-
./spec/cite-as_spec.rb[1:1:25] | passed | 0.
|
28
|
-
./spec/describedby_spec.rb[1:1:1] | passed | 2.
|
29
|
-
./spec/describedby_spec.rb[1:1:2] | passed |
|
30
|
-
./spec/describedby_spec.rb[1:1:3] | passed |
|
31
|
-
./spec/describedby_spec.rb[1:1:4] | passed |
|
32
|
-
./spec/describedby_spec.rb[1:1:5] | passed | 1
|
33
|
-
./spec/describedby_spec.rb[1:1:6] | passed | 0.
|
34
|
-
./spec/describedby_spec.rb[1:1:7] | passed | 0.
|
35
|
-
./spec/describedby_spec.rb[1:1:8] | passed |
|
36
|
-
./spec/describedby_spec.rb[1:1:9] | passed | 1.
|
37
|
-
./spec/describedby_spec.rb[1:1:10] | passed | 1.
|
38
|
-
./spec/describedby_spec.rb[1:1:11] | passed | 2.
|
39
|
-
./spec/describedby_spec.rb[1:1:12] | passed | 2.
|
40
|
-
./spec/describedby_spec.rb[1:1:13] | passed | 1.
|
41
|
-
./spec/describedby_spec.rb[1:1:14] | passed | 1.
|
42
|
-
./spec/describedby_spec.rb[1:1:15] | passed | 1.
|
43
|
-
./spec/fsp_harvester_spec.rb[1:1] | passed | 0.
|
44
|
-
./spec/fsp_harvester_spec.rb[1:2] |
|
45
|
-
./spec/item_spec.rb[1:1:1] | passed | 2.
|
46
|
-
./spec/item_spec.rb[1:1:2] | passed | 2
|
47
|
-
./spec/item_spec.rb[1:1:3] | passed |
|
48
|
-
./spec/item_spec.rb[1:1:4] | passed | 1.
|
49
|
-
./spec/item_spec.rb[1:1:5] | passed | 1.
|
50
|
-
./spec/item_spec.rb[1:1:6] | passed | 1.
|
51
|
-
./spec/item_spec.rb[1:1:7] | passed |
|
52
|
-
./spec/item_spec.rb[1:1:8] | passed | 0.
|
53
|
-
./spec/type_spec.rb[1:1:1] | passed |
|
54
|
-
./spec/type_spec.rb[1:1:2] | passed | 0.
|
55
|
-
./spec/type_spec.rb[1:1:3] | passed |
|
17
|
+
./spec/cite-as_spec.rb[1:1:15] | passed | 1.01 seconds |
|
18
|
+
./spec/cite-as_spec.rb[1:1:16] | passed | 1.02 seconds |
|
19
|
+
./spec/cite-as_spec.rb[1:1:17] | passed | 1.04 seconds |
|
20
|
+
./spec/cite-as_spec.rb[1:1:18] | passed | 0.98558 seconds |
|
21
|
+
./spec/cite-as_spec.rb[1:1:19] | passed | 1.36 seconds |
|
22
|
+
./spec/cite-as_spec.rb[1:1:20] | passed | 1.37 seconds |
|
23
|
+
./spec/cite-as_spec.rb[1:1:21] | passed | 1.71 seconds |
|
24
|
+
./spec/cite-as_spec.rb[1:1:22] | passed | 0.93618 seconds |
|
25
|
+
./spec/cite-as_spec.rb[1:1:23] | passed | 0.94888 seconds |
|
26
|
+
./spec/cite-as_spec.rb[1:1:24] | failed | 1.03 seconds |
|
27
|
+
./spec/cite-as_spec.rb[1:1:25] | passed | 0.3531 seconds |
|
28
|
+
./spec/describedby_spec.rb[1:1:1] | passed | 2.12 seconds |
|
29
|
+
./spec/describedby_spec.rb[1:1:2] | passed | 0.96254 seconds |
|
30
|
+
./spec/describedby_spec.rb[1:1:3] | passed | 0.92669 seconds |
|
31
|
+
./spec/describedby_spec.rb[1:1:4] | passed | 0.92801 seconds |
|
32
|
+
./spec/describedby_spec.rb[1:1:5] | passed | 1 second |
|
33
|
+
./spec/describedby_spec.rb[1:1:6] | passed | 0.66763 seconds |
|
34
|
+
./spec/describedby_spec.rb[1:1:7] | passed | 0.66021 seconds |
|
35
|
+
./spec/describedby_spec.rb[1:1:8] | passed | 1.89 seconds |
|
36
|
+
./spec/describedby_spec.rb[1:1:9] | passed | 1.3 seconds |
|
37
|
+
./spec/describedby_spec.rb[1:1:10] | passed | 1.7 seconds |
|
38
|
+
./spec/describedby_spec.rb[1:1:11] | passed | 2.28 seconds |
|
39
|
+
./spec/describedby_spec.rb[1:1:12] | passed | 2.27 seconds |
|
40
|
+
./spec/describedby_spec.rb[1:1:13] | passed | 1.39 seconds |
|
41
|
+
./spec/describedby_spec.rb[1:1:14] | passed | 1.65 seconds |
|
42
|
+
./spec/describedby_spec.rb[1:1:15] | passed | 1.7 seconds |
|
43
|
+
./spec/fsp_harvester_spec.rb[1:1] | passed | 0.00215 seconds |
|
44
|
+
./spec/fsp_harvester_spec.rb[1:2] | failed | 0.00021 seconds |
|
45
|
+
./spec/item_spec.rb[1:1:1] | passed | 2.04 seconds |
|
46
|
+
./spec/item_spec.rb[1:1:2] | passed | 2 seconds |
|
47
|
+
./spec/item_spec.rb[1:1:3] | passed | 0.92924 seconds |
|
48
|
+
./spec/item_spec.rb[1:1:4] | passed | 1.36 seconds |
|
49
|
+
./spec/item_spec.rb[1:1:5] | passed | 1.71 seconds |
|
50
|
+
./spec/item_spec.rb[1:1:6] | passed | 1.68 seconds |
|
51
|
+
./spec/item_spec.rb[1:1:7] | passed | 2.37 seconds |
|
52
|
+
./spec/item_spec.rb[1:1:8] | passed | 0.34241 seconds |
|
53
|
+
./spec/type_spec.rb[1:1:1] | passed | 0.9855 seconds |
|
54
|
+
./spec/type_spec.rb[1:1:2] | passed | 0.96202 seconds |
|
55
|
+
./spec/type_spec.rb[1:1:3] | passed | 0.96005 seconds |
|
data/Gemfile.lock
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
fsp_harvester (0.1.
|
4
|
+
fsp_harvester (0.1.10)
|
5
5
|
json (~> 2.0)
|
6
6
|
linkeddata (~> 3.2)
|
7
|
-
linkheaders-processor (~> 0.1.
|
7
|
+
linkheaders-processor (~> 0.1.16)
|
8
8
|
metainspector (~> 5.11.2)
|
9
9
|
parseconfig (~> 1.1)
|
10
10
|
rake (~> 13.0)
|
@@ -126,7 +126,7 @@ GEM
|
|
126
126
|
shex (~> 0.7)
|
127
127
|
sparql (~> 3.2)
|
128
128
|
sparql-client (~> 3.2)
|
129
|
-
linkheaders-processor (0.1.
|
129
|
+
linkheaders-processor (0.1.16)
|
130
130
|
json (~> 2.0)
|
131
131
|
json-ld (~> 3.2)
|
132
132
|
json-ld-preloaded (~> 3.2)
|
data/lib/fsp_harvester.rb
CHANGED
@@ -42,7 +42,7 @@ module FspHarvester
|
|
42
42
|
links = resolve_url(url: url)
|
43
43
|
@meta.links << links
|
44
44
|
else
|
45
|
-
@meta.
|
45
|
+
@meta.add_warning(['006', guid, ''])
|
46
46
|
@meta.comments << "FATAL: GUID type not recognized.\n"
|
47
47
|
end
|
48
48
|
[links, @meta]
|
@@ -89,7 +89,7 @@ module FspHarvester
|
|
89
89
|
warn "\n\n head #{response.headers.inspect}\n\n" if response
|
90
90
|
|
91
91
|
unless response
|
92
|
-
@meta.
|
92
|
+
@meta.add_warning(['001', url, header])
|
93
93
|
@meta.comments << "WARN: Unable to resolve #{url} using HTTP Accept header #{header}.\n"
|
94
94
|
return []
|
95
95
|
end
|
@@ -144,12 +144,12 @@ module FspHarvester
|
|
144
144
|
end
|
145
145
|
|
146
146
|
unless citeas.length == 1 && describedby.length > 0
|
147
|
-
@meta.
|
147
|
+
@meta.add_warning(['004', '', ''])
|
148
148
|
@meta.comments << "WARN: The resource does not follow the FAIR Signposting standard, which requires exactly one cite-as header, and at least one describedby header\n"
|
149
149
|
end
|
150
150
|
|
151
151
|
unless types.length >=1
|
152
|
-
@meta.
|
152
|
+
@meta.add_warning(['015', '', ''])
|
153
153
|
@meta.comments << "WARN: The resource does not follow the FAIR Signposting standard, which requires one or two 'type' link headers\n"
|
154
154
|
end
|
155
155
|
end
|
@@ -40,7 +40,7 @@ module FspHarvester
|
|
40
40
|
warn "DIST RESULT: #{result}"
|
41
41
|
if result !~ /@context/i # failure returns nil
|
42
42
|
@meta.comments << "WARN: The Distiller tool failed to find parseable data in the body, perhaps due to incorrectly formatted HTML..\n"
|
43
|
-
@meta.
|
43
|
+
@meta.add_warning(['018', '', ''])
|
44
44
|
else
|
45
45
|
@meta.comments << "INFO: The Distiller found parseable data. Parsing as JSON-LD\n"
|
46
46
|
parse_rdf(result: result, content_type: "application/ld+json")
|
@@ -58,10 +58,10 @@ module FspHarvester
|
|
58
58
|
|
59
59
|
if result.to_s.match(/(Failed\sto\sextract.*?)\n/)
|
60
60
|
@meta.comments << "WARN: extruct threw an error #{Regexp.last_match(1)} when attempting to parse return value (message body) of #{uri}.\n"
|
61
|
-
@meta.
|
61
|
+
@meta.add_warning(['019', '', ''])
|
62
62
|
if result.to_s.match(/(ValueError:.*?)\n/)
|
63
63
|
@meta.comments << "WARN: extruct error was #{Regexp.last_match(1)}\n"
|
64
|
-
@meta.
|
64
|
+
@meta.add_warning(['019', '', ''])
|
65
65
|
end
|
66
66
|
elsif result.to_s.match(/^\s+?\{/) or result.to_s.match(/^\s+\[/) # this is JSON
|
67
67
|
json = JSON.parse result
|
@@ -21,7 +21,7 @@ module FspHarvester
|
|
21
21
|
|
22
22
|
abbreviation, content_type = attempt_to_detect_type(body: response.body, headers: response.headers)
|
23
23
|
unless abbreviation
|
24
|
-
@meta.
|
24
|
+
@meta.add_warning(['017', url, header])
|
25
25
|
@meta.comments << "WARN: metadata format returned from #{url} using Accept header #{header} is not recognized. Processing will end now.\n"
|
26
26
|
next
|
27
27
|
end
|
@@ -56,7 +56,7 @@ module FspHarvester
|
|
56
56
|
url = link.href
|
57
57
|
response = FspHarvester::WebUtils.fspfetch(url: url, method: :get, headers: header)
|
58
58
|
unless response
|
59
|
-
@meta.
|
59
|
+
@meta.add_warning(['016', url, header])
|
60
60
|
@meta.comments << "WARN: Unable to resolve describedby link #{url} using HTTP Accept header #{header}.\n"
|
61
61
|
end
|
62
62
|
response
|
@@ -87,7 +87,7 @@ module FspHarvester
|
|
87
87
|
end
|
88
88
|
|
89
89
|
unless content_type
|
90
|
-
@meta.
|
90
|
+
@meta.add_warning(['017', url, header])
|
91
91
|
@meta.comments << "WARN: metadata format returned from #{url} using Accept header #{header} is not recognized. Processing will end now.\n"
|
92
92
|
end
|
93
93
|
[abbreviation, content_type]
|
data/lib/fsp_metadata_parser.rb
CHANGED
@@ -24,7 +24,7 @@ module FspHarvester
|
|
24
24
|
hash = XmlSimple.xml_in(body)
|
25
25
|
rescue
|
26
26
|
@meta.comments << "CRITICAL: Malformed XML detected. Cannot process metadata.\n"
|
27
|
-
@meta.
|
27
|
+
@meta.add_warning(['020', '', ''])
|
28
28
|
end
|
29
29
|
@meta.comments << "INFO: The XML is being merged in the metadata object\n"
|
30
30
|
@meta.hash.merge hash
|
@@ -35,7 +35,7 @@ module FspHarvester
|
|
35
35
|
hash = JSON.parse(body)
|
36
36
|
rescue
|
37
37
|
@meta.comments << "CRITICAL: Malformed JSON detected. Cannot process metadata.\n"
|
38
|
-
@meta.
|
38
|
+
@meta.add_warning(['021', '', ''])
|
39
39
|
end
|
40
40
|
@meta.comments << "INFO: The JSON is being merged in the metadata object\n"
|
41
41
|
@meta.hash.merge hash
|
@@ -48,20 +48,20 @@ module FspHarvester
|
|
48
48
|
def parse_rdf(body:, content_type:)
|
49
49
|
unless body
|
50
50
|
@meta.comments << "CRITICAL: The response message body component appears to have no content.\n"
|
51
|
-
@meta.
|
51
|
+
@meta.add_warning(['018', '', ''])
|
52
52
|
return
|
53
53
|
end
|
54
54
|
|
55
55
|
unless body.match(/\w/)
|
56
56
|
@meta.comments << "CRITICAL: The response message body component appears to have no content.\n"
|
57
|
-
@meta.
|
57
|
+
@meta.add_warning(['018', '', ''])
|
58
58
|
return
|
59
59
|
end
|
60
60
|
|
61
61
|
rdfformat = RDF::Format.for(content_type: content_type)
|
62
62
|
unless rdfformat
|
63
63
|
@meta.comments << "CRITICAL: Found what appears to be RDF (sample: #{body[0..300].delete!("\n")}), but it could not find a parser. Please report this error, along with the GUID of the resource, to the maintainer of the system.\n"
|
64
|
-
@meta.
|
64
|
+
@meta.add_warning(['018', '', ''])
|
65
65
|
return
|
66
66
|
end
|
67
67
|
|
@@ -77,7 +77,7 @@ module FspHarvester
|
|
77
77
|
reader = rdfformat.reader.new(body)
|
78
78
|
rescue Exception => e
|
79
79
|
@meta.comments << "WARN: Though linked data was found, it failed to parse (Exception #{e}). This likely indicates some syntax error in the data. As a result, no metadata will be extracted from this message.\n"
|
80
|
-
@meta.
|
80
|
+
@meta.add_warning(['018', '', ''])
|
81
81
|
return
|
82
82
|
end
|
83
83
|
|
@@ -97,11 +97,11 @@ module FspHarvester
|
|
97
97
|
rescue RDF::ReaderError => e
|
98
98
|
@meta.comments << "CRITICAL: The Linked Data was malformed and caused the parser to crash with error message: #{e.message} || (sample of what was parsed: #{body[0..300].delete("\n")})\n"
|
99
99
|
warn "CRITICAL: The Linked Data was malformed and caused the parser to crash with error message: #{e.message} || (sample of what was parsed: #{body[0..300].delete("\n")})\n"
|
100
|
-
@meta.
|
100
|
+
@meta.add_warning(['018', '', ''])
|
101
101
|
rescue Exception => e
|
102
102
|
meta.comments << "CRITICAL: An unknown error occurred while parsing the (apparent) Linked Data (sample of what was parsed: #{body[0..300].delete("\n")}). Moving on...\n"
|
103
103
|
warn "\n\nCRITICAL: #{e.inspect} An unknown error occurred while parsing the (apparent) Linked Data (full body: #{body}). Moving on...\n"
|
104
|
-
@meta.
|
104
|
+
@meta.add_warning(['018', '', ''])
|
105
105
|
end
|
106
106
|
end
|
107
107
|
end
|
data/lib/metadata_object.rb
CHANGED
@@ -10,6 +10,8 @@ module FspHarvester
|
|
10
10
|
@full_response = []
|
11
11
|
@links = []
|
12
12
|
@all_uris = []
|
13
|
+
@warn = File.read("./lib/warnings.json")
|
14
|
+
@warn = JSON.parse(@warn)
|
13
15
|
end
|
14
16
|
|
15
17
|
def merge_hash(hash)
|
@@ -25,6 +27,16 @@ module FspHarvester
|
|
25
27
|
def rdf
|
26
28
|
graph
|
27
29
|
end
|
30
|
+
|
31
|
+
def add_warning(warning)
|
32
|
+
id = warning[0]
|
33
|
+
url = warning[1]
|
34
|
+
headers = warning[2]
|
35
|
+
message = @warn[id]['message']
|
36
|
+
linkout = @warn[id]['linkout']
|
37
|
+
severity = @warn[id]['severity']
|
38
|
+
self.warnings << {"id" => id, "message" => message, "severity" => severity, "linkout" => linkout, "processed_url" => url, "accept_headers": headers}
|
39
|
+
end
|
28
40
|
end
|
29
41
|
|
30
42
|
class Cache
|
data/lib/signposting_tests.rb
CHANGED
@@ -9,7 +9,7 @@ def check_for_citeas_conflicts(citeas: )
|
|
9
9
|
|
10
10
|
if citeas_hrefs.length > 1
|
11
11
|
@meta.comments << 'INFO: Found multiple non-identical cite-as links.'
|
12
|
-
@meta.
|
12
|
+
@meta.add_warning(['007', '', ''])
|
13
13
|
@meta.comments << "WARN: The resource does not follow the FAIR Signposting standard: Found conflicting cite-as link headers.\n"
|
14
14
|
end
|
15
15
|
citeas_hrefs.values # return list of unique links
|
@@ -19,7 +19,7 @@ end
|
|
19
19
|
def check_describedby_rules(describedby:)
|
20
20
|
describedby.each do |l|
|
21
21
|
unless l.respond_to? 'type'
|
22
|
-
@meta.
|
22
|
+
@meta.add_warning(['005', l.href, ''])
|
23
23
|
@meta.comments << "WARN: The resource does not follow the FAIR Signposting standard, which requires any describedby links to also have a 'type' attribute.\n"
|
24
24
|
end
|
25
25
|
type = l.type if l.respond_to? 'type'
|
@@ -37,15 +37,15 @@ def check_describedby_rules(describedby:)
|
|
37
37
|
if responsetype == type
|
38
38
|
@meta.comments << "INFO: describedby link responds according to Signposting specifications\n"
|
39
39
|
else
|
40
|
-
@meta.
|
40
|
+
@meta.add_warning(['009', l.href, header])
|
41
41
|
@meta.comments << "WARN: Content type of returned describedby link #{responsetype}does not match the 'type' attribute #{type}\n"
|
42
42
|
end
|
43
43
|
else
|
44
|
-
@meta.
|
44
|
+
@meta.add_warning(['010', l.href, header])
|
45
45
|
@meta.comments << "WARN: Content type of returned describedby link is not specified in response headers or cannot be matched against accept headers\n"
|
46
46
|
end
|
47
47
|
else
|
48
|
-
@meta.
|
48
|
+
@meta.add_warning(['008', l.href, header])
|
49
49
|
@meta.comments << "WARN: describedby link doesn't resolve\n"
|
50
50
|
end
|
51
51
|
end
|
@@ -54,7 +54,7 @@ end
|
|
54
54
|
def check_item_rules(item:)
|
55
55
|
item.each do |l| # l = LinkHeaders::Link
|
56
56
|
unless l.respond_to? 'type'
|
57
|
-
@meta.
|
57
|
+
@meta.add_warning(['011', l.href, ''])
|
58
58
|
@meta.comments << "WARN: The resource does not follow the FAIR Signposting standard, which encourages any item links to also have a 'type' attribute.\n"
|
59
59
|
end
|
60
60
|
type = l.type if l.respond_to? 'type'
|
@@ -72,15 +72,15 @@ def check_item_rules(item:)
|
|
72
72
|
warn typeregex.inspect
|
73
73
|
@meta.comments << "INFO: item link responds according to Signposting specifications\n"
|
74
74
|
else
|
75
|
-
@meta.
|
75
|
+
@meta.add_warning(['012', l.href, header])
|
76
76
|
@meta.comments << "WARN: Content type of returned item link does not match the 'type' attribute\n"
|
77
77
|
end
|
78
78
|
else
|
79
|
-
@meta.
|
79
|
+
@meta.add_warning(['013', l.href, header])
|
80
80
|
@meta.comments << "WARN: Content type of returned item link is not specified in response headers or cannot be matched against accept headers\n"
|
81
81
|
end
|
82
82
|
else
|
83
|
-
@meta.
|
83
|
+
@meta.add_warning(['014', l.href, header])
|
84
84
|
@meta.comments << "WARN: item link doesn't resolve\n"
|
85
85
|
end
|
86
86
|
end
|
data/lib/warnings.json
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fsp_harvester
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Wilkinson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|