Skip to content

Fix unknown object references - #194

Draft
skinkie wants to merge 5 commits into
binary_relation_serializerfrom
fix_unknown_object_references
Draft

skinkie wants to merge 5 commits into
binary_relation_serializerfrom
fix_unknown_object_references

Conversation

@skinkie

@skinkie skinkie commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

As provided in #169 an ambigious object reference (abstract reference or invalid name of ref class) may point to a duplicate id. This pull request is intended to resolve this issue.

recursive_attributes returns a numerical path to traverse the object
tree. While having implemented it, it has never been used in the current
code which still prefer to traverse through the entire object.

This commits lets the boiler plate and test to replace the iteration
over objects, and prefer the lookup.
If a reference has an invalid or missing nameOfRefClass-attribute, or
invalid version attribute, we here test if we correctly update/repair
the original reference.
We have implemented in the past methods to identify location within
objects. Likely due to bit rot or brain rot this lookup was not found
anymore. Unlike attrgetter or the advanced method safe_attrgetter in
this repository, we are only using integers. Hence the method is tied to
the locally generated classes. The only location we actually store the
paths now are in the unknown database.

When an unknown object is resolved, and their version or
name_of_ref_class does not match. We want to update the reference to
match the actual object. The current implementation iterates the entire
object again, while this implementation knows exactly where in the
object to look.

One could argue that if one object has multiple references, it could be
more efficient to interate over all references, but not in the
implementation that currently remained. Benchmarking should still give
an impression what improvements can be achieved using this new codepath.
But it is the boilerplate to open the door for another fix.
@skinkie skinkie self-assigned this Oct 19, 2026
@skinkie skinkie added the bug Something isn't working label Oct 19, 2026
The value now stores:
 - id, version, name_of_ref_class (NL:ARR:ScheduledStopPoint:1, 1, ScheduledStopPoint)
 - referinging class (ScheduledStopPointRef)
 - path (ServiceJourneyPattern/StopPointInJourneyPattern/ScheduledStopPointRef)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant