Public Types | Public Member Functions

Projection Class Reference

Represents a projection in a Select. More...

List of all members.

Public Types

enum  Type { VariableProjection, FunctionProjection, SelectProjection, LiteralProjection }
 

Describes the type of the projection.


Public Member Functions

CUBI_EXPLICIT Projection (const Variable &variable)
 Creates a projection for a variable.
CUBI_EXPLICIT Projection (const Function &function, const Variable &alias=Variable::invalid())
 Creates a projection for a predicate function.
CUBI_EXPLICIT Projection (const Select &select, const Variable &alias=Variable::invalid())
 Creates a projection for a nested Select.
CUBI_EXPLICIT Projection (const LiteralValue &value, const Variable &alias=Variable::invalid())
 Creates a projection for a literal value.
 Projection (const Projection &other)
Projectionoperator= (const Projection &other)
bool operator== (const Projection &other) const
bool operator!= (const Projection &other) const
Type type () const
 Returns the type of the projection.
Variable variable () const
 Returns the variable of the projection.
Function function () const
 Returns the function of the projection.
Select select () const
 Returns the select of the projection.
LiteralValue literalValue () const
 Returns the literal value of the projection.
Variable alias () const
 Returns the alias of the projection.
QString sparql (Options::SparqlOptions options=Options::DefaultSparqlOptions) const
 Returns the Sparql representation of the projection.

Detailed Description

Represents a projection in a Select.

A projection in a Select statement can be a variable, a predicate function or a nested Select. The Projection class holds one of those three classes.


Constructor & Destructor Documentation

Projection::Projection ( const Variable variable  ) 

Creates a projection for a variable.

You will likely never use this function, but rather get Projection instances from Select::projections().

Projection::Projection ( const Function function,
const Variable alias = Variable::invalid() 
)

Creates a projection for a predicate function.

You will likely never use this function, but rather get Projection instances from Select::projections().

Projection::Projection ( const Select select,
const Variable alias = Variable::invalid() 
)

Creates a projection for a nested Select.

You will likely never use this function, but rather get Projection instances from Select::projections().

Projection::Projection ( const LiteralValue literalValue,
const Variable alias = Variable::invalid() 
)

Creates a projection for a literal value.

You will likely never use this function, but rather get Projection instances from Select::projections().


Member Function Documentation

Variable Projection::alias (  )  const

Returns the alias of the projection.

If called on a projection which is not of type Projection::SelectProjection or Projection::FunctionProjection, will print an error message and return an invalid Variable

Function Projection::function (  )  const

Returns the function of the projection.

If called on a projection which is not of type Projection::FunctionProjection, will print an error message and return an invalid Function

LiteralValue Projection::literalValue (  )  const

Returns the literal value of the projection.

If called on a projection which is not of type Projection::LiteralProjection, will print an error message and return an invalid LiteralValue().

Select Projection::select (  )  const

Returns the select of the projection.

If called on a projection which is not of type Projection::SelectProjection, will print an error message and return an empty Select. // FIXME: how to best test for empty state?

Projection::Type Projection::type (  )  const

Returns the type of the projection.

See also:
Projection::Type
Variable Projection::variable (  )  const

Returns the variable of the projection.

If called on a projection which is not of type Projection::VariableProjection, will print an error message and return an invalid Variable


The documentation for this class was generated from the following files:
 All Classes Functions Enumerations