Copyright © 2006-2007 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark and document use rules apply.
This document describes and includes test cases for software agents that extract RDF from XML source documents by following the set of mechanisms outlined in the Gleaning Resource Description from Dialects of Language (GRDDL) specification. They demonstrate the expected behavior of a GRDDL-aware agent by specifying one (or more) RDF graph serializations which are the GRDDL results associated with a single source document.
This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.
This is a First Public Working Draft of the GRDDL Test Cases. This document was developed by the GRDDL Working Group, which was chartered in July 2006 to review the specification and develop use cases, tutorial materials, and tests.
Please send comments about this document to public-grddl-comments@w3.org (with public archive). A log of changes is maintained for the convenience of editors and reviewers.
Publication as a Working Draft does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.
This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.
A set of test cases is provided as part of the definition of [GRDDL]. This document presents those test cases. They are intended to provide examples for, and clarification of, the normative behavior of a GRDDL-aware agent. They should be used for testing the conformance of GRDDL-aware agents. The normative tests cover behavior expected of a GRDDL-aware agent. The informative tests demonstrate other permitted behavior with respect to the issues resolved by the Working Group. This document itself has (as a GRDDL result) a manifest describing the test cases in RDF. - For convenience, serializations of the GRDDL result are available as RDF/XML and Turtle.
Note: the zip archive does not include tests which require network connectivity in order to properly calculate their GRDDL results.
This test collection uses an RDF vocabulary for manifests developed for the RDF Test Cases Recommendation. A GRDDL-aware agent can extract the test collection and automatically test compliance by attempting to reproduce the expected GRDDL result(s) associated with each test case. Some input documents have multiple output documents, see below
We provide testft.py, a test driver, written in Python and based on rdflib 2.3.3. Run it a la:
$ python testft.py --run your_grddl_impl testlist1.rdf >earl_out.rdf All tests were passed!
It has options for --debug and such; invoke it with no arguments (or with --help) for details:
Options: -r, --run path to a GRDDL implementation to use to process the source document (checking results) -u, --update path to a GRDDL Implementation to use to process the source document --tester The URI of an agent associated with the EARL test assertions. A BNode is used if none is given --project The URI of the EARL 'subject' (the implementation being tested). A BNode is used if none is given
The tests do not require the use of this driver
In addition to writing various diagnostic messages to STDERR, the test harness writes additional RDF data to STDOUT: an [EARL] test assertion about each test it runs.
To tell it about the person running the tests and the software project being tested, point it to a tester (a URI in a [FOAF] RDF graph) and a test subject (a URI in a [DOAP] RDF graph).
We find TCPWatch useful for debugging [HTTP] protocol interactions. If you start TCPWatch like so:
$ python tcpwatch.py -p 6543 &
then you can use it as a proxy:
$ http_proxy=http://127.0.0.1:6543 python testft.py --run your_grddl_impl testharness.rdf
A library of standard transforms is available for widespread use by authors
The GRDDL specification states that any transformation identified by an author of a GRDDL source document will provide a Faithful Rendition of the information expressed in the source document. The specification also grants a GRDDL-aware agent the license to makes a determination of whether or not to apply a particular transformation guided by user interaction, a local security policy, or the agent's capabilities. However, for the purpose of running these tests in order to determine compliance, a GRDDL-aware agent with a security policy which does not prevent it from applying transformations identified by each test will produce the GRDDL result associated with each test.
Certain tests have multiple GRDDL results as a direct consequence of Faithful Infoset considerations, information resources with multiple representations, and seperate GRDDL mechanisms which produce distinct GRDDL results. For such tests, A GRDDL-aware agent should output at least one of the GRDDL results associated with the test case.
Each test has an input document and an output document. the output document is an RDF/XML document and represents a GRDDL result of the input document.
For the sake of convenience, this first set of normative tests cover simple scenarios where neither namespace documents nor absolute URIs are used. Such tests can run offline rather easily.
approval: 2006-11-22
approval: 2006-11-22
This test case uses an inline GRDDL transformation reference (i.e.
within an a
element) instead of one within a
link
element. It also exercises the fact that the
rel
attribute can take multiple space-separated values, and
only one of them needs to be equal to transformation
to
indicate that the resource is in fact a GRDDL transformation.
The base URI for the result document is the URI of the source document.
These tests include the use of namespace documents and absolute URIs and are more difficult to run offline.
The namespace document is an RDF document served as mimetype application/xml+rdf.
These tests help check for robustness of implementations in the face of various odd cases.
In this test case, the input file uses XInclude to include xinclude2.xml, and that the output has only one triple unless the XML Processor of the GRDDL implementation implements XInclude. The output for this case assumes that the processor does resolve XIncludes. Note, however, that this test case subsumes the XInclude disabled test case, which assumes that the GRDDL implementation has disabled XInclude processing.
This test case is an alternative to the XInclude enabled test case. The output for this case assumes that the processor does not resolve XIncludes, which may lead to a different GRDDL result.
Note that the input is a RDF document with a GRDDL transformation, and that according to the rules given by the GRDDL Specification, there are three distinct and equally valid output graphs for this test for this document. An implementation only has to produce one of these three. This output is the result of the transformation without merging it with the graph of the source document.
This output is a graph that is identical with the graph given by the input document.
This output is a graph that is merge of the graph given by the source document with the graph given by the result of the GRDDL transformation.
This section includes tests not covered explicitely by the normative text of the GRDDL but demonstrate additional behavior that a GRDDL-aware agent may exhibit. They reflect behavior suggested by the Working Group as a result of resolving certain issues.
This test demonstrates an informative resolution to the issue-output-formats issue with an XSLT GRDDL transformation which outputs a [TURTLE] RDF graph serialization associated with an appropriate media-type (text/rdf+n3) via XSLT's output element.
This test exists to bring attention to developers to issues of content negotiation, in particular, content negotiation over language as described and implemented by W3C QA. There are two valid resulting GRDDL results of running this GRDDL transformation depending on what language the GRDDL-aware agent uses, and an implementation of a GRDDL-aware agent only needs to retrieve the one that is appropriate for its HTTP header request. This result follows from retrieving a English version of the HTML representation and thus having the GRDDL result produce a result with English-language content.
This result follows from retrieving a German version of the HTML representation and thus having the GRDDL result produce a result with German-language content.
This test differs from the previous example of applying GRDDL to an RDF/XML document in that the RDF file is served (not best practice, but rather common) as media-type "application/xml". The output is the result of the transformation without merging it with the graph of the source document.
The output is a graph that is identical with the graph given by the input document.
The output is a graph that is merge of the graph given by the source document with the graph given by the result of the GRDDL transformation
The editor thankfully acknowledges the contributions of the following Working Group members:
Changes since the Working Groups decision to publish on 7 March:
$Log: Overview.html,v $ Revision 1.4 2018/10/09 13:16:36 denis fix validation of xhtml documents Revision 1.3 2017/10/02 10:34:37 denis add fixup.js to old specs Revision 1.2 2007/03/28 14:31:48 jean-gui IPP Revision 1.11 2007/03/27 23:28:43 cogbuji fixed patent policy link Revision 1.10 2007/03/24 19:25:06 cogbuji more pubrules fixes: ids for references headings, fixed cascade of css Revision 1.9 2007/03/24 05:48:34 cogbuji removed recursive log directive Revision 1.8 2007/03/24 05:45:47 cogbuji fixed change log link and added retrospective change log entries Revision 1.7 2007/03/24 05:42:42 cogbuji fixed changelog entries Revision 1.6 2007/03/24 05:09:36 cogbuji; fixed broken links to manifest files Revision 1.5 2007/03/24 04:59:19 cogbuji added SOTD and fixed css for WD (per pubrules) Revision 1.4 2007/03/24 04:39:30 cogbuji various XHTML validity modifications, synched up with deprecated doc50/grddl-tests.html (which was subject of WG approval), and other pre-transtion pubrules checks