W3C

RDF Schema and Semantics tests

Copyright © 2004-2023 World Wide Web Consortium. W3C® liability, trademark and permissive document license rules apply.


Abstract

This page describes W3C RDF 1.1 Working Group's Entailment test suite. This test suite contains two kinds of tests:

These tests are also described in Turtle format in this directory for convenience. The manifest files in this directory lists all of the approved tests in the RDF WG's RDF Entailment test suite. All tests have a name (mf:name) and an input (mf:action).

Each test is one of the above kinds of tests. All tests have

An implementation passes a Positive (Negative) Entailment Test if, when configured to 1. perform entailment under the entailment regime of the test or some entailment regime that is stronger (weaker) than the entailment regime and 2. recognize all the datatypes in the list of recognized datatypes and none of the datatypes in the list of unrecognized datatypes, * for tests that have an output graph, determines that the input RDF graph entails (does not entail) the output RDF graph * for tests that have false as output, either determines that the input RDF graph entails (does not entail) an inconsistent RDF graph or that the input RDF graph is inconsistent (consistent).

An implementation also passes a test if when configured differently from a correct configuration as given above nonetheless produces the given result, and the result is correct in the configured entailment regime with the configured recognized datatypes.

Tests can be run from the web or by downloading either a tarball or zip file.

The home of the test suite is http://www.w3.org/2013/rdf-mt-tests/.

See http://www.w3.org/2011/rdf-wg/wiki/RDF_Test_Suites for more details. Per RFC 3986 section 5.1.3, the base IRI for parsing each file is the retrieval IRI for that file, but changing base IRIs should not affect any testing results.

Contributing Tests

The test manifests and entries are built automatically from manifest.ttl using a Rake task. Tests may be contributed via pull request to https://github.com/w3c/rdf-tests with suitable changes to the manifest.ttl and referenced files.

Distribution

Distributed under both the W3C Test Suite License and the W3C 3-clause BSD License. To contribute to a W3C Test Suite, see the policies and contribution forms.

Disclaimer

UNDER BOTH MUTUALLY EXCLUSIVE LICENSES, THIS DOCUMENT AND ALL DOCUMENTS, TESTS AND SOFTWARE THAT LINK THIS STATEMENT ARE PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS OF THE DOCUMENT ARE SUITABLE FOR ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE DOCUMENT OR THE PERFORMANCE OR IMPLEMENTATION OF THE CONTENTS THEREOF.

Test Descriptions

datatypes-intensional-xsd-integer-decimal-compatible: datatypes-intensional-xsd-integer-decimal-compatible

The claim that xsd:integer is a subClassOF xsd:decimal is not incompatible with using the intensional semantics for datatypes.

type
mf:NegativeEntailmentTest
approval
rdft:Approved
entailmentRegime
RDFS
recognizedDatatypes
xsd:decimal xsd:integer
unrecognizedDatatypes
none
action
datatypes-intensional/test001.nt
datatypes-non-well-formed-literal-1: datatypes-non-well-formed-literal-1

Without datatype knowledge, a 'badly-formed' datatyped literal cannot be detected. Used to be a postitive test to itself.

type
mf:NegativeEntailmentTest
approval
rdft:Approved
entailmentRegime
RDFS
recognizedDatatypes
none
unrecognizedDatatypes
xsd:integer
action
datatypes/test002.nt
datatypes-non-well-formed-literal-2: datatypes-non-well-formed-literal-2

With appropriate datatype knowledge, a 'badly-formed' datatyped literal can be detected. Ill-formed datatyped literals now are inconsistent. Used to be negative entailment to <datatypes/test002b.nt>

type
mf:PositiveEntailmentTest
approval
rdft:Approved
entailmentRegime
RDFS
recognizedDatatypes
xsd:integer
unrecognizedDatatypes
none
action
datatypes/test002.nt
datatypes-semantic-equivalence-within-type-1: datatypes-semantic-equivalence-within-type-1

Demonstrating the semantic equivalence of two lexical forms of the same datatyped value.

type
mf:PositiveEntailmentTest
approval
rdft:Approved
entailmentRegime
RDF
recognizedDatatypes
xsd:integer
unrecognizedDatatypes
none
action
datatypes/test003a.nt
result
datatypes/test003b.nt
datatypes-semantic-equivalence-within-type-2: datatypes-semantic-equivalence-within-type-2

As semantic-equivalence-within-type-1; the entailment works both ways.

type
mf:PositiveEntailmentTest
approval
rdft:Approved
entailmentRegime
RDF
recognizedDatatypes
xsd:integer
unrecognizedDatatypes
none
action
datatypes/test003b.nt
result
datatypes/test003a.nt
datatypes-semantic-equivalence-between-datatypes: datatypes-semantic-equivalence-between-datatypes

Members of different datatypes may be semantically equivalent.

type
mf:PositiveEntailmentTest
approval
rdft:Approved
entailmentRegime
RDF
recognizedDatatypes
xsd:decimal xsd:integer
unrecognizedDatatypes
none
action
datatypes/test005a.nt
result
datatypes/test005b.nt
datatypes-range-clash: datatypes-range-clash

Where sufficient DT knowledge is available, a range clash may be detected; the document then contains a contradiction.

type
mf:PositiveEntailmentTest
approval
rdft:Approved
entailmentRegime
RDFS
recognizedDatatypes
xsd:integer xsd:string
unrecognizedDatatypes
none
action
datatypes/test006.nt
datatypes-test008: datatypes-test008

From decisions listed in http://lists.w3.org/Archives/Public/w3c-rdfcore-wg/2002Oct/0098.html

type
mf:PositiveEntailmentTest
approval
rdft:Approved
entailmentRegime
simple
recognizedDatatypes
none
unrecognizedDatatypes
none
action
datatypes/test008a.nt
result
datatypes/test008b.nt
datatypes-test009: datatypes-test009

From decisions listed in http://lists.w3.org/Archives/Public/w3c-rdfcore-wg/2002Oct/0098.html

type
mf:NegativeEntailmentTest
approval
rdft:Approved
entailmentRegime
simple
recognizedDatatypes
none
unrecognizedDatatypes
xsd:integer
action
datatypes/test009a.nt
result
datatypes/test009b.nt
datatypes-test010: datatypes-test010

From decisions listed in http://lists.w3.org/Archives/Public/w3c-rdfcore-wg/2002Oct/0098.html

type
mf:PositiveEntailmentTest
approval
rdft:Approved
entailmentRegime
RDFS
recognizedDatatypes
xsd:integer
unrecognizedDatatypes
none
action
datatypes/test010.nt
datatypes-plain-literal-and-xsd-string: datatypes-plain-literal-and-xsd-string

A plain literal denotes the same thing as its corresponding xsd:string, where one exists.

type
mf:PositiveEntailmentTest
approval
rdft:Approved
entailmentRegime
RDFS
recognizedDatatypes
xsd:string
unrecognizedDatatypes
none
action
datatypes/test011a.nt
result
datatypes/test011b.nt
horst-01-subClassOf-intensional: horst-01-subClassOf-intensional

rdfs:subClassOf has intensional semantics, not extensional.

type
mf:NegativeEntailmentTest
approval
rdft:Approved
entailmentRegime
RDFS
recognizedDatatypes
none
unrecognizedDatatypes
none
action
horst-01/test001.ttl
result
horst-01/test002.ttl
horst-01-subPropertyOf-intensional: horst-01-subPropertyOf-intensional

rdfs:subPropertyOf has intensional semantics, not extensional.

type
mf:NegativeEntailmentTest
approval
rdft:Approved
entailmentRegime
RDFS
recognizedDatatypes
none
unrecognizedDatatypes
none
action
horst-01/test003.ttl
result
horst-01/test004.ttl
rdf-charmod-uris-test003: rdf-charmod-uris-test003

An international URI ref and its %-escaped form label different nodes in the graph. No model theoretic relationship holds between them.

type
mf:NegativeEntailmentTest
approval
rdft:Approved
entailmentRegime
RDF
recognizedDatatypes
none
unrecognizedDatatypes
none
action
rdf-charmod-uris/test001.ttl
result
rdf-charmod-uris/test002.ttl
rdf-charmod-uris-test004: rdf-charmod-uris-test004

An international URI ref and its %-escaped form label different nodes in the graph. No model theoretic relationship holds between them.

type
mf:NegativeEntailmentTest
approval
rdft:Approved
entailmentRegime
RDF
recognizedDatatypes
none
unrecognizedDatatypes
none
action
rdf-charmod-uris/test002.ttl
result
rdf-charmod-uris/test001.ttl
rdfms-seq-representation-test002: rdfms-seq-representation-test002

Statement of the MT closure rule.

type
mf:PositiveEntailmentTest
approval
rdft:Approved
entailmentRegime
RDFS
recognizedDatatypes
none
unrecognizedDatatypes
none
action
rdfms-seq-representation/empty.nt
result
rdfms-seq-representation/test002.nt
rdfms-seq-representation-test003: rdfms-seq-representation-test003

Statement of the MT closure rule.

type
mf:PositiveEntailmentTest
approval
rdft:Approved
entailmentRegime
RDFS
recognizedDatatypes
none
unrecognizedDatatypes
none
action
rdfms-seq-representation/test003a.nt
result
rdfms-seq-representation/test003b.nt
rdfms-seq-representation-test004: rdfms-seq-representation-test004

Statement of the MT closure rule.

type
mf:PositiveEntailmentTest
approval
rdft:Approved
entailmentRegime
RDFS
recognizedDatatypes
none
unrecognizedDatatypes
none
action
rdfms-seq-representation/empty.nt
result
rdfms-seq-representation/test004.nt
rdfms-xmllang-test007a: rdfms-xmllang-test007a

Plain literals are distinguishable on the basis of language tags.

type
mf:NegativeEntailmentTest
approval
rdft:Approved
entailmentRegime
simple
recognizedDatatypes
none
unrecognizedDatatypes
none
action
rdfms-xmllang/test007a.nt
result
rdfms-xmllang/test007b.nt
rdfms-xmllang-test007b: rdfms-xmllang-test007b

Plain literals are distinguishable on the basis of language tags.

type
mf:NegativeEntailmentTest
approval
rdft:Approved
entailmentRegime
simple
recognizedDatatypes
none
unrecognizedDatatypes
none
action
rdfms-xmllang/test007b.nt
result
rdfms-xmllang/test007c.nt
rdfms-xmllang-test007c: rdfms-xmllang-test007c

Plain literals are distinguishable on the basis of language tags.

type
mf:NegativeEntailmentTest
approval
rdft:Approved
entailmentRegime
simple
recognizedDatatypes
none
unrecognizedDatatypes
none
action
rdfms-xmllang/test007c.nt
result
rdfms-xmllang/test007a.nt
rdfs-container-membership-superProperty-test001: rdfs-container-membership-superProperty-test001

While it is a superproperty, _:a <rdfs:contains (@@member?)> _:b . does NOT entail _:a _:b . for any _n.

type
mf:NegativeEntailmentTest
approval
rdft:Approved
entailmentRegime
RDFS
recognizedDatatypes
none
unrecognizedDatatypes
none
action
rdfs-container-membership-superProperty/not1P.ttl
result
rdfs-container-membership-superProperty/not1C.ttl
rdfs-domain-and-range-intensionality-range: rdfs-domain-and-range-intensionality-range

RDF Semantics defines rdfs:range to have an intensional reading. However, semantic extensions may give an extensional reading to range. The premise/conclusion pair is a non-entailment for RDFS reasoning, but may hold in semantic extensions.

type
mf:NegativeEntailmentTest
approval
rdft:Approved
entailmentRegime
RDFS
recognizedDatatypes
none
unrecognizedDatatypes
none
action
rdfs-domain-and-range/premises005.ttl
result
rdfs-domain-and-range/nonconclusions005.ttl
rdfs-domain-and-range-intensionality-domain: rdfs-domain-and-range-intensionality-domain

RDF Semantics defines rdfs:range to have an intensional reading of domain. However, semantic extensions may give an extensional reading to domain. The premise/conclusion pair is a non-entailment for RDFS reasoning, but may hold in semantic extensions.

type
mf:NegativeEntailmentTest
approval
rdft:Approved
entailmentRegime
RDFS
recognizedDatatypes
none
unrecognizedDatatypes
none
action
rdfs-domain-and-range/premises006.ttl
result
rdfs-domain-and-range/nonconclusions006.ttl
rdfs-entailment-test001: rdfs-entailment-test001

Indicating a simple inconsistency drawn from RDFS. RDFS can only produce inconsistencies through badly-formed XMLLiteral datatypes. rdf:XMLLiteral support is no longer mandatory.

type
mf:PositiveEntailmentTest
approval
rdft:Approved
entailmentRegime
RDFS
recognizedDatatypes
http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral
unrecognizedDatatypes
none
action
rdfs-entailment/test001.nt
rdfs-entailment-test002: rdfs-entailment-test002

Datatype clashes can occur in RDFS entailment. Use to be from an inconsistent graph, any entailment can be drawn. This is an example.

type
mf:PositiveEntailmentTest
approval
rdft:Approved
entailmentRegime
RDFS
recognizedDatatypes
xsd:string http://www.w3.org/1999/02/22-rdf-syntax-ns#langString
unrecognizedDatatypes
none
action
rdfs-entailment/test002p.nt
rdfs-no-cycles-in-subClassOf-test001: rdfs-no-cycles-in-subClassOf-test001

Cycles are permitted in subClassOf; therefore, no error occurs and the following entailment holds trivially.

type
mf:PositiveEntailmentTest
approval
rdft:Approved
entailmentRegime
RDFS
recognizedDatatypes
none
unrecognizedDatatypes
none
action
rdfs-no-cycles-in-subClassOf/test001.ttl
result
rdfs-no-cycles-in-subClassOf/test001.nt
rdfs-no-cycles-in-subPropertyOf-test001: rdfs-no-cycles-in-subPropertyOf-test001

Cycles are permitted in subPropertyOf; therefore, no error occurs and the following entailment holds trivially.

type
mf:PositiveEntailmentTest
approval
rdft:Approved
entailmentRegime
RDFS
recognizedDatatypes
none
unrecognizedDatatypes
none
action
rdfs-no-cycles-in-subPropertyOf/test001.ttl
result
rdfs-no-cycles-in-subPropertyOf/test001.nt
rdfs-subClassOf-a-Property-test001: rdfs-subClassOf-a-Property-test001

an instance of the Property class may have an rdfs:subClassOf property. the meaning of such a property is defined by the model theory. The wording of the formal resolution is a bit bare, so let me add a few words of explanation. What this means is that a resource can be both a class and a property. This test is encoded as follows: a Property may have a subclass (that is, such an RDF graph is satisfiable)

type
mf:NegativeEntailmentTest
approval
rdft:Approved
entailmentRegime
RDFS
recognizedDatatypes
none
unrecognizedDatatypes
none
action
rdfs-subClassOf-a-Property/test001.nt
rdfs-subPropertyOf-semantics-test001: rdfs-subPropertyOf-semantics-test001

The inheritance semantics of the subPropertyOf relationship needs to be clarified. => subProperties inherit conjunctively the domain and range of their superproperties

type
mf:PositiveEntailmentTest
approval
rdft:Approved
entailmentRegime
RDFS
recognizedDatatypes
none
unrecognizedDatatypes
none
action
rdfs-subPropertyOf-semantics/test001.nt
result
rdfs-subPropertyOf-semantics/test002.nt
statement-entailment-test001: statement-entailment-test001

RDFCore WG RESOLVED that a reified statement was a stating, not a statement. The following entailment does not, therefore, hold.

type
mf:NegativeEntailmentTest
approval
rdft:Approved
entailmentRegime
RDF
recognizedDatatypes
none
unrecognizedDatatypes
none
action
statement-entailment/test001a.nt
result
statement-entailment/test001b.nt
statement-entailment-test002: statement-entailment-test002

RDFCore WG RESOLVED that a statement does NOT entail its reification. The following entailment does not, therefore, hold.

type
mf:NegativeEntailmentTest
approval
rdft:Approved
entailmentRegime
RDF
recognizedDatatypes
none
unrecognizedDatatypes
none
action
statement-entailment/test002a.nt
result
statement-entailment/test002b.nt
statement-entailment-test003: statement-entailment-test003

RDFCore WG RESOLVED that a reified statement was a stating, not a statement. The following entailment does not, therefore, hold. This is the same as test001, but using RDFS-entailment.

type
mf:NegativeEntailmentTest
approval
rdft:Approved
entailmentRegime
RDFS
recognizedDatatypes
none
unrecognizedDatatypes
none
action
statement-entailment/test001a.nt
result
statement-entailment/test001b.nt
statement-entailment-test004: statement-entailment-test004

RDFCore WG RESOLVED that a statement does NOT entail its reification. The following entailment does not, therefore, hold. This is the same as test002, but using RDFS-entailment.

type
mf:NegativeEntailmentTest
approval
rdft:Approved
entailmentRegime
RDF
recognizedDatatypes
none
unrecognizedDatatypes
none
action
statement-entailment/test002a.nt
result
statement-entailment/test002b.nt
tex-01-language-tag-case-1: tex-01-language-tag-case-1

The case of the language tag is not significant.

type
mf:PositiveEntailmentTest
approval
rdft:Approved
entailmentRegime
RDF
recognizedDatatypes
none
unrecognizedDatatypes
none
action
tex-01/test001.ttl
result
tex-01/test002.ttl
tex-01-language-tag-case-2: tex-01-language-tag-case-2

The case of the language tag is not significant.

type
mf:PositiveEntailmentTest
approval
rdft:Approved
entailmentRegime
RDF
recognizedDatatypes
none
unrecognizedDatatypes
none
action
tex-01/test002.ttl
result
tex-01/test001.ttl
xmlsch-02-whitespace-facet-1: xmlsch-02-whitespace-facet-1

A well-formed typed literal is not related to an ill-formed literal. Even if they only differ by whitespace.

type
mf:NegativeEntailmentTest
approval
rdft:Approved
entailmentRegime
RDFS
recognizedDatatypes
xsd:int
unrecognizedDatatypes
none
action
xmlsch-02/test001.ttl
result
xmlsch-02/test002.ttl
xmlsch-02-whitespace-facet-2: xmlsch-02-whitespace-facet-2

A well-formed typed literal is not related to an ill-formed literal. Even if they only differ by whitespace. Ill-formed datatyped literals now are inconsistent. Used to be negative entailment to <xmlsch-02/test001.ttl> .

type
mf:PositiveEntailmentTest
approval
rdft:Approved
entailmentRegime
RDFS
recognizedDatatypes
xsd:int
unrecognizedDatatypes
none
action
xmlsch-02/test002.ttl
xmlsch-02-whitespace-facet-4: xmlsch-02-whitespace-facet-4

An integer with whitespace is ill-formed. Ill-formed datatyped literals now are inconsistent. Used to be negative entailment.

type
mf:PositiveEntailmentTest
approval
rdft:Approved
entailmentRegime
RDFS
recognizedDatatypes
xsd:int
unrecognizedDatatypes
none
action
xmlsch-02/test002.ttl