Skip to content

Commit a541deb

Browse files
committed
Extend semantic matching to all binary operators (*, &, -)
Semantic matching now applies consistently to join (*), restriction (&), and difference (-) operators. All match on homologous namesakes and raise errors on non-homologous namesakes.
1 parent f8f9df0 commit a541deb

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

docs/SPEC-semantic-matching.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,19 @@ Lineage propagates through:
6464
- **Foreign key references**: inherited attributes retain their origin lineage regardless of PK/secondary status
6565
- **Query expressions**: projections preserve lineage for renamed attributes; computed attributes have no lineage
6666

67-
### Join Rules
67+
### Semantic Matching Rules
6868

69-
**The `*` operator** performs a semantic join:
70-
1. Joins on **homologous namesakes** (same name AND same lineage)
71-
2. Raises an error on **non-homologous namesakes** (same name, different lineage)
72-
3. Attributes with no namesake in the other operand pass through unchanged
69+
Semantic matching applies to all binary operations that match attributes between two query expressions:
70+
71+
| Operator | Operation | Semantic Matching |
72+
|----------|-----------|-------------------|
73+
| `A * B` | Join | Matches on homologous namesakes |
74+
| `A & B` | Restriction (subquery) | Matches on homologous namesakes |
75+
| `A - B` | Difference | Matches on homologous namesakes |
76+
77+
**All operators**:
78+
1. Match on **homologous namesakes** (same name AND same lineage)
79+
2. Raise an error on **non-homologous namesakes** (same name, different lineage)
7380

7481
**The `.join()` method** provides additional control via kwargs:
7582
- Defaults to semantic matching (same as `*`)

0 commit comments

Comments
 (0)