[Mulgara-dev] Mulgara 2.0.9 released

Paul Gearon gearon at ieee.org
Tue Mar 3 22:27:22 UTC 2009


Hi,

Sorry I'm a day late, but I got sidetracked on a bug.

I've just had a look at that filtered query......

On Fri, Feb 27, 2009 at 11:49 AM, Agustina Martinez <amgcia at gmail.com> wrote:
> 3) This applies to new release and to the previous one. I am trying to use
> the sparql "filter" clause with decimal values. I always get empty results.
> I write below the query I am running and specify a bit the RDF I am dealing
> with.
>
> prefix dc: <http://purl.org/dc/elements/1.1/>
> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
> prefix ex: <http://www.example.org/>
> prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
> prefix biol: <http://purl.org/NET/biol/ns#>
> construct
> {
>   ?s a ex:item;
>   geo:long ?o2.
> }
> from <rmi://localhost/fedora#plants>
> where {
>   ?s geo:long ?o2;
>   geo:lat ?o3.
>   filter(?o2 < 1.0)
> }
>
> The results expected are contruct elements with longitude less than 1.0
> degrees. Is a bug, or I am running the wrong query? My longitudes are
> expressed in decimal values in the form "X.YYYYY".

What is the datatype of your longitudes? Are they just untyped
literals (ie. strings)? If so, then the problem is that you're trying
to compare a string to a number. If not, then please get back to me,
since it looks like it works here.

I'm guessing you don't want to reload your data as floats or doubles,
in which case you'll need to provide a cast on your variable. There
was an issue here, but it's resolved in trunk now. The query then
becomes:

prefix ex: <http://www.example.org/>
prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
construct
{
  ?s a ex:item;
  geo:long ?o2.
}
from <rmi://localhost/fedora#plants>
where {
  ?s geo:long ?o2;
  geo:lat ?o3.
  filter(xsd:double(?o2) < 1.0)
}

Does that help?

Regards,
Paul



More information about the Mulgara-dev mailing list