Re: [edits in 1.505] reworking errors SPARQL Query

Eric Prud'hommeaux wrote:
> I've changed 11.2.3.9 sop:datatype
>   Returns a valid [RFC3066] language tag representing the XML schema
>   language datatype for a variable.
> to
>   Returns the datatype of its argument if that argument is a typed
>   literal. Otherwise it produces a type error.

In the case of a plain literal with no language tag, it would be natural to 
return "", rather than an error.  This is akin to XML and avoids needing a 
hasLang(..) operation.

> and 11.2.3.8 sop:lang
>   Returns a valid [RFC3066] language tag representing the XML schema
>   language datatype for a variable.
> to
>   Returns an [RFC3066] language tag representing the XML schema
>   language datatype of its argument if that argument has a language
>   tag. Otherwise it produces a type error.

If it is going to be an error, then we should have hasDatatype().

[Not sure why the table entry is "SPARQL Casts" for these operations]

 Andy

> 
> I used the lang change in langMatches:
>   RFC3066 section 2.5 defines the language range '*' to match any
>   tag. In SPARQL, the idiom langMatches( lang( ?v ), "*" ) will not
>   match literals without a language tag as lang( ?v ) will produce a
>   type error.
> 
> 
> So basically, the argument for DATATYPE must be a typed literal, and
> the argument to LANG must be a langed literal.
> 
> 
> 
> 
> There is still more work to do on errors. For instance, Andy asked
> what 1/0 is. XPath F&O has a large number of them[ERR], which we
> implicitly use by defining our operators in terms of XPath functions.
> 
> For instance, the Operator Mapping Table[OPS] ties '/' to
> op:numeric-divide[DIV]. (This is inspired by XQuery's similar
> construct somewhere near [QOP].)
> 
> I think what's needed is some words about "errors" and "type errors"
> and "other errors" derived from F&O.
> 
> [ERR] http://www.w3.org/TR/2005/WD-xpath-functions-20050915/#d1e10985
> [DIV] http://www.w3.org/TR/2005/WD-xpath-functions-20050915/#func-numeric-divide
> [OPS] http://unagi/2001/sw/DataAccess/rq23/#OperatorMapping
> [QOP] http://www.w3.org/TR/xquery/#dt-gregorian

Received on Tuesday, 11 October 2005 12:52:19 UTC