Nepomuk-Core
queryserializer.cpp
Go to the documentation of this file.
113 xml.writeAttribute( QLatin1String("uri"), KUrl( term.toResourceTerm().resource().uri() ).url() );
140 xml.writeAttribute( QLatin1String("comparator"), Nepomuk2::Query::comparatorToString(cTerm.comparator()) );
147 xml.writeAttribute( QLatin1String("sortOrder"), cTerm.sortOrder() == Qt::AscendingOrder ? QLatin1String("asc") : QLatin1String("desc") );
149 xml.writeAttribute( QLatin1String("inverted"), cTerm.isInverted() ? QLatin1String("true") : QLatin1String("false") );
159 xml.writeAttribute( QLatin1String("uri"), KUrl( term.toResourceTypeTerm().type().uri() ).url() );
193 term = LiteralTerm( Soprano::LiteralValue::fromString( xml.readElementText(), KUrl(attr.value( QLatin1String("datatype") ).toString()) ) );
195 term = LiteralTerm( Soprano::LiteralValue::createPlainLiteral( xml.readElementText(), attr.value( QLatin1String("lang") ).toString()) );
275 cTerm.setComparator( Nepomuk2::Query::stringToComparator(attr.value( QLatin1String("comparator"))) );
285 attr.value( QLatin1String("sortOrder")) == QLatin1String("desc") ? Qt::DescendingOrder : Qt::AscendingOrder );
343 query.setFullTextScoringEnabled( attributes.value( QLatin1String("fullTextScoring") ) == QLatin1String("true") );
345 query.setFullTextScoringSortOrder( attributes.value( QLatin1String("fullTextScoringOrder") ) == QLatin1String("desc") ? Qt::DescendingOrder : Qt::AscendingOrder );
362 xml.writeAttribute( QLatin1String("queryFiles"), fq.fileMode()&FileQuery::QueryFiles ? QLatin1String("true") : QLatin1String("false") );
363 xml.writeAttribute( QLatin1String("queryFolders"), fq.fileMode()&FileQuery::QueryFolders ? QLatin1String("true") : QLatin1String("false") );
371 xml.writeAttribute( QLatin1String("fullTextScoring"), query.fullTextScoringEnabled() ? QLatin1String("true") : QLatin1String("false") );
372 xml.writeAttribute( QLatin1String("fullTextScoringOrder"), query.fullTextScoringSortOrder() == Qt::AscendingOrder ? QLatin1String("asc") : QLatin1String("desc") );
378 xml.writeAttribute( QLatin1String("optional"), rp.optional() ? QLatin1String("true") : QLatin1String("false") );
390 xml.writeAttribute( QLatin1String("recursive"), it.value() ? QLatin1String("true") : QLatin1String("false") );
435 query.addRequestProperty( Query::RequestProperty( KUrl(xml.attributes().value( QLatin1String("uri") ).toString()),
448 // for the recursive flag we use double negation since the default is true (even if the flag is not specified)
453 fileQuery.addExcludeFolder( KUrl( xml.attributes().value( QLatin1String("url") ).toString() ) );
void setProperty(const Types::Property &)
Set the property for ComparisonTerm Terms.
Definition: comparisonterm.cpp:481
void addExcludeFolder(const KUrl &folder)
Add a folder to exclude from the search.
Definition: filequery.cpp:96
QString serializeTerm(const Term &term)
Definition: queryserializer.cpp:471
Return the average value of all results instead of the results themselves.
Definition: comparisonterm.h:177
QueryFlags queryFlags() const
Get the query flags to configure this query.
Definition: query.cpp:359
Nepomuk2::Resource resource() const
The resource this term should match against.
Definition: resourceterm.cpp:104
A negation term inverts the meaning of its sub term.
Definition: term.h:127
void setAggregateFunction(AggregateFunction function)
Set an aggregate function which changes the result.
Definition: comparisonterm.cpp:502
void setSortWeight(int weight, Qt::SortOrder sortOrder=Qt::AscendingOrder)
Set the sort weight of this property.
Definition: comparisonterm.cpp:516
QString serializeQuery(const Query &query)
Definition: queryserializer.cpp:352
QList< RequestProperty > requestProperties() const
Definition: query.cpp:377
QList< Term > subTerms() const
The sub terms that are combined in this group.
Definition: groupterm.cpp:94
AggregateFunction
Aggregate functions which can be applied to a comparison term to influence the value they return...
Definition: comparisonterm.h:125
void setLimit(int)
Set the maximum number of results this query should yield.
Definition: query.cpp:317
KUrl::List excludeFolders() const
The list of exclude folders set via addExcludeFolder() and setExcludeFolders().
Definition: filequery.cpp:108
An optional term which marks its sub term as optional.
Definition: term.h:136
QHash< KUrl, bool > allIncludeFolders() const
The hash of include folders set via addIncludeFolder() and setIncludeFolders() including their recurs...
Definition: filequery.cpp:90
Do not use any aggregate function.
Definition: comparisonterm.h:129
ComparisonTerm toComparisonTerm() const
Interpret this term as a ComparisonTerm.
Definition: term.cpp:266
void addRequestProperty(const RequestProperty &property)
Add a property that should be reported with each search result.
Definition: query.cpp:365
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 Nepomuk desktop query specialized for file searches.
Definition: filequery.h:44
A term matching the value of a property.
Definition: comparisonterm.h:70
A request property can be added to a Query to retrieve additional information about the results...
Definition: query.h:287
Match resource that match at least one of the sub terms.
Definition: orterm.h:43
void setFullTextScoringEnabled(bool enabled)
Nepomuk supports scoring the results based on any full text matching used in the query (full text mat...
Definition: query.cpp:329
ResourceTypeTerm toResourceTypeTerm() const
Interpret this term as a ResourceTypeTerm.
Definition: term.cpp:275
Nepomuk2::Types::Property property() const
Definition: query.cpp:221
The same as Count except that no two similar results are counted twice.
Definition: comparisonterm.h:143
Return the minimum value of all results instead of the results themselves.
Definition: comparisonterm.h:157
Return the sum of all result values instead of the results themselves.
Definition: comparisonterm.h:164
void addSubTerm(const Term &term)
Add a sub term to the list of terms that are combined in this group.
Definition: groupterm.cpp:108
void addIncludeFolder(const KUrl &folder)
Add a folder to include in the search.
Definition: filequery.cpp:57
void setQueryFlags(QueryFlags flags)
Set the query flags to configure this query.
Definition: query.cpp:353
bool fullTextScoringEnabled() const
Definition: query.cpp:341
void setVariableName(const QString &name)
Set the variable name that is to be used for the variable to match to.
Definition: comparisonterm.cpp:488
Qt::SortOrder fullTextScoringSortOrder() const
Definition: query.cpp:347
The same as Sum except that no two similar results are added twice.
Definition: comparisonterm.h:170
int limit() const
The maximum number of results that this query should yield.
Definition: query.cpp:299
Match all resources that match one of the sub terms.
Definition: term.h:105
Count the number of matching results instead of returning the results themselves. ...
Definition: comparisonterm.h:137
void setFullTextScoringSortOrder(Qt::SortOrder order)
Set the full text scoring sort order.
Definition: query.cpp:335
Soprano::LiteralValue value() const
The value this LiteralTerm should match to.
Definition: literalterm.cpp:262
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.