public static function triplesToQuads(array $triples) {
    $quads = array();
    foreach ($triples as $t) {
      $quads[] = new Quad(new IRI($t['s']), new IRI($t['p']),
      ($t['o_type'] == 'uri') ? new IRI($t['o']) : new TypedValue($t['o'],
      (isset($t['o_datatype']) && $t['o_datatype']!='') ? $t['o_datatype'] : RdfConstants::XSD_STRING));
    }

    return $quads;
  }