[Mulgara-general] Substring Function in Sparql?

Paul Gearon gearon at ieee.org
Tue Oct 6 15:15:10 UTC 2009


Hi Stone,

Were you still interested in a substring function in Mulgara?

If so, then it's in svn now. There will be a release later this week.
You can see details here:

http://mulgara.org/trac/wiki/SPARQLExt

(The function you want is fn:substring. See
http://mulgara.org/trac/wiki/Functions)

Regards,
Paul Gearon

On Mon, Aug 24, 2009 at 6:08 PM, Stone Xiang <stone.xiang at yahoo.com> wrote:
> That's good to know. Good luck with your moving.
> ________________________________
> From: Paul Gearon <gearon at ieee.org>
> To: Mulgara General <mulgara-general at mulgara.org>
> Sent: Monday, August 24, 2009 1:31:01 PM
> Subject: Re: [Mulgara-general] Substring Function in Sparql?
>
> Not for a couple of weeks. I'm moving house right now (I'm only online
> now because I had to check email from a tradesman, and I'm using a
> friend's computer), and I won't be online again until next week.
>
> It's an easy job, so I'll probably do it first thing, as a way of
> getting myself back into the swing of coding.  :-)
>
> Paul
>
> On 8/24/09, Stone Xiang <stone.xiang at yahoo.com> wrote:
>> That would be great. When will this feature be available?
>>
>>
>>
>>
>> ________________________________
>> From: Paul Gearon <gearon at ieee.org>
>> To: Mulgara General <mulgara-general at mulgara.org>
>> Sent: Friday, August 21, 2009 5:29:39 PM
>> Subject: Re: [Mulgara-general] Substring Function in Sparql?
>>
>> On Fri, Aug 21, 2009 at 2:14 PM, Stone Xiang<stone.xiang at yahoo.com> wrote:
>>> The scenario is a (not so elegant) extension of the Fedora repository,
>>> where
>>> the objects
>>> in the RELS-EXT datastream are used to store some data values. A more
>>> appropriate
>>> example would be:
>>> SELECT $s from <#ri> {$s <some predicate> $t}
>>> order by substring($t, 5, 3)
>>> Here the subject of <some predicate> is the URI of a Fedora item while
>>> the
>>> object stores
>>> several fields of data and one of them is relevant to sorting (or other
>>> filtering
>>> operations).
>>> Since you already said there is no substring fuctino in Sparql, I think
>>> I'll
>>> find some other
>>> way around.
>>
>> Not in standard SPARQL, but I'm sure that some implementation will
>> have this function available. I've been looking to add extra functions
>> myself (it's VERY easy). I'd offer to do it here right now, only I
>> haven't implemented ORDER BY for arbitrary expressions yet. You'd have
>> to set a variable. So it would probably end up as:
>>
>>  SELECT $s from <#ri>
>>  WHERE {$s <some predicate> $t . LET ($ord := fn:substring($t, 5, 3)}
>>  ORDER BY $ord
>>
>> Regards,
>> Paul
>> _______________________________________________
>> Mulgara-general mailing list
>> Mulgara-general at mulgara.org
>> http://mulgara.org/mailman/listinfo/mulgara-general
>>
>>
>>
>>
> _______________________________________________
> Mulgara-general mailing list
> Mulgara-general at mulgara.org
> http://mulgara.org/mailman/listinfo/mulgara-general
>
>
> _______________________________________________
> Mulgara-general mailing list
> Mulgara-general at mulgara.org
> http://mulgara.org/mailman/listinfo/mulgara-general
>
>



More information about the Mulgara-general mailing list