Ticket #66 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Resolution of strdf:contains(strdf:period, xsd:dateTime) when the second argument is a variable is not working

Reported by: charnik Owned by: pyravlos-team
Priority: major Milestone: Strabon v3.3
Component: generaldb Version: 3.2.9
Keywords: strdf:contains, contains, period, dateTime, exception, binding Cc:


Take the following endpoint (temporals branch): http://test.strabon.di.uoa.gr/iswc-demo/.

The following query

PREFIX corine: <http://www.linkedopendata.gr/corine/ontology#>
PREFIX strdf: <http://strdf.di.uoa.gr/ontology#>
SELECT ?time

?area corine:hasLandUse ?corineLandUse ?time.
FILTER (strdf:contains("[2013-05-08T05:10:00,2013-05-08T18:00:00]"^^strdf:period, ?time))


raises the following exception

org.openrdf.sail.rdbms.exceptions.RdbmsQueryEvaluationException?: org.postgresql.util.PSQLException: ERROR: syntax error at or near "," Position: 230 SELECT h0.obj, ST_AsBinary(ST_Transform(l_time.strdfgeo,l_time.srid)),l_time.srid FROM hasvalidtime_2 h0 INNER JOIN haslanduse_8 h1 ON (h1.ctx = h0.subj) INNER JOIN geo_values l_time ON (l_time.id = h0.obj) WHERE (ST_Contains(,l_time.strdfgeo)) LIMIT 1000

Apparently, the presence of ST_AsBinary(ST_Transform(l_time.strdfgeo,l_time.srid)) implies that strdf:contains has not been resolved correctly. The correct resolution would have led to the calling of function strdf:contains(strdf:period, xsd:dateTime) instead of function strdf:contains(strdf:geometry, strdf:geometry) that is now used.

If we re-write the above query as follows, then resolution is done correctly.

PREFIX corine: <http://www.linkedopendata.gr/corine/ontology#>
SELECT ?area ?t

?area corine:hasGeometry ?geometry .


SELECT ?area ?time

?area corine:hasLandUse ?corineLandUse ?time.




I suspect that the problem arises when the second argument is a variable coming from the evaluation of a triple pattern. We have to check also
a) the other version of the strdf:contains, that is, strdf:contains(strdf:period i1, strdf:period i2),
b) the possibility that the first argument is a variable, and
c) the possibility that both arguments are variables.

Change History

comment:1 Changed 3 years ago by charnik

  • Milestone set to Strabon v3.3

comment:2 Changed 3 years ago by constant

Temporal containment is checked using the following functions: strdf:PeriodContains or strdf:during. strdf: contains was used in the first version of the temporal component of Strabon, but then, for functions that have spatial alternatives, the URIs changed to avoid confusion. The reference (http://www.strabon.di.uoa.gr/stSPARQL) is now updated with the correct URIS. So this ticket can be closed, unless we decide to have a single URI for each of these functions (that are both spatial and temporal).

PS. I missed you too guys :) (And girls. And P.)

comment:3 Changed 3 years ago by charnik

  • Status changed from new to closed
  • Resolution set to fixed

Gamw th stravomara mou!!!
Bug is set to fixed, Ntina!

Note: See TracTickets for help on using tickets.