Subsections, boundaries, borders - what's the data model being used?

When two entities border, that means they have a shared border segment. Now: Is this border segment to be individually marked?
It seems to me that the area itself is the boundary in the database (there is no distinction). In that case, how do you do this? Are there “shared border” type entities that reference two other entities? In that case, how is it ensured that that entity actually lies on a shared border? Are borders made up of individual segments which can belong to any area? In that case, how do you deal with straight-line segments that share a portion with a shorter straight-line segment of another area’s border? And, by looking at a few things, it seems that the ways are defined by the individual points, not segments, so this doesn’t seem to be the way it happens anyways. Furthermore, what about subsegments? Do they have to be formally linked to the parent segment or is the name enough? Case in point: Way 129034837. This seems very disconnected and it doesn’t have a formal parameter like “parent” that might relate it to the US/Canada border. How exactly is this managed?

If you look at and scroll down on the left you can see that it is part of many relations. That sounds like what you are looking for. Also, have a look at .