Models a Sparql IRI reference. More...
Public Types | |
enum | Type { Invalid, Iri, PrefixedName } |
Public Member Functions | |
ResourceValue () | |
Constructs an empty, invalid ResourceValue. | |
CUBI_EXPLICIT | ResourceValue (const QUrl &iri) |
Constructs a ResourceValue from its IRI. | |
CUBI_EXPLICIT | ResourceValue (const QString &name, ResourceValue::Type type=Iri) |
Constructs a ResourceValue from its prefixed name. | |
bool | operator== (const ResourceValue &other) const |
bool | operator!= (const ResourceValue &other) const |
Type | resourceType () const |
Returns the type of the value. | |
void | setIri (const QUrl &iri) |
Sets the IRI of the ResourceValue from a QUrl. | |
void | setIri (const QString &iri) |
Sets the IRI of the ResourceValue from a QString. | |
QString | iri () const |
Returns the IRI of the ResourceValue. | |
void | setName (const QString &name) |
Sets the name of the ResourceValueData. | |
QString | name () const |
Returns the name of the ResourceValue. |
Models a Sparql IRI reference.
QString ResourceValue::iri | ( | ) | const |
Returns the IRI of the ResourceValue.
If called on a value of type ResourceValue::PrefixedName, returns a converted value.
QString ResourceValue::name | ( | ) | const |
Returns the name of the ResourceValue.
If called on a value of type ResourceValue::Iri, returns a converted value.
ResourceValue::Type ResourceValue::resourceType | ( | ) | const |
Returns the type of the value.
The type can be one of
ResourceValue::Invalid
an invalid (unset) value ResourceValue::Iri
a complete IRI reference (like <iriref>
) ResourceValue::PrefixedName
a prefixed name (like ns:Name
) void ResourceValue::setIri | ( | const QUrl & | iri | ) |
Sets the IRI of the ResourceValue from a QUrl.
This function also sets the type of the value to ResourceValue::Iri.
void ResourceValue::setIri | ( | const QString & | iri | ) |
Sets the IRI of the ResourceValue from a QString.
This function also sets the type of the value to ResourceValue::Iri.
void ResourceValue::setName | ( | const QString & | name | ) |
Sets the name of the ResourceValueData.
This function also sets the type of the value to ResourceValue::PrefixedName.