Arc2JsonLdConverter.php
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;
  }
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;
  }
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 ; }
Converts an array of ARC2 triples into an array of RDF quads
in JsonLD library format.
@param array $triples ARC2 triples
Converts an array of ARC2 triples into an array of RDF quads in JsonLD library format .