W3C home > Mailing lists > Public > public-rif-wg@w3.org > February 2009

Re: [DTB] ACTION 704 completed

From: Dave Reynolds <der@hplb.hpl.hp.com>
Date: Wed, 11 Feb 2009 11:51:56 +0000
Message-ID: <4992BBDC.3070102@hplb.hpl.hp.com>
To: Axel Polleres <axel.polleres@deri.org>
CC: Jos de Bruijn <debruijn@inf.unibz.it>, "Public-Rif-Wg (E-mail)" <public-rif-wg@w3.org>

Axel Polleres wrote:
> 
> Jos de Bruijn wrote:
>> Re: the first editor's note in section 3.1.1
>>
>> I believe the predicates should depend on a specific domain, and should
>> be undefined if it is not the case that both arguments are in the same
>> value space.
>> This only becomes an issue, of course, if we decide to adopt these
>> predicates, which is not something I support.
>>
>> <snip/>
>>
>>> 1) As noted in the editor's note, it seems to me that
>>>
>>>  pred:literal-equal
>>>
>>> is redundant. If that is untrue, let me know.
>>
>> this is not true (at least it should not be).  Equality in XML schema is
>> not the same as identity.
>>
>>> Now here goes an example for the problem case, assuming disjoint
>>> datatypes decimal and double (please confirm),:
>>>   pred:numeric-equals("1"^^xs:double , "1"^^xs:decimal) = t
>>>   pred:literal-equals("1"^^xs:double , "1"^^xs:decimal) = f
>>
>> literal-equals should behave the same as numeric-equals on numbers.  It
>> seems to me that you made a mistake in the definition.
> 
> I tried to write down what we discussed, to get a better understanding 
> ofg what we want... it was/is not clear to me what you mean by "mistake" 
> at this point. If you think that literal-equals should do promotion, 
> that is one point of view, there might be others.

This is indeed a tricky decision and one I hadn't properly considered 
when proposing the builtin.

The original motivating use case was OWL RL where the relevant rule is:

   Forall ?lt1 ?lt2 ( ?lt1[owl:differentFrom->?lt2] :-
               External(pred:isLiteralNotEqual(?l1 ?l2))

For that usage then the semantic inequality notion that Axel has 
captured is right and would not involve type promotion.

However, I can see that having isLiteralNotEqual and numeric-not-equal 
disagree will be counter-intuitive.  If we switched to 
isLiteral[Not]Equal performing the standard XFO type promotion then we 
can still write the OWL RL rule:

   Forall ?lt1 ?lt2 ( ?lt1[owl:differentFrom->?lt2] :-
               External(pred:isLiteralNotEqual(?l1 ?l2))

   Forall ?lt1 ?lt2 ( ?lt1[owl:differentFrom->?lt2] :-
               And( External(pred:isLiteralOfType(?l1 xs:float))
                    External(pred:isLiteralNotOfType(?l2 xs:float)) )

   Forall ?lt1 ?lt2 ( ?lt1[owl:differentFrom->?lt2] :-
               And( External(pred:isLiteralOfType(?l2 xs:float))
                    External(pred:isLiteralNotOfType(?l1 xs:float)) )

   Forall ?lt1 ?lt2 ( ?lt1[owl:differentFrom->?lt2] :-
               And( External(pred:isLiteralOfType(?l1 xs:double))
                    External(pred:isLiteralNotOfType(?l2 xs:double)) )

   Forall ?lt1 ?lt2 ( ?lt1[owl:differentFrom->?lt2] :-
               And( External(pred:isLiteralOfType(?l2 xs:double))
                    External(pred:isLiteralNotOfType(?l2 xs:double)) )

Not pretty but acceptable.

I have a small preference for isLiteralEqual and isLiteralNotEqual 
staying with Axel's definition and not doing type promotion and us 
retaining numeric-equal and numeric-not-equal (while presumably 
discarding other redundant equality/inequality tests).

However, if the majority would prefer isLiteral[Not]Equal to do type 
promotion and replace all the existing equality/inequality tests then I 
would not object.

Dave
-- 
Hewlett-Packard Limited
Registered Office: Cain Road, Bracknell, Berks RG12 1HN
Registered No: 690597 England
Received on Wednesday, 11 February 2009 11:52:50 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 2 June 2009 18:34:03 GMT