#include <PrefixRegistry.h>
|
using | Iterator = std::map< std::string, std::string >::iterator |
|
using | Iterator = std::map< std::string, std::string >::iterator |
|
Stores short names of IRI prefixes.
Definition at line 20 of file PrefixRegistry.h.
◆ Iterator [1/2]
◆ Iterator [2/2]
◆ aliasToUri() [1/2]
Maps alias to URI.
- Parameters
-
- Returns
- the corresponding URI, or nullopt if alias is unknown.
Definition at line 61 of file PrefixRegistry.cpp.
65 auto it =
get().aliasToURI_.find(alias);
static PrefixRegistry & get()
std::optional< std::reference_wrapper< const std::string > > OptionalStringRef
◆ aliasToUri() [2/2]
static OptionalStringRef knowrob::PrefixRegistry::aliasToUri |
( |
std::string_view |
alias | ) |
|
|
static |
Maps alias to URI.
- Parameters
-
- Returns
- the corresponding URI, or nullopt if alias is unknown.
◆ begin() [1/2]
Iterator knowrob::PrefixRegistry::begin |
( |
| ) |
|
|
inline |
- Returns
- begin iterator over the registry map.
Definition at line 71 of file PrefixRegistry.h.
71 {
return uriToAlias_.begin(); }
◆ begin() [2/2]
Iterator knowrob::PrefixRegistry::begin |
( |
| ) |
|
|
inline |
- Returns
- begin iterator over the registry map.
Definition at line 71 of file PrefixRegistry.h.
71 {
return uriToAlias_.begin(); }
◆ createIRI() [1/2]
std::optional< std::string > PrefixRegistry::createIRI |
( |
std::string_view |
alias, |
|
|
std::string_view |
entityName |
|
) |
| |
|
static |
Construct a full IRI from alias and entity name.
- Parameters
-
alias | namespace alias |
entityName | the name of an entity in the namespace identified by alias |
- Returns
- a full IRI if namespace alias is known
Definition at line 70 of file PrefixRegistry.cpp.
72 if (uri.has_value()) {
74 os << uri.value().get() << entityName;
static OptionalStringRef aliasToUri(std::string_view alias)
◆ createIRI() [2/2]
static std::optional<std::string> knowrob::PrefixRegistry::createIRI |
( |
std::string_view |
alias, |
|
|
std::string_view |
entityName |
|
) |
| |
|
static |
Construct a full IRI from alias and entity name.
- Parameters
-
alias | namespace alias |
entityName | the name of an entity in the namespace identified by alias |
- Returns
- a full IRI if namespace alias is known
◆ end() [1/2]
Iterator knowrob::PrefixRegistry::end |
( |
| ) |
|
|
inline |
- Returns
- end iterator over the registry map.
Definition at line 76 of file PrefixRegistry.h.
76 {
return uriToAlias_.end(); }
◆ end() [2/2]
Iterator knowrob::PrefixRegistry::end |
( |
| ) |
|
|
inline |
- Returns
- end iterator over the registry map.
Definition at line 76 of file PrefixRegistry.h.
76 {
return uriToAlias_.end(); }
◆ get() [1/2]
◆ get() [2/2]
- Returns
- the singleton instance of the registry.
◆ getAliasesWithPrefix() [1/2]
std::vector< std::string_view > PrefixRegistry::getAliasesWithPrefix |
( |
std::string_view |
prefix | ) |
|
|
static |
- Parameters
-
- Returns
- all aliases with matching prefix
Definition at line 81 of file PrefixRegistry.cpp.
83 std::vector<std::string_view> result;
84 for (
auto it = range_it.first; it != range_it.second; ++it) {
85 result.emplace_back(it->first.c_str());
constexpr std::string_view prefix
◆ getAliasesWithPrefix() [2/2]
static std::vector<std::string_view> knowrob::PrefixRegistry::getAliasesWithPrefix |
( |
std::string_view |
prefix | ) |
|
|
static |
- Parameters
-
- Returns
- all aliases with matching prefix
◆ registerPrefix() [1/2]
void PrefixRegistry::registerPrefix |
( |
std::string_view |
prefix, |
|
|
std::string_view |
uri |
|
) |
| |
|
static |
Register a namespace prefix. This will overwrite any existing prefix registered for given URI.
- Parameters
-
prefix | a short name for the URI. |
uri | a full URI. |
Definition at line 44 of file PrefixRegistry.cpp.
◆ registerPrefix() [2/2]
static void knowrob::PrefixRegistry::registerPrefix |
( |
std::string_view |
prefix, |
|
|
std::string_view |
uri |
|
) |
| |
|
static |
Register a namespace prefix. This will overwrite any existing prefix registered for given URI.
- Parameters
-
prefix | a short name for the URI. |
uri | a full URI. |
◆ uriToAlias() [1/2]
Maps URI to alias.
- Parameters
-
- Returns
- an alias, or nullopt if no alias is known.
Definition at line 48 of file PrefixRegistry.cpp.
51 }
else if (isDelimiter(uri[uri.size() - 1])) {
52 auto it =
get().uriToAlias_.find(uri);
56 auto it =
get().uriToAlias_.find(withDelimiter);
◆ uriToAlias() [2/2]
Maps URI to alias.
- Parameters
-
- Returns
- an alias, or nullopt if no alias is known.
The documentation for this class was generated from the following files: