src/QueryExecuter.php
public function execute( $query ) {
		if ( $query instanceof QueryBuilder ) {
			$query = $query->getSPARQL();
		}

		if ( !is_string( $query ) ) {
			throw new InvalidArgumentException( '$query has to be a string or an instance of QueryBuilder' );
		}

		$result = $this->getResult( $query );
		
		// TODO also support ask queries (with key 'boolean')
		//      https://www.w3.org/TR/rdf-sparql-json-res/
		return $result['results'];
	}
public function execute( $query ) {
		if ( $query instanceof QueryBuilder ) {
			$query = $query->getSPARQL();
		}

		if ( !is_string( $query ) ) {
			throw new InvalidArgumentException( '$query has to be a string or an instance of QueryBuilder' );
		}

		$result = $this->getResult( $query );
		
		// TODO also support ask queries (with key 'boolean')
		//      https://www.w3.org/TR/rdf-sparql-json-res/
		return $result['results'];
	}
public function execute ( $ query ) { if ( $ query instanceof QueryBuilder ) { $ query = $ query -> getSPARQL ( ) ; } if ( ! is_string ( $ query ) ) { throw new InvalidArgumentException ( '$query has to be a string or an instance of QueryBuilder' ) ; } $ result = $ this -> getResult ( $ query ) ; // TODO also support ask queries (with key 'boolean') //      https://www.w3.org/TR/rdf-sparql-json-res/ return $ result [ 'results' ] ; }
Executes the given SPARQL query.

@param string|QueryBuilder $query
@return array
@throws InvalidArgumentException
@throws RangeException
@throws RuntimeException
Executes the given SPARQL query .