A Unified Framework for Evaluating Algebraic Queries over Annotated Relations