Repository navigation
Remove unique constraints, because we have xsd:key - #998
Conversation
|
@skinkie, |
|
2.0.1 |
|
I had a first look locally today; the branch is not up-to-date anymore, so I'll push the "update from v2.0" from my machine. @TuThoThai in order for GitHub to detect that a branch is not up-to-date, we'll have to (re?)-enable "check status updates" first. |
For both files: * adding in the metadata the changes made most recently on ref / key constraints * changing status from 1.0 to 2.0
|
@skinkie, great work on this one! It definitly helped a lot with the validation speed, but also made the Schema much faster to load with tools like XMLSpy I made a tiny commit to:
|
There was a problem hiding this comment.
I did manual + automated (AI) reviews. The vast majority (> 97%) of the stuff seems right to me. I have questions on a few remaining cases.
Can someone with more historical or functional context comment on these? (@skinkie and others!).
Unsure at this point if these are false positives / issues with the review, or something that deserves actual changes possibly.
Potentially (???) missing xsd:key Replacements
- AlternativeName_UniqueBy_Id_Version_useForLanguage_ordered - Alternative names with language/order constraint
- AlternativeText_UniqueBy_Id_AttributeName_UseForLanguage_Version - Alternative text with 4-field uniqueness (
@id,@attributeName,@useForLanguage,@version) - Vehicle_UniqueRegistrationNumber - Vehicle registration number uniqueness constraint
- Call_UniqueBy_Id_Version_Order - Call element uniqueness with ordering
- DynamicDistanceMatrixElement_UniqueBy_Id_Version - Dynamic distance matrix element constraint
@ue71603 they are catching that unique constraints have been removed here compared to @TuThoThai will provide more explanations (this stuff is a bit mind-boggling due to the double negation, we did a zoom call together so she could see the trouble). |
|
@thbar @TuThoThai Who will do something here or in a PR that we need to undo what was done? |
|
@TuThoThai I am not sure which open question need to be addressed and by who: |
|
Based on the addition of "should-fail" examples by @thbar via #1074, it seems that there should be a roll-back on the removing of the following unique constraints as they do no have keys:
The roll-back could be done by any contributor directly on this PR. I also advocate for all to review carefully once more the PR as we could have all missed other unique constraints that did not have keys. Since there are a lot of them, and at least 7 roll-backs were identified, we should handle the results of the script with care. |
|
What is the reason you want to give them a unique but not fix it to have a key?
|
Mostly because they didn't have a key in v1.3.2 nor in v2.0.0. So, to ensure that v2.0.1 is a patched / fixed version of v2.0.0 without any actual addition. If it makes sense. And leave all the constraints full rework split between v2.1 and v3.0 |
|
We had a unique, FR complained, hence it was effectively a key. So no, it does not make sense. |
Let's not rewrite history here. In #994:
Since then,
During the review of this PR, we collectively spotted removal of |
|
No we shouldn't revert back to unique, we should assign keys which give all the functionality of unique and is the correct solution. |
|
Then, it is no longer a simple cleanup of redundancy and the PR should be targeting branch |
|
@thbar @TuThoThai @skinkie @Aurige can we merge this one and have the discussion as an issue for discussion in 3.0 or 2.1? The biggest part is undisputed, isn't it? |
|
@ue71603, the main question before merging is what we do with these 3:
Option 1: simple roll back of the deletion of unique (in favor: @thbar and @TuThoThai; against: @skinkie) |
|
@ue71603 almost there, but not quite yet. (My message is a bit long, but after all the back-and-forth I think it's worth having the full picture written down in one place.) 1. Why not merge as-is This PR started as an optimisation (welcome!): removing Because of the sheer number of changes, though, we missed a few: some removed Also, CI needs to be green before merging, and it is currently red because of exactly this (see 🔴 below). 2. Why not keys here
It is perfectly fine for v2.1 though, where bigger changes are coming anyway (#1034). 3. What remains to roll back (rejected by v2.0.0, accepted by this PR in its current state): EDIT: still to be verified, but to get an overall idea; I think @Aurige has feedback on that to be posted soon too.
🔴 = already proven by the should-fail examples, and the reason CI is red. The others were found by testing further (happy to share the test files). ( Each one is an exact revert from v2.0. It can be done directly on this branch (as @TuThoThai proposed) or via a sister PR, whichever is easier. Ideally with should-fail cases, but I can live without them if we want. |
|
I found other issues to confirm & complement @thbar 's list
|
|
It feels I am reading LLM generated stuff. Vague wording contradicting what has written. |
|
@skinkie now you're discussing the form rather than the substance. I do use an LLM sometimes to edit my English. The arguments and measurements are mine, though. The substance, once more:
Keys are fine with me & @TuThoThai, in v2.1 (#1034). Turning a |
|
@thbar parse the descriptions within the table of @Aurige. It is full of contradictions. Special case: Equipment is abstract="true", so the constraint is empty (no node matches it !!). Safe to remove, but no key covers it (the large Equipment_AnyVersionedKey only lists the concrete subtypes). Only HeadwayJourneyGroup has a key; JourneyFrequencyGroup has none. It is the only identity constraint → essential. In the timetable file, no key on SectionInSequence (the key only exists in NeTEx_publication.xsd). In timetable, it is the only identity constraint. |
|
@skinkie yes, there is AI in @Aurige's table, as in my edits. What matters is whether it holds up, so I checked each row against the schemas:
Once #1110 is merged into this branch, this is good to go. |
* should-fail: support per-case schema (timetable) and GitHub annotations * should-fail: duplicate TemplateVehicleJourney (publication) * should-fail: duplicate GroupOfLinkSequences (timetable) * should-fail: duplicate ValidBetween (timetable) * should-fail: duplicate TemplateVehicleJourney (timetable) * should-fail: duplicate SectionInSequence (timetable) * rollback: restore GroupOfLinkSequences unique to v2.0 state (publication) * rollback: restore ValidityCondition unique to v2.0 state (publication) * rollback: restore UsageValidityPeriod unique to v2.0 state (publication) * rollback: restore TemplateVehicleJourney unique to v2.0 state (publication) * rollback: restore GroupOfLinkSequences unique to v2.0 state (timetable) * rollback: restore ValidityCondition unique to v2.0 state (timetable) * rollback: restore SectionInSequence unique to v2.0 state (timetable) * rollback: restore TemplateVehicleJourney unique to v2.0 state (timetable) * should-fail: duplicate CalendarDate (publication) * rollback: restore OperatingDay CalendarDate unique to v2.0 state (publication) * rollback: restore OperatingDay CalendarDate unique to v2.0 state (timetable)
Fix #994
With unique constraints:
Without unique constraints: