Library
Module
Module type
Parameter
Class
Class type
Base types and utilities.
type meta = {
iri : Iri.t;
IRI of the resource
*)acl : Iri.t option;
Optional IRI of the ACL (access control list) of the resource.
*)meta : Iri.t option;
Optional IRI of meta information about the resource.
*)user : string option;
Optional used identifier when resource was retrieved.
*)websocket : Iri.t option;
Optional IRI of a websocket tunnel for the resource.
*)editable : Cohttp.Code.meth list;
Allowed HTTP methods on the resource.
*)exists : bool;
Whether the resource exists.
*)info : Cohttp.Response.t * Cohttp_lwt.Body.t;
Original HTTP response and body.
*)}
Information about a resource.
val meta :
?acl:Iri.t ->
?meta:Iri.t ->
?user:string ->
?websocket:Iri.t ->
?editable:Cohttp.Code.meth list ->
?exists:bool ->
Cohttp.Response.t ->
Cohttp_lwt.Body.t ->
Iri.t ->
meta
meta resp body
creates a meta
structure. Optional fields have default value None
. Default editable
is []
. Default exists
is true
.
val string_of_meta : meta -> string
Returns a string representation of a Types.meta
, mainly for debugging purpose;
A RDF resource contains meta information on the resource, its graph, content-type and original contents as a string.
A Non-rdf resource contains meta information on the resource, its content-type and its original contents as a string.
A resource may be a container, another RDF resource or a non-RDF resource.
val container_children : Rdf.Graph.graph -> Iri.t list
container_children g
returns the IRIs of the children of the given container. Container IRI is the name of the graph. Its children are retrieved by looking for the triples with the name of the graph as subjects and the Rdf.Ldp.contains
relation.
exception Error of error
Exception used in the library to signal an error.
val string_of_error : error -> string
Returns a string representation of the given error.
register_string_of_error f
registers f as printer for errors. f
takes the previous printer function, to use it as fallback for errors not handled.
val content_type_of_string : ?fail:bool -> string -> Ct.t
content_type_of_string str
parses str
as content-type, using Ldp.Ct.of_string
. If parsing fails and fail
is true
(which is the default), raises Failure
with the error message, else return the default content-type Ldp.Ct.default
.
split_string string chars
splits the given string
on any of the chars
. Optional argument keep_empty
(default is false
) indicates whether empty strings must be returned too.
val methods_of_string : string -> Cohttp.Code.meth list
methods_of_string str
returns the list of HTTP methods from the given string str
, where they may be separated by characters ','
, ' '
or '\t'
.