Relations
A reusable, immutable collection of Relation types with a fluent builder API.
Build one up with withSemantic, withProcedural, etc., then pass it to a SourceAnalysisContext via withRelations. The same instance can be shared across multiple contexts.
val relations = Relations.empty()
.withSemantic("works at", "is employed by")
.withProcedural("prefers", "has preference for")
.withProceduralForSubject("Person", "likes", "dislikes", "prefers")
val context = SourceAnalysisContext.withContextId("ctx")
.withEntityResolver(resolver)
.withSchema(schema)
.withRelations(relations)Constructors
Properties
Functions
Add an episodic (event-based) relation.
Same as withPredicatesForSubject but takes a class instead of a string — the subject type is recorded as the class simpleName. A mention's type must match it (case-insensitive) for an edge to project.
Add several relations at once, all sharing the same subject type and knowledge type. The predicate string is used as the meaning for each one.
Add a procedural (behavioral/preference) relation.
Add a procedural relation that only applies when the subject is of the given type.
Add several procedural relations at once for a subject type.
Add a semantic (factual) relation.
Add a semantic relation constrained to a specific subject and object type pair.
Add a semantic relation constrained to a specific subject and object type pair, with an evidence floor declared inline. This lets you stay in the fluent builder chain rather than stepping outside it to call Relation.withEvidenceFloor separately.
Add a semantic relation that only applies when the subject is of the given type.
Add several semantic relations at once for a subject type.