Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/dev-2.x' into upstream-merge-2…
Browse files Browse the repository at this point in the history
…023-10-09
  • Loading branch information
leonardehrenfried committed Oct 9, 2023
2 parents 2dd2bc4 + bdfda72 commit a642678
Show file tree
Hide file tree
Showing 287 changed files with 2,237 additions and 2,398 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cibuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ jobs:
# schema hasn't changed.
# example commit: https://github.com/opentripplanner/docs/commit/45e6ddf8e4a4
SCHEMA_FILE_MODIFIED=`git log -n 1 --pretty=format:%ct src/ext/resources/gtfsgraphqlapi/schema.graphqls`
SCHEMA_FILE_MODIFIED=`git log -n 1 --pretty=format:%ct src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls`
echo "schema modified at ${SCHEMA_FILE_MODIFIED}"
git checkout $LOCAL_BRANCH
DOCS_MODIFIED=`git log -n 1 --pretty=format:%ct api/dev-2.x/graphql-gtfs/introduction.html`
Expand All @@ -204,7 +204,7 @@ jobs:
with:
node-version: 16
- name: Run code generator
working-directory: src/ext/java/org/opentripplanner/ext/gtfsgraphqlapi/generated
working-directory: src/main/java/org/opentripplanner/apis/gtfs/generated
run: |
yarn install
yarn generate
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ GTFS and OpenStreetMap). It applies real-time updates and alerts with immediate
clients, finding itineraries that account for disruptions and service changes.

Note that this branch contains **OpenTripPlanner 2**, the second major version of OTP, which has
been under development since Q2 2018. The latest version of OTP is v2.2.0, released in November 2022.
been under development since 2018. The latest version of OTP is v2.4.0, released in September 2023.

If you do not want to test or explore this version, please switch to the final 1.x release
tag `v1.5.0` or the `dev-1.x` branch for any patches and bugfixes applied to the v1.5.0 release.
If you do not want to use this version, please switch to the final 1.x release
tag `v1.5.0` or the `dev-1.x` branch.

## Performance Test

Expand Down
12 changes: 6 additions & 6 deletions doc-templates/GraphQL-Tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
# GraphQL tutorial

This document will give you a quick start tutorial on how to get started with OTP's GraphQL APIs. For
this tutorial we will be using the [GTFS GraphQL API](sandbox/GtfsGraphQlApi.md) as this is the most commonly used one.
this tutorial we will be using the [GTFS GraphQL API](GTFS-GraphQL-API.md) as this is the most commonly used one.

First of all, make sure that you've loaded street and transit data into your instance by following
the [basic tutorial](Basic-Tutorial.md)
the [basic tutorial](../Basic-Tutorial.md)

## Visual GraphQL API client

Expand All @@ -20,7 +20,7 @@ started OTP, visit [http://localhost:8080/graphiql](http://localhost:8080/graphi

It should look like this:

![GraphiQL](images/graphiql.png)
![GraphiQL](../images/graphiql.png)

## Sending your first query

Expand All @@ -35,12 +35,12 @@ side panel.
Now would be a good time to explore the auto-complete capabilities of the tool by moving the
cursor into the query panel and hitting Ctrl-Space to see what other query parameters are possible.

![GraphiQL](images/graphiql-autocomplete.png)
![GraphiQL](../images/graphiql-autocomplete.png)

The explorer also has documentation built into it. If you hover your pointer over a property on the
left hand side you can see its documentation.

![GraphiQL](images/graphiql-documentation.png)
![GraphiQL](../images/graphiql-documentation.png)

## A more advanced query

Expand All @@ -51,4 +51,4 @@ Most people want to get routing results out of OTP, so lets see the query for th
Again, please use the autocomplete and documentation viewers to figure out what each input parameter
and property means.

More examples for a variety of queries can also be found [in the test code](https://github.com/opentripplanner/OpenTripPlanner/tree/dev-2.x/src/ext-test/resources/gtfsgraphqlapi/queries).
More examples for a variety of queries can also be found [in the test code](https://github.com/opentripplanner/OpenTripPlanner/tree/dev-2.x/src/test/resources/org/opentripplanner/apis/gtfs/queries).
2 changes: 1 addition & 1 deletion docs/Basic-Tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,4 +201,4 @@ You can run the OTP .jar file with the `--help` option for a full list of comman

## Exploring the API

If you want to learn how to use OTP's API's, check out the [GraphQL tutorial](GraphQL-Tutorial.md).
If you want to learn how to use OTP's API's, check out the [GraphQL tutorial](apis/GraphQL-Tutorial.md).
3 changes: 3 additions & 0 deletions docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ based on merged pull requests. Search GitHub issues and pull requests for smalle
- Fix rental scooter access [#5361](https://github.com/opentripplanner/OpenTripPlanner/pull/5361)
- De-duplicate stops returned by `stopsByRadius` [#5366](https://github.com/opentripplanner/OpenTripPlanner/pull/5366)
- Fix value mapping for bikesAllowed in GTFS GraphQL API [#5368](https://github.com/opentripplanner/OpenTripPlanner/pull/5368)
- Apply correct traversal permissions to barrier vertex [#5369](https://github.com/opentripplanner/OpenTripPlanner/pull/5369)
- Move GTFS GraphQL API out of the sandbox [#5339](https://github.com/opentripplanner/OpenTripPlanner/pull/5339)
- Transmodel GraphQL API for pass-through searches [#5320](https://github.com/opentripplanner/OpenTripPlanner/pull/5320)
[](AUTOMATIC_CHANGELOG_PLACEHOLDER_DO_NOT_REMOVE)

## 2.4.0 (2023-09-13)
Expand Down
2 changes: 1 addition & 1 deletion docs/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ Here is a list of all features which can be toggled on/off and their default val
| `ConsiderPatternsForDirectTransfers` | Enable limiting transfers so that there is only a single transfer to each pattern. | ✓️ | |
| `DebugClient` | Enable the debug web client located at the root of the web server. | ✓️ | |
| `FloatingBike` | Enable floating bike routing. | ✓️ | |
| `GtfsGraphQlApi` | Enable GTFS GraphQL API. | ✓️ | ✓️ |
| `GtfsGraphQlApi` | Enable GTFS GraphQL API. | ✓️ | |
| `MinimumTransferTimeIsDefinitive` | If the minimum transfer time is a lower bound (default) or the definitive time for the transfer. Set this to `true` if you want to set a transfer time lower than what OTP derives from OSM data. | | |
| `OptimizeTransfers` | OTP will inspect all itineraries found and optimize where (which stops) the transfer will happen. Waiting time, priority and guaranteed transfers are taken into account. | ✓️ | |
| `ParallelRouting` | Enable performing parts of the trip planning in parallel. | | |
Expand Down
14 changes: 14 additions & 0 deletions docs/ReleaseChecklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,20 @@ manually is more tedious, but keeps eyes on each step and is less prone to failu
* Mention the new version number.
* Provide links to the new developer documentation.
* Provide links to the artifacts directory on Maven Central.
* Prepare for the next release in GitHub by renaming the released milestone and creating a new
milestone for the next release. Then make sure all issues and PRs are tagged with the correct
milestone.
* Close open PRs older than 2 years, make sure the milestone is set to `Rejected`.
* Rename the old milestone from `x.y (Next Release)` to `x.y`. All issues and PRs assigned to
this milestone are automatically updated.
* Create a new milestone: `x.y+1 (Next Release)`
* All PullRequests SHOULD have a milestone (except some very old ones)
* Assign all *open* PRs to this new milestone `x.y+1 (Next Release)`.
* Assign all *closed* PRs without a milestone in the release to the released milestone
`x.y`. Make sure NOT to include very old PRs or PRs merged after the release(if any).
* Some issues have a milestone, but not all.
* Move all open issues with the released milestone `x.y` to the next release
`x.y+1 (Next Release)`.

## Artifact Signing

Expand Down
2 changes: 1 addition & 1 deletion docs/RoutingModes.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Used for street-level cable cars where the cable runs beneath the car.

Private car trips shared with others.

This is currently not specified in GTFS so we use the mode type values 1500-1560 which are in the range of private taxis.
This is currently not specified in GTFS so we use the mode type values 1550-1560 which are in the range of private taxis.


<h4 id="COACH">COACH</h4>
Expand Down
1 change: 0 additions & 1 deletion docs/SandboxExtension.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ provided "as is".
- [Geocoder API](sandbox/GeocoderAPI.md) - Adds an API to search for corners, stops and stations.
- [Transfer analyser](sandbox/transferanalyzer.md) - Module used for analyzing the transfers between
nearby stops generated by routing via OSM data.
- [GTFS GraphQL API](sandbox/GtfsGraphQlApi.md) - HSL's GraphQL API used by the Digitransit project.
- [Transmodel API](sandbox/TransmodelApi.md) - Enturs GraphQL Transmodel API.
- [SIRI Updater](sandbox/SiriUpdater.md) - Update OTP with realtime information from a Transmodel SIRI data source.
- [SIRI Azure Updater](sandbox/SiriAzureUpdater.md) - fetch SIRI realtime data through *Azure Service Bus*
Expand Down
7 changes: 4 additions & 3 deletions docs/Version-Comparison.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ the EU profile, and generalization to the EU profile should be feasible once it
| SIRI Realtime | no | yes |
| Elevation data | TIFF and NED | TIFF and NED |
| One-to-many routing,<br> isochrones and scripting | yes | no |
| Java version | 8+ | 11+ |
| Isochrones | yes | yes |
| Java version | 8+ | 17+ |
| Multiple regions per server | yes | no |
| Hot reloading of graphs | yes | no |
| Street (OSM) routing algorithm | Generalized cost A* | Generalized cost A* |
Expand Down Expand Up @@ -125,7 +126,7 @@ OTP2 to simplify the code base and make it easier to reason about security.
Less parameters are available on the OTP2 REST API than in OTP1. Often there is no practical loss of
functionality, just a different way of expressing things due to the new routing algorithms. A
summary of parameters that have been removed and their replacements can be found in the [migration
guide](Version-Comparison.md#Migration guide)
guide](Version-Comparison.md#migration-guide)

## OTP Trip planning and Transit index APIs

Expand All @@ -136,7 +137,7 @@ GraphQL API, the only supported way of sending requests to the OTP routing engin
Details of those two APIs are available at the following pages:


- [GTFS GraphQL API](sandbox/GtfsGraphQlApi.md) - HSL's GraphQL API used by the Digitransit
- [GTFS GraphQL API](apis/GTFS-GraphQL-API.md) - HSL's GraphQL API used by the Digitransit
project.
- [Transmodel API](sandbox/TransmodelApi.md) - Entur´s Transmodel API

Expand Down
10 changes: 5 additions & 5 deletions docs/Apis.md → docs/apis/Apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@

Several services are built upon OTP's routing and transit data indexing engines. They expose these APIs:

The [GTFS GraphQL API](sandbox/GtfsGraphQlApi.md) has been used by the Digitransit and otp-react-redux
The [GTFS GraphQL API](GTFS-GraphQL-API.md) has been used by the Digitransit and otp-react-redux
projects as a general purpose routing and transit data API in production for many years.
If your input data is mostly GTFS then this is probably the best choice as it uses the same vocabulary.

The [Transmodel GraphQL API](sandbox/TransmodelApi.md) is used at
The [Transmodel GraphQL API](../sandbox/TransmodelApi.md) is used at
Entur in production since 2020. Like the GTFS GraphQL API it is also a general purpose API.
If your input data is mostly NeTeX then you might want to investigate
this API as it uses the [Transmodel vocabulary](https://en.wikipedia.org/wiki/Transmodel) to describe
its entities.

The [Vector tiles API](sandbox/MapboxVectorTilesApi.md) is a special purpose API for displaying
The [Vector tiles API](../sandbox/MapboxVectorTilesApi.md) is a special purpose API for displaying
entities on a vector map.

The [Actuator API](sandbox/ActuatorAPI.md) provides endpoints for checking the health status of the
The [Actuator API](../sandbox/ActuatorAPI.md) provides endpoints for checking the health status of the
OTP instance and reading live application metrics.

The [Geocoder API](sandbox/GeocoderAPI.md) allows you to geocode street corners and stop names.
The [Geocoder API](../sandbox/GeocoderAPI.md) allows you to geocode street corners and stop names.

## Legacy APIs (to be removed)

Expand Down
43 changes: 43 additions & 0 deletions docs/apis/GTFS-GraphQL-API.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# GTFS GraphQL API

The GTFS GraphQL API is a general purpose API which was created for the Digitransit project and is
used heavily by [digitransit-ui](https://github.com/HSLdevcom/digitransit-ui).

[otp-react-redux](https://github.com/opentripplanner/otp-react-redux) has also migrated to this API in 2023.

## URLs
- GraphQL endpoint: [`http://localhost:8080/otp/routers/default/index/graphql`](http://localhost:8080/otp/routers/default/index/graphql)
- HTML schema documentation: [https://docs.opentripplanner.org/api/dev-2.x/graphql-gtfs/](https://docs.opentripplanner.org/api/dev-2.x/graphql-gtfs/)
- Built-in visual GraphQL client: [http://localhost:8080/graphiql](http://localhost:8080/graphiql)

## Built-in API client

A browser based GraphQL API client is available at [http://localhost:8080/graphiql](http://localhost:8080/graphiql)

![GraphiQL](../images/graphiql.png)

**`curl` example**

A complete example that fetches the list of all stops from OTP is:

```
curl --request POST \
--url http://localhost:8080/otp/routers/default/index/graphql \
--header 'Content-Type: application/json' \
--header 'OTPTimeout: 180000' \
--data '{"query":"query stops {\n stops {\n gtfsId\n name\n }\n}\n","operationName":"stops"}'
```
## Configuration

The API is enabled by default.

If you want to disable it, do it in `otp-config.json`:

```json
// otp-config.json
{
"otpFeatures" : {
"GtfsGraphQlApi": false
}
}
```
16 changes: 8 additions & 8 deletions docs/GraphQL-Tutorial.md → docs/apis/GraphQL-Tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
# GraphQL tutorial

This document will give you a quick start tutorial on how to get started with OTP's GraphQL APIs. For
this tutorial we will be using the [GTFS GraphQL API](sandbox/GtfsGraphQlApi.md) as this is the most commonly used one.
this tutorial we will be using the [GTFS GraphQL API](GTFS-GraphQL-API.md) as this is the most commonly used one.

First of all, make sure that you've loaded street and transit data into your instance by following
the [basic tutorial](Basic-Tutorial.md)
the [basic tutorial](../Basic-Tutorial.md)

## Visual GraphQL API client

Expand All @@ -20,7 +20,7 @@ started OTP, visit [http://localhost:8080/graphiql](http://localhost:8080/graphi

It should look like this:

![GraphiQL](images/graphiql.png)
![GraphiQL](../images/graphiql.png)

## Sending your first query

Expand Down Expand Up @@ -54,12 +54,12 @@ side panel.
Now would be a good time to explore the auto-complete capabilities of the tool by moving the
cursor into the query panel and hitting Ctrl-Space to see what other query parameters are possible.

![GraphiQL](images/graphiql-autocomplete.png)
![GraphiQL](../images/graphiql-autocomplete.png)

The explorer also has documentation built into it. If you hover your pointer over a property on the
left hand side you can see its documentation.

![GraphiQL](images/graphiql-documentation.png)
![GraphiQL](../images/graphiql-documentation.png)

## A more advanced query

Expand All @@ -71,9 +71,9 @@ Most people want to get routing results out of OTP, so lets see the query for th
```graphql
{
plan(
# these coordinate are in Portland, change this to YOUR origin
# these coordinates are in Portland, change this to YOUR origin
from: { lat: 45.5552, lon: -122.6534 }
# these coordinate are in Portland, change this to YOUR destination
# these coordinates are in Portland, change this to YOUR destination
to: { lat: 45.4908, lon: -122.5519 }
# use the correct date and time of your request
date: "2023-02-15",
Expand Down Expand Up @@ -127,4 +127,4 @@ Most people want to get routing results out of OTP, so lets see the query for th
Again, please use the autocomplete and documentation viewers to figure out what each input parameter
and property means.

More examples for a variety of queries can also be found [in the test code](https://github.com/opentripplanner/OpenTripPlanner/tree/dev-2.x/src/ext-test/resources/gtfsgraphqlapi/queries).
More examples for a variety of queries can also be found [in the test code](https://github.com/opentripplanner/OpenTripPlanner/tree/dev-2.x/src/test/resources/org/opentripplanner/apis/gtfs/queries).
4 changes: 2 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mkdocs==1.5.2
mkdocs-material==9.1.17
mkdocs==1.5.3
mkdocs-material==9.4.2
mike@git+https://github.com/jimporter/mike.git@f0522f245e64687dd18384fbd86b721175711474
mkdocs-no-sitemap-plugin==0.0.1
Loading

0 comments on commit a642678

Please sign in to comment.