Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Neo4j Destination Connector #212

Merged
merged 34 commits into from
Dec 16, 2024
Merged

Conversation

ds-filipknefel
Copy link
Contributor

@ds-filipknefel ds-filipknefel commented Oct 31, 2024

Description

Implements Neo4j destination connector.

Connector takes Unstructured Elements and builds a lexical graph representing relationships between them. It consists of the following entities.

Nodes

  • Document - represents the source file elements come from
  • UnstructuredElement - represents the Unstructured Element prior to chunking
  • Chunk - represents the Unstructured Element post chunking

Edges (Relationships)

  • UnstructredElement/Chunk - PART_OF_DOCUMENT -> Document - relationship of belonging to the source file
  • UnstructuredElement - PART_OF_CHUNK -> Chunk - relationship between origin elements making up a chunk
  • UnstructuredElement - NEXT_ELEMENT -> UnstructuredElement - order of occurrence in the document
  • Chunk - NEXT_ELEMENT -> Chunk - order of occurrence in document

Example graph

image

Notes

  • Code used to interact with Neo4j database doesn't utilize apoc add-on library as it is not guaranteed to be available on designated Neo4j instance.
  • Ability to build a domain graph - graph representing information from document's contents rather then its structure is not in scope of this PR.

TODO

  • Implement upsert support - delete old nodes and relationships when document is re-uploaded
  • Add batch splitting
  • Add precheck test to integration test suite
  • Update descriptions

DATABASE = "neo4j"

EXPECTED_DOCUMENT_COUNT = 1
DOCKER_COMPOSE_FILEPATH = env_setup_path / "neo4j" / "docker-compose.yml"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need this anymore, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants