Struct Namespace¶
Defined in File Namespace.hpp
Inheritance Relationships¶
Derived Types¶
public rdf4cpp::ClosedNamespace(Struct ClosedNamespace)public rdf4cpp::namespaces::XSD(Struct XSD)
Struct Documentation¶
-
struct Namespace¶
Namespace provides a simple tool to create IRIs from a certain namespace and vocabulary. Each Namespace instance maintains an internal cache to save roundtrip to storage::NodeStorage
.
Example:
Namespace ex("http://example.com/); IRI me = ex + "me";
Subclassed by rdf4cpp::ClosedNamespace, rdf4cpp::namespaces::XSD
Public Functions
-
explicit Namespace(std::string_view namespace_iri, storage::DynNodeStoragePtr node_storage = storage::default_node_storage)¶
Namespace Constructor
-
storage::DynNodeStoragePtr node_storage() const¶
-
virtual IRI operator+(std::string_view suffix) const¶
Create an IRI with the suffix added to the Namespace.
- Parameters:
suffix – suffix that is appended
- Returns:
the constructed IRI
-
virtual void clear() const¶
Clears the cache.
Protected Attributes
-
storage::DynNodeStoragePtr node_storage_¶
NodeStorage from which IRI objects are created.
-
mutable dice::sparse_map::sparse_map<std::string, storage::identifier::NodeBackendID, dice::hash::DiceHashwyhash<std::string_view>, std::equal_to<>> cache_¶
Cache storing the NodeBackendHandle for prefixes. This saves roundtrips to NodeStorage.
-
explicit Namespace(std::string_view namespace_iri, storage::DynNodeStoragePtr node_storage = storage::default_node_storage)¶