@prefix tree: <https://w3id.org/tree#>.
@prefix ldes: <https://w3id.org/ldes#>.
@prefix dcat: <http://www.w3.org/ns/dcat#>.
@prefix prov: <http://www.w3.org/ns/prov#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
@prefix patch: <http://example.org/patch#>.
@prefix as: <http://example.org/as#>.
@prefix ex: <http://example.org/ex#>.

ex:LDES a ldes:EventStream ;
    rdfs:comment "An LDES with per member: an ActivityStreams update, the payload and the signature of the payload";
    tree:view <> ;
    tree:member <A> .

## Imagine we would like to create a transactional profile of LDES, including things like policies, transactions, policies, ways to upsert/remove sets of triples, etc.
<A> a patch:Event ;
    patch:processingMethod patch:Upsert ;
    patch:upsertKey <https://example.org/Dataset1> ;
    patch:transaction ex:Transaction1 ;
    patch:upsertPayload _:b0 ;
    patch:sequence 1 ;
    patch:time "2024-09-09T13:27:33.681Z";
    patch:provenance _:b1 ;
    patch:signature _:b2 ;
    patch:policy _:b3 .

_:b0 {
     ## The (updated) representation of this particular dataset
     ## ...
     <https://example.org/Dataset1> a dcat:Dataset .

}

_:b1 {
     <https://example.org/Dataset1#Event1> a as:Create, prov:Activity ;
       as:object <https://example.org/Dataset1> ;
       as:published "2023-10-01T12:00:00Z"^^xsd:dateTime .
}

_:b2 {
     # Signature
     [] a ex:DataIntegrityProof;
        # ...
        ex:signature "rCWNBuxBK1In93X8dvuK1ss91LK0rMiA2KzvsNaEhdGt7PTD5aQ0X58TzbvnTOhvl9t5bRGoOHnxfys52Q9bWjnmD4GoljEWVWFSrBnORsLBOLwcAnLRfEtTvz4t0EYV";
        ex:target (_:b0 _:b1 _:b3) .
}

_:b3 {
      ## We want to indicate that this specific member must be removed after 1 month
      [] a ex:Policy ;
          ex:target (_:b0 _:b1 _:b2) ;
          ex:duty [
                 a ex:RemovalDuty ;
                 ex:after "P1M" 
         ] .
}
