Library
Module
Module type
Parameter
Class
Class type
Providing high-level HTTP queries.
module Ldp = Rdf.Ldp
type query_error = Cohttp.Code.meth * int * Types.meta
val string_of_query_error : query_error -> string
val type_is_container : Iri.t -> bool
type_is_container iri
returns whether iri
is a container type, comparing to known container_types
.
val is_container : ?iri:Iri.t -> Rdf.Graph.graph -> bool
is_container ~iri g
returns whether iri
is a container, according to graph g
. If iri
is not provided, the name if the graph is used intead.
val response_metadata :
Iri.t ->
(Cohttp.Response.t * Cohttp_lwt.Body.t) ->
Types.meta
response_metadata iri (resp, body)
creates a Types.meta
structure with the given iri
and from the http response and body.
val parse_graph :
?g:Rdf.Graph.graph ->
Iri.t ->
Ct.t ->
string ->
(Rdf.Graph.graph, Types.error) Stdlib.result
parse_graph iri content_type body
tries to parse graph in body
according to the content_type
. If no graph g
is provided, a new one with name iri
is created. The graph (the enriched graph or the created one) or an error is returned.
module type Requests = sig ... end
val dummy_requests : string -> (module Requests)
dummy_request name
returns a module which can be used in applications instead of a normal Requests
module, typically before some initializations. dbg
does nothing and call
will raise Not_initialized name
.
module type Cache = sig ... end
type cache_find_response =
| Not_found
The resource was not found in cache.
*)| Found of Cohttp.Response.t * string
The resource was found in cache, with the given response and body as string.
*)| If_error of Cohttp.Response.t -> string -> (Cohttp.Response.t * string) Lwt.t
The resource is in the cache, but it should be used only in case of error after performing the request.
*)The different ways the find
function of a cache implementation can respond.
module type Cache_impl = sig ... end
module Make_cache (I : Cache_impl) : Cache
Creates a cache from implementation of cache operations.
The high-level HTTP module created from a Requests
implementation.
module type Http = sig ... end
These are queries used to send and receive data of a given content-type. The following module types and the Http_ct
module can be used to create functions to perform such queries.
module type Ct_wrapper = sig ... end
Mapping values of a given content-type to and from strings.
module type Http_ct = sig ... end
The type of the module with specialized query functions.