Environment¶
-
SerdEnv *
serd_env_new
(SerdStringView base_uri)¶ Create a new environment.
-
SerdStatus
serd_env_set_base_uri
(SerdEnv *env, SerdStringView uri)¶ Set the current base URI.
-
SerdStatus
serd_env_set_prefix
(SerdEnv *env, SerdStringView name, SerdStringView uri)¶ Set a namespace prefix.
A namespace prefix is used to expand CURIE nodes, for example, with the prefix “xsd” set to “http://www.w3.org/2001/XMLSchema#”, “xsd:decimal” will expand to “http://www.w3.org/2001/XMLSchema#decimal”.
-
SerdNode *
serd_env_qualify
(const SerdEnv *env, const SerdNode *uri)¶ Qualify
uri
into a CURIE if possible.Returns null if
uri
can not be qualified (usually because no corresponding prefix is defined).
-
SerdNode *
serd_env_expand
(const SerdEnv *env, const SerdNode *node)¶ Expand
node
, transforming CURIEs and URI references into absolute URIs.If
node
is a relative URI reference, it is expanded to a full URI if possible. Ifnode
is a literal, its datatype is expanded if necessary. Ifnode
is a CURIE, it is expanded to a full URI if possible.For simple nodes that do not require expansion, a copy is returned. Null is returned if
node
is/contains a CURIE or relative URI that can not be expanded.