public function matches(Node $toMatch)
    {
        if ($toMatch->isConcrete()) {
            if ($toMatch instanceof Literal) {
                return $this->getValue() === $toMatch->getValue()
                    && $this->getDatatype() === $toMatch->getDatatype()
                    && $this->getLanguage() === $toMatch->getLanguage();
            }

            return false;
        } else {
            throw new \Exception('The node to match has to be a concrete node');
        }
    }