Module IriSource

Sourcetype error
Sourceexception Error of error
Sourceval string_of_error : error -> string
Sourcemodule KV : Map.S with type key = string
Sourcetype query_kv = string KV.t
Sourcetype path =
  1. | Absolute of string list
  2. | Relative of string list
Sourcetype t
Sourceval iri : ?scheme:string -> ?user:string -> ?host:string -> ?port:int -> ?path:path -> ?query_kv:query_kv -> ?query:string -> ?fragment:string -> unit -> t

Parameter query is %-encoded. Parameter query_kv is %-decoded.

Sourcemodule Set : Set.S with type elt = t
Sourcemodule Map : Map.S with type key = t
Sourceval is_absolute : t -> bool

true if fragment is None and scheme is not empty.

Sourceval is_relative : t -> bool

true is scheme is empty.

Sourceval compare : ?normalize:bool -> t -> t -> int

IRI comparison. Optional parameter normalize indicates whether to normalize the IRIs to compare (default is false).

Sourceval equal : ?normalize:bool -> t -> t -> bool

Equality. Optional parameter normalize indicates whether to normalize the IRIs to compare (default is false).

Sourceval of_string : ?pctdecode:bool -> ?pos:Lexing.position -> ?normalize:bool -> string -> t

Read an IRI from the given string. Optional parameter normalize tells whether to normalize to IRI or not; default is false when IRI is relative (has no scheme) or true overwise. Optional parameter pctdecode tells whether to %-decode strings or not; default is true.

Sourceval to_string : ?pctencode:bool -> t -> string

Return a string representation of the given IRI. Optional parameter pctencode is true by default.

Sourceval to_string_details : t -> string

Return a debug purpose string representation of the given IRI.

Sourceval pp : Format.formatter -> t -> unit

Print the given IRI to the given formatter, using to_string ?pctencode:None.

Sourceval pp_details : Format.formatter -> t -> unit

Print a debug purpose representation of the given IRI to the given formatter, using to_string_details.

Sourceval scheme : t -> string
Sourceval with_scheme : t -> string -> t
Sourceval user : t -> string option
Sourceval with_user : t -> string option -> t
Sourceval host : t -> string option
Sourceval with_host : t -> string option -> t
Sourceval port : t -> int option
Sourceval with_port : t -> int option -> t
Sourceval path : t -> path
Sourceval with_path : t -> path -> t
Sourceval path_string : ?pctencode:bool -> t -> string

Return the path of the given IRI as a string. Optional parameter encode indicates whether the path elements must be encoded; default is false.

Sourceval append_path : t -> string list -> t

Append the given (not %-encoded) string list to the path of the given IRI and return a new IRI with this path.

Sourceval query : t -> string option

Return the query string of the given IRI. The query string is not %-decoded as it is not parsed to name/value pairs.

Sourceval query_kv : t -> query_kv

Return the key/value pairs from the query string of the given IRI. Strings are %-decoded.

Sourceval with_query : t -> string option -> t

Return a new IRI which is the same as the given IRI but with the optional query string provided. This string must already be %-encoded.

Sourceval with_query_kv : t -> query_kv -> t

with_query_kv iri kv returns a new IRI which is the same as the given iri but with the provided list of key/value pairs kv. The strings in kv must be %-decoded.

Sourceval query_get : t -> string -> string
Sourceval query_opt : t -> string -> string option
Sourceval query_set : t -> string -> string -> t
Sourceval fragment : t -> string option
Sourceval with_fragment : t -> string option -> t
Sourceval normalize : ?nfkc:bool -> t -> t
Sourceval resolve : ?normalize:bool -> base:t -> t -> t

resolve ~base iri resolves iri against the base IRI. Optional parameter normalize tells whether to apply normalization after resolution; default is true.

Sourceval to_uri : t -> string

Return a correctly pct-encoded URI as a string, from the given IRI.