Configuring data-sources: Google Spanner

If you have data in Google Cloud Spanner, you can explore this data as a graph using Linkurious Enterprise.
To achieve this, you must first define a property graph schema in Spanner, which defines a projection of the data in your tables as a graph.
Prerequisites
This section defines the technical requirements to use Spanner with Linkurious Enterprise.
Graph Schema
Make sure that your graph schema defines at least one KEY property for each node and edge in
the graph schema. Make sure all KEY columns are part of the graph node/edge properties. The
Supported key types are: INT32, INT64 and STRING.
Nodes with multiple labels are not supported, please assign a single label for each table. Each label must unambiguously reference a single table, make sure a given label does not correspond to two different SQL tables.
For edges, we recommend using:
- for one-to-many edge types: the key property of the target table row
(e.g. for
Person (1) -OWNS_BIKE-> (*) Bike, a good key for theOWNS_BIKEedge is the key property of theBikenode-table); - for many-to-many edge types, when multiples edges of that type is possible between two nodes:
the key property of the join-table itself
(e.g. for
Account (*) <-TRANSACTION-> (*) Accounta good key for theTRANSACTIONedge is the key of theTRANSACTIONedge-table); - for many-to-many edge types, when only one edge of that type is possible between two nodes:
a combination of the key property of the source and target table rows
(e.g. for
Person (*) <-KNOWS-> (*) Person, a good key for theKNOWSedge is(sourcePersonId, targetPersonId))
Full-text search
To use this feature, you must have at least one node property in your graph that is tokenized, and at least one index that contains that tokenized property.
For more details, see how to configure Google Spanner Search.
Configuration
To edit the Spanner data-source configuration, you can either use the Web user-interface or edit the configuration file located at linkurious/data/config/production.json.
Example configuration:
{
"dataSources": [
{
"graphdb": {
"databaseName": "spanner-dev-db",
"graphName": "spanner_dev_graph",
"vendor": "spanner",
"url": "https://cloud.google.com",
"projectId": "dev-test-spanner",
"instanceId": "spanner-test-instance",
"keyFileContent": "<secret>"
},
"index": {
"vendor": "spannerSearch"
}
}
]
}
Supported graphdb options with Spanner:
vendor(required): must bespanner;projectId(required): Your Google Cloud project ID;instanceId(required): Your Google Spanner instance ID;databaseName(required): Your Google Spanner database name;graphName(required): Your property graph's name;keyFile(required ifkeyFileContentis not set): If you are running Linkurious Enterprise on GCP, you must set up application credentials and set this field to$ENV:GOOGLE_APPLICATION_CREDENTIALS(this will read the value of this environment variable);keyFileContent(required ifkeyFileis not set): If you are not running Linkurious Enterprise on GCP, you must create a service account key file and copy the full content of the file in this field;url(required): must behttps://cloud.google.com.
Supported index options with Spanner:
vendor(required): must bespannerSearch;retrievalLimit(optional, default:10000): Limit how many results to fetch and rank in each table when executing a search. See Google Spanner documentation about retrieval depth.