package activitypub_client
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=332e6cab89ed63fda379aba37e00c40b
sha512=b6e5fe4948fdbe1d63227adc834c783821b609691c8db24438a8f76c5f6a2c60d1ecbd385baf1029901225abe2031d9aa994a0ed0321ea8082b3281e35552bb0
doc/activitypub_client/Activitypub_client/Object/index.html
Module Activitypub_client.ObjectSource
Implementation of objects
Objects
Implementation of objects inherits from Activitypub.Object.object_ and here we provide a way to dereference objects. To dereference an object, you need an actor and its public/private key to sign http queries. An Http_t module is used by Make to create a module of type T which can be used to create and dereference objects with the actor of the Http_t module in parameter of Make.
type dereferencer =
Iri.t ->
(Rdf.Graph.graph * Iri.t option, Activitypub.E.error) result Lwt.tA dereferencer takes an IRI and returns the result as a RDF graph and an optional IRI (for queries creating remote objects, like POST queries).
The type of modules to create, dereference and query objects as a given actor.
Convenient functions to create some specific objects and graphs.
val note :
?add:(Rdf.Graph.graph -> Rdf.Term.term -> unit) ->
?content_map:string Activitypub.Smap.t ->
string ->
Rdf.Graph.graph * Rdf.Term.termnote content creates a new graph, with empty name, of type Note, with the given content. An optional content_map can be passed to specify language-specific contents. The function returns the graph and the subject sub (a blank node) corresponding to the note id. The add optional argument is called on g and sub before returning.
val link :
?g:Rdf.Graph.graph ->
?root:Rdf.Term.term ->
?height:int ->
?hreflang:string ->
?media_type:Ldp.Ct.mime ->
?name:string ->
?rel:string list ->
?type_:Iri.t ->
?width:int ->
Iri.t ->
Activitypub.Object.linklink iri creates a new Activitypub.Object.link from the given parameters.
type attachment = [ | `Iri of Iri.t| `Link of Activitypub.Types.link| `Obj of Activitypub.Types.object_
]add_attachment g sub a adds a as an attachment to sub in graph g, eventually merging parts of a's triples into g.
val document :
(module T) ->
?g:Rdf.Graph.graph ->
?root:Rdf.Term.term ->
?height:int ->
?media_type:Ldp.Ct.t ->
?name:string ->
?type_:Iri.t ->
?width:int ->
Iri.t ->
Activitypub.Types.documentdocument (module O) url creates a new object O.o from the given parameters. If no graph g is provided, a new one with an empty named is used. If no root node is provided, a blank node is used as id for the object. Default type of the object is Document but another one can be specified with typ argument.