opentripmodel / otm5-change-requests

Tracking and reporting bugs and change requests of the OTM5 specification.
5 stars 1 forks source link

Replace `routeConstraint` in favor of `routeEntityConstraint`. #80

Closed bmeesters closed 11 months ago

bmeesters commented 1 year ago

Type of request

Is your feature request related to a problem? Currently OTM5 consists of route entities and constraint entities that can be a routeConstraint. The routeConstraint however is not an association to a route, but inlines a geoReference. There are a few problems with this approach:

For the First/Last mile project we want to share first and last miles (routes) for locations. It is currently not possible to export a location with all the first/last miles since the information in the route constraint is less rich than in an actual route. We cannot share the UUID, the name, the creationDate or any other attributes as a constraint, but only as a separate route. But then we cannot link the routes to the locations.

Describe the solution you'd like Deprecate the routeConstraint and introduce a new routeEntityConstraint so this standard is more consistent and more rich.

A new constraint could then look like:

{
    "entityType": "constraint",
    "value": {
        "type": "routeEntityConstraint",
        "route": {
            "associationType": "inline",
            "entity": {
                "id": "<uuid>",
                "creationDate": "2023-08-15T10:00Z",
                "geoReference": {
                    "points": [
                        { "lat": 3, "lon": 4},
                        { "lat": 4, "lon": 4},
                        { "lat": 5, "lon": 6}
                    ],
                    "type": "latLonArrayGeoReference"
                }
            }
        }
    }
}

Currently it would look like:

{
    "entityType": "constraint",
    "value": {
        "type": "routeConstraint",
        "route": {
            "points": [
              { "lat": 3, "lon": 4 },
              { "lat": 4, "lon": 4 },
              { "lat": 5, "lon": 6 }
            ],
            "type": "latLonArrayGeoReference"
        }
    }
}

which is shorter, but also missed the UUID, name, externalAtrtributes, creationDate, etc.

Describe alternatives you've considered It is not possible to share locations and route constraints in one message unless you use the existing routeConstraint. But that has less fields, so is not adequate for the first/last mile project. We could also extend the routeConstraint with new fields but that would still make it less consistent with how OTM5 works generally.

Additional context

bmeesters commented 12 months ago

Discussed last Wednesday and accepted as candidate for OTM5.6. We are still thinking about the best name though

bmeesters commented 11 months ago

This is now part of OTM5.6 so can be closed.