Project

General

Profile

Actions

Feature #960

closed

Ostalpen Revisited Corrections

Added by Bernhard Koschiček-Krombholz about 6 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Category:
-
Target version:
-
Start date:
2018-11-28
Estimated time:

Description

This issue is a collection of dataset which need to be corrected

Incorrect Dates:

https://dppopenatlas.oeaw.ac.at/place/view/47891
https://dppopenatlas.oeaw.ac.at/place/view/48383


Related issues 1 (0 open1 closed)

Related to OpenAtlas - Feature #961: Check function for dates and circular dependenciesClosedAlexander Watzinger2018-11-28Actions
Actions #1

Updated by Stefan Eichert about 6 years ago

  • Status changed from New to Resolved

Dates changed.

Actions #2

Updated by Alexander Watzinger about 6 years ago

  • Related to Feature #961: Check function for dates and circular dependencies added
Actions #3

Updated by Alexander Watzinger about 6 years ago

I wrote a new ticket to implement a date check function #961 so that invalid dates (e.g. begin after end) can be checked for all existing data.

Actions #4

Updated by Bernhard Koschiček-Krombholz about 6 years ago

  • Status changed from Resolved to Assigned

updated

Incorrect Dates:
https://dppopenatlas.oeaw.ac.at/place/view/47283
https://dppopenatlas.oeaw.ac.at/place/view/47289
https://dppopenatlas.oeaw.ac.at/place/view/47307
https://dppopenatlas.oeaw.ac.at/place/view/48149
https://dppopenatlas.oeaw.ac.at/place/view/49709
https://dppopenatlas.oeaw.ac.at/place/view/48521
https://dppopenatlas.oeaw.ac.at/place/view/49417
https://dppopenatlas.oeaw.ac.at/place/view/49319
https://dppopenatlas.oeaw.ac.at/place/view/49387
https://dppopenatlas.oeaw.ac.at/place/view/49273
https://dppopenatlas.oeaw.ac.at/place/view/48371
https://dppopenatlas.oeaw.ac.at/place/view/49369
https://dppopenatlas.oeaw.ac.at/place/view/47745
https://dppopenatlas.oeaw.ac.at/place/view/48323
https://dppopenatlas.oeaw.ac.at/place/view/47363
https://dppopenatlas.oeaw.ac.at/place/view/48569
https://dppopenatlas.oeaw.ac.at/place/view/49121
https://dppopenatlas.oeaw.ac.at/place/view/49159
https://dppopenatlas.oeaw.ac.at/place/view/49127
https://dppopenatlas.oeaw.ac.at/place/view/48557
https://dppopenatlas.oeaw.ac.at/place/view/47375
https://dppopenatlas.oeaw.ac.at/place/view/47369
https://dppopenatlas.oeaw.ac.at/place/view/47331
https://dppopenatlas.oeaw.ac.at/place/view/47219
https://dppopenatlas.oeaw.ac.at/place/view/48563
https://dppopenatlas.oeaw.ac.at/place/view/48317
https://dppopenatlas.oeaw.ac.at/place/view/49375
https://dppopenatlas.oeaw.ac.at/place/view/49351
https://dppopenatlas.oeaw.ac.at/place/view/48005
https://dppopenatlas.oeaw.ac.at/place/view/47643
https://dppopenatlas.oeaw.ac.at/place/view/47051
https://dppopenatlas.oeaw.ac.at/place/view/49331
https://dppopenatlas.oeaw.ac.at/place/view/47751
https://dppopenatlas.oeaw.ac.at/place/view/50051
https://dppopenatlas.oeaw.ac.at/place/view/49857

Actions #5

Updated by Alexander Watzinger about 6 years ago

Found the problem for internal server error: there are entities linked to the root of types (e.g. Hilltop Classification HTC) which is not allowed.

They came from the Ostalpen import, to fix this you can use the SQL below. Be sure to make a backup before.

DELETE FROM model.link WHERE property_code = 'P2' AND range_id IN (SELECT id FROM web.hierarchy);

In my test run on a current dpp dump 192 links were deleted.

Actions #6

Updated by Alexander Watzinger almost 6 years ago

I just double checked. It was not an import bug, the dates were already invalid (begin after end) in the Ostalpen Revisited database.

I moved #961 (checking dates in backend) up, I'm already working on it and should be available with the version 3.12.0 at the end of year. Will be implemented in DPP in 2019 whenever Berni is available. I suggest to wait for that to fix the entries systematically.

Anyway, when testing on a local backup 68 rows were found. In case anyone is in a hurry to fix them earlier here is the SQL to find them:

SELECT e.id,
    max(b1.value_timestamp) AS begin_1,
    max(b2.value_timestamp) AS begin_2,
    max(e1.value_timestamp) AS end_1,
    max(e2.value_timestamp) AS end_2
 FROM model.entity e

LEFT JOIN model.link bl1 ON e.id = bl1.domain_id
    AND bl1.property_code IN ('OA1', 'OA3', 'OA5')
LEFT JOIN model.entity b1 ON bl1.range_id = b1.id
    AND b1.system_type IN ('from date value', 'exact date value')

LEFT JOIN model.link bl2 ON e.id = bl2.domain_id
    AND bl2.property_code IN ('OA1', 'OA3', 'OA5')
LEFT JOIN model.entity b2 ON bl2.range_id = b2.id AND b2.system_type = 'to date value'

LEFT JOIN model.link el1 ON e.id = el1.domain_id
    AND el1.property_code IN ('OA2', 'OA4', 'OA6')
LEFT JOIN model.entity e1 ON el1.range_id = e1.id
    AND e1.system_type IN ('from date value', 'exact date value')

LEFT JOIN model.link el2 ON e.id = el2.domain_id
    AND el2.property_code IN ('OA2', 'OA4', 'OA6')
LEFT JOIN model.entity e2 ON el2.range_id = e2.id AND e2.system_type = 'to date value'

GROUP BY e.id

HAVING e.class_code IN ('E6', 'E7', 'E8', 'E12', 'E18', 'E21', 'E22', 'E40', 'E74')
    AND (max(b1.value_timestamp) > max(b2.value_timestamp)
        OR max(e1.value_timestamp) > max(e2.value_timestamp)
        OR (max(b1.value_timestamp) IS NOT NULL AND max(e1.value_timestamp) IS NOT NULL
            AND max(b1.value_timestamp) > max(e1.value_timestamp))                
        OR (max(b2.value_timestamp) IS NOT NULL AND max(e2.value_timestamp) IS NOT NULL
            AND max(b2.value_timestamp) > max(e2.value_timestamp)));
Actions #7

Updated by Alexander Watzinger about 5 years ago

  • Tracker changed from 5 to Feature
Actions #8

Updated by Alexander Watzinger almost 5 years ago

I'm trying to clean up our issues - do we still need this one or can we close it?

Actions #9

Updated by Bernhard Koschiček-Krombholz almost 5 years ago

  • Status changed from Assigned to Closed
Actions

Also available in: Atom PDF