public function transformEntryToNode($entry)
    {
        /*
         * An $entry looks like:
         * array(
         *      'type' => 'uri',
         *      'value' => '...'
         * )
         */

        // it seems that for instance Virtuoso returns type=literal for bnodes,
        // so we manually fix that here to avoid that problem, if other stores act
        // the same
        if (isset($entry['value'])
            && true === is_string($entry['value'])
            && false !== strpos($entry['value'], '_:')) {
            $entry['type'] = 'bnode';
        }

        $newEntry = null;

        switch ($entry['type']) {
            /*
             * Literal (language'd)
             */
            case 'literal':
                if (isset($entry['xml:lang'])) {
                    $newEntry = $this->nodeFactory->createLiteral(
                        $entry['value'],
                        'http://www.w3.org/1999/02/22-rdf-syntax-ns#langString',
                        $entry['xml:lang']
                    );
                // if a literal was created, but with no language information, it seems to confuse
                // it when loading, therefor check if lang was explicitly given, otherwise handle it
                // as it were a normal string.
                } else {
                    $newEntry = $this->nodeFactory->createLiteral(
                        $entry['value']
                    );
                }

                break;

            /*
             * Typed-Literal
             */
            case 'typed-literal':
                $newEntry = $this->nodeFactory->createLiteral($entry['value'], $entry['datatype']);
                break;

            /*
             * NamedNode
             */
            case 'uri':
                $newEntry = $this->nodeFactory->createNamedNode($entry['value']);
                break;

            /*
             * BlankNode
             */
            case 'bnode':
                $newEntry = $this->nodeFactory->createBlankNode($entry['value']);
                break;

            default:
                throw new \Exception('Unknown type given: '.$entry['type']);
                break;
        }

        return $newEntry;
    }
public function transformEntryToNode($entry)
    {
        /*
         * An $entry looks like:
         * array(
         *      'type' => 'uri',
         *      'value' => '...'
         * )
         */

        // it seems that for instance Virtuoso returns type=literal for bnodes,
        // so we manually fix that here to avoid that problem, if other stores act
        // the same
        if (isset($entry['value'])
            && true === is_string($entry['value'])
            && false !== strpos($entry['value'], '_:')) {
            $entry['type'] = 'bnode';
        }

        $newEntry = null;

        switch ($entry['type']) {
            /*
             * Literal (language'd)
             */
            case 'literal':
                if (isset($entry['xml:lang'])) {
                    $newEntry = $this->nodeFactory->createLiteral(
                        $entry['value'],
                        'http://www.w3.org/1999/02/22-rdf-syntax-ns#langString',
                        $entry['xml:lang']
                    );
                // if a literal was created, but with no language information, it seems to confuse
                // it when loading, therefor check if lang was explicitly given, otherwise handle it
                // as it were a normal string.
                } else {
                    $newEntry = $this->nodeFactory->createLiteral(
                        $entry['value']
                    );
                }

                break;

            /*
             * Typed-Literal
             */
            case 'typed-literal':
                $newEntry = $this->nodeFactory->createLiteral($entry['value'], $entry['datatype']);
                break;

            /*
             * NamedNode
             */
            case 'uri':
                $newEntry = $this->nodeFactory->createNamedNode($entry['value']);
                break;

            /*
             * BlankNode
             */
            case 'bnode':
                $newEntry = $this->nodeFactory->createBlankNode($entry['value']);
                break;

            default:
                throw new \Exception('Unknown type given: '.$entry['type']);
                break;
        }

        return $newEntry;
    }
public function transformEntryToNode ( $ entry ) { /*
         * An $entry looks like:
         * array(
         *      'type' => 'uri',
         *      'value' => '...'
         * )
         */ // it seems that for instance Virtuoso returns type=literal for bnodes, // so we manually fix that here to avoid that problem, if other stores act // the same if ( isset ( $ entry [ 'value' ] ) && true === is_string ( $ entry [ 'value' ] ) && false !== strpos ( $ entry [ 'value' ] , '_:' ) ) { $ entry [ 'type' ] = 'bnode' ; } $ newEntry = null ; switch ( $ entry [ 'type' ] ) { /*
             * Literal (language'd)
             */ case 'literal' : if ( isset ( $ entry [ 'xml:lang' ] ) ) { $ newEntry = $ this -> nodeFactory -> createLiteral ( $ entry [ 'value' ] , 'http://www.w3.org/1999/02/22-rdf-syntax-ns#langString' , $ entry [ 'xml:lang' ] ) ; // if a literal was created, but with no language information, it seems to confuse // it when loading, therefor check if lang was explicitly given, otherwise handle it // as it were a normal string. } else { $ newEntry = $ this -> nodeFactory -> createLiteral ( $ entry [ 'value' ] ) ; } break ; /*
             * Typed-Literal
             */ case 'typed-literal' : $ newEntry = $ this -> nodeFactory -> createLiteral ( $ entry [ 'value' ] , $ entry [ 'datatype' ] ) ; break ; /*
             * NamedNode
             */ case 'uri' : $ newEntry = $ this -> nodeFactory -> createNamedNode ( $ entry [ 'value' ] ) ; break ; /*
             * BlankNode
             */ case 'bnode' : $ newEntry = $ this -> nodeFactory -> createBlankNode ( $ entry [ 'value' ] ) ; break ; default : throw new \ Exception ( 'Unknown type given: ' . $ entry [ 'type' ] ) ; break ; } return $ newEntry ; }
Helper function which transforms an result entry to its proper Node instance.

@param array $entry

@return Node instance of Node
@unstable
Helper function which transforms an result entry to its proper Node instance .