oaregithub / oare_sql

1 stars 0 forks source link

Identify any inconsistencies between child_num and obj_in_text #20

Closed edstratford closed 5 months ago

edstratford commented 1 year ago

The following query should do so:

SELECT * FROM text_discourse td1 INNER JOIN text_discourse td2 ON td2.parent_uuid = td1.parent_uuid AND td2.child_num = td1.child_num+1 WHERE td2.obj_in_text < td1.obj_in_text IN (SELECT MIN(obj_in_text) FROM text_discourse WHERE parent_uuid = td1.parent_uuid AND obj_in_text > td1.obj_in_text) AND td1.text_uuid = 'dff850c8-ccd4-44a9-9994-2834ca832a6d';

however this query is too consuming to do on entire table... adapt a PHP script to do same thing>

edstratford commented 1 year ago

Any texts in Issue 12 should be removed from this query -there are clear errors in any marked in orange there.

edstratford commented 1 year ago

Related -- but inconsistencies between object_on_tablet and char_on_tablet:

https://docs.google.com/spreadsheets/d/1Z4fvOytPDtzOrtqeFl3uo5SAm95bYkDWYW82SylIisg/edit?usp=sharing

Results are from this query:

SELECT * FROM text_epigraphy te1 INNER JOIN text_epigraphy te2 ON te2.text_uuid = te1.text_uuid AND te1.object_on_tablet < te2.object_on_tablet AND te1.char_on_tablet > te2.char_on_tablet WHERE te1.type IN ('sign','number','undeterminedSigns','undeterminedLines') AND te2.type IN ('sign','number','undeterminedSigns','undeterminedLines');

edstratford commented 1 year ago

Only a very few from this query:

SELECT * FROM text_discourse td1 INNER JOIN text_discourse td2 ON td2.text_uuid = td1.text_uuid AND td1.obj_in_text < td2.obj_in_text AND td1.word_on_tablet > td2.word_on_tablet WHERE td1.type IN ('word','number') AND td2.type IN ('word','number');

And I fixed them all.

Gertrudius commented 5 months ago

These should all be resolved now by the fix_text_discourse_iteratives_and_orphans PHP script.