Connecting the Trovares xGT graph analytics engine to the Neo4j Database.
Project description
trovares_connector Package
This Python package is for connecting the Trovares xGT graph analytics engine with the Neo4j graph database. Trovares xGT can significantly speedup Neo4j queries.
Homepage: | trovares.com |
Documentation: | trovares.github.io/trovares_connector |
General Help: | github.com/trovares/trovares_connector/discussions |
Requirements
Installation
You can install this python package by executing this command:
python -m pip install trovares_connector
If you don't have Trovares xGT, you can install and run the Developer version from Docker:
docker pull trovares/xgt
docker run --publish=4367:4367 trovares/xgt
Using the trovares_connector
From any Python environment, simply importing both xgt
and trovares_connector
is all that is needed to operate this connector.
A simple example below shows connecting to Neo4j and xGT, transferring the whole graph database to xGT, running a query in xGT, and printing the results:
import xgt
from trovares_connector import Neo4jConnector, Neo4jDriver
# Connect to xGT and Neo4j.
xgt_server = xgt.Connection()
xgt_server.set_default_namespace('neo4j')
neo4j_server = Neo4jDriver(auth=('neo4j', 'foo'))
conn = Neo4jConnector(xgt_server, neo4j_server)
# Transfer the whole graph.
conn.transfer_to_xgt()
# Run the query.
query = "match(a:foo) return a"
job = xgt_server.run_job(query)
# Print results.
print("Results: ")
for row in job.get_data():
print(row)
API
The available properties are:
- neo4j_relationship_types
- neo4j_node_labels
- neo4j_property_keys
- neo4j_node_type_properties
- neo4j_rel_type_properties
- neo4j_nodes
- neo4j_edges
The available methods are:
- get_xgt_schemas
- create_xgt_schemas
- copy_data_to_xgt
- transfer_to_xgt
- transfer_to_neo4j
Examples
Some examples can be found here:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for trovares_connector-1.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b359f2ca7b4020b122106ba8797de8022dc30bbde2fb5b9a839d293add9e12b |
|
MD5 | c6911549148d08ccd32594dc0411b650 |
|
BLAKE2b-256 | a1a3d2375aebd8f309175385c03b012fc6a738b60987ab9833a2b1266509d37f |