Skip to content

Commit f3e5aae

Browse files
term: eliminate 'semijoin' and 'antijoin' terminology
Replace deprecated SQL-derived terms with accurate DataJoint terminology: - 'semijoin/antijoin' → 'restriction/anti-restriction' - Clarify that A & B restricts A (does not join attributes) Changes in source code comments: - expression.py:1081: 'antijoin' → 'anti-restriction' - condition.py:296: '(semijoin/antijoin)' → 'for restriction' - condition.py:401: '(aka semijoin and antijoin)' → removed Rationale: In relational algebra, joins combine attributes from both operands. DataJoint's A & B restricts A to matching entities—no attributes from B appear in the result. This is fundamentally restriction, not a join operation.
1 parent fa6957a commit f3e5aae

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/datajoint/condition.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ def make_condition(
293293
- ``str``: Used directly as SQL condition
294294
- ``dict``: AND of equality conditions for matching attributes
295295
- ``bool``: Returns the boolean value (possibly negated)
296-
- ``QueryExpression``: Generates subquery (semijoin/antijoin)
296+
- ``QueryExpression``: Generates subquery for restriction
297297
- ``AndList``: AND of all conditions
298298
- ``list/set/tuple``: OR of all conditions
299299
- ``numpy.void``: Like dict, from record array
@@ -398,7 +398,7 @@ def combine_conditions(negate, conditions):
398398
if inspect.isclass(condition) and issubclass(condition, QueryExpression):
399399
condition = condition()
400400

401-
# restrict by another expression (aka semijoin and antijoin)
401+
# restrict by another expression
402402
if isinstance(condition, QueryExpression):
403403
assert_join_compatibility(query_expression, condition, semantic_check=semantic_check)
404404
# Match on all non-hidden namesakes (hidden attributes excluded)

src/datajoint/expression.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1078,7 +1078,7 @@ def make_sql(self):
10781078
alias=next(self.__count),
10791079
sorting=self.sorting_clauses(),
10801080
)
1081-
# with secondary attributes, use union of left join with antijoin
1081+
# with secondary attributes, use union of left join with anti-restriction
10821082
fields = self.heading.names
10831083
sql1 = arg1.join(arg2, left=True).make_sql(fields)
10841084
sql2 = (arg2 - arg1).proj(..., **{k: "NULL" for k in arg1.heading.secondary_attributes}).make_sql(fields)

0 commit comments

Comments
 (0)