BEAR: A Unified Framework for Evaluating Relational Knowledge in Causal and Masked Language Models