profile
viewpoint

GeoKnow/LinkedGeoData 108

OpenStreetMap for the Semantic Web

apano-on/IFCtoRDF 0

IFCtoRDF is a set of reusable Java components that allows to parse IFC-SPF files and convert them into RDF graphs.

apano-on/incubator-sedona 0

A cluster computing framework for processing large-scale geospatial data

apano-on/LinkedGeoData 0

OpenStreetMap for the Semantic Web

apano-on/ontop 0

Ontop is a platform to query relational databases as Virtual RDF Knowledge Graphs using SPARQL

apano-on/ontop-website 0

New website for Ontop, including the documentation for Ontop >=3.0

apano-on/python-ifc 0

An IFC file parser in python

apano-on/rasterframes 0

Geospatial Raster support for Spark DataFrames

apano-on/teiid 0

Teiid is a data virtualization system that allows applications to use data from multiple, heterogenous data stores.

delete branch GeoKnow/LinkedGeoData

delete branch : test/ontop-optional-properties-file

delete time in 12 days

push eventGeoKnow/LinkedGeoData

apano-on

commit sha 7792daee3efcecce3cbd3446957558869df8b82a

Update to latest version of Ontop (4.2.0)

view details

push time in 12 days

delete branch ontop/ontop

delete branch : feature/ofn-time-arithmetic

delete time in a month

delete branch ontop/ontop

delete branch : bugfix/dates-postgres

delete time in a month

issue closedontop/ontop

Time function extension - duration

Time function extension - duration arithmetic

Implement functions in Ontop which perform arithmetic between timestamps and dates with the goal of supporting expressions which retrieve the duration in user specified units between two dates or datetimes e.g.:

now() - ‘1970-01-01’^^xsd:date 
?end - ?start < 5 (days)

The output of these functions should be durations in user-specified units. Tentative prefix for these functions will be ofn with namespace to be defined. The functions to be implemented are:

  • [x] ofn:weeksBetween
  • [x] ofn:daysBetween
  • [x] ofn:hoursBetween
  • [x] ofn:minutesBetween
  • [x] ofn:secondsBetween
  • [x] ofn:millisBetween

Support both xsd:dateTime and xsd:date.

Also investigate adding more specific datatypes related to duration. A similar implementation to what will be added is available here.

closed time in a month

apano-on

issue commentontop/ontop

Time function extension - duration

Issue resolved by changes implemented in #483.

apano-on

comment created time in a month

issue commentontop/ontop

Time function extension - duration

I think since there is no approved official standard for time/duration arithmetic, it was not necessary to constrain the functionality to such a solution in this case.

apano-on

comment created time in a month

issue commentontop/ontop

Date & time functions fail for constant input in PostgreSQL

Issue resolved by changes implemented in #483.

apano-on

comment created time in a month

issue closedontop/ontop

Date & time functions fail for constant input in PostgreSQL

Description

Functions for date & time fail for PostgreSQL when there is a constant input in the SPARQL query.

Steps to Reproduce

Run the following query:

SELECT ?w WHERE
BIND("1799-12-14T09:00:00"^^xsd:dateTime AS ?death )
BIND("1732-02-22T09:30:00"^^xsd:dateTime AS ?birth )
BIND (YEAR(?death) - YEAR(?birth) AS ?w)

Expected behavior: Return 67

Actual behavior: Caused by: org.postgresql.util.PSQLException: ERROR: function pg_catalog.date_part(unknown, unknown) is not unique Hint: Could not choose a best candidate function. You might need to add explicit type casts.

Reproduces how often: Always

Attached material

Translated query is: SELECT (EXTRACT(YEAR FROM '1799-12-14 09:00:00') - EXTRACT(YEAR FROM '1732-02-22 09:30:00')) Translated query should be (tentatively): SELECT (EXTRACT(YEAR FROM TIMESTAMP '1799-12-14 09:00:00') - EXTRACT(YEAR FROM TIMESTAMP '1732-02-22 09:30:00'))

Versions

Ontop v4.1.1 and v4.2.0-SNAPSHOT

Additional Information

As a tentative fix, what works is simply overriding the serialization for the date & time functions for constants and adding a cast as attempted in 59b0eca229e02f39f4713c34a269a30a7fd8588d. However, I do not know if there is a better way to handle this issue.

closed time in a month

apano-on

create barnchapano-on/incubator-sedona

branch : test/sedona-ontop-raster

created branch time in a month

push eventapano-on/test-spark-datatypes

apano-on

commit sha f944c9c0119b936e29049508085107fc311aee98

Update

view details

apano-on

commit sha 54266268e9ac09b624b8160ad5a315e097c55633

Merge remote-tracking branch 'origin/test/rasterframes-spark2' into test/rasterframes-spark2

view details

push time in a month

push eventapano-on/test-spark-datatypes

apano-on

commit sha 387d1008afc942f08f43c24a7d2d4140d11a9686

Update readme.md

view details

push time in a month

push eventapano-on/test-spark-datatypes

apano-on

commit sha 26fe4d96835f6b2ff0e423f91a66eb1b7e8c5b30

Update readme.md

view details

push time in a month

push eventapano-on/test-spark-datatypes

apano-on

commit sha 89eab9d4574c676991d302f277449154b24e28d6

Update readme.md

view details

push time in a month

create barnchapano-on/test-spark-datatypes

branch : test/rasterframes-spark2

created branch time in a month

push eventapano-on/test-spark-datatypes

apano-on

commit sha 5158bf6f79683f324eb0bcaed1317c7c81b68acc

Update

view details

push time in a month

push eventapano-on/test-spark-datatypes

apano-on

commit sha 296c71459bcb0bbe86cfc1cc75d3224db085b56e

Fix build

view details

push time in a month

push eventapano-on/test-spark-datatypes

apano-on

commit sha 7f4c48b5c619d253b1819759166b5c6d1433717a

Update portal file

view details

push time in a month

push eventapano-on/test-spark-datatypes

apano-on

commit sha 63af64ba5ff38e4d748092b6e1785768b7ae4e5a

Sedona working setup

view details

push time in a month

push eventapano-on/test-spark-datatypes

apano-on

commit sha 8cdf876fe759174fe8b792cf7d891ac51c7ebca2

Sedona working setup

view details

push time in a month

issue commentontop/ontop

Date & time functions fail for constant input in PostgreSQL

Hi @bcogrel ,

I applied the suggested simplification with 006fddf. Let me know in case of any other change.

apano-on

comment created time in a month

push eventontop/ontop

apano-on

commit sha 006fddff069d5f922717c5138fa5e549bfad0a89

Code simplification

view details

push time in a month

push eventGeoKnow/LinkedGeoData

apano-on

commit sha 1283a1c1271089224e492cdb24987876f08913a7

Add custom script to expand metamappings

view details

apano-on

commit sha 04534d597a16e0b88c2540efab536db5b94e8711

Merge remote-tracking branch 'origin/develop' into develop

view details

push time in a month

issue commentontop/ontop

Date & time functions fail for constant input in PostgreSQL

Hi @bcogrel ,

Thanks for the hint. I applied a trivial change to the switch accounting for DATETIME, and also added a new DBTermType category for DATE which solved the issue. This was also useful as part of a separate change since it also resolved an issue there 5c0a8d2. Let me know if it is not well aligned (or there is any other issue).

I applied the change only for PostgreSQL and Dremio (where I noticed a similar problem). I tried changing the default serializer and noticed it caused an issue for Denodo, since it did not seem possible to cast a string to a TIMESTAMPTZ (when the input contained a timezone and special handling was necessary and I did not want to test thoroughly Denodo time datatypes). Maybe a more generic change can be applied in the future.

apano-on

comment created time in a month

pull request commentontop/ontop

Implementation of time duration arithmetic

As discussed we will try to ensure the results of the function were consistent across DB engines by among other things trying to see whether unix time or other solutions could help. The following changes were applied with that in mind:

  • PostgreSQL - EXTRACT EPOCH used for unix time. This ensures all values are calculated more consistently.
  • Microsoft SQL Server - No unix time function available (indeed DATEDIFF is used to get unix time). Therefore adjustments were performed to DATEDIFF to avoid the automatic rounding up. E.g. if we seek the difference in hours between timestamp2 and timestamp1, if the total minutes in timestamp2 is lower than that in timestamp1, we subtract 1 (to account for rounding). The same logic applies for other units (e.g. hour in this example) and their respective subunits (e.g. minute in this example).

Moreover, following an investigation of other changes (either to improve precision or function consistency) I can report the following:

  • DB2 - The EXTRACT function can be used to calculate unix time but it is usually off by 1 in the case of milliseconds due to automatic rounding rather than truncation. Therefore, since a non-unix time solution was used for milliseconds I kept the other built-in {TIME_UNIT}_BETWEEN functions defined. The results are consistent even without unix time. Timezone support for DB2 is also missing.
  • Oracle - No built-in function to get unix time found. The use of EXTRACT is reasonably consistent (same results) albeit the resulting SQL translation is unfortunately very long.
  • Denodo - No built-in function for unix time found. Results for timestamps without timezone are correct.
  • Dremio - The function to retrieve unix time has as its lowest unit seconds. For seconds and larger units the built-in TIMESTAMPDIFF works correctly so no change was necessary. Support for milliseconds is missing in Dremio.

No changes needed for H2, MySQL.

Some issues with conversion of constant TEXT input to TIMESTAMP/DATE for PostgreSQL and Dremio were also addressed.

If further changes are necessary or some other solutions are possible I am available to look into them.

apano-on

comment created time in a month

push eventontop/ontop

apano-on

commit sha 5c0a8d298d63f0a016bb9f5a7251c5dc1d76da46

Refactor ofn time functions

view details

push time in a month

push eventontop/ontop

apano-on

commit sha e9e2761a6585f13aca8a92e98c465f86443fe0e7

Refactor ofn time functions

view details

push time in a month

fork apano-on/rasterframes

Geospatial Raster support for Spark DataFrames

http://rasterframes.io

fork in a month

issue openedontop/ontop

Date & time functions fail for constant input in PostgreSQL

Description

Functions for date & time fail for PostgreSQL when there is a constant input in the SPARQL query.

Steps to Reproduce

Run the following query:

SELECT ?w WHERE
BIND("1799-12-14T09:00:00"^^xsd:dateTime AS ?death )
BIND("1732-02-22T09:30:00"^^xsd:dateTime AS ?birth )
BIND (YEAR(?death) - YEAR(?birth) AS ?w)

Expected behavior: Return 67

Actual behavior: Caused by: org.postgresql.util.PSQLException: ERROR: function pg_catalog.date_part(unknown, unknown) is not unique Hint: Could not choose a best candidate function. You might need to add explicit type casts.

Reproduces how often: Always

Attached material

Translated query is: SELECT (EXTRACT(YEAR FROM '1799-12-14 09:00:00') - EXTRACT(YEAR FROM '1732-02-22 09:30:00')) Translated query should be (tentatively): SELECT (EXTRACT(YEAR FROM TIMESTAMP '1799-12-14 09:00:00') - EXTRACT(YEAR FROM TIMESTAMP '1732-02-22 09:30:00'))

Versions

Ontop v4.1.1 and v4.2.0-SNAPSHOT

Additional Information

As a tentative fix, what works is simply overriding the serialization for the date & time functions for constants and adding a cast as attempted in 59b0eca229e02f39f4713c34a269a30a7fd8588d. However, I do not know if there is a better way to handle this issue.

created time in 2 months

create barnchontop/ontop

branch : bugfix/dates-postgres

created branch time in 2 months

more