Represents a projection in a Select. More...
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) | |
Projection & | operator= (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. |
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.
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().
Creates a projection for a predicate function.
You will likely never use this function, but rather get Projection instances from Select::projections().
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().
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.
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