W3C home > Mailing lists > Public > public-rdfa-wg@w3.org > November 2010

Re: PROPOSAL to close ISSUE-49: RDFNode type, equality and canonicalization

From: Toby Inkster <tai@g5n.co.uk>
Date: Thu, 11 Nov 2010 15:10:43 +0000
To: Manu Sporny <msporny@digitalbazaar.com>
Cc: RDFa WG <public-rdfa-wg@w3.org>
Message-ID: <20101111151043.2d7274a1@miranda.g5n.co.uk>
On Wed, 10 Nov 2010 20:42:51 -0500
Manu Sporny <msporny@digitalbazaar.com> wrote:

> The equals() method will return true if both RDFNodes have the same
> nodeType() and the same toCanonical() result. Simple string comparison
> between the two methods is sufficient when testing for equality
> between RDFNodes.

My implementation already has an isEqual method that works precisely
that way. :-) I'll just need to rename it.

FWIW my isEqual also accepts a string as a parameter, so:

	$iri = RDF::RDFa::API::IRI->new('http://example.com/');
	$iri->isEqual('<http://example.com/>');   # true

There's a reason for that - I overload Perl's normal 'eq' operator
which tests for string equality, so I can do this:

	$iri = RDF::RDFa::API::IRI->new('http://example.com/');
	if ($iri eq '<http://example.com/>')
	{
		# this will happen
	}

-- 
Toby A Inkster
<mailto:mail@tobyinkster.co.uk>
<http://tobyinkster.co.uk>
Received on Thursday, 11 November 2010 15:11:16 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:19:50 UTC