Skip to main content

yet another tool for transforming heterogeneous data in to knowledge graph

Project description

hd2neo4j

hd2neo4j tool to transform heterogeneous data into a knowledge graph stored in Neo4j.

Installation

pip install hd2neo4j

Usage

1. Import Necessary Services

Import RepositoryService and MapperService from hd2neo4j.services, which handle the connection to Neo4j and data mapping, respectively.

from hd2neo4j.services import RepositoryService, MapperService

2. Connect to Neo4j

Stablish a connection to the Neo4j database using RepositoryService.

r_service: RepositoryService = RepositoryService(
    "neo4j://connection-uri:port", "user", "Neo4j_password", "database_name"
)

3. Load Configuration and Data

Two things are needed to start the mapping process:

  • The mapping configuration JSON file.
  • A data array to transform into a Neo4j graph. For large amounts of data, using a Python iterator is recommended.

4. Execute the Mapping Process

initialize MapperService with the loaded configuration and data, and then the mapping process is executed by calling start_mapping().

m_service: MapperService = MapperService(
    mapping_config=config, 
    repository_service=r_service, 
    data_to_map=data
)

m_service.start_mapping()

5. (Optional) Clean the Database

If you want to clear the database before performing a new mapping, you can use:

r_service.clean_graph_db()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hd2neo4j-0.1.8.tar.gz (20.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hd2neo4j-0.1.8-py3-none-any.whl (23.4 kB view details)

Uploaded Python 3

File details

Details for the file hd2neo4j-0.1.8.tar.gz.

File metadata

  • Download URL: hd2neo4j-0.1.8.tar.gz
  • Upload date:
  • Size: 20.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.5 Darwin/24.3.0

File hashes

Hashes for hd2neo4j-0.1.8.tar.gz
Algorithm Hash digest
SHA256 666eca11b1b92e2557a6e7a5a87467dfa5f932a81f227fc0a403d1f20ab67942
MD5 e3783e9ab3c1f82b888803a47379f2e3
BLAKE2b-256 3114da7187ab86fa45d9f8b421f7c0d4f85cca01d03fb6d7b662ab7bc401e7ea

See more details on using hashes here.

File details

Details for the file hd2neo4j-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: hd2neo4j-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 23.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.5 Darwin/24.3.0

File hashes

Hashes for hd2neo4j-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 aaa9f1d7d5dc823aff6176d52f43fe2cdf873b8c18bcc2c627b3b557c5289750
MD5 8c06324f497908dcd3ba7b00d21637cf
BLAKE2b-256 6c183e9bff2618e595e51f41996d1b9c7691b6ca0fea88915ded35220a6e3523

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page