Skip to content

feat(neo4j): create constraints and indexes - #14

Merged
ariwired merged 1 commit into
docs/graph-modelfrom
feat/neo4j-schema
Nov 7, 2026
Merged

ariwired merged 1 commit into
docs/graph-modelfrom
feat/neo4j-schema

Conversation

@ariwired

@ariwired ariwired commented Nov 7, 2026

Copy link
Copy Markdown
Owner

Closes #4

Stacked on #13 (retarget as the stack merges).

  • Unique constraints: Image.id, ObjectInstance.id, Class.name (natural key; create classes with MERGE)
  • Indexes: Image.uri, ObjectInstance.confidence
  • All statements use IF NOT EXISTS; python -m visual_graph.graph applies them
  • Integration tests: schema present, idempotent across repeated runs, duplicates rejected, MERGE does not duplicate classes

Verified

Applied twice against a brand-new throwaway Neo4j container (no volume) and against the dev instance; integration tests pass (7), unit tests pass.

Note: property-existence constraints are Enterprise-only, so required properties are enforced in application code.

@ariwired
ariwired merged commit c24ed0a into docs/graph-model Nov 7, 2026
1 check passed
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.

1 participant