claeis / ili2db

interlis import/export to relational databases
30 stars 30 forks source link

ili2gpkg `--validate` checks date wrong #538

Open signedav opened 7 months ago

signedav commented 7 months ago

ili2gpkg handle the date differently to ilivalidator.

I have:

I validate with ilivalidator:

Error: line 6: Gebaeudeinventar_V1.Gebaeude.Gebaeude: tid _503befcd-7ae5-4d6f-b60d-2dabb8c3c407: invalid format of date value <09.03.2024> in attribute Datum_Heizung
Info: second validation pass...

as expected...

Now I do the following:

The model:

INTERLIS 2.3;
MODEL Gebaeudeinventar_V1 (de)
AT "mailto:signedav@localhost"
VERSION "2023-01-19" =
  TOPIC Gebaeude = 
    CLASS Gebaeude =
        Datum_Heizung : INTERLIS.XMLDate;
    END Gebaeude;
  END Gebaeude;
END Gebaeudeinventar_V1.

The XTF:

<?xml version="1.0" encoding="UTF-8"?><TRANSFER xmlns="http://www.interlis.ch/INTERLIS2.3">
<HEADERSECTION SENDER="ili2gpkg-5.0.1-447c03f22b8f346a44ada86c553d10110872fd40" VERSION="2.3"><MODELS><MODEL NAME="Gebaeudeinventar_V1" VERSION="2023-01-19" URI="mailto:signedav@localhost"></MODEL></MODELS></HEADERSECTION>
<DATASECTION>
<Gebaeudeinventar_V1.Gebaeude BID="_656c0f6f-7028-46e5-837c-3cbf447746a6">
<Gebaeudeinventar_V1.Gebaeude.Gebaeude TID="_503befcd-7ae5-4d6f-b60d-2dabb8c3c406"><Datum_Heizung>2024-03-08</Datum_Heizung></Gebaeudeinventar_V1.Gebaeude.Gebaeude>
<Gebaeudeinventar_V1.Gebaeude.Gebaeude TID="_503befcd-7ae5-4d6f-b60d-2dabb8c3c407"><Datum_Heizung>09.03.2024</Datum_Heizung></Gebaeudeinventar_V1.Gebaeude.Gebaeude>
</Gebaeudeinventar_V1.Gebaeude>
</DATASECTION>
</TRANSFER>

The ili2gpkg Log:

2024-03-01 10:10:03,296 INFO    Run: java -jar /home/dave/.local/share/QGIS/QGIS3/profiles/mjpnl/python/plugins/QgisModelBaker/libs/modelbaker/iliwrapper/bin/ili2gpkg-5.0.1/ili2gpkg-5.0.1.jar --validate --dbfile /home/dave/dev/opengisch/teaching-and-talks/teaching-interlis-webinar/data/test/datum2.gpkg --models Gebaeudeinventar_V1 --exportTid --xtflog /tmp/home_dave_dev_opengisch_teaching_and_talks_teaching_interlis_webinar_data_test_datum2_gpkg.xtf --models Gebaeudeinventar_V1 --iliMetaAttrs NULL
2024-03-01 10:10:03,431 ERROR   Info: dburl <jdbc:sqlite:/home/dave/dev/opengisch/teaching-and-talks/teaching-interlis-webinar/data/test/datum2.gpkg>
2024-03-01 10:10:03,432 ERROR   Info: dbusr <>
2024-03-01 10:10:03,609 ERROR   Info: ili2gpkg-5.0.1-447c03f22b8f346a44ada86c553d10110872fd40
2024-03-01 10:10:03,621 ERROR   Info: ili2c-5.3.3-be3aa7eaac016c8301424dd1bf027d9ef39f86c8
2024-03-01 10:10:03,622 ERROR   Info: iox-ili-1.21.18-11c92f590bbe67df7af2051dad58b246996d14eb
2024-03-01 10:10:03,622 ERROR   Info: java.version 18.0.2-ea
2024-03-01 10:10:03,622 ERROR   Info: user.name <dave>
2024-03-01 10:10:03,622 ERROR   Info: maxMemory 4005888 KB
2024-03-01 10:10:03,625 ERROR   Info: currentTime 2024-03-01 10:10:03
2024-03-01 10:10:03,630 ERROR   Info: dburl <jdbc:sqlite:/home/dave/dev/opengisch/teaching-and-talks/teaching-interlis-webinar/data/test/datum2.gpkg>
2024-03-01 10:10:03,630 ERROR   Info: dbusr <>
2024-03-01 10:10:03,632 ERROR   Info: databaseProduct <SQLite>
2024-03-01 10:10:03,632 ERROR   Info: databaseVersion <3.43.0>
2024-03-01 10:10:03,632 ERROR   Info: driverName <SQLite JDBC>
2024-03-01 10:10:03,632 ERROR   Info: driverVersion <3.43.0.0>
2024-03-01 10:10:03,632 ERROR   Info: max active DB statements <0>
2024-03-01 10:10:03,641 ERROR   Info: compile models...
2024-03-01 10:10:03,642 ERROR   Info: lookup model <Gebaeudeinventar_V1> in repository <jdbc:sqlite:/home/dave/dev/opengisch/teaching-and-talks/teaching-interlis-webinar/data/test/datum2.gpkg/>
2024-03-01 10:10:03,643 ERROR   Info: ilifile </home/dave/.ilicache/jdbc&003asqlite&003a/home/dave/dev/opengisch/teaching-and-talks/teaching-interlis-webinar/data/test/datum2.gpkg/datum.ili>
2024-03-01 10:10:03,701 ERROR   Info: process data...
2024-03-01 10:10:03,727 ERROR   Info: assume unknown external objects
2024-03-01 10:10:03,736 ERROR   Info: first validation pass...
2024-03-01 10:10:03,739 ERROR   Info: Gebaeudeinventar_V1.Gebaeude BID <_656c0f6f-7028-46e5-837c-3cbf447746a6>...
2024-03-01 10:10:03,739 ERROR   Info: Gebaeudeinventar_V1.Gebaeude.Gebaeude...
2024-03-01 10:10:03,742 ERROR   Error: line 0: Gebaeudeinventar_V1.Gebaeude.Gebaeude: tid _503befcd-7ae5-4d6f-b60d-2dabb8c3c406: invalid format of date value <2024-03-08 00:00:00.000Z> in attribute Datum_Heizung
2024-03-01 10:10:03,745 ERROR   Info: second validation pass...
2024-03-01 10:10:03,746 ERROR   ...validate failed