public static function quadsToTriples(array $quads) {
    $arcTriples = array();
    foreach ($quads as $q) {
      $arcTriples[] = array(
        's' => (string)$q->getSubject(),
        'p' => (string)$q->getProperty(),
        'o' => (is_a($q->getObject(), 'ML\JsonLD\TypedValue'))
          ? $q->getObject()->getValue()
          : (string)$q->getObject(),
        'o_type' => (is_a($q->getObject(), 'ML\JsonLD\TypedValue'))
          ? 'literal'
          : (($q->getObject()->getScheme() == '_')
            ? 'bnode'
            : 'uri')
      );
    }
    return $arcTriples;
  }