Skip to content

Commit 9c018a8

Browse files
committed
Add example of valid join currently blocked
FavoriteCourse * DependentCourse is rejected by current implementation because course_id is secondary in both. With semantic matching, both course_id attributes share lineage to Course, so the join is valid and answers "courses dependent on the student's favorite course."
1 parent 21d645c commit 9c018a8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

docs/SPEC-semantic-matching.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,18 @@ With semantic matching: `Student.id` and `Course.id` have different lineages (on
3737

3838
Note: The current implementation already prevents joining on common *secondary* attributes (e.g., if both had a `name` attribute). The problem semantic matching solves is coincidental name collisions in *primary key* attributes.
3939

40+
#### Example: Valid Join Currently Blocked
41+
42+
Consider two tables:
43+
- `FavoriteCourse(student_id*, course_id)` - student's favorite course (course_id is secondary, with lineage to Course)
44+
- `DependentCourse(dep_course_id*, course_id)` - course dependencies (course_id is secondary, with lineage to Course)
45+
46+
With current behavior: `FavoriteCourse * DependentCourse` is **rejected** because `course_id` is a secondary attribute in both tables.
47+
48+
With semantic matching: Both `course_id` attributes share the same lineage (tracing to `Course.course_id`). They are **homologous namesakes**, so the join proceeds. The result answers: "all courses that are dependent on the student's favorite course."
49+
50+
This shows semantic matching is not just about preventing bad joins—it also **enables valid joins** that the current implementation incorrectly blocks.
51+
4052
## Key Concepts
4153

4254
### Terminology

0 commit comments

Comments
 (0)