private static ImmutableList < Function > getJoinOnFilter ( RAExpressionAttributes re1 , RAExpressionAttributes re2 , ImmutableSet < QuotedID > using , TermFactory termFactory ) { return using . stream ( ) . map ( id -> new QualifiedAttributeID ( null , id ) ) . map ( id -> { // TODO: this will be removed later, when OBDA factory will start checking non-nulls Term v1 = re1 . getAttributes ( ) . get ( id ) ; if ( v1 == null ) throw new IllegalArgumentException ( "Term " + id + " not found in " + re1 ) ; Term v2 = re2 . getAttributes ( ) . get ( id ) ; if ( v2 == null ) throw new IllegalArgumentException ( "Term " + id + " not found in " + re2 ) ; return termFactory . getFunctionEQ ( v1 , v2 ) ; } ) . collect ( ImmutableCollectors . toList ( ) ) ; }
internal implementation of JOIN USING and NATURAL JOIN