Neo4j Store Config
This object is used to configure the Neo4j Store to connect to your Neo4j Instance and to manage the parsing of a Triple Store.
Constructor
Name |
Type |
Required |
Values(Default) |
Description |
auth_data |
Dictionary |
Yes, unless a driver object is passed in the store init |
("uri", "database", "user", "pwd") |
A dictionary containing authentication data. The required keys are: ["uri", "database", "user", "pwd"]. |
batching |
Boolean |
False |
boolean (True) |
A boolean indicating whether batching is enabled. |
batch_size |
Integer |
False |
(5000) |
An integer representing the batch size (The batch size is intended as number of entities to store inside the database (nodes/relationships) and not triples. |
custom_mappings |
List[Tuple[Str,Str,Str]] |
False |
Empty list |
A list of tuples containing custom mappings for prefixes in the form (prefix, object_to_replace, new_object). |
custom_prefixes |
Dictionary |
True ① |
({}) |
A dictionary containing custom prefixes. |
handle_vocab_uri_strategy |
HANDLE_VOCAB_URI_STRATEGY |
False |
IGNORE, KEEP, MAP, (SHORTEN) |
* 'SHORTEN', full uris are shortened using prefixes for property names, relationship names and labels. Fails if a prefix is not predefined for a namespace in the imported RDF. * 'IGNORE' uris are ignored and only local names are kept * 'MAP' vocabulary element mappings are applied on import * 'KEEP' uris are kept unchanged |
handle_multival_strategy |
HANDLE_MULTIVAL_STRATEGY |
False |
ARRAY (OVERWRITE) |
* 'OVERWRITE' property values are kept single valued. Multiple values in the imported RDF are overwriten (only the last one is kept) * 'ARRAY' properties are stored in an array enabling storage of multiple values. All of them unless multivalPropList is set. |
multival_props_names |
List[Tuple[Str,Str]] |
False |
([]) |
A list of tuples containing the prefix and property names to be treated as multivalued in the form (prefix, property_name). |
① if handle_vocab_uri_strategy == HANDLE_VOCAB_URI_STRATEGY.SHORTEN
Functions
delete_custom_mapping
Deletes a custom mapping from the custom_mappings dictionary. It will raise PrefixNotFoundException if the prefix is not found in the available prefixes.
Enumerated Values
HANDLE_VOCAB_URI_STRATEGY
Enum class defining different strategies for handling vocabulary URIs.
Possible Values
Name |
Description |
SHORTEN |
Strategy to shorten the URIs (Every prefix that you will use must be defined in the config, otherwise Neo4jStore will throw a ShortenStrictException) |
MAP |
Strategy to map the URIs using provided mappings |
KEEP |
Strategy to keep the URIs |
IGNORE |
Strategy to ignore the Namespace and get only the local part |
Shorten
This strategy will shorten the URIs, replacing the prefix with its shorted version. If the Store find a prefix not defined inside its Neo4jStoreConfig object, the parsing will stop, raising a ShortenStrictException error.