earl-report 0.4.3 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1119b1b46c38387b9565ad9eefe96bcea4c05cd8
4
- data.tar.gz: cee2b030f2a72dacc021d027aa98b253bf48c4b7
3
+ metadata.gz: 3e9d247fba459dcbd456748828fa9f9b9eb54299
4
+ data.tar.gz: 80656782c30c8009a93b0d7cad413f2a7968aa94
5
5
  SHA512:
6
- metadata.gz: bc5068bdd7e743385e67a7b76090aa88365c59b3fa98e1b5fb1e14167798b79ce4e4ae73a953ba3860071d7f304444f70cb61723343a3cb81d31f727da8aacb6
7
- data.tar.gz: 4cc8561f19460e2570f6d0fe9e1b29a38e274e7289563e47516cb3e5c0555eec80bd541db93c80ac70fd63904c78cfba69400e4001f2382ea5c3f364b74dbedb
6
+ metadata.gz: 44de180a4830bd4fc9d18224e2000089e1838de04b77efc07ee9d2d57e366dff0ca562f17a9f9caba1fc260f59ba5d4faa5225308f5164b89a43505760154c24
7
+ data.tar.gz: f6d34dd93d796502b9a913d7fd7d65229136dbd9f5b06032e99bffcf27fcc76637e63a435c366f642d7d7f61b1fc3459a7652cf4087e0d169c20362b4c7f1be8
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.3
1
+ 0.4.4
@@ -1,11 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  require 'rubygems'
3
3
  $:.unshift(File.expand_path("../../lib", __FILE__))
4
- begin
5
- require "bundler/setup"
6
- rescue LoadError
7
- #skip
8
- end
9
4
  require 'earl_report'
10
5
  require 'getoptlong'
11
6
  require 'yaml'
@@ -195,7 +195,7 @@ class EarlReport
195
195
  man_opts[:base_uri] = RDF::URI(@options[:base]) if @options[:base]
196
196
  @graph = RDF::Graph.new
197
197
  Array(@options[:manifest]).each do |man|
198
- g = RDF::Graph.load(man, man_opts)
198
+ g = RDF::Graph.load(man, unique_bnodes: true, **man_opts)
199
199
  status " loaded #{g.count} triples from #{man}"
200
200
  graph << g
201
201
  end
@@ -305,17 +305,21 @@ class EarlReport
305
305
  end
306
306
 
307
307
  status "query assertions"
308
+ assertion_stats = {}
308
309
  SPARQL.execute(ASSERTION_QUERY, assertion_graph).each do |solution|
309
310
  subject = solution[:subject]
310
311
  unless tests[solution[:test]]
312
+ assertion_stats["Skipped"] = assertion_stats["Skipped"].to_i + 1
311
313
  $stderr.puts "Skipping result for #{solution[:test]} for #{subject}, which is not defined in manifests"
312
314
  next
313
315
  end
314
316
  unless subjects[subject]
317
+ assertion_stats["Missing Subject"] = assertion_stats["Missing Subject"].to_i + 1
315
318
  $stderr.puts "No test result subject found for #{subject}: in #{subjects.keys.join(', ')}"
316
319
  next
317
320
  end
318
321
  found_solutions[subject] = true
322
+ assertion_stats["Found"] = assertion_stats["Found"].to_i + 1
319
323
 
320
324
  # Add this solution at the appropriate index within that list
321
325
  ndx = subjects.keys.find_index(subject)
@@ -338,6 +342,7 @@ class EarlReport
338
342
  # Fill any missing entries with an untested outcome
339
343
  ary.each_with_index do |a, ndx|
340
344
  unless a
345
+ assertion_stats["Untested"] = assertion_stats["Untested"].to_i + 1
341
346
  ary[ndx] = a = RDF::Node.new
342
347
  graph << RDF::Statement(a, RDF.type, EARL.Assertion)
343
348
  graph << RDF::Statement(a, EARL.subject, subjects.keys[ndx])
@@ -353,6 +358,8 @@ class EarlReport
353
358
  end
354
359
  end
355
360
 
361
+ assertion_stats.each {|stat, count| status("Assertions #{stat}: #{count}")}
362
+
356
363
  # See if any subject did not report results, which may indicate a formatting error in the EARL source
357
364
  subjects.reject {|s| found_solutions[s]}.each do |sub|
358
365
  $stderr.puts "No results found for #{sub} using #{ASSERTION_QUERY}"
@@ -40,7 +40,7 @@ describe EarlReport do
40
40
  context "with base" do
41
41
  it "loads manifest relative to base" do
42
42
  expect(RDF::Graph).to receive(:load)
43
- .with(File.expand_path("../test-files/manifest.ttl", __FILE__), {:base_uri => "http://example.com/base/"})
43
+ .with(File.expand_path("../test-files/manifest.ttl", __FILE__), {unique_bnodes: true, base_uri: "http://example.com/base/"})
44
44
  .and_return(manifest)
45
45
  expect(RDF::Graph).to receive(:load)
46
46
  .with(File.expand_path("../test-files/report-complete.ttl", __FILE__))
@@ -56,7 +56,7 @@ describe EarlReport do
56
56
  context "complete report" do
57
57
  before(:each) do
58
58
  expect(RDF::Graph).to receive(:load)
59
- .with(File.expand_path("../test-files/manifest.ttl", __FILE__), {})
59
+ .with(File.expand_path("../test-files/manifest.ttl", __FILE__), {unique_bnodes: true, })
60
60
  .and_return(manifest)
61
61
  expect(RDF::Graph).to receive(:load)
62
62
  .with(File.expand_path("../test-files/report-complete.ttl", __FILE__))
@@ -90,7 +90,7 @@ describe EarlReport do
90
90
  context "no doap report" do
91
91
  before(:each) do
92
92
  expect(RDF::Graph).to receive(:load)
93
- .with(File.expand_path("../test-files/manifest.ttl", __FILE__), {})
93
+ .with(File.expand_path("../test-files/manifest.ttl", __FILE__), {unique_bnodes: true, })
94
94
  .and_return(manifest)
95
95
  expect(RDF::Graph).to receive(:load)
96
96
  .with(File.expand_path("../test-files/report-no-doap.ttl", __FILE__))
@@ -127,7 +127,7 @@ describe EarlReport do
127
127
  context "no foaf report" do
128
128
  before(:each) do
129
129
  expect(RDF::Graph).to receive(:load)
130
- .with(File.expand_path("../test-files/manifest.ttl", __FILE__), {})
130
+ .with(File.expand_path("../test-files/manifest.ttl", __FILE__), {unique_bnodes: true, })
131
131
  .and_return(manifest)
132
132
  expect(RDF::Graph).to receive(:load)
133
133
  .with(File.expand_path("../test-files/report-no-foaf.ttl", __FILE__))
@@ -73,8 +73,8 @@
73
73
  <h2 id='w3c-document-28-october-2015'>
74
74
  <abbr title='World Wide Web Consortium'>W3C</abbr>
75
75
  Document
76
- <time class='dt-published' datetime='2016-12-28' property='dc:issued'>
77
- 28 December 2016
76
+ <time class='dt-published' datetime='2017-01-03' property='dc:issued'>
77
+ 03 January 2017
78
78
  </time>
79
79
  </h2>
80
80
  <dl>
@@ -105,7 +105,7 @@
105
105
  </p>
106
106
  <hr />
107
107
  </div>
108
- <section about='' id='abstract' typeof='Software doap:Project'>
108
+ <section about='' id='abstract' typeof='doap:Project Software'>
109
109
  <h2>Abstract</h2>
110
110
  <p>
111
111
  This document report test subject conformance for and related specifications for
@@ -230,7 +230,7 @@
230
230
  <span class='secno'>2.</span>
231
231
  Test Manifests
232
232
  </h2>
233
- <section id='Description-for-Example-Test-Cases' resource='http://example/manifest.ttl' typeof='mf:Manifest Report'>
233
+ <section id='Description-for-Example-Test-Cases' resource='http://example/manifest.ttl' typeof='Report mf:Manifest'>
234
234
  <h2>
235
235
  <span class='secno'>2.1</span>
236
236
  <span property='dc:title mf:name'>Example Test Cases</span>
@@ -244,7 +244,7 @@
244
244
  <a href='#subj_0'>RDF::Turtle</a>
245
245
  </th>
246
246
  </tr>
247
- <tr inlist='inlist' rel='mf:entries' resource='http://example/manifest.ttl#testeval00' typeof='TestCase TestCriterion http://www.w3.org/ns/rdftest#TestTurtleEval'>
247
+ <tr inlist='inlist' rel='mf:entries' resource='http://example/manifest.ttl#testeval00' typeof='http://www.w3.org/ns/rdftest#TestTurtleEval TestCase TestCriterion'>
248
248
  <td>
249
249
  <a href='#test_1fdd82ac4caf30510cabfdb0a5987ddd'>subm-test-00</a>
250
250
  </td>
@@ -260,12 +260,12 @@
260
260
  </span>
261
261
  </td>
262
262
  </tr>
263
- <tr inlist='inlist' rel='mf:entries' resource='_:b0' typeof='TestCase TestCriterion http://www.w3.org/ns/rdftest#TestTurtleEval'>
263
+ <tr inlist='inlist' rel='mf:entries' resource='_:b2' typeof='http://www.w3.org/ns/rdftest#TestTurtleEval TestCase TestCriterion'>
264
264
  <td>
265
- <a href='#test_9616fad74c7bf0cfba5d70f087ed0a96'>subm-test-01</a>
265
+ <a href='#test_9430e2f85f26fd582ac7fcccd7f50d46'>subm-test-01</a>
266
266
  </td>
267
267
  <td class='UNTESTED' property='earl:assertions' typeof='Assertion'>
268
- <link href='_:b0' property='earl:test' />
268
+ <link href='_:b2' property='earl:test' />
269
269
  <link href='http://rubygems.org/gems/rdf-turtle' property='earl:subject' />
270
270
  <span property='earl:result' typeof='TestResult'>
271
271
  <span property='earl:outcome' resource='earl:untested'>
@@ -300,7 +300,7 @@
300
300
  <span about='http://rubygems.org/gems/rdf-turtle' property='doap:name'>RDF::Turtle</span>
301
301
  </a>
302
302
  </dt>
303
- <dd property='earl:testSubjects' resource='http://rubygems.org/gems/rdf-turtle' typeof='Software doap:Project TestSubject'>
303
+ <dd property='earl:testSubjects' resource='http://rubygems.org/gems/rdf-turtle' typeof='doap:Project Software TestSubject'>
304
304
  <dl>
305
305
  <dt>Description</dt>
306
306
  <dd lang='en' property='doap:description'>RDF::Turtle is an Turtle reader/writer for the RDF.rb library suite.</dd>
@@ -374,11 +374,11 @@
374
374
  <pre class='example actionDoc' property='mf:action' resource='http://example/test-00.ttl' title='subm-test-00 Input'>http://example/test-00.ttl not loaded</pre>
375
375
  <pre class='example resultDoc' property='mf:result' resource='http://example/test-00.out' title='subm-test-00 Result'>http://example/test-00.out not loaded</pre>
376
376
  </dd>
377
- <dt id='test_9616fad74c7bf0cfba5d70f087ed0a96' resource='_:b0'>
377
+ <dt id='test_9430e2f85f26fd582ac7fcccd7f50d46' resource='_:b2'>
378
378
  Test
379
379
  <span property='dc:title mf:name'>subm-test-01</span>
380
380
  </dt>
381
- <dd resource='_:b0'>
381
+ <dd resource='_:b2'>
382
382
  <p property='dc:description rdfs:comment'></p>
383
383
  <pre class='example actionDoc' property='mf:action' resource='http://example/test-01.ttl' title='subm-test-01 Input'>http://example/test-01.ttl not loaded</pre>
384
384
  <pre class='example resultDoc' property='mf:result' resource='http://example/test-01.out' title='subm-test-01 Result'>http://example/test-01.out not loaded</pre>
@@ -386,7 +386,7 @@
386
386
  </div>
387
387
  </dl>
388
388
  </section>
389
- <section class='appendix' id='report-generation-software' property='earl:generatedBy' resource='http://rubygems.org/gems/earl-report' typeof='Software doap:Project'>
389
+ <section class='appendix' id='report-generation-software' property='earl:generatedBy' resource='http://rubygems.org/gems/earl-report' typeof='doap:Project Software'>
390
390
  <h2>
391
391
  <span class='secno'>D.</span>
392
392
  Report Generation Software
@@ -400,7 +400,7 @@
400
400
  <span property='doap:release' resource='https://github.com/gkellogg/earl-report/tree/0.4.3' typeof='doap:Version'>
401
401
  <span property='doap:revision'>0.4.3</span>
402
402
  <meta content='earl-report-0.4.3' property='doap:name' />
403
- <meta content='2016-12-26' datatype='xsd:date' property='doap:created' />
403
+ <meta content='2016-12-28' datatype='xsd:date' property='doap:created' />
404
404
  </span>
405
405
  an
406
406
  <a href='http://unlicense.org' property='doap:license'>Unlicensed</a>
@@ -103,8 +103,8 @@
103
103
  },
104
104
  "@id": "",
105
105
  "@type": [
106
- "Software",
107
- "doap:Project"
106
+ "doap:Project",
107
+ "Software"
108
108
  ],
109
109
  "assertions": [
110
110
  "/Users/gregg/Projects/earl-report/spec/test-files/report-complete.ttl"
@@ -114,25 +114,25 @@
114
114
  {
115
115
  "@id": "http://example/manifest.ttl",
116
116
  "@type": [
117
- "mf:Manifest",
118
- "Report"
117
+ "Report",
118
+ "mf:Manifest"
119
119
  ],
120
120
  "entries": [
121
121
  {
122
122
  "@id": "http://example/manifest.ttl#testeval00",
123
123
  "@type": [
124
+ "http://www.w3.org/ns/rdftest#TestTurtleEval",
124
125
  "TestCase",
125
- "TestCriterion",
126
- "http://www.w3.org/ns/rdftest#TestTurtleEval"
126
+ "TestCriterion"
127
127
  ],
128
128
  "assertions": [
129
129
  {
130
- "@id": "_:b0",
130
+ "@id": "_:b4",
131
131
  "@type": "Assertion",
132
132
  "assertedBy": "http://greggkellogg.net/foaf#me",
133
133
  "mode": "earl:automatic",
134
134
  "result": {
135
- "@id": "_:b1",
135
+ "@id": "_:b3",
136
136
  "@type": "TestResult",
137
137
  "outcome": "earl:passed"
138
138
  },
@@ -148,17 +148,17 @@
148
148
  {
149
149
  "@id": "_:b2",
150
150
  "@type": [
151
+ "http://www.w3.org/ns/rdftest#TestTurtleEval",
151
152
  "TestCase",
152
- "TestCriterion",
153
- "http://www.w3.org/ns/rdftest#TestTurtleEval"
153
+ "TestCriterion"
154
154
  ],
155
155
  "assertions": [
156
156
  {
157
- "@id": "_:b3",
157
+ "@id": "_:b0",
158
158
  "@type": "Assertion",
159
159
  "assertedBy": null,
160
160
  "result": {
161
- "@id": "_:b4",
161
+ "@id": "_:b1",
162
162
  "@type": "TestResult",
163
163
  "outcome": "earl:untested"
164
164
  },
@@ -179,8 +179,8 @@
179
179
  "generatedBy": {
180
180
  "@id": "http://rubygems.org/gems/earl-report",
181
181
  "@type": [
182
- "Software",
183
- "doap:Project"
182
+ "doap:Project",
183
+ "Software"
184
184
  ],
185
185
  "developer": [
186
186
  {
@@ -201,7 +201,7 @@
201
201
  "release": {
202
202
  "@id": "https://github.com/gkellogg/earl-report/tree/0.4.3",
203
203
  "@type": "doap:Version",
204
- "created": "2016-12-26",
204
+ "created": "2016-12-28",
205
205
  "name": "earl-report-0.4.3",
206
206
  "revision": "0.4.3"
207
207
  },
@@ -212,8 +212,8 @@
212
212
  {
213
213
  "@id": "http://rubygems.org/gems/rdf-turtle",
214
214
  "@type": [
215
- "Software",
216
215
  "doap:Project",
216
+ "Software",
217
217
  "TestSubject"
218
218
  ],
219
219
  "developer": [
@@ -7,8 +7,8 @@
7
7
  @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
8
8
  @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
9
9
 
10
- <> a earl:Software,
11
- doap:Project;
10
+ <> a doap:Project,
11
+ earl:Software;
12
12
  dc:bibliographicCitation "[[TURTLE]]";
13
13
  doap:name "Turtle Test Results";
14
14
  mf:entries (<http://example/manifest.ttl>);
@@ -18,15 +18,15 @@
18
18
 
19
19
  # Manifests
20
20
 
21
- <http://example/manifest.ttl> a mf:Manifest,
22
- earl:Report;
21
+ <http://example/manifest.ttl> a earl:Report,
22
+ mf:Manifest;
23
23
  rdfs:comment "Description for Example Test Cases";
24
- mf:entries (<http://example/manifest.ttl#testeval00> _:g70287090109560);
24
+ mf:entries (<http://example/manifest.ttl#testeval00> _:g70336025838220);
25
25
  mf:name "Example Test Cases" .
26
26
 
27
- <http://example/manifest.ttl#testeval00> a earl:TestCase,
28
- earl:TestCriterion,
29
- <http://www.w3.org/ns/rdftest#TestTurtleEval>;
27
+ <http://example/manifest.ttl#testeval00> a <http://www.w3.org/ns/rdftest#TestTurtleEval>,
28
+ earl:TestCase,
29
+ earl:TestCriterion;
30
30
  rdfs:comment "Blank subject";
31
31
  mf:action <http://example/test-00.ttl>;
32
32
  mf:name "subm-test-00";
@@ -43,9 +43,9 @@
43
43
  earl:test <http://example/manifest.ttl#testeval00>
44
44
  ] .
45
45
 
46
- _:g70287090109560 a earl:TestCase,
47
- earl:TestCriterion,
48
- <http://www.w3.org/ns/rdftest#TestTurtleEval>;
46
+ _:g70336025838220 a <http://www.w3.org/ns/rdftest#TestTurtleEval>,
47
+ earl:TestCase,
48
+ earl:TestCriterion;
49
49
  rdfs:comment "@prefix and qnames";
50
50
  mf:action <http://example/test-01.ttl>;
51
51
  mf:name "subm-test-01";
@@ -57,13 +57,13 @@ _:g70287090109560 a earl:TestCase,
57
57
  earl:outcome earl:untested
58
58
  ];
59
59
  earl:subject <http://rubygems.org/gems/rdf-turtle>;
60
- earl:test _:g70287090109560
60
+ earl:test _:g70336025838220
61
61
  ] .
62
62
 
63
63
  # Test Subjects
64
64
 
65
- <http://rubygems.org/gems/rdf-turtle> a earl:Software,
66
- doap:Project,
65
+ <http://rubygems.org/gems/rdf-turtle> a doap:Project,
66
+ earl:Software,
67
67
  earl:TestSubject;
68
68
  doap:description "RDF::Turtle is an Turtle reader/writer for the RDF.rb library suite."@en;
69
69
  doap:developer <http://greggkellogg.net/foaf#me>;
@@ -78,8 +78,8 @@ _:g70287090109560 a earl:TestCase,
78
78
 
79
79
  # Report Generation Software
80
80
 
81
- <http://rubygems.org/gems/earl-report> a earl:Software,
82
- doap:Project;
81
+ <http://rubygems.org/gems/earl-report> a doap:Project,
82
+ earl:Software;
83
83
  doap:description "EarlReport generates HTML+RDFa rollups of multiple EARL reports"@en;
84
84
  doap:developer <http://greggkellogg.net/foaf#me>;
85
85
  doap:homepage <https://github.com/gkellogg/earl-report>;
@@ -90,6 +90,6 @@ _:g70287090109560 a earl:TestCase,
90
90
  doap:shortdesc "Earl Report summary generator"@en .
91
91
 
92
92
  <https://github.com/gkellogg/earl-report/tree/0.4.3> a doap:Version;
93
- doap:created "2016-12-26"^^xsd:date;
93
+ doap:created "2016-12-28"^^xsd:date;
94
94
  doap:name "earl-report-0.4.3";
95
95
  doap:revision "0.4.3" .
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: earl-report
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregg Kellogg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-26 00:00:00.000000000 Z
11
+ date: 2017-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: linkeddata