You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: index.html
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -61,6 +61,8 @@ <h2>Overview</h2>
61
61
<li>After running all tests, you can generate an <ahref="">EARL Report</a> using the <buttonclass='btn btn-primary btn-sm'>EARL Report</button> button.</li>
62
62
</ul>
63
63
<p>So that the test suite can access the processor to request resources, please be sure to add <code>Access-Control-Allow-Origin: *</code> to returned HTTP headers.</p>
64
+
<pclass="text-warning">Due to differences in how browsers implement XMLHTTPRequest, some tests may not run properly on browsers other than WebKit or Firefox.</p>
65
+
<p>See <ahref="{{ base_url }}/test-suite/suite-details">this page</a> for more information on the design of the test suite and how to create a processor end-point.</p>
<p>The RDFa Test Suite is a set of Web Services, markup and tests that can
12
+
be used to verify RDFa Processor conformance to the set of specifications
13
+
that constitute RDFa 1.1. The goal of the suite is to provide an easy and
14
+
comprehensive RDFa testing solution for developers creating RDFa Processors.</p>
15
+
16
+
<h2id="design">Design</h2>
17
+
18
+
<p>The RDFa Test suite allows developers to mix and match RDFa processor endpoints
19
+
with different RDFa versions and Host Languages.</p>
20
+
21
+
<p>The RDFa Test Suite is an single-page HTML application driving the entire
22
+
process.</p>
23
+
24
+
<p>The page is loaded with the complete lists of tests associated with different RDFa versions and host languages.
25
+
To execute a test, the application uses the <code>processorUrl</code> and appends URI query parameters identifying the test source and other necessary parameters, upon which the processor will return the parsed RDF represented as either <ahref="">N-Triples</a> or <ahref="">Turtle</a>. As the processor executes in HTML, it is important that the processor return the header <code>Access-Control-Allow-Origin: *</code>.
26
+
The application also fetches an associated SPARQL query, which
27
+
uses an <em>ASK</em> form to return true or false.</p>
28
+
29
+
<p>The test-suite is implemented using <ahref="https://en.wikipedia.org/wiki/JavaScript">JavaScript</a> and <ahref="https://github.com/linkeddata/rdflib.js/">rdflib.js</a>.
30
+
The user interface is implemented in JavaScript using
31
+
<ahref="http://twitter.github.com/bootstrap/">Bootstrap.js</a> and <ahref="http://documentcloud.github.com/backbone/">Backbone.js</a>.</p>
32
+
33
+
<p>The test files are managed statically using <ahref="https://jekyllrb.com">Jekyll</a> with a <ahref="https://en.wikipedia.org/wiki/Rake_(software">Rake task</a>) used to build version- and language-specific test files.</p>
34
+
35
+
<p>The HTML application is implemented principally in JavaScript using <ahref="http://documentcloud.github.com/backbone/">Backbone.js</a> as a model-viewer-controller, which downloads the test suite manifest and creates a simple user interface using <ahref="http://twitter.github.com/bootstrap/">Bootstrap.js</a> to run tests, or get test details.</p>
36
+
37
+
<p>Processing happens in the following order:</p>
38
+
39
+
<pre><code>RDFa Test Suite | RDFa Website | RDFa Processor
40
+
load webpage ->
41
+
<- test scaffold
42
+
load manifest ->
43
+
<- JSON-LD manifest
44
+
run test -> Load SPARQL query.
45
+
-> Process referenced
46
+
test document and
47
+
return RDF with
48
+
Content-Type indicating
49
+
<- format.
50
+
SPARQL runs with
51
+
returned document
52
+
returning _true_
53
+
or _false_.
54
+
55
+
display results
56
+
</code></pre>
57
+
58
+
<h2id="running_the_test_suite">Running the test suite</h2>
59
+
60
+
<p>You can view and run this test suite at the following URL:</p>
<h2id="how_to_add_a_unit_test">How to add a unit test</h2>
65
+
66
+
<p>In order to add a unit test, you must follow these steps:</p>
67
+
68
+
<ol>
69
+
<li>Pick a new unit test number. For example - 250. To be consistent, please use
70
+
the next available unit test number.</li>
71
+
<li>Create a markup file in the tests/ directory with a .txt extension.
72
+
For example: tests/250.txt</li>
73
+
<li>Create a SPARQL query file in the tests/ directory with a .sparql extension.
74
+
For example: tests/250.sparql</li>
75
+
<li>Add your test to manifest.ttl and indicate the host language(s) and version(s) for which
76
+
it applies. For example, if you would like your example to only apply to HTML4,
77
+
you would specify <code>rdfatest:hostLanguage "html4";</code> in the test case entry.</li>
78
+
</ol>
79
+
80
+
<p>There are three classifications for Unit Tests:</p>
81
+
82
+
<ul>
83
+
<li>required - These are tests that are required for proper operation per the
84
+
appropriate RDFa specification.</li>
85
+
<li>optional - These are tests for optional features supported by some RDFa
86
+
Processors.</li>
87
+
<li>buggy - These are tests that are buggy or are not considered valid test
88
+
cases by all RDFa processor maintainers.</li>
89
+
</ul>
90
+
91
+
<p>The test suite is designed to empower RDFa processor maintainers to create
92
+
and add tests as they see fit. This may mean that the test suite may become
93
+
unstable from time to time, but this approach has been taken so that the
94
+
long-term goal of having a comprehensive test suite for RDFa can be achieved
95
+
by the RDFa community.</p>
96
+
97
+
<p>When running locally, after adding a unit test, run <code>rake cache:clear</code> to remove cached files and ensure that necessary HTTP resources are regenerated. For the deployed website, this happens automatically each time a Git commit is pushed to the server.</p>
98
+
99
+
<h2id="how_to_create_a_processor_endpoint">How to create a processor endpoint.</h2>
100
+
101
+
<p>The Test Suite operates by making a call to a <em>processor endpoint</em> with a query parameter that indicates
102
+
the URL of the test document to be processed. Within the test suite, a text box (upper right-hand corner)
103
+
allows a processor endpoint to be selected or added manually. It is presumed that the endpoint URL ends
104
+
with a query parameter to which a test URL can be appended. For example, the <em>pyrdfa</em> endpoint is
105
+
defined as follows: <code>http://www.w3.org/2012/pyRdfa/extract?uri=</code>. When invoked, the URL of an actual
<p>The <code>doap</code> is the IRI defining the processor. It should be an information resource resulting in a
190
+
<ahref="https://github.com/edumbill/doap/wiki">DOAP</a> project description, and will be used when formatting reports.</p>
191
+
192
+
<p>If the DOAP project description location differs from the identifying IRI, set that location in <code>doap_url</code></p>
193
+
194
+
<h2id="document_caching">Document caching</h2>
195
+
196
+
<p>Test cases are provided with HTTP ETag headers and expiration values.
197
+
Processors <em>MAY</em> cache test case documents but <em>MUST</em> validate the document using HTTP HEAD or conditional GET
198
+
operations.</p>
199
+
200
+
<h2id="crazy_ivan">Crazy Ivan</h2>
201
+
202
+
<p>The test suite is termed <em>Crazy Ivan</em> because of an unusual maneuver popularized in <ahref="http://www.imdb.com/title/tt0099810/quotes?qt=qt0458296">The Hunt for Red October</a>
203
+
and <ahref="http://www.youtube.com/watch?v=Oi6BLxusAM8">Firefly</a>. It is a term used to detect problems that are hiding, which is what the test suite.</p>
204
+
205
+
<blockquote>
206
+
<p>Seaman Jones: Conn, sonar! Crazy Ivan!
207
+
Capt. Bart Mancuso: All stop! Quick quiet! [the ships engines are shut down completely]
208
+
Beaumont: What’s goin’ on?
209
+
Seaman Jones: Russian captains sometime turn suddenly to see if anyone’s behind them. We call it “Crazy Ivan.” The only thing you can do is go dead. Shut everything down and make like a hole in the water.
210
+
Beaumont: So what’s the catch?
211
+
Seaman Jones: The catch is, a boat this big doesn’t exactly stop on a dime… and if we’re too close, we’ll drift right into the back of him. </p>
212
+
</blockquote>
213
+
214
+
<h1id="contributing">Contributing</h1>
215
+
216
+
<p>If you would like to contribute a to the website, include an additional
217
+
test suite processor endpoint, contribute a new test or to a fix to an existing test,
218
+
please follow these steps:</p>
219
+
220
+
<ol>
221
+
<li>Notify the RDFa mailing list, public-rdf-wg@w3.org,
222
+
that you will be creating a new test or fix and the purpose of the
223
+
change.</li>
224
+
<li>Clone the git repository: <ahref="https://github.com/rdfa/rdfa-website">git://github.com/rdfa/rdfa-website.git</a>.</li>
225
+
<li>Make your changes and submit them via github, or via a ‘git format-patch’
226
+
to the RDFa mailing list.</li>
227
+
</ol>
228
+
229
+
<p>Optionally, you can ask for direct access to the repository and may make
230
+
changes directly to the RDFa Website source code. All updates to the test
231
+
suite go live within seconds of pushing changes to github via a WebHook call.</p>
<p>The JavaScript and CSS files are minimized into cached assets. Any change to CSS or JavaScript files
236
+
requires that the assets be re-compiled. This can be done as follows:</p>
237
+
238
+
<pre><code>rake assets:precompile
239
+
</code></pre>
240
+
241
+
<p>Make sure to do this before committing changes that involve any CSS or JavaScript contained within <code>file:public/stylesheets</code> or <code>public/javascripts</code>.</p>
0 commit comments