Relation Based Graph Projector
Graph projector that uses predicates from both the DataDictionary schema and Relations to determine relationship types.
Does not use LLM - matches proposition text directly against known predicates.
Matching priority:
Schema relationships from DataDictionary.allowedRelationships with explicit predicates defined via
@Semantics(With(key = Proposition.PREDICATE, value = "...")). Uses the property name as the relationship type.Schema relationships with derived predicates from the property name. For example, property
employerderives predicate "has employer".Fallback to Relations predicates, deriving relationship type from predicate using UPPER_SNAKE_CASE convention.
Example with explicit @Semantics predicate:
// Given: Person.employer property annotated with @Semantics predicate="works at"
val schema = DataDictionary.fromClasses("myschema", Person::class.java, Company::class.java)
val projector = RelationBasedGraphProjector.from(Relations.empty())
// "Bob works at Acme" -> (bob)-[:employer]->(acme)
// Uses property name "employer" as relationship typeExample with derived predicate (no annotation needed):
// Given: Person.employer property with no @Semantics annotation
// Predicate "has employer" is derived automatically
// "Bob has employer Acme" -> (bob)-[:employer]->(acme)Example with Relations fallback:
val relations = Relations.empty()
.withProcedural("likes", "expresses preference for")
val projector = RelationBasedGraphProjector.from(relations)
// "Alice likes jazz" -> (alice)-[:LIKES]->(jazz)
// Derives LIKES from predicateParameters
The relation predicates to match against (fallback)
Optional policy to filter propositions before projection
Whether predicate matching is case-sensitive (default: false)
Constructors
Functions
Projects a single proposition to a graph relationship.
Projects a list of propositions, applying the configured policy to each.
Set the resolver that stamps each projected edge with its source authority.
Set case sensitivity for predicate matching.
Use a DefaultProjectionPolicy with default confidence threshold.
Use a DefaultProjectionPolicy with the given confidence threshold.
Use a LenientProjectionPolicy with default confidence threshold.
Use a LenientProjectionPolicy with the given confidence threshold.
Set the projection policy.
Add more relations to this projector.