Connect to Spanner

Connecting Google Spanner to GraphXR Explorer requires completing the following steps:

  1. Launch Explorer from the GCP Marketplace.

  2. Obtain and upload a service account key.

  3. Configure the Spanner database.

  4. Connect Spanner to the Explorer project.

Before you begin…

Before you can use GraphXR Explorer, you need:

  • A Google Cloud Spanner account.

  • A Spanner database and Spanner Graph property graph database based on it.

    You can start with Spanner Graph demo data available for free trial through your Google Cloud Platform account.

1. Launch Explorer from the GCP Marketplace

  1. Go to the Google Cloud Marketplace

  2. Open the GraphXR Explorer product page

  3. Click Launch to configure a deployment.

  4. Enter a Deployment name.

  5. Create a Service Account: under Deployment Service Account, click New Account. Enter

    • Service account name, ID and description.

    • Zone (us-central-c)

    • Under Firewall, click Allow HTTP and Allow HTTPS checkboxes.

  6. Click Deploy and wait for deployment to complete. This may take a few minutes.

  7. Open the deployment Details tab and locate Outputs

    • Copy the Admin Password (click the Copy Link icon)

    • Click Site URL to open GraphXR Explorer login.

  8. Log In to GraphXR Explorer

    50 00 01 SpEx Login
    • Enter your user ID and Admin Password.

    • Click Login.

      A GraphXR Explorer project is automatically created. A connection wizard shows you how to connect the project to your Spanner database.

2. Obtain and upload the service account key

In the connection wizard, you enter required service account details and download the JSON key file that will connect the Explorer project to a specific Spanner Graph database.

50 00 02 SpEx Wizard1
  1. Click the link to visit the Google Cloud Console Service Accounts page.

  2. Open the service account created for the project (or create a new one).

  3. Under Permissions, assign 3 roles:

    • Cloud Spanner API Service Agent

    • Cloud Spanner Database Reader

    • Cloud Spanner Viewer

  4. Click Done to return to the Service Accounts page.

  5. Create and download the JSON key file

    1. Click the 3 dots at the far right on the service account list item, and choose Manage Keys.

    2. Click Add Key, and choose Create New Key, select JSON and click Create.

  6. Drag the downloaded key file to the connection wizard to upload, and click Next.

3. Review Database configuration

Database details are pre-filled in the connection wizard.

50 00 03 SpEx DBConfig
  • Review the Instance, Database name, and Graph Database, and click Done.

    Your GraphXR Explorer project is now open and connected to the Spanner Graph database.

Query the Database

The project canvas is empty when it first opens.

50 00 04 SpEx NewProjectQuery

To import data from the connected database you can:

  • Click in the Query/Search bar to use GraphXR’s point-and-click query builder.

  • On the left menu, click to open the GraphXR Query panel and enter and run a Cypher, GQL, or SQL query.