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.
The tests are meant to satisfy the requirement for test cases covering all GRDDL features and library transformations as outlined in the GRDDL Working Group charter. They should be used for testing the conformance of GRDDL-aware agents. The normative tests cover the required behavior expected of a GRDDL-aware agent. The informative tests demonstrate expected behavior with respect to the issues resolved by the Working Group as well as other tests of robustness for software agents which consume source documents within a Semantic Web and generate GRDDL results. This document itself has (as a GRDDL result) a manifest document describing the test cases in RDF.
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.
We provide testft.py, a test driver, based on rdflib 2.3.3 and 4suite, specifically 4Suite-XML-1.0.tar.gz. Run it a la:
$ python testft.py --run your_grddl_impl
testlist1.rdf >earl_out.rdf
All tests were
passed!
@@ NOTE: testft.py currently only depends on rdflib 2.3.3
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
In addition to writing various diagnostic messages to STDERR, the test harness writes additional RDF data to STDOUT: an EARL 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.rdfThe 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.
@TODO: The manifest needs a vocabulary to describe test alternatives beyond what the RDF Test vocabulary provides.
These tests address the functional requirements of the various ways in which GRDDL mandates the extraction of a GRDDL result.
For the sake of convenience, these first set of normative tests cover 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.
These tests include the use of namespace documents and absolute URIs and are much more difficult to run offline.
@@Why (?nsDoc grddl:namspaceTransformation <http://dev.w3.org/cvsweb/~checkout~/2005/grddl-ts/sq1t.xsl>) - i.e., absolute URI?
These tests help check for robustness of implementations in the face of various odd cases.
@@ACK: thanks Gokhan Soydan
@@Does this work on Xalan and Saxon??@@
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.
See also issue-mt-ns.
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.
See the explanation of having three valid outputs for this test case. This output is a graph that is identical with the graph given by the input document.
See the explanation of having three valid outputs for this test case. 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.
See the explanation of having three valid outputs for this test case. This differs from that test case 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.
See the explanation of having three valid outputs for this test case. This differs from that test case in that the RDF file is served (not best practice, but rather common) as media-type "application/xml". The output is a graph that is identical with the graph given by the input document.
See the explanation of having three valid outputs for this test case. This differs from that test case in that the RDF file is served (not best practice, but rather common) as media-type "application/xml". 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
These tests cover features not mandated explicitely by the GRDDL specification, but demonstrate behavior expected of a GRDDL-aware agent in the context of Web Architecture best practices (@@Appropriate [WEBARCH] link?). They also cover behavior suggested by the Working Group as a result of resolving certain issues.
@@TODO: How to reconcile current (approved but informative) status of the Atom / Turtle test? - There was appreciable consensus on mentioning RDF graphs not RDF/XML documents
Note the transformation, atom2turtle_xslt-1.0.xsl, gives an RDF graph using turtle rather than RDF/XML. This test uses the text/rdf+n3 media type, which should appear in the IANA list of text media types in due course. See also the SPARQL CR request of Apr 2006.
See also: Atom/RDF in progress Aug 2006 by David Powell.
APPROVED in 24 Jan discussion of #issue-output-formats
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.
See the explanation of having two valid outputs for this test case. 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.
@@Need references
@@Need comprehensive list of acknowledgements