Informatievlaanderen / VSDS-LDESServer4J

Linked Data Event Streams Server for Java
https://informatievlaanderen.github.io/VSDS-LDESServer4J
European Union Public License 1.2
10 stars 11 forks source link

Update the eventsource doesnt work #1322

Open xdxxxdx opened 5 months ago

xdxxxdx commented 5 months ago

Prerequisites:

  curl -X 'GET' \
  'http://localhost:8080/admin/api/v1/eventstreams' \
  -H 'accept: text/turtle'
@prefix bearb:        <../../../../bearb/> .
@prefix dcat:         <http://www.w3.org/ns/dcat#> .
@prefix ldes:         <https://w3id.org/ldes#> .
@prefix prov:         <http://www.w3.org/ns/prov#> .
@prefix rdf:          <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix shacl:        <http://www.w3.org/ns/shacl#> .
@prefix terms:        <http://purl.org/dc/terms/> .
@prefix timebased-50: <../../../../bearb/timebased-50/> .
@prefix tree:         <https://w3id.org/tree#> .

timebased-50:description
        rdf:type                    tree:ViewDescription;
        tree:fragmentationStrategy  ( [ rdf:type                tree:HierarchicalTimeBasedFragmentation;
                                        tree:fragmentationPath  "http://www.w3.org/ns/prov#generatedAtTime";
                                        tree:maxGranularity     "hour"
                                      ]
                                    );
        tree:pageSize               "50"^^<http://www.w3.org/2001/XMLSchema#int> .

<https://w3id.org/tree/specification>
        rdf:type  terms:Standard .

<../../../../bearb>  rdf:type  dcat:Dataset , ldes:EventStream;
        terms:conformsTo     <https://w3id.org/tree/specification> , <https://w3id.org/ldes/specification>;
        terms:identifier     "../../../../bearb"^^<http://www.w3.org/2000/01/rdf-schema#Literal>;
        ldes:createVersions  true;
        ldes:eventSource     [ rdf:type              ldes:EventSource;
                               ldes:retentionPolicy  [ rdf:type    ldes:DurationAgoPolicy;
                                                       tree:value  "PT6S"^^<http://www.w3.org/2001/XMLSchema#duration>
                                                     ]
                             ];
        ldes:timestampPath   prov:generatedAtTime;
        ldes:versionOfPath   terms:isVersionOf;
        tree:shape           [ rdf:type  shacl:NodeShape ];
        tree:view            bearb:timebased-50 .

<https://w3id.org/ldes/specification>
        rdf:type  terms:Standard .

bearb:timebased-50  rdf:type  tree:Node;
        tree:viewDescription  timebased-50:description .

Scenarios Run

curl --location --request PUT 'http://localhost:8080/admin/api/v1/eventstreams/berab/eventsource' \
--header 'Content-Type: text/turtle' \
--data-raw '@prefix ldes: <https://w3id.org/ldes#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix tree: <https://w3id.org/tree#>.

<> a ldes:EventSource ;
    ldes:retentionPolicy [
        a ldes:LatestVersionSubset ;
        ldes:amount 2 ;
      ].'

Got response

image

Current result If I call again

  curl -X 'GET' \
  'http://localhost:8080/admin/api/v1/eventstreams' \
  -H 'accept: text/turtle'

I got

@prefix bearb:        <../../../../bearb/> .
@prefix dcat:         <http://www.w3.org/ns/dcat#> .
@prefix ldes:         <https://w3id.org/ldes#> .
@prefix prov:         <http://www.w3.org/ns/prov#> .
@prefix rdf:          <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix shacl:        <http://www.w3.org/ns/shacl#> .
@prefix terms:        <http://purl.org/dc/terms/> .
@prefix timebased-50: <../../../../bearb/timebased-50/> .
@prefix tree:         <https://w3id.org/tree#> .

timebased-50:description
        rdf:type                    tree:ViewDescription;
        tree:fragmentationStrategy  ( [ rdf:type                tree:HierarchicalTimeBasedFragmentation;
                                        tree:fragmentationPath  "http://www.w3.org/ns/prov#generatedAtTime";
                                        tree:maxGranularity     "hour"
                                      ]
                                    );
        tree:pageSize               "50"^^<http://www.w3.org/2001/XMLSchema#int> .

<https://w3id.org/tree/specification>
        rdf:type  terms:Standard .

<../../../../bearb>  rdf:type  dcat:Dataset , ldes:EventStream;
        terms:conformsTo     <https://w3id.org/tree/specification> , <https://w3id.org/ldes/specification>;
        terms:identifier     "../../../../bearb"^^<http://www.w3.org/2000/01/rdf-schema#Literal>;
        ldes:createVersions  true;
        ldes:eventSource     [ rdf:type              ldes:EventSource;
                               ldes:retentionPolicy  [ rdf:type    ldes:DurationAgoPolicy;
                                                       tree:value  "PT6S"^^<http://www.w3.org/2001/XMLSchema#duration>
                                                     ]
                             ];
        ldes:timestampPath   prov:generatedAtTime;
        ldes:versionOfPath   terms:isVersionOf;
        tree:shape           [ rdf:type  shacl:NodeShape ];
        tree:view            bearb:timebased-50 .

<https://w3id.org/ldes/specification>
        rdf:type  terms:Standard .

bearb:timebased-50  rdf:type  tree:Node;
        tree:viewDescription  timebased-50:description .

The ldes:eventSource stays unchanged

Expected result The ldes:eventSource should be changed to the new configured version based one.

P.S. is it possible to configure two kinds of retention policies on the ldes:eventSource ? if yes=> please provide an example

Thanks

Yalz commented 5 months ago

@xdxxxdx we'll need to validate this, but have you excluded the chance of a caching issue?

jobulcke commented 3 days ago

On verificiation, I saw that you posted to a non-existing collection (berab instead of bearb), however, this returns a 200 HTTP status, instead of an expected 404 status, but this will be fixed in #1427