W3C home > Mailing lists > Public > w3c-rdfcore-wg@w3.org > January 2002

RE: Datatyping Summary

From: Jeremy Carroll <jjc@hplb.hpl.hp.com>
Date: Wed, 30 Jan 2002 09:38:15 -0000
To: <w3c-rdfcore-wg@w3.org>
Message-ID: <CEECKEAMDAJDDEDGJNBEAEBHCAAA.jjc@hpl.hp.com>
Summary:

A test suite that systematically includes one example of a type error for
each idiom would have 19 files for S, and 5 files for TDL.


Dan wrote:
> Perhaps I don't know what you mean by an implementation.
> Is it different from an RDF 1.0 parser implementation?
> If so, would you please give me a test that a datatypes-capable
> implementation is expected to pass that an RDF 1.0
> parser isn't required to pass?

While parser/processor tests do not exhaust my idea of an implementation it
is a starting point. I try to sketch a test suite for S and a test suite for
TDL, where the test suites are about RDF errors rather more than XML Schema
Datatype errors. e.g. applying two inconsistent type declarations to a
value. Such errors result in an RDF graph that has no models, what a
logician would call an inconsistent graph.

Having said that, it is also clear that there are many possible tests that
are parser oriented, although some will require schema processing.

I will try to list graphs with type errors fairly systematically for both S
and TDL.

(I will use pseudo-ntriple, the ntriple-like language that gets used in our
examples).

I hope these help you understand what I mean by an implementation of S or
TDL.

So an RDF processor, implementing S or TDL as appropriate, with a
pseudo-ntriple parser, and XSD support, and schema support (for those tests
with an rdfs:range) , should reject the following documents:

S error test cases
==================

[[ (S-A)
_:n <xsd:integer.map> "twenty" .
]]

[[ (S-B)
_:n <age> "ten" .
<age> <rdfs:range> <xsd:integer.lex> .
]]

[[ (S-P local)
_:n <age> _:a .
_:a <rdf:type> <xsd:integer.map> .
_:a <rdf:value> "ten" .
]]

[[ (S-P global)

_:n <age> _:a .
<age> <rdfs:range> <xsd:integer.map> .
_:a <rdf:value> "ten" .
]]

For each idiom we may have contradictory type information:
[[ (S-A#S-A 1)
_:n <xsd:integer.map> "20" .
_:n <xsd:string.map> "20" .
]]
[[ (S-A#S-A 2)
_:a <age> _:n .
_:n <xsd:string.map> "20" .
<age> <rdfs:range> <xsd:integer.val> .
]]
Perhaps this? (Not included in total)
[[ (S-B#S-B)
_:n <age> _:a .
<age> <rdfs:range> <xsd:integer.lex> .
<age> <rdfs:range> <boolean.lex>.
]]

[[ (S-P local#S-P local)
_:n <age> _:a .
_:a <rdf:type> <xsd:integer.map> .
_:a <rdf:type> <xsd:string.map> .
_:a <rdf:value> "10" .
]]

[[ (S-P global#S-P local)

_:n <age> _:a .
<age> <rdfs:range> <xsd:integer.map> .
_:a <rdf:type> <xsd:string.map> .
_:a <rdf:value> "10" .
]]
[[ (S-P global#S-P global)

_:n <age> _:a .
<age> <rdfs:range> <xsd:integer.map> .
<age> <rdf:type> <xsd:string.map> .
]]


S also has a range of error conditions when two idioms are intermixed.

[[ (S-A#S-B 1)
_:a <age> _:n .
_:n <xsd:integer.map> "20" .
<age> <rdfs:range> <xsd:integer.lex> .
]]
[[ (S-A#S-B 2)
_:a <age> _:n .
<age> <rdfs:range> <xsd:integer.val> .
<age> <rdfs:range> <xsd:integer.lex> .
]]
[[ (S-A#S-P global 1)
_:a <age> _:n .
_:n <xsd:integer.map> "20" .
<age> <rdfs:range> <xsd:integer.map> .
]]
[[ (S-A#S-P global 2)
_:a <age> _:n .
<age> <rdfs:range> <xsd:integer.val> .
<age> <rdfs:range> <xsd:integer.map> .
]]
[[ (S-A#S-P local1)
_:a <age> _:n .
_:n <xsd:integer.map> "20" .
_:n <rdf:value> _:foo.
]]
[I find this next one really counterintuitive].
[[ (S-A#S-P local2!!!)
_:a <age> _:n .
_:n <xsd:integer.map> "20" .
_:n <rdf:type> <xsd:integer.map>.
]]
[[ (S-A#S-P local 3)
_:a <age> _:n .
<age> <rdfs:range> <xsd:integer.val> .
_:n <rdf:type> <xsd:integer.map>.
]]
[[ (S-B#S-P global 1)
_:n <age> "10" .
<age> <rdfs:range> <xsd:integer.map> .
]]
[[ (S-B#S-P global 2)
<age> <rdfs:range> <xsd:integer.lex> .
<age> <rdfs:range> <xsd:integer.map> .
_:n <age> _:a.
]]
[[ (S-B#S-P local1)
_:a <age> _:n .
<age> <rdfs:range> <xsd:integer.lex> .
_:n <rdf:value> _:foo.
]]
[[ (S-B#S-P local 2 - not included in total)
_:a <age> _:n .
<age> <rdfs:range> <xsd:integer.lex> .
_:n <rdf:type> <xsd:integer.map>.
]]


TDL error test cases
====================


[[ (TDL global)
_:n <age> _:a .
<age> <rdfs:range> <xsd:integer> .
_:a <rdf:value> "ten" .
]]
[[ (TDL local)
_:n <age> _:a .
_:a <rdf:type> <xsd:integer> .
_:a <rdf:value> "ten" .
]]
[[ (TDL local#TDL local)
_:n <age> _:a .
_:a <rdf:type> <xsd:integer> .
_:a <rdf:type> <xsd:string> .
_:a <rdf:value> "10" .
]]

[[ (TDL global#TDL local)

_:n <age> _:a .
<age> <rdfs:range> <xsd:integer> .
_:a <rdf:type> <xsd:string> .
_:a <rdf:value> "10" .
]]
[[ (TDL global#TDL global)

_:n <age> _:a .
<age> <rdfs:range> <xsd:integer> .
<age> <rdf:type> <xsd:string> .
]]

Both TDL and S-P may have some ill-formed triples with rdf:value and URIref
nodes. Unfortunately neither document is clear enough to say which. The
problems are identical and so plague both proposals equally.

The test cases were generated by:
  take each idiom
    generate a single instance type error
    generate a type error from multiple incompatible type information

  take each idiom pair
    generate a model theoretic error by making poor combinations of them


(For all the idioms in both proposals, it would be worth having OK test
cases with multiple compatible types. They all permit it).

Jeremy
Received on Wednesday, 30 January 2002 04:38:51 EST

This archive was generated by hypermail pre-2.1.9 : Wednesday, 3 September 2003 09:44:02 EDT