public function getSingleNodeByLabel($label) { foreach ($this->nodes as $node) { if ($node->hasLabel($label)) { return $node; } } return; }