src/QueryBuilder.php
public function getSPARQL( $includePrefixes = true ) {
		if ( !is_bool( $includePrefixes ) ) {
			throw new InvalidArgumentException( '$includePrefixes has to be a bool' );
		}

		$this->usageValidator->validate();

		$sparql = $includePrefixes ? $this->prefixBuilder->getSPARQL() : '';
		// @todo throw an exception instead of defaulting to SELECT?
		$sparql .= $this->queryForm ?: 'SELECT';
		$sparql .= ' ' . $this->uniqueness . $this->formatSelects() . ' WHERE';
		$sparql .= ' {' . $this->graphBuilder->getSPARQL() . ' }';
		$sparql .= $this->modifierBuilder->getSPARQL();

		return $sparql;
	}
public function getSPARQL( $includePrefixes = true ) {
		if ( !is_bool( $includePrefixes ) ) {
			throw new InvalidArgumentException( '$includePrefixes has to be a bool' );
		}

		$this->usageValidator->validate();

		$sparql = $includePrefixes ? $this->prefixBuilder->getSPARQL() : '';
		// @todo throw an exception instead of defaulting to SELECT?
		$sparql .= $this->queryForm ?: 'SELECT';
		$sparql .= ' ' . $this->uniqueness . $this->formatSelects() . ' WHERE';
		$sparql .= ' {' . $this->graphBuilder->getSPARQL() . ' }';
		$sparql .= $this->modifierBuilder->getSPARQL();

		return $sparql;
	}
public function getSPARQL ( $ includePrefixes = true ) { if ( ! is_bool ( $ includePrefixes ) ) { throw new InvalidArgumentException ( '$includePrefixes has to be a bool' ) ; } $ this -> usageValidator -> validate ( ) ; $ sparql = $ includePrefixes ? $ this -> prefixBuilder -> getSPARQL ( ) : '' ; // @todo throw an exception instead of defaulting to SELECT? $ sparql .= $ this -> queryForm ? : 'SELECT' ; $ sparql .= ' ' . $ this -> uniqueness . $ this -> formatSelects ( ) . ' WHERE' ; $ sparql .= ' {' . $ this -> graphBuilder -> getSPARQL ( ) . ' }' ; $ sparql .= $ this -> modifierBuilder -> getSPARQL ( ) ; return $ sparql ; }
Returns the plain SPARQL string of this query.

@param bool $includePrefixes
@return string
@throws InvalidArgumentException
@throws RangeException
Returns the plain SPARQL string of this query .