[sc34wg3] TMQL: Operators "Not equal"

Inge Henriksen inge.henriksen at bouvet.no
Mon Oct 29 06:42:07 EDT 2007


How will different Unicode characters be handled when it comes to
comparing? When see the "==" operator I assume a binary comparison, but
should these kinds of operators be used when comparing text's? If you
say 

  select $p / name
  where
     $p isa person
  &  $p / homepage == "http://myspace.com/"

where each side of the operator is of a different Unicode character set
then they are not binary equal but they may still be equal from a
culture-insensitive standpoint. In addition "http://myspace.com/" and
"HTTP:/MYSPACE.COM/" are also not equal from a binary comparison
standpoint, but are equal from a case-insensitive standpoint. Would it
be logical to rather use an "equals" operator when comparing texts, and
use the "==" operator only when doing binary comparisons? An "equals"
operator would allow for comparison of different texts with Unicode
character sets (culture-insensitive), and could also be
case-insensitive, or one could go for an "ordinal" comparison which is
culture-insensitive and case-sensitive. 

Example of culture-insensitive text comparing:

  select $p / name
  where
     $p isa person
  &  $p / homepage equals "http://myspace.com/"

Please forgive me if this has been discussed before and I have missed it
:)

-Inge

-----Original Message-----
From: sc34wg3-bounces at isotopicmaps.org
[mailto:sc34wg3-bounces at isotopicmaps.org] On Behalf Of Robert Barta
Sent: 29. oktober 2007 10:34
To: Discussion of ISO/IEC 13250 Topic Maps
Subject: Re: [sc34wg3] TMQL: Operators "Not equal"

On Fri, Oct 26, 2007 at 05:22:25PM +0200, Lars Heuer wrote:
> The current draft lacks of a not equal operator, like "!=". Is that
> intentional?
> 
> A not equal operator is quite handy even if
> 
>        not(1.0 = 2.0)
> 
> works, though.

Careful here: 

'==' has 'exists semantics' as it is operating on sequences! So 

  select $p / name
  where
     $p isa person
  &  $p / homepage != "http://myspace.com/"

might not really signal what is going on. If I read the above quickly,
then I would select all persons which have not a homepage at MySpace.

But what it means is

  not ($p / homepage == "http://myspace.com/")

So I'm actually asking for all persons where it is

  "not true, that there is at least one MySpace homepage"

The proposed notation

  $p / homepage != "http://myspace.com/"

would more indicate

  "no homepage is on MySpace"

This is also the reason to prefer '==' over '=', because the query
author should keep that in mind.

\rho
-- 
And then he said: "You should read my blog." http://kill.devc.at/
_______________________________________________
sc34wg3 mailing list
sc34wg3 at isotopicmaps.org
http://www.isotopicmaps.org/mailman/listinfo/sc34wg3


More information about the sc34wg3 mailing list