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');
        }
    }
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');
        }
    }
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' ) ; } }
A literal matches only another literal if its value, datatype and language are equal.

@param Node $toMatch Node instance to apply the pattern on

@return bool true, if this pattern matches the node, false otherwise

@todo check if that could be deleted
A literal matches only another literal if its value datatype and language are equal .