Informatievlaanderen / VSDS-LDESServer4J

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

Timebased fragmentations are both lessThan and greaterOrEqual at the same time #1243

Closed Tomvbe closed 5 months ago

Tomvbe commented 6 months ago

Describe the bug Timebased fragmentations have two relations to everything. In the screenshot below you can see that there are two relations to 2024, a tree:LessThanRelation and a tree:GreaterThanOrEqualToRelation. This should not be possible, something is either lessThan or something is greaterThanOrEqual. The same problem occurs with the other relations to months, days, etc.

image

To Reproduce Steps to reproduce the behavior:

  1. Create eventstream
curl -X 'POST' \
  'http://localhost:8080/admin/api/v1/eventstreams' \
  -H 'accept: text/turtle' \
  -H 'Content-Type: text/turtle' \
  -d '@prefix ldes: <https://w3id.org/ldes#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix tree: <https://w3id.org/tree#>.
@prefix sh:   <http://www.w3.org/ns/shacl#> .
@prefix server: <http://localhost:8080/> .
@prefix xsd:  <http://www.w3.org/2001/XMLSchema#> .
@prefix event-stream: <http://localhost:8080/event-stream/> .

server:event-stream a ldes:EventStream ;
    ldes:timestampPath dcterms:created ;
    ldes:versionOfPath dcterms:isVersionOf ;
    tree:shape event-stream:shape .

event-stream:shape a sh:NodeShape .
'
  1. Create view
curl -X 'POST' \
  'http://localhost:8080/admin/api/v1/eventstreams/event-stream/views' \
  -H 'accept: */*' \
  -H 'Content-Type: text/turtle' \
  -d '@prefix server: <http://localhost:8080/event-stream/> .
@prefix tree: <https://w3id.org/tree#> .
@prefix ldes: <https://w3id.org/ldes#> .

server:by-time tree:viewDescription [
    tree:fragmentationStrategy ([
        a tree:HierarchicalTimeBasedFragmentation ;
        tree:maxGranularity "day" ;
        tree:linearTimeCachingEnabled "true" ;
        tree:fragmentationPath <http://purl.org/dc/terms/created> ;
    ]) ;
    tree:pageSize "100"^^<http://www.w3.org/2001/XMLSchema#int> ;
 ] .
'
  1. Ingest member
curl -X 'POST' \
  'http://localhost:8080/event-stream' \
  -H 'accept: */*' \
  -H 'Content-Type: text/turtle' \
  -d '@prefix schema: <http://schema.org/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix terms: <http://purl.org/dc/terms/> .
@prefix prov:     <http://www.w3.org/ns/prov#> .

<https://example.com/John-Doe/1>
  a schema:Person ;
  schema:age 16 ;
  schema:name "John"^^xsd:string, "Johnny"^^xsd:string ;
  terms:isVersionOf <https://example.com/John-Doe> ;
  terms:created "2023-11-30T21:45:15+01:00"^^xsd:dateTime .
'
  1. Go to http://localhost:8080/event-stream/by-time
  2. Observe two relations to http://localhost:8080/event-stream/by-time?year=2023

Expected behavior There is only one relation.

xdxxxdx commented 5 months ago

Hello @Tomvbe , I don't get this issue. In the example, the member links to the nodes under =2024 are tree:lessThan to value 2025-01-01T00:00, and greaterOrEqual to value 2024-01-01T00:00. This was supposed to replace the inBetween relation. That seems to be logic.

Thanks

Tomvbe commented 5 months ago

Hi @xdxxxdx you are right, this seems to be according to spec..

xdxxxdx commented 5 months ago

Hello @Tomvbe , Yep, It was a change requested by https://github.com/Informatievlaanderen/VSDS-LDESServer4J/issues/1186. InBetween relation is supposed to used for datatype xsd:duration such as. 2003-02-15T00:00:00Z/P2M. https://github.com/TREEcg/specification/issues/82