W3C home > Mailing lists > Public > public-sparql-dev@w3.org > July to September 2006

RE: Collations

From: Seaborne, Andy <andy.seaborne@hp.com>
Date: Tue, 12 Sep 2006 17:45:05 +0100
Message-ID: <86FE9B2B91ADD04095335314BE6906E868AB51@sdcexc04.emea.cpqcorp.net>
To: "Denis Gaertner" <denis_gaertner@gmx.net>, <public-sparql-dev@w3.org>




-------- Original Message --------
> From: Denis Gaertner <>
> Date: 11 September 2006 16:58
> 
> Hi!
> 
> I am interested in using different ways of comparing and ordering
> strings in a search query. 
> 
> ?s ?p ?string1 . ?s ?p2 ?string2 FILTER (?string1 <= ?string2)
> 
> This calls the Xpath compare function. I am interested in having
> something which is like a directory by ordering the strings
> alphabetically. So the definition of fn:compare has an argument for a
> collation which should be an appropriate one for this task. Is it
> possible to do this?    
> 
> Thanks
> 
> Denis

Hi Denis,

SPARQL allows functions to be added to the processors for extensibility.
While <= is dispatched to fn:compare/2 (code point) for strings, your
processor can also provide fn:compare/3 and so:

	FILTER (fn:compare(?string1, ?string2, "The Collation name"))

	Andy
Received on Tuesday, 12 September 2006 16:45:46 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:17:05 GMT