W3C

OWL Web Ontology Language
Test Cases

W3C Candidate Recommendation 18 August 2003

This version:
http://www.w3.org/TR/2003/CR-owl-test-20030818/
Latest version:
http://www.w3.org/TR/owl-test/
Previous version:
http://www.w3.org/TR/2003/WD-owl-test-20030528/
Editors:
Jeremy J. Carroll, HP <jjc@hpl.hp.com>
Jos De Roo, AGFA,<jos.deroo@agfa.com>

This normative version is a compound document. Non-normative versions consisting of a single HTML file are available in three sizes: medium, large, and extra large. The tests of this document are also available in these non-normative formats: Zip archive of approved tests, Zip archive of proposed tests, the test web site.


Abstract

This document contains and presents test cases for the Web Ontology Language (OWL) approved by the Web Ontology Working Group. Many of the test cases illustrate the correct usage of the Web Ontology Language (OWL), and the formal meaning of its constructs. Other test cases illustrate the resolution of issues considered by the working group. Conformance for OWL documents and OWL document checkers is specified.

Status of this 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/.

Publication as a Candidate Recommendation 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 draft is one of six parts of the Candidate Recommendation (CR) for OWL, the Web Ontology Language. It has been developed by the Web Ontology Working Group as part of the W3C Semantic Web Activity (Activity Statement, Group Charter) for publication on 18 August 2003.

The design of OWL expressed in earlier versions of these documents has been widely reviewed and satisfies the Working Group's technical requirements. The Working Group has addressed all comments received, making changes as necessary. Changes to this document since the Last Call Working Draft are detailed in the change log.

The Working Group now hopes to gather experience from the growing number of OWL implementations in order to increase confidence in the language and meet specific exit criteria. This CR period will extend until at least 20 September 2003. After that date, when and if the exit criteria are met, the group intends to request Proposed Recommendation status.

Please send reports of implementation experience to public-webont-comments@w3.org (archive). Reports of any success or difficulty with the Test Cases are encouraged, and reports received by 20 September 2003 will be particularly helpful. General discussion of related technology is welcome at www-rdf-logic@w3.org (archive).

Although OWL is essentially stable, later versions of these documents are expected to contain minor improvements. The test site is likely to include new, clarifying tests, even during this CR period. Additionally, the design of OWL depends in part on the design of RDF, and at this time the relevant RDF specifications are only Working Drafts. It is therefore possible that unanticipated changes in RDF may require changes to OWL.

Each test may be edited or have a change of status according to the process specified below. Further tests are being added and contributions are invited. The approved tests in this document have typically been successfully executed; the proposed tests are also believed to be correct. An editor's draft of this document is available with the latest tests and up-to-date test status information.

This document is subsidiary to the normative definition of the Web Ontology Language [OWL Semantics and Abstract Syntax]).

One technical detail concerning structure reuse in OWL Semantics and Abstract Syntax, Section 4 (Mapping to RDF Graphs) has been identified as "at risk" and subject to change. We expect this change, if made, to simplify rather than complicate implementations, and since it is a relaxation of a current restriction, it will not invalidate or change the meaning of any valid OWL or RDF documents.

The W3C maintains a list of any patent disclosures related to this work.


Table of Contents


1. Introduction

As part of the definition of the Web Ontology Language (OWL) the Web Ontology Working Group provides a set of test cases. This document presents those test cases. They are intended to provide examples for, and clarification of, the normative definition of OWL found in [OWL Semantics and Abstract Syntax] to which this document is subsidiary.

This document is one component of the description of OWL, the Web Ontology Language, being produced by the W3C Web Ontology Working Group. The Document Roadmap section of the [OWL Overview] describes each of the different parts and how they fit together.

This document describes the various types of test used and the format in which the tests are presented. Alternative formats of the test collection are provided. These are intended to be suitable for use by OWL developers in test harnesses, possibly as part of a test driven development process, such as Extreme Programming [XP]. The format of the Manifest files used as part of these alternative formats is described.

This document describes the process for conflict resolution and errata related to these tests.

In the non-normative appendices, this document also describes the process for creation and approval of these tests.

Further appendices show further proposed tests that are awaiting resolution by the working group.

1.1. Conformance and Scope

Various conformance levels are defined in this document in terms of [OWL Semantics and Abstract Syntax].

However, the test cases do not constitute a conformance test suite for OWL, since they are silent on several important issues. This document cannot be considered a complete specification of OWL.

The tests illustrate issue resolutions, and illustrate the use and meaning of the terms in the OWL namespace.

There are other miscellaneous tests: some arising in the literature, and in preexisting systems; others intending to show the difficulty of complete implementations of OWL Full.

2. Deliverables (Normative)

The deliverables included as part of the test cases are:

Note: Other files can be found under the top URL of the web-site which are not part of the deliverable.

2.1. Normative Status

Of the deliverables the only normative tests are those included in this document. All other deliverables are informative. Moreover, the recommendation document is informative except for the conformance statements, the test data (specified in RDF/XML [RDF/XML Syntax]), and the supporting documentation.

3. Test Types (Normative)

Each test consists of one or more RDF/XML documents and a Manifest file. Tests of one document indicate some property of that document when viewed as an OWL knowledge base. Tests of two or more documents indicate a relationship between the two documents when viewed as OWL knowledge bases.

The Manifest file is named ManifestNNN.rdf (The NNN is replaced by the test number). It contains metadata (in RDF) indicating the test type, and describing the test.

The metadata also indicates the language levels appropriate for each test and each document in each test. For each RDF/XML document, one language level is indicated, being OWL Lite, OWL DL or OWL Full, as given by the syntactic rules in [OWL Semantics and Abstract Syntax]. For semantic tests, one or two language levels are indicated. If the language level OWL Full is indicated for a semantic test, then the test holds according to the RDF-Compatible Model-Theoretic Semantics in [OWL Semantics and Abstract Syntax]. If the language level OWL Lite or OWL DL is indicated for a semantic test, then the test holds according to the Direct Model-Theoretic Semantics in [OWL Semantics and Abstract Syntax]. If the language level OWL Lite is indicated for a semantic test, then the test only uses features within the OWL Lite sublanguage.

Some of the tests require that certain datatypes are, or are not, supported in the datatype theory [OWL Semantics and Abstract Syntax]. These are indicated with the test. Other datatypes which are used in the test are also indicated: the test applies whether or not these are supported in the datatype theory . The datatypes xsd:integer, xsd:string from [XML Schema Datatypes] are not indicated, even when used or required, since they must be supported.

3.1. Tests for Incorrect Use of OWL Namespace

These tests use one document. It is named badNNN.rdf. This document includes a use of the OWL namespace with a local name that is not defined by the OWL recommendation. An OWL Syntax checker SHOULD give a warning.

Note: These tests are intended to help migration from DAML+OIL [DAML+OIL], since the local names chosen are defined in the DAML+OIL namespace.

3.2. Entailment Tests

These tests use two documents. One is named premisesNNN.rdf, the other is named conclusionsNNN.rdf. The conclusions are entailed by the premises. Such entailment is defined by the OWL semantics [OWL Semantics and Abstract Syntax], (see also OWL Full entailment).

3.3. Non-Entailment Tests

These tests use two documents. One is named premisesNNN.rdf, the other is named nonconclusionsNNN.rdf. The nonconclusions are not entailed by the premises. Such entailment is defined by the OWL semantics [OWL Semantics and Abstract Syntax], (see also OWL Full entailment).

Exceptionally, test imports-002 includes a third document.

3.4. True Tests

These tests use one document. It is named conclusionsNNN.rdf. The conclusions follow from the OWL semantics [OWL Semantics and Abstract Syntax]. These tests are a special case of the entailment tests in which the premises are empty.

3.5. OWL for OWL Tests

These tests use one document. It is named conclusionsNNN.rdf. These are a special case of true tests. The conclusions follow from the OWL Full semantics [OWL Semantics and Abstract Syntax]. The tests are intended to illustrate how OWL Full can be used to describe its own properties and classes.

3.6. Consistency Tests

These tests use one document. It is named consistentNNN.rdf. The document is consistent as defined by the OWL Semantics [OWL Semantics and Abstract Syntax], (see also OWL Full consistency).

3.7. Inconsistency Tests

These tests use one document. It is named inconsistentNNN.rdf. The document is not consistent as defined by the OWL semantics [OWL Semantics and Abstract Syntax], (see also OWL Full consistency).

3.8. Import Entailment Tests

These tests use more than two documents. One is named premisesNNN.rdf, another is named conclusionsNNN.rdf, the rest have names like supportNNN-A.rdf. The support documents are in the imports closure of the premises document. The conclusions are entailed by the imports closure of the premises. Such entailment is defined by the OWL semantics [OWL Semantics and Abstract Syntax], (see also OWL Full entailment).

3.9. Import Level Tests

These tests use two documents. One is named importsNNN.rdf, the other is named mainNNN.rdf. These tests indicate the interaction between owl:imports and the sublanguage levels of the main document.

4. Conformance (Normative)

4.1. Document Conformance

4.1.1. Syntactic Conformance

An OWL Full document is any RDF/XML document [RDF/XML Syntax].

An OWL DL document is an OWL Full document such that the imports closure [OWL Semantics and Abstract Syntax] of the corresponding RDF graph [RDF Concepts] is an OWL DL ontology in RDF graph form.

An OWL Lite document is an OWL Full document such that the imports closure [OWL Semantics and Abstract Syntax] of the corresponding RDF graph [RDF Concepts] is an OWL Lite ontology in RDF graph form.

4.1.2. Semantic Conformance

An OWL Lite or OWL DL document D is OWL DL consistent with respect to a datatype theory T if and only if there is some abstract OWL interpretation I with respect to T such that I satisfies an abstract ontology O corresponding to D, in which O has a separated vocabulary; (see [OWL Semantics and Abstract Syntax]).

An OWL Full document D is OWL Full consistent with respect to a datatype theory T, if and only if there is some OWL Full interpretation I with respect to T such that I satisfies all the RDF graphs in some imports closed collection containing an RDF graph corresponding to D.

4.2. Document Checker Conformance

This section uses the words MUST, MUST NOT, SHOULD and MAY as in [RFC 2119].

4.2.1. Syntax Checker

An OWL syntax checker takes a document as input, and returns one word being one of Lite, DL, Full, Other.

The return value MUST conform with the following:

Lite
The input document is an OWL Lite document.
DL
The input document is an OWL DL document but not an OWL Lite document.
Full
The input document is an OWL Full document but not an OWL DL document.
Other
The input document is not an OWL Full document.

In addition, an OWL Syntax Checker SHOULD report a warning if the RDF graph [RDF Concepts] corresponding to the document uses any URI references starting with the prefix http://www.w3.org/2002/07/owl# except those found in the [RDF Schema for OWL].

An OWL syntax checker SHOULD report network errors occurring during the computation of the imports closure.

4.2.2. Consistency Checker

An OWL consistency checker takes a document as input, and returns one word being Consistent, Inconsistent, or Unknown.

An OWL consistency checker SHOULD report network errors occurring during the computation of the imports closure.

An OWL consistency checker MUST provide a means to determine the datatypes supported by its datatype theory, [OWL Semantics and Abstract Syntax]; for example, by listing them in its supporting documentation.

An OWL consistency checker MUST provide a means to determine the model theory [OWL Semantics and Abstract Syntax], it uses (either the Direct Model-Theoretic Semantics or the RDF-Compatible Model-Theoretic Semantics); for example, in its supporting documentation.

An OWL consistency checker MUST be sound: it MUST return Consistent only when the input document is consistent and Inconsistent only when the input document is not consistent, with respect to the datatype theory of the checker.

If an input document uses datatypes that are not supported by the datatype theory of an OWL consistency checker then it MAY report a warning.

An OWL consistency checker is complete and terminating, if, given sufficient (but finite) resources (CPU cycles and memory) and the absence of network errors, it will always return either Consistent or Inconsistent. It has been shown that for OWL Lite and DL it is possible to construct a complete and terminating consistency checker (the languages are decidable), and that for OWL full it is not possible to construct a complete and terminating consistency checker (the language is undecidable, [Practical Reasoning]).

The datatype theory of an OWL consistency checker MUST minimally support at least xsd:integer, xsd:string from [XML Schema Datatypes].

An OWL consistency checker SHOULD NOT return Unknown. Unknown, while sometimes needed, is not a desired response.

Four different conformance classes of OWL consistency checker are defined.

An OWL Lite consistency checker is an OWL consistency checker that takes an OWL Lite document as input, and uses the Direct Model-Theoretic Semantics.

An OWL DL consistency checker is an OWL consistency checker that takes an OWL DL document as input and uses the Direct Model-Theoretic Semantics.

An OWL Full consistency checker is an OWL consistency checker that takes an OWL Full document as input and uses the RDF-Compatible Model-Theoretic Semantics.

A complete OWL Lite consistency checker is an OWL Lite consistency checker that is complete and terminating.

Note: An OWL Full consistency checker may indicate that an OWL DL document is inconsistent, while an OWL DL consistency checker indicates that the same document is consistent, (for example: compare test Thing-001 with Thing-002 or compare AnnotationProperty-001 with AnnotationProperty-002). Every OWL DL consistency checker is also an OWL Lite consistency checker.

Note: A complete OWL Lite consistency checker MAY return Unknown for an OWL Lite document in the case where a resource limit has been exceeded.

Note: The usage of the word 'complete' in this section follows the conventions of the description logic community. In some other communities the word 'complete' is used in a weaker sense, refering to the detection of inconsistency by logical inference systems.

5. Testing an OWL Implementation (Informative)

5.1. OWL Syntax Checkers

An OWL syntax checker when presented with any of the test files must return the indicated result.

5.2. OWL Consistency Checker

An OWL consistency checker can be tested using appropriate consistency and inconsistency tests. Appropriate tests are those of an appropriate level and for which the checker has appropriate datatype support. The level of the test indicates the semantic theory being used, which may differ from the level of the file. For example, test Thing-001 contains an OWL Lite file which is consistent as an OWL Lite or OWL DL consistency test, but inconsistent as an OWL Full consistency test.

An OWL consistency checker has appropriate datatype support for a test if both:

An OWL Lite consistency checker with appropriate datatype support, when presented with a file from an OWL Lite consistency test, must return Consistent or Unknown.

An OWL DL consistency checker with appropriate datatype support, when presented with a file from an OWL DL or OWL Lite consistency test, must return Consistent or Unknown.

An OWL Full consistency checker with appropriate datatype support, when presented with a file from an OWL Full consistency test, must return Consistent or Unknown.

The corresponding inconsistency tests must return Inconsistent or Unknown.

A complete OWL Lite consistency checker should not return Unknown on the OWL Lite consistency or inconsistency tests, regardless of the use of unsupported datatypes.

6. Manifest Files (Informative)

The Manifest file follows the RDF schema developed for the RDF Test Cases [RDF Test Cases].

This is augmented by a few new properties and types which are declared in the OWL Test Ontology, found at http://www.w3.org/2002/03owlt/testOntology.

Specifically each test has its own Manifest file, and is identified from the URI reference formed from the Manifest file's URL with a fragment test.

The test has one rdf:type explicit, and this is one of:

otest:NotOwlFeatureTest
A test for the incorrect use of the OWL namespace name.
otest:PositiveEntailmentTest
An entailment test.
otest:NegativeEntailmentTest
A non-entailment test.
otest:TrueTest
A true test.
otest:OWLforOWLTest
An OWL for OWL test.
otest:ConsistencyTest
A consistency test.
otest:InconsistencyTest
An inconsistency test.
otest:ImportEntailmentTest
An import entailment test.
otest:ImportLevelTest
An import level test.

Where otest is bound to http://www.w3.org/2002/03owlt/testOntology# and rtest is bound to http://www.w3.org/2000/10/rdf-tests/rdfcore/testSchema#.

The name of the original author of the test is shown using a dc:creator property, see [Dublin Core].

A description of the test is given (using XHTML markup [XHTML]) as the value of the rtest:description property.

An issue, if any, from the OWL Issues list [OWL Issues], is the value of a rtest:issue property.

An appropriate language feature, from the OWL namespace, if any, is the value of the otest:feature property.

The input documents with the test data are found as the value of the rtest:inputDocument property or as the value of both the rtest:premiseDocument and the rtest:conclusionDocument. The support files for import entailment tests, import level tests and test imports-002 are found as the values of otest:importedPremiseDocument.

The conformance levels associated with both files and tests are given with the otest:level property. The value for each document is one of otest:Full, otest:DL, otest:Lite or otest:Other. Each test is explicitly associated with one or two levels. If it is associated with otest:Lite then it is implicitly suitable for otest:DL.

The datatypes used in the test are given with the otest:usedDatatype property or with one of its subproperties: otest:supportedDatatype or otest:notSupportedDatatype. These indicate that the test is only valid when the datatype is supported or not supported respectively by the datatype theory being used.

7. The OWL Tests (Normative)

Contents

Contents

7.3. Additional Description Logic Tests

These tests are ones that are either known from the literature (for instance, from [Heinsohn et al.]), or from test suites contributed by Network Inference, or developed by the Working Group.

The following additional namespace prefix is used in this section:

oiled
http://oiled.man.example.net/test#

In the N3 syntax [N3] used for namespace declarations, this as as follows:

Namespaces:
@prefix oiled: <http://oiled.man.example.net/test#> .

Contents

Contents

Contents

Contents

7.4. Miscellaneous Tests

These tests are ones that do not fit any other category. Some are taken from the [OWL Guide]; others reflect various aspects of OWL, that were not formal issues addressed by the working group.

Contents

A. Test Creation, Approval and Modification (Informative)

A.1. Creation

Tests are created by members of the working group. An (optional) test editor is provided to facilitate this. Tests are then placed in the appropriate directory in the test web site. This is done using CVS access to the W3C CVS server [W3C CVS].

When created, tests are given a status of "PROPOSED". The author of the test creates a Manifest file in the directory of the new test, identifying:

A.2. Approval

At the chair's discretion, individual tests or groups of tests are put to the working group in the weekly telecon or at a face-to-face meeting.

Tests are approved by working group decision.

The working group may take account of favourable review of the tests and/or implementation reports, as well as other factors.

If the Working Group approves a test, then it is included in the test case document.

The Working Group may reject a test, in which case its status is changed to "REJECTED". This does not indicate that the converse of the test has been accepted. There may be stylistic or other grounds for rejecting technically correct tests.

The Working Group has complete discretion to approve or reject tests independent of their conformance with this process or their conformance with the OWL working drafts.

In the light of new information, and at the chairs' discretion, the working group may review any previous decision regarding any test cases. The status of "OBSOLETED" may be used where a test has ceased to be appropriate.

A.3. Modification

The editors may make editorial changes to approved and proposed tests. This includes:

B. Stylistic Preferences (Informative)

There is a preference for the following stylistic rules. None of these rules is obligatory, but test authors should be minded that it will be easier to gain working group consensus if they follow these rules.

B.1. Use of RDF/XML

Tests should normally be expressed in RDF/XML.

The following RDF/XML grammar rules [RDF/XML Syntax] are not used:

  1. Property attributes.
  2. rdf:parseType="Resource".

B.2. Use of xml:base

Test and manifest files should have an xml:base attribute [XMLBASE] on the document element. This should show the preferred URL of the document, from which it is actually retrievable.

Files that contain no relative URIs may omit the xml:base attribute.

B.3. Use of .rdf Suffix

Test and manifest files should use the ".rdf" suffix. URIs should not. The URL used for xml:base declarations does not have a suffix.

B.4. Use of example Domains

All URLs in the test and manifest files should be retrievable web resources except for those that use domain names with "example" as the penultimate component (e.g. "http://www.example.org/ontology#prop").

B.5. Copyright

The following copyright statement should be included as an XML comment in every test file:



<!--
  Copyright World Wide Web Consortium, (Massachusetts Institute of
  Technology, European Research Consortium for Informatics and 
  Mathematics, Keio University).
 
  All Rights Reserved.
 
  Please see the full Copyright clause at
  <http://www.w3.org/Consortium/Legal/copyright-software.html>

  $Id: Overview.html,v 1.9 2003/08/19 15:40:12 sandro Exp $
-->

B.6. Description

The description should:

The description should be included as an XML comment in each test file, and be included as RDF content in the Manifest file.

B.7. Directory Structure

Tests that relate principally to some owl property or class, should be put in a directory named using the local name of that property of class.

Otherwise, tests that relate to an issue should be put in a directory named like I3.4 where the issue number is taken from the OWL issue list [OWL Issues].

B.8. Test Numbering

Each directory should contain tests numbered consecutively from 001.

No two tests in a single directory should have the same number.

Each file in a test should have the number of the test at the end of its name, before the suffix.

The rest of the file name should follow the conventions for the test type.

Note: the approved tests in a directory will not necessarily be contiguously numbered.

Note: this differs from the RDF Core test case numbering conventions.

B.9. Triple Format of Test Data

Both the approved and proposed tests are shown both in RDF/XML, which is their normative form, and in a triples format. This lists the triples as subject, predicate and object, similar to the N-triples format described in [RDF Test Cases]. The following additional conventions are used:

The following namespace prefixes are used throughout:

rdf
http://www.w3.org/1999/02/22-rdf-syntax-ns#
rdfs
http://www.w3.org/2000/01/rdf-schema#
owl
http://www.w3.org/2002/07/owl#
xsd
http://www.w3.org/2001/XMLSchema#
first
The URL of the first file concatenated with #. The first file is that named premisesNNN.rdf, badNNN.rdf, consistentNNN.rdf, inconsistentNNN.rdf or importsNNN.rdf depending on the test type. (Not used for true tests or OWL for OWL tests ).
second
The URL of the second file concatenated with #. The second file is named conclusionsNNN.rdf, nonconclusionsNNN.rdf or mainNNN.rdf depending on the test type.

In the N3 syntax [N3] used for namespace declarations, the first four appear as follows:

Namespaces:
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

Other namespaces are explicitly listed with the test data.

C. Proposed Tests (Informative)

Contents

Contents

C.3. Additional Description Logic Tests

These tests are ones that are either known from the literature (for instance, from [Heinsohn et al.]), or from test suites contributed by Network Inference, or developed by the Working Group.

The following additional namespace prefix is used in this section:

oiled
http://oiled.man.example.net/test#

In the N3 syntax [N3] used for namespace declarations, this as as follows:

Namespaces:
@prefix oiled: <http://oiled.man.example.net/test#> .

Contents

Contents

Contents

Contents

Contents

C.4. Miscellaneous Tests

These tests are ones that do not fit any other category. Some are taken from the [OWL Guide]; others reflect various aspects of OWL, that were not formal issues addressed by the working group.

Contents

Contents

Contents

C.5. Extra Credit (Informative)

There is no expectation that any implementation will successfully run the tests in this section; any that do gain extra credit.

The intent is to illustrate the semantics of OWL, particularly OWL Full, as specified by [OWL Semantics and Abstract Syntax], with the specific goal of showing that it is possible to say things that it is not reasonable to expect an implementation to completely understand.

Contents

Contents


E. Acknowledgments (Informative)

Jeremy Carroll thanks Oreste Signore, his host at the W3C Office in Italy and Istituto di Scienza e Tecnologie dell'Informazione "Alessandro Faedo", part of the Consiglio Nazionale delle Ricerche, where Jeremy is a visiting researcher.

The following people have contributed tests to this document: Sean Bechhofer, Ian Horrocks, Peter F. Patel-Schneider, Jeff Heflin, Jonathan Borden, Guide editors, Dan Connolly, Charles White, Martin Dürst, Masayasu Ishikawa, Jim Hendler, Herman ter Horst, and the editors.

Ian Horrocks contributed to the conformance section of this document.

This document is the result of extensive discussions within the Web Ontology Working Group as a whole. The members of this group working group included: Yasser al Safadi, Jean-François Baget, James Barnette, Sean Bechhofer, Jonathan Borden, Frederik Brysse, Stephen Buswell, Peter Crowther, Jos De Roo, David De Roure, Mike Dean, Larry Eshelman, Jérôme Euzenat, Dieter Fensel, Tim Finin, Nicholas Gibbins, Pat Hayes, Jeff Heflin, Ziv Hellman, James Hendler,