Trip alternatives (p:trip-alternatives)

http://profiles.goabout.com/trip-alternatives

Trip alternatives are a set of trips that satisfy a planning request. It is created by sending a POST request to a Trip planner (r:plan) relation link.

Examples

$ curl -H'Authorization: Bearer UArtDY9Bpo9Whga2mfd7nIK6vENxp2twtnH7RvPC6xj0jy6' 'https://api.goabout.com/trip-alternatives/1'
{
  "_embedded" : {
    "http://rels.goabout.com/trip" : [
       { "..." : "..."},
       { "..." : "..."}
    ],
    "http://rels.goabout.com/trip-selection" : {
      "_links" : {
        "http://rels.goabout.com/trip-alternatives" : {
          "href" : "https://api.goabout.com/trip-alternatives/1"
        },
        "self" : {
          "href" : "https://api.goabout.com/trip-alternatives/1/trip-selection"
        }
      }
    }
  },
  "_links" : {
    "http://rels.goabout.com/user" : { "href" : "https://api.goabout.com/user/1" },
    "self" : { "href" : "https://api.goabout.com/trip-alternatives/1" }
  },
  "planRequest" : {
    "departure" : "2012-11-15T11:24:00.000Z",
    "fromHref" : "geo:51.93247673912413,4.482672050311598",
    "toHref" : "geo:52.09303096173506,5.122257392758907"
  },
  "sortIndex" : {
    "arrival" : [ "https://api.goabout.com/trip/1", "https://api.goabout.com/trip/2", "..." ],
    "departure" : [ "https://api.goabout.com/trip/2", "https://api.goabout.com/trip/1", "..." ],
    "plannedTime" : [ "https://api.goabout.com/trip/1", "https://api.goabout.com/trip/2", "..." ]
  },
  "groupIndex" : [
    [ "https://api.goabout.com/trip/1", "https://api.goabout.com/trip/2" ],
    [ "https://api.goabout.com/trip/5", "https://api.goabout.com/trip/3", "https://api.goabout.com/trip/7" ],
    [ "https://api.goabout.com/trip/4" ]
  ]
  "tripHrefs" : [ "https://api.goabout.com/trip/1", "https://api.goabout.com/trip/2" ]
}

Reference

Properties

planRequest:PlanRequest The original planRequest
tripHrefs:List A list of href, linking to each trip within this trip-alternatives. All trips have been embedded for convenience.
sortIndex:TripIndex Different types of sorting indices.
groupIndex:TripGroup[] Different types of sorting indices.

PlanRequest

arrival:Date The arrival date-time, null if departure-time was requested.
departure:Date The departure date-time, null if arrival-time was requested.
fromHref:URI The URI indicating the original requested departure location.
toHref:URI The URI indicating the original requested arrival location.

TripIndex

arrival:List<URI> The list of trip-hrefs sorted by arrival-time (DESC), then duration (ASC) if arrival-time is equal.
departure:List<URI> The list of trip-hrefs sorted by departure-time (ASC), then duration (ASC) if departure-time is equal.
plannedTime:List<URI> The list of trip-hrefs sorted by arrival-time (DESC) when the request was made with an expected arrival-time. Sorted by departure-time (ASC) if the request was made with an expected departure time. Both sorting has secondary on duration (ASC) if times are equal.

TripGroup

URI[] A partitioning of the trips in related groups. Intuitively, alternatives in a group will be recognized by users as variations of “the same trip”. Trips that only differ by how to travel to the train station, for example, may be grouped together. The similarity is not formally defined and may change in the future, so any display-logic MUST NOT depend on the current grouping behavior, the ordering or any other seemingly steady properties.

Methods

GET:Retrieve the trip alternatives. Only the user who requested the planning can retrieve the resource.