15.5.1.1.1 Loading Vertex Providers
You can add a vertex provider, by calling
alterationBuilder.addVertexProvider(EntityProviderConfig vertexProviderConfig)
. vertexProviderConfig
is a vertex provider configuration and it provides configuration details such as:
- location of the datasource to load from
- the stored format
- properties of the vertex provider
Additionally, you can also add the provider by calling alterationBuilder.addVertexProvider(String pathToVertexProviderConfig)
where pathToVertexProviderConfig
points to a file accessible from the client that contains a JSON representation of a vertex provider configuration.
For example, the vertex provider can be added in the alteration as shown:
// loading by indicating the path to the JSON file
alterationBuilder.addVertexProvider("<path-to-vertex-provider-configuration>");
// or by first loading the content of a JSON file into an EntityProviderConfig object
EntityProviderConfig vertexProviderConfig = new AnyFormatEntityProviderConfigFactory().fromPath("<path-to-vertex-provider-configuration>");
alterationBuilder.addVertexProvider(vertexProviderConfig);
Alternatively, the vertex provider configuration can be built programmatically:
FileEntityProviderConfigBuilder vertexProviderConfigBuilder = new FileEntityProviderConfigBuilder().
setFormat().
setName("typicalVertexProvider").
setUris("").
setKeyColumn(1).
addProperty("prop1", PropertyType.STRING, null, 2).
addProperty("prop2", PropertyType.LOCAL_DATE, null, 3);
EntityProviderConfig vertexProviderConfig = vertexProviderConfigBuilder.build();
alterationBuilder.addVertexProvider(vertexProviderConfig);
Parent topic: Loading Or Removing Additional Vertex or Edge Providers