Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce TRIAS resources #18

Open
andaryjo opened this issue Dec 19, 2020 · 11 comments
Open

Introduce TRIAS resources #18

andaryjo opened this issue Dec 19, 2020 · 11 comments

Comments

@andaryjo
Copy link

andaryjo commented Dec 19, 2020

While most of the resources here focus on HAFAS, I think it would be a good idea to also consider creating and sharing resources on TRIAS, wich is a relatively new interface specification pushed by many public transport companies.

TRIAS stands for "Travellor Realtime Information and Advisory Standard", has been developed in scope of the research and standardisation project for public transport "IP-KOM-ÖV" and was then introduced in 2014 as a standardized specification by the VDV (Verband Deutscher Verkehrsunternehmen). TRIAS offers a wide-range list of functionalities, including station / location search, realtime departures, navigation, ticket price calculation, malfunction reportings, etc.

Here's a list of public transport providers that provide a TRIAS interface (that I know of). Most of them only implemented the more basic functionalities of the TRIAS specification:

Currently, there aren't a lot of helpful resources on TRIAS. Most providers only publish a few implementation examples and refer to the documentation: VDV 431-2 EKAP-Schnittstellenbeschreibung

But why?

Compared to HAFAS, TRIAS obviously isn't that widely distributed. But I think it's a step in the right direction as it allows for some kind of standardization in the jungle of Public Transport APIs. Unfortunately, many of the data providers still build their own proprietary APIs.

You might wonder why this even matters if you can just continue to use the existing HAFAS interfaces. At least in my opinion, the biggest difference is that these HAFAS interfaces are not supposed to be used by the public and public transport providers might even prohibit to use it. So if you want to develop and publish a project that uses public transport data, you might want to have some kind of agreement with the data provider, that reduces operational and legal risk for both you and the data provider.

And this is where TRIAS becomes relevant, as the APIs built on it are public (not open, as they still require authentication, but public). And at least in my experience, some providers are a bit more strict regarding the use and display of the data, but in general all of the APIs have fair terms of use and come with realistic request quotas.

I wouldn't want to make any assumptions on what specification is superior from a technical perspective, as I don't have that much experience with HAFAS. TRIAS is XML-based (urgh) and comes with a quite high request payload, but it's easy to understand and well documented.

So what to do?

Firstly, I'd just wanted to raise awareness that there actually is at least a bit of public API standardization out there. And then I think it would be interesting to provide learning resources and client libraries to achieve better developer enablement and maybe drive the adoption of TRIAS.

After a quick search I only found a few public resources and both of them seem to be somewhat propriertary:

As I've been using TRIAS for a long time now and I have a working multi-provider TRIAS client in place, I'd be interested in trying to develop a generic and easy to use JS TRIAS client library which also utilizes the Friendly Public Transport Format you guys already established.

@derhuerst
Copy link
Member

[…] I'd be interested in trying to develop a generic and easy to use JS TRIAS client library which also utilizes the Friendly Public Transport Format you guys already established.

That would be amazing! Just open a draft PR somewhere, tag me, and we can collaborate.

@kiliankoe
Copy link
Member

FWIW, the Verkehrsverbund Oberelbe also provides a TRIAS interface at http://efa.vvo-online.de:8080/std3/trias.

Also, if you were referring to the (unfortunately very unfinished) Swift client as being proprietary because it was missing a license, that was just an oversight on my part. It's there now 😊

@derhuerst
Copy link
Member

@juliuste might also be interested in writing a TRIAS client.

@andaryjo
Copy link
Author

@kiliankoe Thanks for the info, I updated my post. ☺️

@iLazlow
Copy link

iLazlow commented Jun 28, 2021

TRIAS also supports JSON output and can be requested with url parameters. If anyone doesn't want to use XML.

@derhuerst
Copy link
Member

TRIAS also supports JSON output and can be requested with url parameters. If anyone doesn't want to use XML.

Thanks for the hint! What is the parameter for that?

@andaryjo
Copy link
Author

@iLazlow The TRIAS documentation does not mention JSON at all. Is this maybe something specific to a single provider?

@iLazlow
Copy link

iLazlow commented Jun 30, 2021

For DM Request as example you can use the parameter outputFormat=JSON
e.g: {APIBase}/XML_DM_REQUEST?outputFormat=JSON&coordOutputFormat=WGS84[dd.ddddd]&mode=direct&name_dm=de:8212:6&type_dm=stop

Tested these on multiple providers and there are maybe one or two which block their requests to xml output. Sometimes "XML_DM_REQUEST" has to be renamed to "XSLT_DM_REQUEST". This works also on all other endpoints like "XSLT_TRIP_REQUEST2" or "XML_STOPSEQCOORD_REQUEST".

Here a link to the "open" KVV Api:
https://projekte.kvv-efa.de/sl3-alone/XML_DM_REQUEST?outputFormat=JSON&coordOutputFormat=WGS84[dd.ddddd]&mode=direct&name_dm=de:8212:6&type_dm=stop

Tested the json output so far successfully on these providers
KVV
VRN
Bwegt
VVS
VGN
GVH (efa.de)
Even the swiss TRIAS supports json (but their stops are not in GID format)

@andaryjo
Copy link
Author

andaryjo commented Jul 2, 2021

For DM Request as example you can use the parameter outputFormat=JSON
e.g: {APIBase}/XML_DM_REQUEST?outputFormat=JSON&coordOutputFormat=WGS84[dd.ddddd]&mode=direct&name_dm=de:8212:6&type_dm=stop

Unfortunately that's not TRIAS. While I've seen many providers build their TRIAS interface on top of their internal EFA controllers, it's not the same. You can take a look at the TRIAS specification here.

@iLazlow
Copy link

iLazlow commented Jul 2, 2021

For DM Request as example you can use the parameter outputFormat=JSON

e.g: {APIBase}/XML_DM_REQUEST?outputFormat=JSON&coordOutputFormat=WGS84[dd.ddddd]&mode=direct&name_dm=de:8212:6&type_dm=stop

Unfortunately that's not TRIAS. While I've seen many providers build their TRIAS interface on top of their internal EFA controllers, it's not the same. You can take a look at the TRIAS specification here.

OH good to know its my mistake then. Worked with the same request pages and even the same parameters so I thought it's TRIAS 😅

@derhuerst
Copy link
Member

Just to make them more discoverable, here are the two open source TRIAS clients that I'm aware of:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants