[Mulgara-general] Substring Function in Sparql?

Paul Gearon gearon at ieee.org
Fri Aug 21 01:51:18 UTC 2009


On Thu, Aug 20, 2009 at 3:08 PM, Stone Xiang<stone.xiang at yahoo.com> wrote:
> Is there any substring function in the Mulgara version of the Sparql so I
> can do
> something like the following?
> select $v where substring($v, 5, 3) <some predicate> $u
> ...
> order by substring($v, 5, 3)
> I couldn't find any in the W3C Sparql spec.

No, there's no substring function in SPARQL, though it would be a
trivial extension.

As for your example, it doesn't make a lot of sense.

   where substring($v, 5, 3) <some predicate> $u

You have no binding on the variable $v, so how can you do a substring
on it? Could you describe what you want a little more clearly please?

Also, it's an outstanding bug in Mulgara that we don't order by
arbitrary expressions. Now that we have variable expressions it will
be trivial to implement, but I haven't got it done yet (sorry).

Regards,
Paul



More information about the Mulgara-general mailing list