W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > January to March 2006

valueTesting and divide-by-zero [comment: major technical: underspecified errors]

From: Dan Connolly <connolly@w3.org>
Date: Thu, 12 Jan 2006 17:09:38 -0600
To: RDF Data Access Working Group <public-rdf-dawg@w3.org>
Message-Id: <1137107378.19546.425.camel@dirk.w3.org>

EricP, please add to your test suite something about
divide by zero and help me find the part of the spec
that says how it works.

Here's a possible sketch:

ASK { [] foaf:name ?n FILTER 1/0 }.


I think I can answer the rest of this comment:
major technical: underspecified errors
http://lists.w3.org/Archives/Public/public-rdf-dawg-comments/2006Jan/0066.html


On Thu, 2006-01-12 at 13:41 -0800, Fred Zemke wrote: 
> The document specifies almost no exceptions, errors or warnings.
> This seems unrealistic and unhelpful.  The entire syntax should be
> reviewed so that appropriate syntax and run-time errors are defined.
> Failing to specify this will not be good for portability because
> different implementations will make different judgments about what are
> the appropriate errors.  A good place to start would be to ask participants
> who are developing implementations to submit their lists of errors.
> 
> Specifically with regard to syntax errors, is it true that
> any string conforming to the EBNF is a valid query?

Essentially yes...

"A SPARQL query string is a Unicode character string
(c.f. section 6.1 String concepts of [CHARMOD]) in the language defined
by the following grammar, starting with the Query production."

there are two extra-grammatical constraints; one on IRI syntax:

Text matched by the  Q_IRI_REF production and QName (after prefix expansion) production,
after escape processing, must be conform to the generic syntax of IRI
references in section 2.2 of RFC 3987 "ABNF for IRI References and IRIs"
[RFC3987]. For example, the  Q_IRI_REF <abc#def> may occur in a SPARQL query
string, but the  Q_IRI_REF <abc##def> must not.

and one on prefix redeclaration:

@@note constraint on prefix redeclaration from Syntax of IRI Terms


>   For example,
> section 9. "Specifying RDF datasets",
> is it a syntax error to name the same dataset twice?

No.

>   For example,
> SELECT ?x FROM NAMED <xyz> FROM NAMED <xyz> WHERE { ?x a w:idget }. 
> Is this permitted?

Yes, that's a SPARQL query string.

> If so, does it effectively create a copys, so that every solution
> appears twice?

I believe that's specified in section 9 Specifying RDF Datasets:

[[
The dataset resulting from a number of FROM and FROM NAMED clauses is:

      * a default graph consisting of the merge of the graphs referred
        to in the FROM clauses
      * a set of (IRI, graph) pairs, one from each FROM NAMED clause.
]]

> Also in this section,
> there is no mention of any syntax or runtime checks that an IRI
> actually identifies a graph.  Possibly the interpretation of an IRI that
> does not identify a graph is that the graph is empty.  However, this would
> be a disservice to the user since it would not alert the user to
> a typo in spelling a graph IRI.  It would be better to specify an error.
> Presumably the list of acceptable IRIs would be implementation-defined.

Hmm... he's got a point there... more on that separately.


> Turning to run-time errors, are there any other than type errors?
> I see no mention of common arithmetic run-time errors (divide by zero,
> overflow).  The cast operations presumably have run-time errors too.
> (This should be noted in Table 11.2 "SPARQL constructor functions",
> that a run-time error may happen for those casts that are "dependent on
> the lexical value (M)".)  Are there any other run-time errors?
> 
> Fred Zemke

-- 
Dan Connolly, W3C http://www.w3.org/People/Connolly/
D3C2 887B 0F92 6005 C541  0875 0F91 96DE 6E52 C29E
Received on Thursday, 12 January 2006 23:09:42 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:15:25 GMT