- From: Steve Harris <steve.harris@garlik.com>
- Date: Sun, 28 Nov 2010 16:30:53 +0000
- To: Andy Seaborne <andy.seaborne@epimorphics.com>
- Cc: Gregory Williams <greg@evilfunhouse.com>, SPARQL Working Group <public-rdf-dawg@w3.org>
On 2010-11-28, at 15:34, Andy Seaborne wrote:
>
> On 28/11/10 15:14, Steve Harris wrote:
>>> > If we require it, it seems natural to me to have:
>>> >
>>> > CONCAT("a"@en, "b"@en) -> "ab"@en
>>> > CONCAT("a"@en, "b"@fr) -> "ab" (or error)
>>> > CONCAT("a"@en, "b") -> "ab" (or error)
>> There are legitimate cases where you might have some literals without tags, and some with, and want to concatenate them, without having loads of logic.
>
> (just sorting out the small details)
>
> This can be achieved by using STR:
>
> CONCAT(STR("a"@en), STR("b"@fr)) -> "ab"
>
> Is that too much logic?
That's not what I was thinking of as logic, but then you can't preserve the lang tag, if one applies. Might not matter though.
I was thinking of cases like:
<distilation> a :Process ;
:name "Distillation", "Дестилация"@ru ;
:produces "C2H5OH" .
SELECT (CONCAT(?name, " -> ", ?produces))
WHERE {
?process a :Process ;
:name ?name ;
:produces ?produces .
FILTER(lang(?name) = "ru" || lang(?name) = "")
FILTER(lang(?produces) = "ru" || lang(?produces) = "")
}
If we preserve lang tags then you'll get:
"Дестилация -> C2H5OH"@ru
"Distillation -> C2H5OH"
With STR() you'd lose the lang tag.
This might be nonsense scientifically speaking, the example I'm most familiar with is from signal processing, but it's hard to explain without a lot of context. I hope it makes the point though.
> GROUP_CONCAT does require use of STR becuase it uses fn:string-join.
That wasn't intentional though.
- Steve
--
Steve Harris, CTO, Garlik Limited
1-3 Halford Road, Richmond, TW10 6AW, UK
+44 20 8439 8203 http://www.garlik.com/
Registered in England and Wales 535 7233 VAT # 849 0517 11
Registered office: Thames House, Portsmouth Road, Esher, Surrey, KT10 9AD
Received on Sunday, 28 November 2010 16:31:30 UTC