Uri represents a single URI.
It is a very thin wrapper around a string. Its purpose is to allow us to distinguish between abbreviated URIs (CURIEs) which may be subject to prefix expansion (represented by strings) and full URIs (represented by Uri).
In terms of the Turtle syntax, anything written within angle brackets is a Uri, while a bare string in URI context is not: it should be stored as a QString and converted to a Uri using Store::expand(). For example, http://xmlns.com/foaf/0.1/name is a Uri, while foaf:name is just a string. Never store the latter form in a Uri object without expanding it first.
Dataquay uses Uri in preference to QUrl because the latter is relatively slow to convert to and from string forms. Uri imposes no overhead over a string, it simply aids type safety.
Definition at line 76 of file Uri.h.
Dataquay::Uri::Uri |
( |
const QString & | s | ) |
|
|
inlineexplicit |
Construct a URI from the given string, which is expected to contain the text of a complete well-formed absolute URI.
As special cases, file: URIs are allowed to be relative ("file:x" will be expanded to "file://x" automatically) and "a" will be expanded to the rdf:type URI.
This will throw RDFIncompleteURI if given an incomplete or relative URI, so use care when constructing Uri objects from unvalidated input. Call isComplete() if you wish to test whether a URI string will be accepted before constructing.
To construct a Uri from an abbreviated or relative URI via prefix or base expansion, use Store::expand().
This constructor is intentionally marked explicit; no silent conversion is available.
Definition at line 104 of file Uri.h.