anchor.diff:              }
   
   let private expressionSetValuesEqualCondition left right =
  -    sprintf "ExpressionSet equality for %A and %A" left right |> NotImplementedException |> raise
  +    let isTypeEqual =
  +        Comparison(Comparisons.EqualTo, left.TypeExpression, right.TypeExpression)
  +        |> optimizeRelationalCondition
  +
  +    let notIsValueInCategory category =
  +        Comparison(Comparisons.EqualTo, left.TypeCategoryExpression, category |> int |> Int |> Constant)
  +        |> optimizeRelationalCondition
  +        |> Not
  +        |> optimizeRelationalCondition
  +
  +    let notIsValueNumeric = notIsValueInCategory TypeIndexer.TypeCategory.NumericLiteral
  +    let notIsValueBoolean = notIsValueInCategory TypeIndexer.TypeCategory.BooleanLiteral
  +    let notIsValueDateTime = notIsValueInCategory TypeIndexer.TypeCategory.DateTimeLiteral
  +    let notIsValueString =
  +        [
  +            notIsValueInCategory TypeIndexer.TypeCategory.BlankNode
  +            notIsValueInCategory TypeIndexer.TypeCategory.Iri
  +            notIsValueInCategory TypeIndexer.TypeCategory.StringLiteral
  +            notIsValueInCategory TypeIndexer.TypeCategory.SimpleLiteral
  +            notIsValueInCategory TypeIndexer.TypeCategory.OtherLiteral
  +        ]
  +        |> Conjunction |> optimizeRelationalCondition
  +
  +    let expressionEqual selector =
  +        Comparison(Comparisons.EqualTo, left |> selector, right |> selector)
  +        |> optimizeRelationalCondition
  +
  +    [
  +        isTypeEqual
  +        [ notIsValueString; expressionEqual (fun x -> x.StringExpression) ] |> Disjunction |> optimizeRelationalCondition
  +        [ notIsValueNumeric; expressionEqual (fun x -> x.NumericExpression) ] |> Disjunction |> optimizeRelationalCondition
  +        [ notIsValueBoolean; expressionEqual (fun x -> x.BooleanExpression) ] |> Disjunction |> optimizeRelationalCondition
  +        [ notIsValueDateTime; expressionEqual (fun x -> x.DateTimeExpresion) ] |> Disjunction |> optimizeRelationalCondition
  +    ]
  +    |> Conjunction
  +    |> optimizeRelationalCondition
   
   let private valueBinderValueEqualToNodeCondition typeIndexer valueBinder node =
       (valueBinder |> valueBinderToExpressionSet typeIndexer, node |> nodeToExpressionSet typeIndexer)
  
positive.code:             neededVariables
              |> List.map (
                  fun var ->
                      var, source |>SqlSource.getColumn var |> Column
              )
              |> Map.ofList
  
  
negative.code: open Slp.Evi.Relational.Algebra
  open Slp.Evi.Relational.RelationalAlgebraOptimizers
  open Slp.Evi.R2RML.MappingTemplate
  open Slp.Evi.Common.Algebra
  
  let rec private isBaseValueBinderBoundCondition neededVars =
      if neededVars |> Map.isEmpty then
  