-
-
- require 'cgi'
- require 'digest'
- editors = [{ name: "Gregg Kellogg", url: "http://greggkellogg.net/"}]
- foaf = {name: "Gregg Kellogg", url: "http://greggkellogg.net/foaf#me" }
!!! 5
%html
- subjects = tests['testSubjects']
%head
%meta{"http-equiv" => "Content-Type", :content => "text/html;charset=utf-8"}
%link{rel: "alternate", href: "earl.jsonld"}
%link{rel: "stylesheet", href: "https://www.w3.org/StyleSheets/TR/base"}
- tests['assertions'].each do |file|
%link{rel: "related", href: file}
%title
JSON-LD 1.1 Processor Conformance
:css
span[property='dc:description rdfs:comment'] { display: none; }
td.PASS { color: green; }
td.FAIL { color: red; }
table.report {
border-width: 1px;
border-spacing: 2px;
border-style: outset;
border-color: gray;
border-collapse: separate;
background-color: white;
}
table.report th {
border-width: 1px;
padding: 1px;
border-style: inset;
border-color: gray;
background-color: white;
-moz-border-radius: ;
}
table.report td {
border-width: 1px;
padding: 1px;
border-style: inset;
border-color: gray;
background-color: white;
-moz-border-radius: ;
}
tr.summary {font-weight: bold;}
td.passed-all {color: green;}
td.passed-most {color: darkorange;}
td.passed-some {color: red;}
em.rfc2119 {
text-transform: lowercase;
font-variant: small-caps;
font-style: normal;
color: #900;
}
a.testlink {
color: inherit;
text-decoration: none;
}
a.testlink:hover {
text-decoration: underline;
}
pre > code {
color: #C83500;
}
.non-normative, .non-normative a:visited, .non-normative a:link {
color: gray;
}
#test-manifests .report td:last-child::before {
position: absolute;
left: 1em;
content: "X";
color: red;
font-weight: bold;
}
#test-manifests .report tr.summary td:last-child::before,
#test-manifests .report .PASS ~ td.PASS:last-child::before,
#test-manifests .report .PASS ~ .PASS ~ td:last-child::before {
display: none;
}
%body{prefix: "bibo: http://purl.org/ontology/bibo/ earl: http://www.w3.org/ns/earl# doap: http://usefulinc.com/ns/doap# mf: http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#", vocab: "http://www.w3.org/ns/earl#"}
- subject_refs = {}
- passed_tests = []
- subjects.each_with_index do |subject, index|
- frag_id = "subj_#{subject['name']}-#{subject['language']}".gsub(/[\W_]+/, '_')
- subject_refs[subject['@id']] = frag_id
%div.head{role: :contentinfo}
%p
%a{href: "http://www.w3.org/"}
%img{width: 72, height: 48, src: "https://www.w3.org/Icons/w3c_home", alt: "W3C"}
%h1.title.p-name#title{property: "dc:title"}
JSON-LD 1.1 Processor Conformance
%h2.subtitle
EARL results from the JSON-LD 1.1 Test Suite
%h2#w3c-document-28-october-2015
%time.dt-published{property: "dc:issued", datetime: Time.now.strftime('%Y-%m-%d')}
= Time.now.strftime("%d %B %Y")
%dl
%dt="Editor:"
- editors.each do |ed|
%dd{property: "bibo:editor", inlist: true}<>
%span{typeof: "foaf:Person"}<>
%meta{property: "foaf:name", content: ed[:name]}<>
%a{property: "foaf:homepage", href: ed[:url]}<>
= ed[:name]
%p
This document is also available in these non-normative formats:
%a{re: "alternate", href: "earl.jsonld"}="JSON-LD"
= "."
%p.copyright
%a{href: "http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"}
Copyright
© 2010-2019
%a{href: "http://www.w3.org/"}
%sup="®"
(
%a{href: "http://www.csail.mit.edu/"}<>
%abbr{title: "Massachusetts Institute of Technology"}<>="MIT"
= ", "
%a{href: "http://www.ercim.eu/"}<>
%abbr{title: "European Research Consortium for Informatics and Mathematics"}<>="ERCIM"
= ", "
%a{href: "http://www.keio.ac.jp/"}<>="Keio"
= ", "
%a{href: "http://ev.buaa.edu.cn/"}<>="Beihang"
).
%abbr{title: "World Wide Web Consortium"}="W3C"
%a{href: "http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer"}="liability"
= ","
%a{href: "http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks"}="trademark"
and
%a{rel: "license", href: "http://www.w3.org/Consortium/Legal/copyright-documents"}="document use"
rules apply.
%hr
%section#abstract
%h2="Abstract"
%p
This document report test subject conformance for and related specifications for
%span{property: "doap:name"}<="JSON-LD 1.1 Test Suite"
according to the requirements of the Evaluation and Report Language (EARL) 1.0 Schema
[
%a{href: "https://www.w3.org/TR/EARL10-Schema/"}<>="EARL10-SCHEMA"
].
%p
This report is also available in alternate formats:
%a{href: "earl.jsonld"}
JSON-LD
%section#sodt
%h2#h-sotd{resource: "#h-sotd"}
%span{property: "xhv:role", resource: "xhv:heading"}
Status of This Document
%p
This document is merely a
= " "
%abbr{title: "World Wide Web Consortium"}<>="W3C"
="-internal document."
It has no official standing of any kind and does not represent consensus of the
%abbr{title: "World Wide Web Consortium"}="W3C"
Membership.
%p
This report describes the state of implementation conformance at the time of publication.
%section#toc
%h2.introductory#h-toc{resource: "#h-toc"}
%span{property: "xhv:role", resource: "xhv:heading"}
Table of Contents
%ul.toc#respecContents{role: "directory"}
%li.tocline
%a.tocxref{href: "#introduction"}
%span.secno="1."
Introduction
%li.tocline
%a.tocxref{href: "#instructions-for-submitting-implementation-reports"}
%span.secno="2."
Instructions for submitting implementation reports
%li.tocline
%a.tocxref{href: "#test-manifests"}
%span.secno="3."
Test Manifests
%ul.toc
- tests['entries'].sort_by {|m| m['title'].to_s.downcase}.each_with_index do |manifest, ndx|
%li.tocline
%span.secno="3.#{ndx+1}"
%a.tocxref{href: "##{manifest['title'].gsub(' ', '-')}"}
~ manifest['title']
%li.tocline
%a.tocxref{href: "#test-subjects"}
%span.secno="A."
Test Subjects
%ul.toc
- subjects.each_with_index do |subject, ndx|
%li.tocline
%span.secno="A.#{ndx+1}"
%a.tocxref{href: "#" + subject_refs[subject['@id']]}
= subject['name']
- if subject['language']
= " (#{subject['language']})"
%li.tocline
%a.tocxref{href: "#individual-test-results"}
%span.secno="B."
Individual Test Results
%li.tocline
%a.tocxref{href: "#report-generation-software"}
%span.secno="C."
Report Generation Software
%section#introduction
:markdown
## Introduction
This implementation report covers the implementations of the JSON-LD
specifications which have submitted test results. It is intended to be
maintained by the [JSON for Linking Data Community Group](https://www.w3.org/community/json-ld/),
or a JSON-LD Working Group if one is active.
The implementation report serves two purposes:
1. To demonstrate that there are multiple, independent implementations of
the specifications. This is a prerequisite for progression of any
standard to Recommendation.
2. To catalog the known, conforming implementations and which features
each supports.
There are other [JSON-LD implementations](http://json-ld.org/#developers) which are not listed in this
report, either due to not submitting tests or by not being intended as
direct implementations of the specification, but instead layering on
top of such libraries. For a broader list of implementations, please
see the [JSON-LD Website](https://json-ld.org/).
%section#instructions-for-submitting-implementation-reports
:markdown
## Instructions for submitting implementation reports
Reports should be submitted in Turtle format to
[Public JSON-LD WG](mailto:public-json-ld-wg@w3.org) or via a Pull
Request to the [w3c/json-ld-api](https://github.com/w3c/json-ld-api/pulls).
Tests should be run using the test manifests defined in the
[Test Manifests](#test-manifests) Section.
The assumed base URI for the tests is `<http://example/base/>` if needed.
Include an `earl:Assertion` for each test, referencing the test
resource from the associated manifest and the test subject being
reported upon. See the example below:
[ a earl:Assertion;
earl:assertedBy <--your-developer-identifier-->;
earl:subject <--your-software-identifier-->;
earl:test <--uri-of-test-from-manifest>;
earl:result [
a earl:TestResult;
earl:outcome earl:passed;
dc:date "2016-12-26T10:18:04-08:00"^^xsd:dateTime];
earl:mode earl:automatic ] .
The Test Subject should be defined as a `doap:Project`, including the name,
homepage and developer(s) of the software (see [DOAP](https://github.com/edumbill/doap/wiki)). Optionally, including the
project description and programming language. An example test subject description is the following:
<> foaf:primaryTopic <--your-software-identifier--> ;
dc:issued "2016-12-26T10:18:04-08:00"^^xsd:dateTime ;
foaf:maker <--your-developer-identifier--> .
<--your-software-identifier--> a doap:Project, earl:TestSubject, earl:Software ;
doap:name "My Cool JSON-LD Parser" ;
doap:release [
doap:name "--short name wih version number--";
doap:revision "--Software version number--" ;
doap:created "2020-02-19"^^xsd:date;
] ;
doap:developer <--your-developer-identifier--> ;
doap:homepage <--your-software-homepace--> ;
doap:description "--your-project-description--"@en ;
doap:programming-language "--your-implementation-language--" .
The software developer, either an organization or one or more individuals SHOULD be
referenced from `doap:developer` using [FOAF](http://xmlns.com/foaf/spec). For example:
<--your-developer-identifier--> a foaf:Person, earl:Assertor;
foaf:name "--My Name--";
foaf:homepage <--my homepage--> .
%section#test-manifests
%h2
%span.secno="3."
Test Manifests
- tests['entries'].sort_by {|m| m['title'].to_s.downcase}.each_with_index do |manifest, ndx2|
- test_cases = manifest['entries']
%section{id: manifest['title'].gsub(' ', '-')}
%h2
%span.secno="3.#{ndx2+1}"
%span<
= manifest['title'] || 'Test Manifest'
- Array(manifest['rdfs:comment']).each do |desc|
- desc = desc['@value'] if desc.is_a?(Hash)
:markdown
#{desc}
%table.report
- skip_subject = {}
- passed_tests[ndx2] = []
%tr
%th
Test
- subjects.each_with_index do |subject, index|
-
- skip_subject[subject['@id']] = manifest['entries'].all? {|t| t['assertions'][index]['result']['outcome'] == 'earl:untested'}
- unless skip_subject[subject['@id']]
%th
%a{href: '#' + subject_refs[subject['@id']]}
= subject['name']
- if subject['language']
%br
= "(#{subject['language']})"
- test_cases.each do |test|
- test['title'] ||= test['rdfs:label']
- test['title'] = Array(test['title']).first
- option = test.fetch('https://w3c.github.io/json-ld-api/tests/vocab#option', {})
- normative = option.fetch('https://w3c.github.io/json-ld-api/tests/vocab#normative', {"@value" => "true"})['@value'] == 'true'
%tr{class: normative ? 'normative' : 'non-normative'}
%td
%a{href: test['@id']}<
= "Test #{test['@id'].split("#").last}: #{CGI.escapeHTML test['title'].to_s}"
- other = []
- if option['https://w3c.github.io/json-ld-api/tests/vocab#specVersion'] == 'json-ld-1.1'
- other << "new in JSON-LD 1.1"
- if option['https://w3c.github.io/json-ld-api/tests/vocab#processorFeature']
- other << "feature: #{option['https://w3c.github.io/json-ld-api/tests/vocab#processorFeature']}"
- if !normative
- other << "non-normative"
- unless other.empty?
= "(#{other.join(', ')})"
-
- subjects.each_with_index do |subject, ndx|
- next if skip_subject[subject['@id']]
- assertion = test['assertions'].detect {|a| a['subject'] == subject['@id']}
- pass_fail = assertion['result']['outcome'].split(':').last.upcase.sub(/(PASS|FAIL)ED$/, '\1')
- passed_tests[ndx2][ndx] = (passed_tests[ndx2][ndx] || 0) + (pass_fail == 'PASS' ? 1 : 0)
%td{class: pass_fail}
= pass_fail
%tr.summary
%td
= "Percentage passed out of #{manifest['entries'].length} Tests"
- passed_tests[ndx2].compact.each do |r|
- pct = (r * 100.0) / manifest['entries'].length
%td{class: (pct == 100.0 ? 'passed-all' : (pct >= 95.0 ? 'passed-most' : 'passed-some'))}
= "#{'%.1f' % pct}%"
%section.appendix#test-subjects
%h2
%span.secno="A."
Test Subjects
%p
This report was tested using the following test subjects:
%dl
- subjects.each_with_index do |subject, index|
%dt{id: subject_refs[subject['@id']]}
%span.secno="A.#{index+1}"
%a{href: subject['@id']}
%span{about: subject['@id'], property: "doap:name"}<= subject['name']
%dd
%dl
- if subject['doapDesc']
- subject['doapDesc'] = subject['doapDesc']['@value'] if subject['doapDesc'].is_a?(Hash)
%dt= "Description"
%dd{property: "doap:description", lang: 'en'}<
~ CGI.escapeHTML subject['doapDesc']
- if subject['release']
- subject['release'] = subject['release'].first if subject['release'].is_a?(Array)
- subject['release']['revision'] = subject['release']['revision']['@value'] if subject['release']['revision'].is_a?(Hash)
%dt= "Release"
%dd{property: "doap:release"}<
%span{property: "doap:revision"}<
~ CGI.escapeHTML subject['release']['revision'].to_s
- if subject['language']
- subject['language'] = subject['language']['@value'] if subject['language'].is_a?(Hash)
%dt= "Programming Language"
%dd{property: "doap:programming-language"}<
~ CGI.escapeHTML subject['language'].to_s
- if subject['homepage']
%dt= "Home Page"
%dd
%a{property: "doap:homepage", href: subject['homepage']}
~ CGI.escapeHTML subject['homepage'].to_s
- if subject['developer']
%dt= "Developer"
- subject['developer'].each do |dev|
%dd{rel: "doap:developer"}
%div
- if dev.has_key?('@id')
%a{href: dev['@id']}
%span{property: "foaf:name"}<
~ CGI.escapeHTML dev['foaf:name'].to_s
- else
%span{property: "foaf:name"}<
- if dev['foaf:homepage']
%a{property: "foaf:homepage", href: dev['foaf:homepage']}
~ CGI.escapeHTML dev['foaf:homepage'].is_a?(Hash) ? dev['foaf:homepage']['@id'] : dev['foaf:homepage']
%dt
Test Suite Compliance
%dd
%table.report
%tbody
- tests['entries'].sort_by {|m| m['title'].to_s.downcase}.each_with_index do |manifest, ndx|
- passed = passed_tests[ndx][index].to_i
- next if passed == 0
- total = manifest['entries'].length
- pct = (passed * 100.0) / total
%tr
%td
~ manifest['title']
%td{class: (pct == 100.0 ? 'passed-all' : (pct >= 85.0 ? 'passed-most' : 'passed-some'))}
= "#{passed}/#{total} (#{'%.1f' % pct}%)"
- unless tests['assertions'].empty?
%section.appendix#individual-test-results{rel: "xhv:related earl:assertions"}
%h2
%span.secno="B."
Individual Test Results
%p
Individual test results used to construct this report are available here:
%ul
- tests['assertions'].each do |file|
%li
%a.source{href: file}<= file
%section.appendix#report-generation-software{property: "earl:generatedBy", resource: tests['generatedBy']['@id'], typeof: tests['generatedBy']['@type'].join(' ')}
%h2
%span.secno="C."
Report Generation Software
- doap = tests['generatedBy']
- rel = doap['release']
%p
This report generated by
%span{property: "doap:name"}<
%a{href: tests['generatedBy']['@id']}<
= doap['name']
%meta{property: "doap:shortdesc", content: doap['shortdesc']}
%meta{property: "doap:description", content: doap['doapDesc']}
version
%span{property: "doap:release", resource: rel['@id'], typeof: 'doap:Version'}
%span{property: "doap:revision"}<=rel['revision']
%meta{property: "doap:name", content: rel['name']}
%meta{property: "doap:created", content: rel['created'], datatype: "xsd:date"}
is a
%span{property: "doap:programming-language"}<="Ruby"
application freely available under the generous terms of the
= " "
%a{property: "doap:license", href: doap['license']}<>="Unlicense"
= "."
More information is available at
%a{property: "doap:homepage", href: doap['homepage']}<=doap['homepage']
= "."
%p{property: "doap:developer", resource: "http://greggkellogg.net/foaf#me", typeof: "foaf:Person"}
This software is provided by
%a{property: "foaf:homepage", href: "http://greggkellogg.net/"}<
%span{about: "http://greggkellogg.net/foaf#me", property: "foaf:name"}<
Gregg Kellogg
in hopes that it might make the lives of conformance testers easier.