Please refer to the errata for this document, which may include some normative corrections.
See also translations.
Copyright © 2004 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark, document use and software licensing rules apply.
This document describes the RDF Test Cases deliverable for the RDF Core Working Group as defined in the Working Group's Charter.
This document has been reviewed by W3C Members and other interested parties, and it has been endorsed by the Director as a W3C Recommendation. W3C's role in making the Recommendation is to draw attention to the specification and to promote its widespread deployment. This enhances the functionality and interoperability of the Web.
This is one document in a set of six (Primer, Concepts, Syntax, Semantics, Vocabulary, and Test Cases) intended to jointly replace the original Resource Description Framework specifications, RDF Model and Syntax (1999 Recommendation) and RDF Schema (2000 Candidate Recommendation). It has been developed by the RDF Core Working Group as part of the W3C Semantic Web Activity (Activity Statement, Group Charter) for publication on 10 February 2004.
Changes to this document since the Proposed Recommendation Working Draft are detailed in the change log.
The public is invited to send comments to www-rdf-comments@w3.org (archive) and to participate in general discussion of related technology on www-rdf-interest@w3.org (archive).
A list of implementations is available.
The W3C maintains a list of any patent disclosures related to this work.
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/.
One of the deliverables specified in Charter of the RDF Core Working Group is: a set of machine-processable test cases corresponding to technical issues addressed by the Working Group. This document describes the test cases that fulfill that deliverable but it does not contain the test cases themselves. The test cases are available at http://www.w3.org/2000/10/rdf-tests/rdfcore/.
The RDF Interest Group and other members of the RDF community have identified issues/ambiguities in the [RDFMS] Specification and the [RDF-SCHEMA] Candidate Recommendation. These issues have been collected and categorized in the RDF Core Working Group Issue Tracking document. The RDF Core Working Group uses this issue list to guide its work. The issues list is a working document; it is updated as new issues are identified. It is updated as the Working Group makes decisions as documented in the Attention Developers section of the document.
The complete specification of RDF consists of a number of documents:
A comprehensive and complete test suite for RDF should cover all of the rules in the Formal Grammar for RDF. The Working Group, however, is not chartered to deliver such a test suite but rather to create test cases for the issues the Working Group addresses (when applicable). Although the Working Group will not create test cases for some grammar rules (e.g. rule [6.1]), if such test cases are donated to the W3C the Consortium may add such test cases to this set of test cases.
The RDF Errata documents known errors in [RDFMS]. Since errata are considered normative changes to a W3C Specification and Working Group decisions are not normative until a specification is a W3C Recommendation, none of the decisions made by the RDF Core Working Group have (to date) been reflected in the errata.
The Test Case Repository [REPOSITORY] contains subdirectories, each containing test cases devoted to a single issue. Each directory contains a manifest file describing the tests in that directory. Where an issue originated with the RDF Issue Tracking process [ISSUES], the manifest will indicate this fact.
The Test Case Repository contains ZIP files of all Approved test cases [APPROVED] as well as a ZIP archive of all Approved and Not Approved test cases [FULLTESTS]
The Manifest file [MANIFEST] contains a machine-readable manifest of the test cases. The format of this file is described below.
The manifest file [MANIFEST] contains a machine-readable description of the test cases in RDF/XML. Care has been taken to ensure that this file follows a simple format to assist in machine-processing the test cases.
The file consists of a simple header [MANIFEST-HEAD], individual descriptions of the test cases, and a closing footer [MANIFEST-TAIL].
The test cases are divided into the following categories:
<test:PositiveParserTest rdf:about="http://w3.example.org/test001">
<test:issue rdf:resource="http://w3.example.org/rdf-tracking/#example1" />
<test:status>APPROVED</test:status>
<test:approval rdf:resource="http://rdfcore.example.org/archives/001.html" />
<test:description>
This is a simple positive parser test example.
</test:description>
<test:inputDocument>
<test:RDF-XML-Document rdf:about="http://w3.example.org/test001.rdf" />
</test:inputDocument>
<test:outputDocument>
<test:NT-Document rdf:about="http://w3.example.org/test001.nt" />
</test:outputDocument>
<test:warning>Some parsers may produce a warning when running this test</test:warning>
</test:PositiveParserTest>
<test:NegativeParserTest rdf:about="http://w3.example.org/error001">
<test:issue rdf:resource="http://w3.example.org/rdf-tracking/#example1" />
<test:status>APPROVED</test:status>
<test:inputDocument>
<test:RDF-XML-Document rdf:about="http://w3.example.org/error001.rdf" />
</test:inputDocument>
</test:NegativeParserTest>
<test:entailmentRules rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#" />then the test succeeds if the entailment holds according to the rules of RDF-entailment as specified in [RDF-SEMANTICS]. If the following two elements are present
<test:entailmentRules rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#" />
<test:entailmentRules rdf:resource="http://www.w3.org/2000/01/rdf-schema#" />
then the test succeeds if the entailment holds according to the
rules of RDFS-entailment as specified in [RDF-SEMANTICS].
For test cases that use simple entailment, the following marker
is used:
<test:entailmentRules rdf:resource="http://www.w3.org/2000/10/rdf-tests/rdfcore/testSchema#simpleEntailment" />
<test:PositiveEntailmentTest rdf:about="http://w3.example.org/rdfs-domain-and-range/conjunction-test">
<test:description>
This test demonstrates the conjunctive nature of range and domain.
</test:description>
<test:entailmentRules rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#" />
<test:entailmentRules rdf:resource="http://www.w3.org/2000/01/rdf-schema#" />
<test:premiseDocument>
<test:NT-Document rdf:about="http://w3.example.org/rdfs-domain-and-range/test001.nt" />
</test:premiseDocument>
<test:premiseDocument>
<test:NT-Document rdf:about="http://w3.example.org/rdfs-domain-and-range/test002.nt" />
</test:premiseDocument>
<test:premiseDocument>
<test:NT-Document rdf:about="http://w3.example.org/rdfs-domain-and-range/test003.nt" />
</test:premiseDocument>
<test:conclusionDocument>
<test:NT-Document rdf:about="http://w3.example.org/rdfs-domain-and-range/test004.nt" />
</test:conclusionDocument>
</test:PositiveEntailmentTest>
According to [RDF-SEMANTICS], a premise document that contains a semantic error with respect to any constraints imposed by the entailment rules selected will be false in any interpretation (and hence entail anything).
Support for such situations is provided by the manifest format by declaring an premise or conclusion pseudo-document as follows:
<test:conclusionDocument>
<test:False-Document/>
</test:conclusionDocument>
By convention, such a pseudo-document is said to come out false under any interpretation.
<test:NegativeEntailmentTest rdf:about="http://w3.example.org/statement-entailment/test001">
<test:status>PENDING</test:status>
<test:approval rdf:resource="http://rdfcore.example.org/Archives/Public/w3c-rdfcore-wg/2002Feb/0476.html" />
<test:description>
RDF Core WG RESOLVED that a reified statement was a stating, not a statement.
The following entailment does not, therefore, hold.
</test:description>
<test:entailmentRules rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#" />
<test:entailmentRules rdf:resource="http://www.w3.org/2000/01/rdf-schema#" />
<test:premiseDocument>
<test:NT-Document rdf:about="http://w3.example.org/statement-entailment/test001a.nt" />
</test:premiseDocument>
<test:conclusionDocument>
<test:NT-Document rdf:about="http://w3.example.org/statement-entailment/test001b.nt" />
</test:conclusionDocument>
</test:NegativeEntailmentTest>
<test:entailmentRules rdf:resource="http://www.w3.org/2000/10/rdf-tests/rdfcore/datatypes#" /> <test:datatypeSupport rdf:resource="http://www.w3.org/2001/XMLSchema#integer" /> <test:datatypeSupport rdf:resource="http://dt.example.org/datatype#foo" />For the purposes of the test suite, if a test case requires datatype support for a set of datatypes, { T, U, V, ... } then the following three pieces of machinery are required:
<test:MiscellaneousTest rdf:about="http://w3.example.org/misc001">
<test:status>PENDING</test:status>
<test:description>
A serializer asked to output the graph described in the test001
document should raise an exception since it cannot be described using
RDF/XML.
</test:description>
<test:document>
<test:NT-Document rdf:about="http://w3.example.org/nonserializable/test001.nt" />
</test:document>
</test:MiscellaneousTest>
In addition, each test case description may have the following common attributes:
<test:issue rdf:resource="http://www.w3.org/2000/03/rdf-tracking/#rdfs-no-cycles-in-subClassOf" />
<test:status>APPROVED</test:status>
<test:approval rdf:resource="http://lists.w3.org/Archives/Public/w3c-rdfcore-wg/2002Feb/0476.html" />
<test:discussion rdf:resource="http://rdfcore.example.org/" />
<test:description>
Text describing the test case goes here.
</test:description>
<test:warning> Text describing the warning goes here. </test:warning>
The test cases in the following table have been approved.
The test case repository contains test cases that have not been approved. Such test cases are not enumerated in this document but a list of them is available at http://www.w3.org/2000/10/rdf-tests/rdfcore/allTestCases.html.
The test case manifest format was deliberately chosen to be a simple, declarative description of the test cases. Parser tests can be run in conjunction with simple tools such as ntc[NTC]. A parser should pass all the positive parser tests, and reject all the negative parser tests. Tools like Euler [EULER] have been used to run the entailment tests.
Due to the rules of entailment tests, a positive or negative entailment test case with an empty conclusion document can be used to illustrate semantic constraints associated with sets of entailment rules.
The test cases have been created to illustrate the resolution of particular issues on the RDF Issue Tracking list. Consequently, test case results should always be interpreted in conjunction with the resolution of the associated issue and the description (if any) attached to the test case in the manifest.
N-Triples is a line-based, plain text format for encoding an RDF graph. It was designed to be a fixed subset of N3[N3] [N3-Primer] and hence N3 tools such as cwm [CWM], n-triples2kif [N-TRIPLES2KIF], and Euler [EULER] can be used to read and process it. cwm can output this format when invoked as "cwm -ntriples".
It is recommended, but not required, that N-Triples content is stored in files with an '.nt' suffix to distinguish them from N3.
The Internet media type / MIME type of N-Triples is text/plain and the character encoding is 7-bit US-ASCII.
NOTE: N-Triples is an RDF syntax for expressing RDF test cases and