Nepomuk-Core
comparisonterm.cpp
Go to the documentation of this file.
43 QString varInAggregateFunction( Nepomuk2::Query::ComparisonTerm::AggregateFunction f, const QString& varName )
91 Nepomuk2::Query::ComparisonTerm::Comparator Nepomuk2::Query::stringToComparator( const QStringRef& c )
109 QString Nepomuk2::Query::ComparisonTermPrivate::toSparqlGraphPattern( const QString& resourceVarName, const TermPrivate* parentTerm, const QString &additionalFilters, QueryBuilderData *qbd ) const
159 // when using Regexp comparator with a resource range property we match the resource URI to the regular expression
174 finalPattern = LiteralTermPrivate::createContainsPattern( v, m_subTerm.toLiteralTerm().value().toString(), qbd );
263 // BUG: 3591024 - https://sourceforge.net/tracker/?func=detail&aid=3591024&group_id=161622&atid=820574
271 // since this is not a "real" full text search but rather a match on resource "names" we do not call QueryBuilderData::addFullTextSearchTerm
285 kDebug() << QString( "Invalid Term: comparator %1 cannot be used for matching to a resource!" ).arg( comparatorToString( m_comparator ) );
291 return corePattern.arg( Soprano::Node::resourceToN3(m_subTerm.toResourceTerm().resource().uri()) );
338 // Determines the main variable name, i.e. the variable representing the compared value, i.e. the one
341 // Thus, the basic scheme is: if a variable name has been set via setVariableName, return that name,
353 // -> determine a new random variable, use it as sorting var (via QueryBuilderData::addOrderVariable),
356 // 1.2.1 sorting weight set (no sorting weight is useless and behaves exactly as if no aggregate function was set)
362 // -> add the variable name as custom variable via QueryBuilderData::addCustomVariable and return the variable name
367 // -> Create a new random variable, embed it in the aggregate expression with the set variable name,
370 // -> Do the same as above only also add the set variable name as sort variable via QueryBuilderData::addOrderVariable
372 QString Nepomuk2::Query::ComparisonTermPrivate::getMainVariableName( QueryBuilderData* qbd, bool* firstUse ) const
397 // for inverted terms we do not perform variable sharing as described in QueryBuilderData::uniqueVarName
398 // since we would have to check inverse properties and their cardinality and the former is rarely defined.
409 // trueg: there seems to be a bug in Virtuoso which gives wrong search order if the sort variable is not in the select list.
438 Nepomuk2::Query::ComparisonTerm::ComparisonTerm( const Types::Property& property, const Term& term, Comparator comparator )
453 Nepomuk2::Query::ComparisonTerm& Nepomuk2::Query::ComparisonTerm::operator=( const ComparisonTerm& term )
509 Nepomuk2::Query::ComparisonTerm::AggregateFunction Nepomuk2::Query::ComparisonTerm::aggregateFunction() const
A LiteralTerm sub-term is matched to smaller literal values.
Definition: comparisonterm.h:104
void setProperty(const Types::Property &)
Set the property for ComparisonTerm Terms.
Definition: comparisonterm.cpp:481
Return the average value of all results instead of the results themselves.
Definition: comparisonterm.h:177
void setAggregateFunction(AggregateFunction function)
Set an aggregate function which changes the result.
Definition: comparisonterm.cpp:502
A LiteralTerm sub-term is matched to greater literal values.
Definition: comparisonterm.h:99
QString variableName() const
The variable name set in setVariableName() or an empty string if none has been set.
Definition: comparisonterm.cpp:495
A LiteralTerm sub-term is matched to greater or equal literal values.
Definition: comparisonterm.h:109
ComparisonTerm inverted() const
Create an inverted copy of this ComparisonTerm.
Definition: comparisonterm.cpp:552
void setSortWeight(int weight, Qt::SortOrder sortOrder=Qt::AscendingOrder)
Set the sort weight of this property.
Definition: comparisonterm.cpp:516
AggregateFunction
Aggregate functions which can be applied to a comparison term to influence the value they return...
Definition: comparisonterm.h:125
A sub-term is matched one-to-one.
Definition: comparisonterm.h:94
AggregateFunction aggregateFunction() const
The aggregate function to be used with the additional binding set in setVariableName().
Definition: comparisonterm.cpp:509
ComparisonTerm()
Default constructor: creates a comparison term that matches all properties.
Definition: comparisonterm.cpp:426
A LiteralTerm sub-term is matched against a string literal value using the literal term's value as a ...
Definition: comparisonterm.h:89
Return the maximum value of all results instead of the results themselves.
Definition: comparisonterm.h:150
The same as Average except that no two similar results are counted twice.
Definition: comparisonterm.h:183
A LiteralTerm sub-term is matched to smaller or equal literal values.
Definition: comparisonterm.h:114
A term matching the value of a property.
Definition: comparisonterm.h:70
A property is a resource of type rdf:Property which relates a domain with a range.
Definition: libnepomukcore/types/property.h:52
The same as Count except that no two similar results are counted twice.
Definition: comparisonterm.h:143
Abstract base class for NegationTerm and ComparisonTerm which maintains one sub-term.
Definition: simpleterm.h:41
Return the minimum value of all results instead of the results themselves.
Definition: comparisonterm.h:157
Qt::SortOrder sortOrder() const
Definition: comparisonterm.cpp:531
Comparator comparator() const
The Comparator used by ComparisonTerm Terms.
Definition: comparisonterm.cpp:460
Return the sum of all result values instead of the results themselves.
Definition: comparisonterm.h:164
int sortWeight() const
Definition: comparisonterm.cpp:524
A LiteralTerm sub-term is matched against string literal values.
Definition: comparisonterm.h:81
void setVariableName(const QString &name)
Set the variable name that is to be used for the variable to match to.
Definition: comparisonterm.cpp:488
The same as Sum except that no two similar results are added twice.
Definition: comparisonterm.h:170
bool isInverted() const
Definition: comparisonterm.cpp:538
ComparisonTerm & operator=(const ComparisonTerm &term)
Assignment operator.
Definition: comparisonterm.cpp:453
Types::Property property() const
A property used for ComparisonTerm Terms.
Definition: comparisonterm.cpp:467
Count the number of matching results instead of returning the results themselves. ...
Definition: comparisonterm.h:137
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:08 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:08 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.