protected function generateList($subject, $property, $list) {
$current = $subject;
$prop = $property;
// Output a blank node for each item in the list
foreach ($list as $item) {
$newNode = $this->graph
->newBNodeId();
$this
->addTriple($current, $prop, array(
'type' => 'bnode',
'value' => $newNode,
));
$this
->addTriple($newNode, 'rdf:first', $item);
$current = $newNode;
$prop = 'rdf:rest';
}
// Finally, terminate the list
$this
->addTriple($current, $prop, array(
'type' => 'uri',
'value' => EasyRdf_Namespace::expand('rdf:nil'),
));
}