Ticket #48 (assigned defect)

Opened 4 years ago

Last modified 3 years ago

Problematic execution when a nested spatial function occurs inside a FILTER

Reported by: stella Owned by: giannis
Priority: major Milestone: Strabon v3.2.11
Component: generaldb Version:
Keywords: Cc:

Description

The following query:

select ?g
where
{

ex:A geo:hasGeometry ?geom .
?geom geo:asWKT ?g .
FILTER(strdf:within(?g, strdf:buffer(?g, 0, ogc:degree)))

}

gives unexpected results because the query that is sent to postgres does not make the join between the tables aswkt and geo_values. The query has the same behavior even if instead of buffer i put another construct.
I think that a hint to solve it has to do with the construction of the tuple expression and the "dummy" statement pattern that is appended at the filters.

Change History

comment:1 Changed 3 years ago by psmeros

  • Milestone set to Strabon v3.2.10

comment:2 Changed 3 years ago by giannis

  • Owner changed from pyravlos-team to giannis
  • Status changed from new to assigned

comment:3 follow-up: ↓ 4 Changed 3 years ago by giannis

We discussed with babis that the ?g variable is bound to the geometry of the ex:A resource, however the same does not happen with the ?g variable inside the buffer function and as a result there's no join condition between the two tables.
The query :

select ?g
where
{
<http://example.org#A> geo:hasGeometry ?geom .
?geom geo:asWKT ?g .
FILTER(strdf:within(?g, strdf:buffer(?g, 0, ogc:metre) && ?g = ?g))
}

works fine, by returning no results (as it should have)

comment:4 in reply to: ↑ 3 Changed 3 years ago by giannis

If I invert the order of the arguments of within it works fine!
(Btw, if you calculate within(?g ?g) it returns true (tested in postgis).

So the initial query is supposed to return the geometry of the given resource only.

Replying to giannis:

We discussed with babis that the ?g variable is bound to the geometry of the ex:A resource, however the same does not happen with the ?g variable inside the buffer function and as a result there's no join condition between the two tables.
The query :

select ?g
where
{
<http://example.org#A> geo:hasGeometry ?geom .
?geom geo:asWKT ?g .
FILTER(strdf:within(?g, strdf:buffer(?g, 0, ogc:metre) && ?g = ?g))
}

works fine, by returning no results (as it should have)

comment:5 Changed 3 years ago by giannis

Suppose also that we have:

select ?g
where
{
<​http://example.org#A> geo:hasGeometry ?geom .
?geom geo:asWKT ?g .
FILTER(strdf:within(?g, strdf:buffer(?g, 0, ogc:metre)))
}

And an equivalent one could be:

select ?g
where
{
<​http://example.org#geomA> geo:asWKT ?g .
FILTER(strdf:within(?g, strdf:buffer(?g, 0, ogc:metre)))
}

The first one is still the faulty, but the second query returns the correct result!
Maybe the bug may not lie necessarily in the FILTER processing mechanism but it could be (also) sesame's fault.

comment:6 Changed 3 years ago by charnik

Hasn't this been fixed Gianni? I thought you had it fixed a long time now. Have you stumbled upon any specific issue?

Note: See TracTickets for help on using tickets.