NepomukDaemons
Nepomuk::Search::Term Class Reference
A Query constist of Terms. More...
#include <nepomuk/term.h>
Public Types | |
enum | Comparator { Contains, Equal, Greater, Smaller, GreaterOrEqual, SmallerOrEqual } |
enum | Type { InvalidTerm, LiteralTerm, ResourceTerm, AndTerm, OrTerm, ComparisonTerm } |
Public Member Functions | |
void | addSubTerm (const Term &) |
Comparator | comparator () const |
QString | field () const |
bool | isValid () const |
Term & | operator= (const Soprano::LiteralValue &other) |
Term & | operator= (const Term &other) |
bool | operator== (const Term &) const |
QUrl | property () const |
QUrl | resource () const |
void | setComparator (Comparator) |
void | setField (const QString &) |
void | setProperty (const QUrl &) |
void | setResource (const QUrl &) |
void | setSubTerms (const QList< Term > &) |
void | setType (Type) |
void | setValue (const Soprano::LiteralValue &) |
QList< Term > | subTerms () const |
Term (const QUrl &field, const QUrl &resource) | |
Term (const QUrl &field, const Soprano::LiteralValue &value, Comparator c=Contains) | |
Term (const QString &field, const Soprano::LiteralValue &value, Comparator c=Contains) | |
Term (const QUrl &resource) | |
Term (const Soprano::LiteralValue &value) | |
Term (const Term &other) | |
Term () | |
Type | type () const |
Soprano::LiteralValue | value () const |
~Term () |
Detailed Description
A Query constist of Terms.Queries are build from Term instances. A Term can have one of multiple types and subterms. See Term::Type for details on the different Term types.
Definition at line 44 of file term.h.
Member Enumeration Documentation
Each search term has a type.
- Enumerator:
-
InvalidTerm An invalid term does not do anything. LiteralTerm A literal term is the simplest form of Term. It matches all resource that contain the value.
It is also used to specify literal values in comparison Terms such as ContainsTerm or EqualityTerm.
ResourceTerm A resource term matches one resource by URI. It is also used to specify a resource in EqualityTerm Terms.
AndTerm Match all resources that match all sub terms. OrTerm Match all resources that match one of the sub terms. ComparisonTerm A comparison. The comparison operator needs to be specified in addition. For specifying the property the same applies as for ContainsTerm.
A single subterm specifies the resource or value to match (resource terms can only be matched via Equal or Contains.
Constructor & Destructor Documentation
Nepomuk::Search::Term::Term | ( | const Term & | other | ) |
Nepomuk::Search::Term::Term | ( | const Soprano::LiteralValue & | value | ) |
Nepomuk::Search::Term::Term | ( | const QUrl & | resource | ) |
Nepomuk::Search::Term::Term | ( | const QString & | field, | |
const Soprano::LiteralValue & | value, | |||
Comparator | c = Contains | |||
) |
Nepomuk::Search::Term::Term | ( | const QUrl & | field, | |
const Soprano::LiteralValue & | value, | |||
Comparator | c = Contains | |||
) |
Member Function Documentation
void Nepomuk::Search::Term::addSubTerm | ( | const Term & | term | ) |
Nepomuk::Search::Term::Comparator Nepomuk::Search::Term::comparator | ( | ) | const |
QString Nepomuk::Search::Term::field | ( | ) | const |
A property name used for ComparisonTerm Terms.
Will be matched against the rdfs:label to find the corresponding property.
- See also:
- setField, property, setProperty
bool Nepomuk::Search::Term::isValid | ( | ) | const |
Nepomuk::Search::Term & Nepomuk::Search::Term::operator= | ( | const Soprano::LiteralValue & | other | ) |
Nepomuk::Search::Term & Nepomuk::Search::Term::operator= | ( | const Term & | other | ) |
bool Nepomuk::Search::Term::operator== | ( | const Term & | other | ) | const |
QUrl Nepomuk::Search::Term::property | ( | ) | const |
QUrl Nepomuk::Search::Term::resource | ( | ) | const |
void Nepomuk::Search::Term::setComparator | ( | Comparator | c | ) |
void Nepomuk::Search::Term::setField | ( | const QString & | f | ) |
Set the property label in case the exact property is not known.
Will be mached against the property's rdfs:label.
- See also:
- field, setProperty, property
void Nepomuk::Search::Term::setProperty | ( | const QUrl & | p | ) |
void Nepomuk::Search::Term::setResource | ( | const QUrl & | res | ) |
void Nepomuk::Search::Term::setType | ( | Type | type | ) |
void Nepomuk::Search::Term::setValue | ( | const Soprano::LiteralValue & | v | ) |
QList< Nepomuk::Search::Term > Nepomuk::Search::Term::subTerms | ( | ) | const |
Nepomuk::Search::Term::Type Nepomuk::Search::Term::type | ( | ) | const |
Soprano::LiteralValue Nepomuk::Search::Term::value | ( | ) | const |
The documentation for this class was generated from the following files: