Custom Connector
TPG Open Data Connector
Switzerland
The TPG Open Data Connector integrates with public-transport datasets from Transports Publics Genevois (TPG) in Geneva, Switzerland. It acts as a proxy for querying catalogs, datasets, and records, and exporting data in JSON, CSV, Parquet, GPX, and DCAT — leveraging ODSQL for filtering, sorting, and pagination for transport applications.
Overview
Integration Overview
This document provides a detailed guide for each integration point, its purpose, configuration, and workflow support using the TPG Open Data Connector. It exposes the standard OpenDataSoft catalog and dataset actions.
- getDatasets. Query catalog datasets.
- listExportFormats. List export formats for the catalog.
- exportDatasets / exportCatalogCSV / exportCatalogDCAT. Export the catalog in a chosen format, CSV, or DCAT.
- getDatasetsFacets. List facet values for datasets.
- getRecords. Query dataset records.
- listDatasetExportFormats. List export formats for a specific dataset.
- exportRecords / CSV / Parquet / GPX. Export a dataset’s records in a chosen format.
- getDataset. Show dataset information.
Documentation
Detailed Integration Documentation
Get Datasets
| Action | getDatasets |
|---|---|
| Purpose | Retrieves available catalog datasets, optionally filtered and sorted with ODSQL. |
| Configuration | Configure the base URL via CONNECTOR_ENV_TPGOPENDATA_BASE_URL. |
| Parameters | Optional: select; where (ODSQL, e.g. records_count > 1000); order_by; limit (default 10, max 100); offset; refine; exclude; lang (default en); timezone (default UTC); group_by; include_links; include_app_metas. |
| Output | Successful: JSON with links and a datasets array (metas, fields). Failure: ODSQLError. |
| Workflow example | Execute getDatasets with where=“records_count > 1000” and limit=20 to list datasets. |
Catalog Export Formats & Exports
| Action | listExportFormats / exportDatasets / exportCatalogCSV / exportCatalogDCAT |
|---|---|
| Purpose | Lists catalog export formats and exports the catalog in a chosen format, CSV (delimiter options), or RDF/XML (DCAT). |
| Configuration | Configure the base URL via CONNECTOR_ENV_TPGOPENDATA_BASE_URL. |
| Parameters | exportDatasets required: format (e.g. csv, json). CSV optional: delimiter (; , \t |); list_separator; quote_all; with_bom. DCAT required: dcat_ap_format; optional include_exports, use_labels_in_exports. Plus catalog filters. |
| Output | Successful: a JSON list of export links or a file. Failure: ODSQLError. |
| Workflow example | Call listExportFormats, then exportCatalogCSV with delimiter=; and import into BigQuery. |
Get Datasets Facets
| Action | getDatasetsFacets |
|---|---|
| Purpose | Enumerates facet values for datasets (e.g. publisher) for guided navigation. |
| Configuration | Configure the base URL via CONNECTOR_ENV_TPGOPENDATA_BASE_URL. |
| Parameters | Optional: facet (e.g. publisher); refine; exclude; where; timezone. |
| Output | Successful: JSON with links and facets (name, count, state, value). Failure: ODSQLError. |
| Workflow example | Execute getDatasetsFacets with facet=publisher to refine dataset searches. |
Get Records
| Action | getRecords |
|---|---|
| Purpose | Queries records within a specific dataset, optionally filtered and sorted. |
| Configuration | Configure the base URL via CONNECTOR_ENV_TPGOPENDATA_BASE_URL. |
| Parameters | Required: dataset_id. Optional: select; where (e.g. population > 1000000); group_by; order_by; limit (default 10, max 100); offset; refine; exclude; lang; timezone; include_links; include_app_metas. |
| Output | Successful: JSON with total_count and a results array. Failure: ODSQLError. |
| Workflow example | Execute getRecords with dataset_id and where=“population > 1000000”, then display records. |
Dataset Exports (formats / CSV / Parquet / GPX)
| Action | listDatasetExportFormats / exportRecords / exportRecordsCSV / exportRecordsParquet / exportRecordsGPX |
|---|---|
| Purpose | Lists a dataset’s export formats and exports its records in a chosen format, CSV, Parquet (snappy/zstd), or GPX. |
| Configuration | Configure the base URL via CONNECTOR_ENV_TPGOPENDATA_BASE_URL. |
| Parameters | Required: dataset_id (and format for exportRecords). Optional: select, where, order_by, group_by, limit, refine, exclude, lang, timezone, use_labels, compressed, epsg; CSV delimiter options; parquet_compression; GPX name_field/description_field_list/use_extension. |
| Output | Successful: a file in the requested format. Failure: ODSQLError. |
| Workflow example | Execute exportRecords with dataset_id and format=json, then store the file. |
Get Dataset Info
| Action | getDataset |
|---|---|
| Purpose | Returns information about a specific dataset — metadata, fields, and features. |
| Configuration | Configure the base URL via CONNECTOR_ENV_TPGOPENDATA_BASE_URL. |
| Parameters | Required: dataset_id. Optional: select; lang; timezone; include_links; include_app_metas. |
| Output | Successful: JSON with dataset_id, metas (records_count, modified), fields, and features. Failure: ODSQLError. |
| Workflow example | Execute getDataset with a dataset_id to configure data queries. |
Example Workflow: Public Transport Route Planning
| Retrieve datasets | Use getDatasets with refine=publisher:“TPG” to fetch transport datasets. |
|---|---|
| Query dataset info | Execute getDataset with a dataset_id to understand fields and features. |
| Fetch records | Use getRecords with a dataset_id and optional where filters, then display in a UI. |
| Export | Use exportRecords with format=csv, then integrate into route-planning or archiving applications. |
Support
For technical support, contact custom-connectors-support@isolutions.sa.