private function getRelationshipsFromPathMetadata(array $metadata, array $graph)
{
$rels = [];
foreach ($metadata['relationships'] as $relationship) {
$relId = $this->extractIdFromRestUrl($relationship);
foreach ($graph['relationships'] as $grel) {
$grid = (int) $grel['id'];
if ($grid === $relId) {
$rels[$grid] = new Relationship($grel['id'], $grel['type'], $grel['startNode'], $grel['endNode'], $grel['properties']);
}
}
}
return array_values($rels);
}