protected static function _compareRDFTriples($t1, $t2) {
    foreach(array('subject', 'predicate', 'object') as $attr) {
      if($t1->{$attr}->type !== $t2->{$attr}->type ||
        $t1->{$attr}->value !== $t2->{$attr}->value) {
        return false;
      }
    }
    if(property_exists($t1->object, 'language') !==
      property_exists($t1->object, 'language')) {
      return false;
    }
    if(property_exists($t1->object, 'language') &&
      $t1->object->language !== $t2->object->language) {
      return false;
    }
    if(property_exists($t1->object, 'datatype') &&
      $t1->object->datatype !== $t2->object->datatype) {
      return false;
    }
    return true;
  }