Common class for update statements. More...
Public Types | |
enum | Type { InsertUpdate, DeleteUpdate } |
Public Member Functions | |
UpdateBase (const UpdateBase &other) | |
UpdateBase & | operator= (const UpdateBase &other) |
bool | operator== (const UpdateBase &other) const |
bool | operator!= (const UpdateBase &other) const |
Type | type () const |
Retrurns the type of the UpdateBase. | |
void | addData (const PatternBase &pattern) |
Adds a graph pattern to the data part of this statement. | |
void | addData (const Value &s, const Value &p, const Value &o) |
Adds a triple to the data part of this statement. | |
QList< PatternBase > | data () const |
Returns all the patterns in the data part of this statement. | |
void | addRestriction (const PatternBase &pattern) |
Adds a graph pattern to the restrictions of this statement. | |
void | addRestriction (const Value &s, const Value &p, const Value &o) |
Adds a triple to the restrictions of this statement. | |
void | addRestriction (const Value &s, const ValueChain &chain, const Value &o) |
Adds a triple chain to the statement's restrictions. | |
QList< PatternBase > | restrictions () const |
Returns all the patterns in the restrictions of this statement. | |
Filter | filter () const |
Returns the current statement's restriction filter, or NULL if there is none. | |
void | setFilter (const Filter &filter) |
Sets a global filter on the statement's restrictions. | |
QString | sparql (Options::SparqlOptions options=Options::DefaultSparqlOptions) const |
Protected Member Functions | |
UpdateBase (const ResourceValue &graph=ResourceValue()) | |
UpdateBase (UpdateBaseData *data) | |
Protected Attributes | |
QSharedDataPointer < UpdateBaseData > | d |
Common class for update statements.
The UpdateBase class is the base for the Sparql statements used to modify a graph, that is Insert and Delete. You will never use this class directly, only its subclasses.
void UpdateBase::addData | ( | const PatternBase & | pattern | ) |
Adds a graph pattern to the data part of this statement.
You will most likely use this function to insert PatternGroup instances into the data part.
The user keeps the ownership of the pattern and must free it.
Adds a triple to the data part of this statement.
The user keeps the ownership of the variables and must free them.
void UpdateBase::addRestriction | ( | const PatternBase & | pattern | ) |
Adds a graph pattern to the restrictions of this statement.
You will most likely use this function to insert PatternGroup instances into the restrictions.
The user keeps the ownership of the pattern and must free it.
Adds a triple to the restrictions of this statement.
The user keeps the ownership of the variables and must free them.
Adds a triple chain to the statement's restrictions.
The user keeps the ownership of the variables and must free them.
QList< PatternBase > UpdateBase::data | ( | ) | const |
Returns all the patterns in the data part of this statement.
Note that this list is actually a tree, since it can contain PatternGroup instances, that contains restrictions themselves.
QList< PatternBase > UpdateBase::restrictions | ( | ) | const |
Returns all the patterns in the restrictions of this statement.
Note that this list is actually a tree, since it can contain PatternGroup instances, that contains restrictions themselves.
void UpdateBase::setFilter | ( | const Filter & | filter | ) |
Sets a global filter on the statement's restrictions.
More specific filters applying only to a subset of the restrictions can be done setting filters on PatternGroup instances and adding those instances to the restrictions.