NamedEntityDataRepositoryGraphRelationshipPersister

class NamedEntityDataRepositoryGraphRelationshipPersister constructor(repository: <Error class: unknown class>, authorityResolver: AuthorityResolver = StructuralAuthorityResolver()) : GraphRelationshipPersister

Persists projected graph relationships via NamedEntityDataRepository.

Converts each ProjectedRelationship to the repository's relationship format and writes it to the underlying graph database.

The authorityResolver stamps the strongest authority across the source propositions onto each edge written by synthesizeAndUpdateDescriptions, so authority is preserved through the description-synthesis re-persist cycle and not silently dropped.

val persister = NamedEntityDataRepositoryGraphRelationshipPersister(repository)
val result = persister.persist(graphProjector.projectAll(propositions, schema))
println("Persisted ${result.persistedCount} relationships")

Parameters

repository

the graph repository to write relationships into

authorityResolver

resolves the source authority to stamp on synthesized edges; defaults to StructuralAuthorityResolver

Constructors

constructor(repository: <Error class: unknown class>, authorityResolver: AuthorityResolver = StructuralAuthorityResolver())

Functions

Link copied to clipboard

Persist all successfully projected relationships from the results.

Persist a list of projected relationships.

Link copied to clipboard
open override fun persistRelationship(relationship: ProjectedRelationship)

Persists a single projected relationship to the graph.

Link copied to clipboard
open override fun projectAndPersist(propositions: List<Proposition>, graphProjector: GraphProjector, schema: <Error class: unknown class>): <Error class: unknown class><ProjectionResults<ProjectedRelationship>, RelationshipPersistenceResult>

Project propositions and persist the resulting relationships in one operation.

Link copied to clipboard

Synthesize descriptions for entity-pair relationships and update the edges. Default implementation is a no-op for implementations that don't support synthesis.