earl-report 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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
data/bin/earl-report CHANGED
@@ -25,12 +25,13 @@ OPT_ARGS = [
25
25
  ]
26
26
  def usage
27
27
  STDERR.puts %{
28
+ earl-report version #{EarlReport::VERSION}
28
29
  Generate EARL report for mutliple test results against a test manifest.
29
30
 
30
31
  Options are initialized by reading optional run-control file '.earl' in the local directory,
31
32
  if it exists.
32
33
 
33
- Usage: #{$0} [options] test-manifest test-result ...
34
+ Usage: #{$0} [options] test-result ...
34
35
  }.gsub(/^ /, '')
35
36
  width = OPT_ARGS.map do |o|
36
37
  l = o.first.length
@@ -90,6 +91,8 @@ if options.has_key?(:template) && options[:template].empty?
90
91
  File.open(File.expand_path("../../lib/earl_report/views/earl_report.html.haml", __FILE__)) do |f|
91
92
  options[:io].write(f.read)
92
93
  end
94
+ elsif ARGV.empty?
95
+ usage
93
96
  else
94
97
  earl = EarlReport.new(*ARGV, options)
95
98
  earl.generate(options)
data/lib/earl_report.rb CHANGED
@@ -7,6 +7,8 @@ require 'haml'
7
7
  # EARL reporting class.
8
8
  # Instantiate a new class using one or more input graphs
9
9
  class EarlReport
10
+ autoload :VERSION, 'earl_report/version'
11
+
10
12
  attr_reader :graph
11
13
 
12
14
  MANIFEST_QUERY = %(
@@ -81,22 +83,28 @@ class EarlReport
81
83
  assertedBy: {"@type" => "@id"},
82
84
  assertions: {"@type" => "@id", "@container" => "@list"},
83
85
  bibRef: {"@id" => "dc:bibliographicCitation"},
84
- description: {"@id" => "dc:description"},
86
+ created: {"@id" => "doap:created", "@type" => "xsd:date"},
87
+ description: {"@id" => "dc:description", "@language" => "en"},
85
88
  developer: {"@id" => "doap:developer", "@type" => "@id", "@container" => "@set"},
86
- doapDesc: {"@id" => "doap:description"},
89
+ doapDesc: {"@id" => "doap:description", "@language" => "en"},
90
+ generatedBy: {"@type" => "@id"},
87
91
  homepage: {"@id" => "doap:homepage", "@type" => "@id"},
88
- label: {"@id" => "rdfs:label"},
92
+ label: {"@id" => "rdfs:label", "@language" => "en"},
89
93
  language: {"@id" => "doap:programming-language"},
94
+ license: {"@id" => "doap:license", "@type" => "@id"},
90
95
  mode: {"@type" => "@id"},
91
96
  name: {"@id" => "doap:name"},
92
97
  outcome: {"@type" => "@id"},
98
+ release: {"@id" => "doap:release", "@type" => "@id"},
99
+ shortdesc: {"@id" => "doap:shortdesc", "@language" => "en"},
93
100
  subject: {"@type" => "@id"},
94
101
  test: {"@type" => "@id"},
95
102
  testAction: {"@id" => "mf:action", "@type" => "@id"},
96
103
  testResult: {"@id" => "mf:result", "@type" => "@id"},
97
104
  tests: {"@type" => "@id", "@container" => "@list"},
98
105
  testSubjects: {"@type" => "@id", "@container" => "@list"},
99
- title: {"@id" => "dc:title"}
106
+ title: {"@id" => "dc:title"},
107
+ xsd: {"@id" => "http://www.w3.org/2001/XMLSchema#"}
100
108
  }.freeze
101
109
 
102
110
  # Convenience vocabularies
@@ -120,6 +128,7 @@ class EarlReport
120
128
  @options = files.last.is_a?(Hash) ? files.pop.dup : {}
121
129
  @options[:query] ||= MANIFEST_QUERY
122
130
  raise "Test Manifest must be specified with :manifest option" unless @options[:manifest] || @options[:json]
131
+ raise "Require at least one input file" if files.empty?
123
132
  @files = files
124
133
  @prefixes = {}
125
134
  if @options[:json]
@@ -234,11 +243,34 @@ class EarlReport
234
243
  # Customized JSON-LD output
235
244
  {
236
245
  "@context" => TEST_CONTEXT,
237
- "@id" => "",
238
- "@type" => %w(earl:Software doap:Project),
246
+ "@id" => "",
247
+ "@type" => "earl:Report",
248
+ 'title' => @options[:name],
249
+ 'bibRef' => @options[:bibRef],
250
+ 'generatedBy' => {
251
+ "@id" => "http://rubygems.org/gems/earl-report",
252
+ "@type" => "doap:Project",
253
+ "name" => "earl-report",
254
+ "shortdesc" => "Earl Report summary generator",
255
+ "doapDesc" => "EarlReport generates HTML+RDFa rollups of multiple EARL reports",
256
+ "homepage" => "https://github.com/gkellogg/earl-report",
257
+ "language" => "Ruby",
258
+ "license" => "http://unlicense.org",
259
+ "release" => {
260
+ "@id" => "https://github.com/gkellogg/earl-report/tree/#{VERSION}",
261
+ "@type" => "doap:Version",
262
+ "name" => "earl-report-#{VERSION}",
263
+ "created" => File.mtime(File.expand_path('../../VERSION', __FILE__)).strftime('%Y-%m-%d'),
264
+ "revision" => VERSION.to_s
265
+ },
266
+ "developer" => {
267
+ "@type" => "foaf:Person",
268
+ "@id" => "http://greggkellogg.net/foaf#me",
269
+ "foaf:name" => "Gregg Kellogg",
270
+ "foaf:homepage" => "http://greggkellogg.net/"
271
+ }
272
+ },
239
273
  "assertions" => @files,
240
- 'name' => @options[:name],
241
- 'bibRef' => @options[:bibRef],
242
274
  'testSubjects' => json_test_subject_info,
243
275
  'tests' => json_result_info
244
276
  }
@@ -375,21 +407,33 @@ class EarlReport
375
407
  io.puts
376
408
 
377
409
  # Write earl:Software for the report
378
- io.puts %{<#{json_hash['@id']}> a earl:Software, doap:Project;}
379
- io.puts %{ doap:homepage <#{json_hash['homepage']}>;}
380
- io.puts %{ doap:name "#{json_hash['name']}";}
381
- io.puts %{ dc:bibliographicCitation "#{json_hash['bibRef']}";}
382
- io.puts %{ earl:assertions\n}
383
- io.puts %{ } + json_hash['assertions'].map {|a| as_resource(a)}.join(",\n ") + ';'
384
- io.puts %{ earl:testSubjects (\n}
385
- io.puts %{ } + json_hash['testSubjects'].map {|a| as_resource(a['@id'])}.join("\n ") + ');'
386
- io.puts %{ earl:tests (\n}
387
- io.puts %{ } + json_hash['tests'].map {|a| as_resource(a['@id'])}.join("\n ") + ') .'
388
-
389
- # Test Cases
390
- # also collect each assertion definition
391
- test_cases = {}
392
- assertions = []
410
+ io.puts %{
411
+ #{as_resource(json_hash['@id'])} a #{[json_hash['@type']].flatten.join(', ')};
412
+ dc:title "#{json_hash['title']}";
413
+ dc:bibliographicCitation "#{json_hash['bibRef']}";
414
+ earl:generatedBy #{as_resource json_hash['generatedBy']['@id']};
415
+ earl:assertions
416
+ #{json_hash['assertions'].map {|a| as_resource(a)}.join(",\n ")};
417
+ earl:testSubjects (
418
+ #{json_hash['testSubjects'].map {|a| as_resource(a['@id'])}.join("\n ")});
419
+ earl:tests (
420
+ #{json_hash['tests'].map {|a| as_resource(a['@id'])}.join("\n ")}) .
421
+
422
+ }.gsub(/^ /, '')
423
+
424
+ # Write generating software information
425
+ io.puts %{
426
+ <http://rubygems.org/gems/earl-report> a earl:Software, doap:Project;
427
+ doap:name "earl-report";
428
+ doap:shortdesc "Earl Report summary generator"@en;
429
+ doap:description "EarlReport generates HTML+RDFa rollups of multiple EARL reports"@en;
430
+ doap:homepage <https://github.com/gkellogg/earl-report>;
431
+ doap:programming-language "Ruby";
432
+ doap:license <http://unlicense.org>;
433
+ doap:release <https://github.com/gkellogg/earl-report/tree/#{VERSION}>;
434
+ doap:developer <http://greggkellogg.net/foaf#me> .
435
+
436
+ }.gsub(/^ /, '')
393
437
 
394
438
  # Write out each earl:TestSubject
395
439
  io.puts %(#\n# Subject Definitions\n#)
@@ -411,7 +455,7 @@ class EarlReport
411
455
  def test_subject_turtle(desc)
412
456
  res = %(<#{desc['@id']}> a #{desc['@type'].join(', ')};\n)
413
457
  res += %( doap:name "#{desc['name']}";\n)
414
- res += %( doap:description """#{desc['doapDesc']}""";\n) if desc['doapDesc']
458
+ res += %( doap:description """#{desc['doapDesc']}"""@en;\n) if desc['doapDesc']
415
459
  res += %( doap:programming-language "#{desc['language']}";\n) if desc['language']
416
460
  res += %( .\n\n)
417
461
 
@@ -438,7 +482,7 @@ class EarlReport
438
482
  def tc_turtle(desc)
439
483
  res = %{#{as_resource desc['@id']} a #{[desc['@type']].flatten.join(', ')};\n}
440
484
  res += %{ dc:title "#{desc['title']}";\n}
441
- res += %{ dc:description """#{desc['description']}""";\n} if desc.has_key?('description')
485
+ res += %{ dc:description """#{desc['description']}"""@en;\n} if desc.has_key?('description')
442
486
  res += %{ mf:result #{as_resource desc['testResult']};\n} if desc.has_key?('testResult')
443
487
  res += %{ mf:action #{as_resource desc['testAction']};\n}
444
488
  res += %{ earl:assertions (\n}
@@ -0,0 +1,18 @@
1
+ module EarlReport::VERSION
2
+ VERSION_FILE = File.join(File.expand_path(File.dirname(__FILE__)), "..", "..", "VERSION")
3
+ MAJOR, MINOR, TINY, EXTRA = File.read(VERSION_FILE).chop.split(".")
4
+
5
+ STRING = [MAJOR, MINOR, TINY, EXTRA].compact.join('.')
6
+
7
+ ##
8
+ # @return [String]
9
+ def self.to_s() STRING end
10
+
11
+ ##
12
+ # @return [String]
13
+ def self.to_str() STRING end
14
+
15
+ ##
16
+ # @return [Array(Integer, Integer, Integer)]
17
+ def self.to_a() STRING.split(".") end
18
+ end
@@ -0,0 +1,279 @@
1
+ -# This template is used for generating a rollup EARL report. It expects to be
2
+ -# called with a single _tests_ local with the following structure
3
+ -#
4
+ -# {
5
+ -# "@context": {...},
6
+ -# "@id": "",
7
+ -# "@type": "earl:Software",
8
+ -# "title": "...",
9
+ -# "bibRef": "[[...]]",
10
+ -# "assertions": ["./rdf.rb-earl.ttl"],
11
+ -# "testSubjects": [
12
+ -# {
13
+ -# "@id": "http://rubygems.org/gems/rdf-turtle",
14
+ -# "@type": "earl:TestSubject",
15
+ -# "name": "RDF::Turtle"
16
+ -# },
17
+ -# ...
18
+ -# ],
19
+ -# "tests": [{
20
+ -# "@id": "http://dvcs.w3.org/hg/rdf/raw-file/default/rdf-turtle/tests-ttl/manifest.ttl#turtle-syntax-file-01",
21
+ -# "@type": ["earl:TestCriterion", "earl:TestCase"],
22
+ -# "title": "subm-test-00",
23
+ -# "description": "Blank subject",
24
+ -# "testAction": "http://dvcs.w3.org/hg/rdf/raw-file/default/rdf-turtle/tests-ttl/turtle-syntax-file-01.ttl",
25
+ -# "testResult": "http://dvcs.w3.org/hg/rdf/raw-file/default/rdf-turtle/tests-ttl/turtle-syntax-file-01.out"
26
+ -# "mode": "earl:automatic",
27
+ -# "assertions": [
28
+ -# {
29
+ -# "@type": "earl:Assertion",
30
+ -# "assertedBy": "http://greggkellogg.net/foaf#me",
31
+ -# "test": "http://svn.apache.org/repos/asf/jena/Experimental/riot-reader/testing/RIOT/Lang/TurtleSubm/manifest.ttl#testeval00",
32
+ -# "subject": "http://rubygems.org/gems/rdf-turtle",
33
+ -# "result": {
34
+ -# "@type": "earl:TestResult",
35
+ -# "outcome": "earl:passed"
36
+ -# }
37
+ -# }
38
+ -# ]
39
+ -# }]
40
+ -# }
41
+
42
+ !!! 5
43
+ %html{:prefix => "earl: http://www.w3.org/ns/earl# doap: http://usefulinc.com/ns/doap# mf: http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#"}
44
+ - subjects = tests['testSubjects']
45
+ - test_cases = tests['tests']
46
+ %head
47
+ %meta{"http-equiv" => "Content-Type", :content => "text/html;charset=utf-8"}
48
+ %title
49
+ = tests['name']
50
+ %script.remove{:type => "text/javascript", :src => "http://www.w3.org/Tools/respec/respec-w3c-common"}
51
+ :javascript
52
+ var respecConfig = {
53
+ // extend the bibliography entries
54
+ localBiblio: {
55
+ TURTLE: "Eric Prud'hommeaux, Gavin Carothers. <cite><a href=\"http://www.w3.org/TR/2011/WD-turtle-20110809/\">Turtle: Terse RDF Triple Language.</a></cite> 09 August 2011. W3C Working Draft. URL: <a href=\"http://www.w3.org/TR/2011/WD-turtle-20110809/\">http://www.w3.org/TR/2011/WD-turtle-20110809/</a>",
56
+ },
57
+
58
+ // specification status (e.g. WD, LCWD, NOTE, etc.). If in doubt use ED.
59
+ specStatus: "unofficial",
60
+ copyrightStart: "2010",
61
+ doRDFa: "1.1",
62
+
63
+ // the specification's short name, as in http://www.w3.org/TR/short-name/
64
+ shortName: "turtle-earl",
65
+ subtitle: "Turtle Implementation Conformance Report",
66
+ // if you wish the publication date to be other than today, set this
67
+ publishDate: "#{Time.now.strftime("%Y/%m/%d")}",
68
+
69
+ // if there is a previously published draft, uncomment this and set its YYYY-MM-DD date
70
+ // and its maturity status
71
+ //previousPublishDate: "2011-10-23",
72
+ //previousMaturity: "ED",
73
+ //previousDiffURI: "http://json-ld.org/spec/ED/json-ld-syntax/20111023/index.html",
74
+ //diffTool: "http://www.aptest.com/standards/htmldiff/htmldiff.pl",
75
+
76
+ // if there a publicly available Editor's Draft, this is the link
77
+ //edDraftURI: "",
78
+
79
+ // if this is a LCWD, uncomment and set the end of its review period
80
+ // lcEnd: "2009-08-05",
81
+
82
+ // if you want to have extra CSS, append them to this list
83
+ // it is recommended that the respec.css stylesheet be kept
84
+ extraCSS: [
85
+ "http://dev.w3.org/2009/dap/ReSpec.js/css/respec.css"
86
+ ],
87
+
88
+ // editors, add as many as you like
89
+ // only "name" is required
90
+ editors: [
91
+ { name: "Gregg Kellogg", url: "http://greggkellogg.net/",
92
+ company: "Kellogg Associates" },
93
+ { name: "Andy Seaborne",
94
+ company: "The Apache Software Foundation"}
95
+ ],
96
+
97
+ // authors, add as many as you like.
98
+ // This is optional, uncomment if you have authors as well as editors.
99
+ // only "name" is required. Same format as editors.
100
+ //authors: [
101
+ //RDF Working Group],
102
+
103
+ // name of the WG
104
+ wg: "RDF Working Group",
105
+
106
+ // URI of the public WG page
107
+ wgURI: "http://www.w3.org/2011/rdf-wg/",
108
+
109
+ // name (with the @w3c.org) of the public mailing to which comments are due
110
+ wgPublicList: "public-rdf-comments",
111
+
112
+ // URI of the patent status for this WG, for Rec-track documents
113
+ // !!!! IMPORTANT !!!!
114
+ // This is important for Rec-track documents, do not copy a patent URI from a random
115
+ // document unless you know what you're doing. If in doubt ask your friendly neighbourhood
116
+ // Team Contact.
117
+ wgPatentURI: "http://www.w3.org/2004/01/pp-impl/46168/status",
118
+ alternateFormats: [
119
+ {uri: "earl.ttl", label: "Turtle"},
120
+ {uri: "earl.jsonld", label: "JSON-LD"}
121
+ ],
122
+ };
123
+ :css
124
+ span[property='dc:description'] { display: none; }
125
+ td.PASS { color: green; }
126
+ td.FAIL { color: red; }
127
+ table.report {
128
+ border-width: 1px;
129
+ border-spacing: 2px;
130
+ border-style: outset;
131
+ border-color: gray;
132
+ border-collapse: separate;
133
+ background-color: white;
134
+ }
135
+ table.report th {
136
+ border-width: 1px;
137
+ padding: 1px;
138
+ border-style: inset;
139
+ border-color: gray;
140
+ background-color: white;
141
+ -moz-border-radius: ;
142
+ }
143
+ table.report td {
144
+ border-width: 1px;
145
+ padding: 1px;
146
+ border-style: inset;
147
+ border-color: gray;
148
+ background-color: white;
149
+ -moz-border-radius: ;
150
+ }
151
+ %body
152
+ %section#abstract{:about => tests['@id'], :typeof => [tests['@type']].flatten.join(' ')}
153
+ %p
154
+ This document report processor conformance for and related specifications for
155
+ %span{:property => "dc:title"}<=tests['title']
156
+ %span{:property => "dc:bibliographicCitation"}<
157
+ = tests['bibRef']
158
+ according to the requirements of the Evaluation and Report Language (EARL) 1.0 Schema [[EARL10-SCHEMA]].
159
+ %section#sodt
160
+ %section
161
+ - test_refs = {}
162
+ - subject_refs = {}
163
+ %h2
164
+ Results
165
+ %table.report
166
+ %tr
167
+ %th
168
+ Test
169
+ - subjects.each_with_index do |subject, i|
170
+ - subject_refs[subject['@id']] = "subj_#{i}"
171
+ %th
172
+ %a{:href => '#' + subject_refs[subject['@id']]}<=subject['name']
173
+ - test_cases.each do |test|
174
+ - test_refs[test['@id']] = 'test_' + (test['@id'][0,2] == '_:' ? test['@id'][2..-1] : test['@id'].split('#').last)
175
+ %tr{:resource => test['@id']}
176
+ %td
177
+ %a{:href => '#' + test_refs[test['@id']]}<= test['title']
178
+ - test['assertions'].each do |assertion|
179
+ - pass_fail = assertion['result']['outcome'].split(':').last.upcase.sub(/ED$/, '')
180
+ %td{:class => pass_fail, :property => "earl:assertions", :typeof => assertion['@type'], :inlist => true}
181
+ - if assertion['assertedBy']
182
+ %link{:property => "earl:assertedBy", :href => assertion['assertedBy']}
183
+ %link{:property => "earl:test", :href => assertion['test']}
184
+ %link{:property => "earl:subject", :href => assertion['subject']}
185
+ - if assertion['mode']
186
+ %link{:property => 'earl:mode', :href => assertion['mode']}
187
+ %span{:property => "earl:result", :typeof => assertion['result']['@type']}
188
+ %span{:property => 'earl:outcome', :resource => assertion['result']['outcome']}
189
+ = pass_fail
190
+ %section.appendix
191
+ %h2
192
+ Test Subjects
193
+ %p
194
+ This report was tested using the following test subjects:
195
+ %dl
196
+ - subjects.each do |subject|
197
+ %dt{:id => subject_refs[subject['@id']]}<
198
+ %a{:href => subject['@id']}
199
+ %span{:about => subject['@id'], :property => "doap:name"}<= subject['name']
200
+ %dd{:property => "earl:testSubjects", :resource => subject['@id'], :typeof => [subject['@type']].flatten.join(" "), :inlist => true}
201
+ %dl
202
+ - if subject['doapDesc']
203
+ %dt= "Description"
204
+ %dd{:property => "doap:description", :lang => 'en'}<= subject['doapDesc']
205
+ - if subject['language']
206
+ %dt= "Programming Language"
207
+ %dd{:property => "doap:programming-language"}<= subject['language']
208
+ - if subject['developer']
209
+ %dt= "Developer"
210
+ %dd{:rel => "doap:developer"}
211
+ - subject['developer'].each do |dev|
212
+ %div{:resource => dev['@id'], :typeof => dev['@type']}
213
+ - if dev.has_key?('@id')
214
+ %a{:href => dev['@id']}
215
+ %span{:property => "foaf:name"}<= dev['foaf:name']
216
+ - else
217
+ %span{:property => "foaf:name"}<= dev['foaf:name']
218
+ - if dev['foaf:homepage']
219
+ %dt
220
+ Home Page
221
+ %dd
222
+ %a{:property => "foaf:homepage", :href=> dev['foaf:homepage']}
223
+ = dev['foaf:homepage']
224
+ - unless tests['assertions'].empty?
225
+ %section.appendix{:rel => "earl:assertions"}
226
+ %h2
227
+ Individual Test Results
228
+ %p
229
+ Individual test results used to construct this report are available here:
230
+ %ul
231
+ - tests['assertions'].each do |file|
232
+ %li
233
+ %a.source{:href => file}<= file
234
+ %section.appendix
235
+ %h2
236
+ Test Definitions
237
+ %dl
238
+ - tests['tests'].each do |test|
239
+ %dt{:id => test_refs[test['@id']], :resource => test['@id']}
240
+ Test
241
+ %span{:property => "dc:title"}<= test['title']
242
+ %dd{:property => "earl:tests", :resource => test['@id'], :typeof => [test['@type']].flatten.join(' '), :inlist => true}
243
+ %p{:property => "dc:description", :lang => 'en'}<= test['description']
244
+ %dl
245
+ %dt
246
+ %pre{:class => "example actionDoc", :property => "mf:action", :resource => test['testAction'], :title => "#{test['title']} Input"}<
247
+ ~ Kernel.open(test['testAction']) {|f| CGI.escapeHTML(f.read).gsub(/\n/, '<br/>')} rescue "#{test['testAction']} not loaded"
248
+ - if test['testResult']
249
+ %pre{:class => "example resultDoc", :property => "mf:result", :resource => test['testResult'], :title => "#{test['title']} Result"}<
250
+ ~ Kernel.open(test['testResult']) {|f| CGI.escapeHTML(f.read).gsub(/\n/, '<br/>')} rescue "#{test['testResult']} not loaded"
251
+ %section#appendix{:property => "earl:generatedBy", :resource => tests['generatedBy']['@id'], :typeof => tests['generatedBy']['@type']}
252
+ %h2
253
+ Report Generation Software
254
+ - doap = tests['generatedBy']
255
+ - rel = doap['release']
256
+ %p
257
+ This report generated by
258
+ %span{:property => "doap:name"}<
259
+ %a{:href => tests['generatedBy']['@id']}<
260
+ = doap['name']
261
+ %meta{:property => "doap:shortdesc", :content => doap['shortdesc'], :lang => 'en'}
262
+ %meta{:property => "doap:description", :content => doap['doapDesc'], :lang => 'en'}
263
+ version
264
+ %span{:property => "doap:release", :resource => rel['@id'], :typeof => 'doap:Version'}
265
+ %span{:property => "doap:revision"}<=rel['revision']
266
+ %meta{:property => "doap:name", :content => rel['name']}
267
+ %meta{:property => "doap:created", :content => rel['created'], :datatype => "xsd:date"}
268
+ an
269
+ %a{:property => "doap:license", :href => doap['license']}<="Unlicensed"
270
+ %span{:property => "doap:programming-language"}<="Ruby"
271
+ package available at
272
+ %a{:property => "doap:homepage", :href => doap['homepage']}<=doap['homepage']
273
+ = "."
274
+ %p{:property => "doap:developer", :resource => "http://greggkellogg.net/foaf#me", :typeof => "foaf:Person"}
275
+ This software is provided by
276
+ %a{:property => "foaf:homepage", :href => "http://greggkellogg.net/"}<
277
+ %span{:aboue => "http://greggkellogg.net/foaf#me", :property => "foaf:name"}<
278
+ Gregg Kellogg
279
+ in hopes that it might make the lives of conformance testers easier.
@@ -41,7 +41,11 @@ describe EarlReport do
41
41
  RDF::Graph.should_receive(:load)
42
42
  .with(File.expand_path("../test-files/manifest.ttl", __FILE__), {:base_uri => "http://example.com/base/"})
43
43
  .and_return(manifest)
44
+ RDF::Graph.should_receive(:load)
45
+ .with(File.expand_path("../test-files/report-complete.ttl", __FILE__))
46
+ .and_return(reportComplete)
44
47
  EarlReport.new(
48
+ File.expand_path("../test-files/report-complete.ttl", __FILE__),
45
49
  :verbose => false,
46
50
  :base => "http://example.com/base/",
47
51
  :manifest => File.expand_path("../test-files/manifest.ttl", __FILE__))
@@ -164,14 +168,14 @@ describe EarlReport do
164
168
  specify {json.should be_a(Hash)}
165
169
  {
166
170
  "@id" => "",
167
- "@type" => %w(earl:Software doap:Project),
171
+ "@type" => "earl:Report",
168
172
  'bibRef' => "[[TURTLE]]",
169
- 'name' => "Turtle Test Results"
173
+ 'title' => "Turtle Test Results"
170
174
  }.each do |prop, value|
171
175
  specify(prop) {json[prop].should == value}
172
176
  end
173
177
 
174
- %w(assertions testSubjects tests).each do |key|
178
+ %w(assertions generatedBy testSubjects tests).each do |key|
175
179
  specify {json.keys.should include(key)}
176
180
  end
177
181
 
@@ -314,7 +318,7 @@ describe EarlReport do
314
318
  ttl.should match(/ doap:name "#{desc['name']}"\s*[;\.]$/)
315
319
  end
316
320
  it "has description" do
317
- ttl.should match(/ doap:description """#{desc['doapDesc']}"""\s*[;\.]$/)
321
+ ttl.should match(/ doap:description """#{desc['doapDesc']}"""@en\s*[;\.]$/)
318
322
  end
319
323
  it "has doap:programming-language" do
320
324
  ttl.should match(/ doap:programming-language "#{desc['language']}"\s*[;\.]$/)
@@ -371,7 +375,7 @@ describe EarlReport do
371
375
  ttl.should match(/ dc:title "#{tc['title']}"\s*[;\.]$/)
372
376
  end
373
377
  it "has dc:description" do
374
- ttl.should match(/ dc:description """#{tc['description']}"""\s*[;\.]$/)
378
+ ttl.should match(/ dc:description """#{tc['description']}"""@en\s*[;\.]$/)
375
379
  end
376
380
  it "has mf:action" do
377
381
  ttl.should match(/ mf:action <#{tc['testAction']}>\s*[;\.]$/)
@@ -444,8 +448,8 @@ describe EarlReport do
444
448
  end
445
449
 
446
450
  context "earl:Software" do
447
- specify {output.should match(/<> a earl:Software, doap:Project\s*[;\.]$/)}
448
- specify {output.should match(/ doap:name "#{json_hash['name']}"\s*[;\.]$/)}
451
+ specify {output.should match(/<> a earl:Report\s*[;\.]$/)}
452
+ specify {output.should match(/ dc:title "#{json_hash['title']}"\s*[;\.]$/)}
449
453
  end
450
454
 
451
455
  context "Subject Definitions" do
@@ -531,9 +535,10 @@ describe EarlReport do
531
535
  PREFIX earl: <http://www.w3.org/ns/earl#>
532
536
 
533
537
  ASK WHERE {
534
- ?uri a earl:Software, doap:Project;
535
- doap:name "Turtle Test Results";
538
+ ?uri a earl:Report;
539
+ dc:title "Turtle Test Results";
536
540
  dc:bibliographicCitation "[[TURTLE]]";
541
+ earl:generatedBy ?generatedBy;
537
542
  earl:assertions ?assertionFile;
538
543
  earl:testSubjects (<http://rubygems.org/gems/rdf-turtle>);
539
544
  earl:tests (
@@ -550,7 +555,7 @@ describe EarlReport do
550
555
  ASK WHERE {
551
556
  <http://rubygems.org/gems/rdf-turtle> a earl:TestSubject, doap:Project;
552
557
  doap:name "RDF::Turtle";
553
- doap:description """RDF::Turtle is an Turtle reader/writer for the RDF.rb library suite.""";
558
+ doap:description """RDF::Turtle is an Turtle reader/writer for the RDF.rb library suite."""@en;
554
559
  doap:programming-language "Ruby";
555
560
  doap:developer <http://greggkellogg.net/foaf#me> .
556
561
  }
@@ -574,7 +579,7 @@ describe EarlReport do
574
579
  ASK WHERE {
575
580
  <http://example/manifest.ttl#testeval00> a earl:TestCriterion, earl:TestCase;
576
581
  dc:title "subm-test-00";
577
- dc:description """Blank subject""";
582
+ dc:description """Blank subject"""@en;
578
583
  mf:action <http://example/test-00.ttl>;
579
584
  mf:result <http://example/test-00.out>;
580
585
  earl:assertions (
@@ -3,17 +3,17 @@
3
3
  <head>
4
4
  <meta content='text/html;charset=utf-8' http-equiv='Content-Type' />
5
5
  <title>
6
- Turtle
6
+
7
7
  </title>
8
8
  <script class='remove' src='http://www.w3.org/Tools/respec/respec-w3c-common' type='text/javascript'></script>
9
9
  <script type='text/javascript'>
10
10
  //<![CDATA[
11
11
  var respecConfig = {
12
12
  // extend the bibliography entries
13
- "localBiblio": {
14
- "TURTLE": "Eric Prud'hommeaux, Gavin Carothers. <cite><a href=\"http://www.w3.org/TR/2011/WD-turtle-20110809/\">Turtle: Terse RDF Triple Language.</a></cite> 09 August 2011. W3C Working Draft. URL: <a href=\"http://www.w3.org/TR/2011/WD-turtle-20110809/\">http://www.w3.org/TR/2011/WD-turtle-20110809/</a>",
13
+ localBiblio: {
14
+ TURTLE: "Eric Prud'hommeaux, Gavin Carothers. <cite><a href=\"http://www.w3.org/TR/2011/WD-turtle-20110809/\">Turtle: Terse RDF Triple Language.</a></cite> 09 August 2011. W3C Working Draft. URL: <a href=\"http://www.w3.org/TR/2011/WD-turtle-20110809/\">http://www.w3.org/TR/2011/WD-turtle-20110809/</a>",
15
15
  },
16
-
16
+
17
17
  // specification status (e.g. WD, LCWD, NOTE, etc.). If in doubt use ED.
18
18
  specStatus: "unofficial",
19
19
  copyrightStart: "2010",
@@ -23,7 +23,7 @@
23
23
  shortName: "turtle-earl",
24
24
  subtitle: "Turtle Implementation Conformance Report",
25
25
  // if you wish the publication date to be other than today, set this
26
- publishDate: "2012/11/25",
26
+ publishDate: "2012/11/26",
27
27
 
28
28
  // if there is a previously published draft, uncomment this and set its YYYY-MM-DD date
29
29
  // and its maturity status
@@ -114,23 +114,13 @@
114
114
  </style>
115
115
  </head>
116
116
  <body>
117
- <section about='' id='abstract' typeof='earl:Software doap:Project'>
117
+ <section about='' id='abstract' typeof='earl:Report'>
118
118
  <p>
119
119
  This document report processor conformance for and related specifications for
120
- <span property='doap:name'>Turtle</span>
121
- <span property='dc:bibliographicCitation'>[[TURTLE]]</span>
120
+ <span property='dc:title'></span>
121
+ <span property='dc:bibliographicCitation'></span>
122
122
  according to the requirements of the Evaluation and Report Language (EARL) 1.0 Schema [[EARL10-SCHEMA]].
123
123
  </p>
124
- <p>
125
- This report is also available in alternate formats:
126
- <a href='earl.ttl'>
127
- Turtle
128
- </a>
129
- and
130
- <a href='earl.jsonld'>
131
- JSON-LD
132
- </a>
133
- </p>
134
124
  </section>
135
125
  <section id='sodt'></section>
136
126
  <section>
@@ -155,23 +145,21 @@
155
145
  <link href='http://example/manifest.ttl#testeval00' property='earl:test' />
156
146
  <link href='http://rubygems.org/gems/rdf-turtle' property='earl:subject' />
157
147
  <link href='earl:automatic' property='earl:mode' />
158
- <span property='earl:result' resource='_' typeof='earl:TestResult'>
148
+ <span property='earl:result' typeof='earl:TestResult'>
159
149
  <span property='earl:outcome' resource='earl:passed'>
160
150
  PASS
161
151
  </span>
162
152
  </span>
163
153
  </td>
164
154
  </tr>
165
- <tr resource='_:g70363621872700'>
155
+ <tr resource='_:g70304060229600'>
166
156
  <td>
167
- <a href='#test_g70363621872700'>subm-test-01</a>
157
+ <a href='#test_g70304060229600'>subm-test-01</a>
168
158
  </td>
169
159
  <td class='UNTEST' inlist='inlist' property='earl:assertions' typeof='earl:Assertion'>
170
- <link property='earl:assertedBy' />
171
- <link href='_:g70363621872700' property='earl:test' />
160
+ <link href='_:g70304060229600' property='earl:test' />
172
161
  <link href='http://rubygems.org/gems/rdf-turtle' property='earl:subject' />
173
- <link property='earl:mode' />
174
- <span property='earl:result' resource='_' typeof='earl:TestResult'>
162
+ <span property='earl:result' typeof='earl:TestResult'>
175
163
  <span property='earl:outcome' resource='earl:untested'>
176
164
  UNTEST
177
165
  </span>
@@ -194,7 +182,7 @@
194
182
  <dd inlist='inlist' property='earl:testSubjects' resource='http://rubygems.org/gems/rdf-turtle' typeof='earl:TestSubject doap:Project'>
195
183
  <dl>
196
184
  <dt>Description</dt>
197
- <dd property='doap:description'>RDF::Turtle is an Turtle reader/writer for the RDF.rb library suite.</dd>
185
+ <dd lang='en' property='doap:description'>RDF::Turtle is an Turtle reader/writer for the RDF.rb library suite.</dd>
198
186
  <dt>Programming Language</dt>
199
187
  <dd property='doap:programming-language'>Ruby</dd>
200
188
  <dt>Developer</dt>
@@ -240,7 +228,7 @@
240
228
  <span property='dc:title'>subm-test-00</span>
241
229
  </dt>
242
230
  <dd inlist='inlist' property='earl:tests' resource='http://example/manifest.ttl#testeval00' typeof='earl:TestCriterion earl:TestCase'>
243
- <p property='dc:description'>Blank subject</p>
231
+ <p lang='en' property='dc:description'>Blank subject</p>
244
232
  <dl>
245
233
  <dt>
246
234
  <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>
@@ -248,12 +236,12 @@
248
236
  </dt>
249
237
  </dl>
250
238
  </dd>
251
- <dt id='test_g70363621872700' resource='_:g70363621872700'>
239
+ <dt id='test_g70304060229600' resource='_:g70304060229600'>
252
240
  Test
253
241
  <span property='dc:title'>subm-test-01</span>
254
242
  </dt>
255
- <dd inlist='inlist' property='earl:tests' resource='_:g70363621872700' typeof='earl:TestCriterion earl:TestCase'>
256
- <p property='dc:description'>@prefix and qnames</p>
243
+ <dd inlist='inlist' property='earl:tests' resource='_:g70304060229600' typeof='earl:TestCriterion earl:TestCase'>
244
+ <p lang='en' property='dc:description'>@prefix and qnames</p>
257
245
  <dl>
258
246
  <dt>
259
247
  <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>
@@ -263,5 +251,33 @@
263
251
  </dd>
264
252
  </dl>
265
253
  </section>
254
+ <section id='appendix' property='earl:generatedBy' resource='http://rubygems.org/gems/earl-report' typeof='doap:Project'>
255
+ <h2>
256
+ Report Generation Software
257
+ </h2>
258
+ <p>
259
+ This report generated by
260
+ <span property='doap:name'><a href='http://rubygems.org/gems/earl-report'>earl-report</a></span>
261
+ <meta content='Earl Report summary generator' lang='en' property='doap:shortdesc' />
262
+ <meta content='Earl Report generates HTML+RDFa rollups of multiple EARL reports' lang='en' property='doap:description' />
263
+ version
264
+ <span property='doap:release' resource='https://github.com/gkellogg/earl-report/tree/0.1.1' typeof='doap:Version'>
265
+ <span property='doap:revision'>0.1.1</span>
266
+ <meta content='earl-report-0.1.1' property='doap:name' />
267
+ <meta content='2012-11-25' datatype='xsd:date' property='doap:created' />
268
+ </span>
269
+ an
270
+ <a href='http://unlicense.org' property='doap:license'>Unlicensed</a>
271
+ <span property='doap:programming-language'>Ruby</span>
272
+ package available at
273
+ <a href='https://github.com/gkellogg/earl-report' property='doap:homepage'>https://github.com/gkellogg/earl-report</a>
274
+ .
275
+ </p>
276
+ <p property='doap:developer' resource='http://greggkellogg.net/foaf#me' typeof='foaf:Person'>
277
+ This software is provided by
278
+ <a href='http://greggkellogg.net/' property='foaf:homepage'><span aboue='http://greggkellogg.net/foaf#me' property='foaf:name'>Gregg Kellogg</span></a>
279
+ in hopes that it might make the lives of conformance testers easier.
280
+ </p>
281
+ </section>
266
282
  </body>
267
283
  </html>
@@ -20,8 +20,13 @@
20
20
  "bibRef": {
21
21
  "@id": "dc:bibliographicCitation"
22
22
  },
23
+ "created": {
24
+ "@id": "doap:created",
25
+ "@type": "xsd:date"
26
+ },
23
27
  "description": {
24
- "@id": "dc:description"
28
+ "@id": "dc:description",
29
+ "@language": "en"
25
30
  },
26
31
  "developer": {
27
32
  "@id": "doap:developer",
@@ -29,18 +34,27 @@
29
34
  "@container": "@set"
30
35
  },
31
36
  "doapDesc": {
32
- "@id": "doap:description"
37
+ "@id": "doap:description",
38
+ "@language": "en"
39
+ },
40
+ "generatedBy": {
41
+ "@type": "@id"
33
42
  },
34
43
  "homepage": {
35
44
  "@id": "doap:homepage",
36
45
  "@type": "@id"
37
46
  },
38
47
  "label": {
39
- "@id": "rdfs:label"
48
+ "@id": "rdfs:label",
49
+ "@language": "en"
40
50
  },
41
51
  "language": {
42
52
  "@id": "doap:programming-language"
43
53
  },
54
+ "license": {
55
+ "@id": "doap:license",
56
+ "@type": "@id"
57
+ },
44
58
  "mode": {
45
59
  "@type": "@id"
46
60
  },
@@ -50,6 +64,14 @@
50
64
  "outcome": {
51
65
  "@type": "@id"
52
66
  },
67
+ "release": {
68
+ "@id": "doap:release",
69
+ "@type": "@id"
70
+ },
71
+ "shortdesc": {
72
+ "@id": "doap:shortdesc",
73
+ "@language": "en"
74
+ },
53
75
  "subject": {
54
76
  "@type": "@id"
55
77
  },
@@ -74,18 +96,41 @@
74
96
  },
75
97
  "title": {
76
98
  "@id": "dc:title"
99
+ },
100
+ "xsd": {
101
+ "@id": "http://www.w3.org/2001/XMLSchema#"
77
102
  }
78
103
  },
79
104
  "@id": "",
80
- "@type": [
81
- "earl:Software",
82
- "doap:Project"
83
- ],
105
+ "@type": "earl:Report",
106
+ "title": null,
107
+ "bibRef": null,
108
+ "generatedBy": {
109
+ "@id": "http://rubygems.org/gems/earl-report",
110
+ "@type": "doap:Project",
111
+ "name": "earl-report",
112
+ "shortdesc": "Earl Report summary generator",
113
+ "doapDesc": "Earl Report generates HTML+RDFa rollups of multiple EARL reports",
114
+ "homepage": "https://github.com/gkellogg/earl-report",
115
+ "language": "Ruby",
116
+ "license": "http://unlicense.org",
117
+ "release": {
118
+ "@id": "https://github.com/gkellogg/earl-report/tree/0.1.1",
119
+ "@type": "doap:Version",
120
+ "name": "earl-report-0.1.1",
121
+ "created": "2012-11-25",
122
+ "revision": "0.1.1"
123
+ },
124
+ "developer": {
125
+ "@type": "foaf:Person",
126
+ "@id": "http://greggkellogg.net/foaf#me",
127
+ "foaf:name": "Gregg Kellogg",
128
+ "foaf:homepage": "http://greggkellogg.net/"
129
+ }
130
+ },
84
131
  "assertions": [
85
132
  "test-files/report-complete.ttl"
86
133
  ],
87
- "name": "Turtle",
88
- "bibRef": "[[TURTLE]]",
89
134
  "testSubjects": [
90
135
  {
91
136
  "@id": "http://rubygems.org/gems/rdf-turtle",
@@ -133,7 +178,7 @@
133
178
  "testResult": "http://example/test-00.out"
134
179
  },
135
180
  {
136
- "@id": "_:g70363621872700",
181
+ "@id": "_:g70304060229600",
137
182
  "@type": [
138
183
  "earl:TestCriterion",
139
184
  "earl:TestCase"
@@ -143,7 +188,7 @@
143
188
  "assertions": [
144
189
  {
145
190
  "@type": "earl:Assertion",
146
- "test": "_:g70363621872700",
191
+ "test": "_:g70304060229600",
147
192
  "subject": "http://rubygems.org/gems/rdf-turtle",
148
193
  "result": {
149
194
  "@type": "earl:TestResult",
@@ -9,23 +9,38 @@
9
9
  @prefix xhv: <http://www.w3.org/1999/xhtml/vocab#> .
10
10
  @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
11
11
 
12
- <> a earl:Software, doap:Project;
13
- doap:homepage <>;
14
- doap:name "Turtle";
15
- dc:bibliographicCitation "[[TURTLE]]";
12
+
13
+ <> a earl:Report;
14
+ dc:title "";
15
+ dc:bibliographicCitation "";
16
+ earl:generatedBy <http://rubygems.org/gems/earl-report>;
16
17
  earl:assertions
17
18
  <test-files/report-complete.ttl>;
18
19
  earl:testSubjects (
19
20
  <http://rubygems.org/gems/rdf-turtle>);
20
21
  earl:tests (
21
22
  <http://example/manifest.ttl#testeval00>
22
- _:g70363621872700) .
23
+ _:g70304060229600) .
24
+
25
+
26
+
27
+ <http://rubygems.org/gems/earl-report> a earl:Software, doap:Project;
28
+ doap:name "earl-report";
29
+ doap:shortdesc "Earl Report summary generator"@en;
30
+ doap:description "EarlReport generates HTML+RDFa rollups of multiple EARL reports"@en;
31
+ doap:homepage <https://github.com/gkellogg/earl-report>;
32
+ doap:programming-language "Ruby";
33
+ doap:license <http://unlicense.org>;
34
+ doap:release <https://github.com/gkellogg/earl-report/tree/0.1.1>;
35
+ doap:developer <http://greggkellogg.net/foaf#me> .
36
+
37
+
23
38
  #
24
39
  # Subject Definitions
25
40
  #
26
41
  <http://rubygems.org/gems/rdf-turtle> a earl:TestSubject, doap:Project;
27
42
  doap:name "RDF::Turtle";
28
- doap:description """RDF::Turtle is an Turtle reader/writer for the RDF.rb library suite.""";
43
+ doap:description """RDF::Turtle is an Turtle reader/writer for the RDF.rb library suite."""@en;
29
44
  doap:programming-language "Ruby";
30
45
  .
31
46
 
@@ -41,7 +56,7 @@
41
56
  #
42
57
  <http://example/manifest.ttl#testeval00> a earl:TestCriterion, earl:TestCase;
43
58
  dc:title "subm-test-00";
44
- dc:description """Blank subject""";
59
+ dc:description """Blank subject"""@en;
45
60
  mf:result <http://example/test-00.out>;
46
61
  mf:action <http://example/test-00.ttl>;
47
62
  earl:assertions (
@@ -53,3 +68,15 @@
53
68
  earl:result [ a earl:TestResult; earl:outcome earl:passed ]]
54
69
  ) .
55
70
 
71
+ _:g70304060229600 a earl:TestCriterion, earl:TestCase;
72
+ dc:title "subm-test-01";
73
+ dc:description """@prefix and qnames"""@en;
74
+ mf:result <http://example/test-01.out>;
75
+ mf:action <http://example/test-01.ttl>;
76
+ earl:assertions (
77
+ [ a earl:Assertion;
78
+ earl:test _:g70304060229600;
79
+ earl:subject <http://rubygems.org/gems/rdf-turtle>;
80
+ earl:result [ a earl:TestResult; earl:outcome earl:untested ]]
81
+ ) .
82
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: earl-report
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -59,7 +59,7 @@ dependencies:
59
59
  - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: 2.8.0
62
- description: EarlReport generates HTML+RDFa rollups of multiple EARL report.
62
+ description: EarlReport generates HTML+RDFa rollups of multiple EARL reports.
63
63
  email: gregg@greggkellogg.net
64
64
  executables:
65
65
  - earl-report
@@ -68,6 +68,8 @@ extra_rdoc_files: []
68
68
  files:
69
69
  - README.md
70
70
  - VERSION
71
+ - lib/earl_report/version.rb
72
+ - lib/earl_report/views/earl_report.html.haml
71
73
  - lib/earl_report.rb
72
74
  - spec/earl_report_spec.rb
73
75
  - spec/spec_helper.rb