W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > April to June 2005

Re: valueTesting [was: Editor's Draft ready for DAWG review]

From: Eric Prud'hommeaux <eric@w3.org>
Date: Mon, 4 Apr 2005 12:19:22 -0400
To: Dan Connolly <connolly@w3.org>
Cc: RDF Data Access Working Group <public-rdf-dawg@w3.org>
Message-ID: <20050404161921.GB11040@w3.org>
On Mon, Apr 04, 2005 at 10:27:16AM -0500, Dan Connolly wrote:
> On Thu, 2005-03-31 at 23:16 -0500, Eric Prud'hommeaux wrote:
> [...]
> > [SQ] http://www.w3.org/2001/sw/DataAccess/rq23/
> 
> I gather this is/includes your proposal re valueTesting.
> 
> Is there anything besides that text that you'd like to tell us?
> Any test materials to go along with it that we can use to prepare

http://dev.w3.org/cvsweb/perl/modules/W3C/Rdf/test/SPARQL0-alg.sh?rev=HEAD&content-type=text/x-cvsweb-markup

> for a decision? Any recent design changes?

I'm really waffling on one point, whether 5^^int == 5^^float without
any casting (say, float(5^^int) == 5^^float). I've loosened it up
after getting buy-in from a few people to keep it tighter.

it boils down to whether numericOrDTCompare (below) in called by < > =
!= or is just called when calculating the effective boolean
value. Andy has it one way and I have it the other.

sub numericOrDTCompare {
    my ($self, $vs) = @_;

    if ($self == $vs) {
	return 0;
    }

    if (UNIVERSAL::isa($vs, 'W3C::Rdf::Uri') || 
	UNIVERSAL::isa($vs, 'W3C::Rdf::BNode')) {
	# arbitrary decision: strings sort after everything else.
	return -1;
    }

    if ($self->{DATATYPE} && $vs->{DATATYPE}) {
	my $selfDT = $self->{DATATYPE}->getUri();
	my $vsDT = $vs->{DATATYPE}->getUri();
	if (exists $NumericTypes{$selfDT} && 
	    exists $NumericTypes{$vsDT}) {
	    return $self->{STRING} <=> $vs->{STRING};
	} elsif (exists $DateTimeTypes{$selfDT} && 
	    exists $DateTimeTypes{$vsDT}) {
	    require Date::Manip;
	    return Date_Cmp(ParseDate($self->{STRING}), 
			    ParseDate($vs->{STRING}));
	}
    }

    # Can't be sure that they are the same or different.
    my $lStr = $self->toString();
    my $rStr = $vs->toString();
    &throw(new W3C::Util::SafeEvaluationException(
	             -message => "cannot compare $lStr to $rStr"));
}



> I think our last group discussion was in Boston...
> http://www.w3.org/2001/sw/DataAccess/ftf5-bos.html#item05
-- 
-eric

office: +81.466.49.1170 W3C, Keio Research Institute at SFC,
                        Shonan Fujisawa Campus, Keio University,
                        5322 Endo, Fujisawa, Kanagawa 252-8520
                        JAPAN
        +1.617.258.5741 NE43-344, MIT, Cambridge, MA 02144 USA
cell:   +81.90.6533.3882

(eric@w3.org)
Feel free to forward this message to any list for any purpose other than
email address distribution.

Received on Monday, 4 April 2005 16:19:25 GMT

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