Connect to Linear Data in RapidMiner
This article shows how you can easily integrate the CData JDBC driver for Linear into your processes in RapidMiner. This article uses the CData JDBC Driver for Linear to transfer Linear data to a process in RapidMiner.
Connect to Linear in RapidMiner as a JDBC Data Source
You can follow the procedure below to establish a JDBC connection to Linear:
- Add a new database driver for Linear: Click Connections -> Manage Database Drivers.
- In the resulting wizard, click the Add button and enter a name for the connection.
- Enter the prefix for the JDBC URL:
jdbc:linear: - Enter the path to the cdata.jdbc.linear.jar file, located in the lib subfolder of the installation directory.
- Enter the driver class:
cdata.jdbc.linear.LinearDriver
- Create a new Linear connection: Click Connections -> Manage Database Connections.
- Enter a name for your connection.
- For Database System, select the Linear driver you configured previously.
- Enter your connection string in the Host box.
You can authenticate to Linear with a personal API key or with OAuth 2.0. The API key is the simplest option for connecting with your own Linear account.
Authenticating with an API Key
Set the following connection properties:
- AuthScheme: Set this to APIKey.
- APIKey: A Linear personal API key.
To create a personal API key, log in to Linear, open Settings > Security & access > Personal API keys, select New API key, and create it. Copy the key immediately, because Linear shows it only once.
Authenticating with OAuth
OAuth requires a custom OAuth application registered in Linear (Settings > API > OAuth applications), which provides the OAuthClientId and OAuthClientSecret. Two flows are supported:
- Authorization code: Set AuthScheme to OAuth, InitiateOAuth to GETANDREFRESH, and provide OAuthClientId, OAuthClientSecret, and the CallbackURL defined in your application (e.g., http://localhost:33333). The driver opens Linear in your browser so you can grant access.
- Client credentials: Set AuthScheme to OAuthClient and provide OAuthClientId and OAuthClientSecret. This authenticates the application itself, with no browser interaction, and suits machine-to-machine integrations.
By default, the driver requests the read,write scopes. The driver refreshes the access token automatically when it expires.
Built-in Connection String Designer
For assistance in constructing the JDBC URL, use the connection string designer built into the Linear JDBC Driver. Either double-click the JAR file or execute the jar file from the command-line.
java -jar cdata.jdbc.linear.jarFill in the connection properties and copy the connection string to the clipboard.
A typical connection string is below:
AuthScheme=APIKey;APIKey=myAPIKey; - Enter your username and password if necessary.
You can now use your Linear connection with the various RapidMiner operators in your process. To retrieve Linear data, drag the Retrieve operator from the Operators view.
With the Retrieve operator selected, you can then define which table to retrieve in the Parameters view by clicking the folder icon next to the "repository entry." In the resulting Repository Browser, you can expand your connection node to select the desired example set.
Finally, wire the output to the Retrieve process to a result, and run the process to see the Linear data.