Informatievlaanderen / VSDS-LDESServer4J

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

Add a path to tree:Collection to the view page. #766

Closed xdxxxdx closed 1 year ago

xdxxxdx commented 1 year ago

Docker image: ldes/ldes-server:1.1.0-SNAPSHOT

According to the spec: https://treecg.github.io/specification/#core-concepts

When the current page is a tree:Node, there MUST be a property linking the current page URL to the URI of the tree:Collection.

but for our tree:view Node, e.g. http://localhost:8080/kbo/by-page There no path link to the tree:Collection.

@prefix kbo:   <http://localhost:8080/kbo/> .
@prefix ldes:  <https://w3id.org/ldes#> .
@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 tree:  <https://w3id.org/tree#> .

kbo:by-page  rdf:type  tree:Node ;
        tree:relation  [ rdf:type   tree:Relation ;
                         tree:node  <http://localhost:8080/kbo/by-page?pageNumber=1>
                       ] .

<http://localhost:8080/kbo>
        rdf:type            ldes:EventStream ;
        ldes:timestampPath  terms:issued ;
        ldes:versionOfPath  terms:isVersionOf ;
        tree:view           kbo:by-page .

kbo:shape  rdf:type        shacl:NodeShape ;
        shacl:deactivated  true ;
        shacl:nodeShape    [ shacl:closed         true ;
                             shacl:propertyShape  [] 
                           ] .

I think something like

<http://localhost:8080/kbo/by-page>
        terms:isPartOf  <http://localhost:8080/kbo>.

Please feel free to leave a comment Thanks Xueying

pj-cegeka commented 1 year ago

We now add a property with predicate terms:isPartOf to every node.

xdxxxdx commented 1 year ago

Validated on the ldes/ldes-server:1.2.0-SNAPSHOT

rorlic commented 1 year ago

I disagree with this change because a node cannot be a view and a subset at the same time, that is, from a tree:Node you can either reach all members or not. Both statements cannot be true at the same time.

At this moment the LDES contains something like this:

@prefix ldes:                <https://w3id.org/ldes#> .
@prefix mobility-hindrances: <http://localhost:8080/mobility-hindrances/> .
@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 tree:                <https://w3id.org/tree#> .

mobility-hindrances:by-time
        rdf:type        tree:Node ;
        terms:isPartOf  <http://localhost:8080/mobility-hindrances> .

<http://localhost:8080/mobility-hindrances>
        rdf:type   ldes:EventStream ;
        tree:view  mobility-hindrances:by-time .

[ rdf:type  shacl:NodeShape ] .

which, if we filter out the relevant statements, claims that the view is both a subset and a view, which cannot be true at the same time.

<http://localhost:8080/mobility-hindrances/by-time> terms:isPartOf <http://localhost:8080/mobility-hindrances> .
<http://localhost:8080/mobility-hindrances> tree:view <http://localhost:8080/mobility-hindrances/by-time> .

More detail

If a tree:Node ex:N1 is a view, the collection ex:C1 has a predicate tree:view linking the view to the collection: ex:C1 tree:view ex:N1 which connects the fragment to the collection in a "reverse" way, but still both graphs are connected.

If a tree:Node ex:N2 is not a view, the collection ex:C1 can be connected to the ex:N2 using the property void:subset OR using the reverse property dcterms:isPartOf, i.e. ex:C1 void:subset ex:N2 OR ex:N2 dcterms:isPartOf ex:C1 in both cases the graphs are connected, which is basically what we need: one connected graph

Note: you could add both ex:C1 void:subset ex:N2 AND ex:N2 dcterms:isPartOf ex:C1 to a fragment but there is little value in this.

Conclusion

I vote to revert this change, that is, the behavior we want is:

This connects the node and the collection in a single graph.

rorlic commented 1 year ago

Team, please revert this change and verify (view and first fragment) behavior using test 019:

npx cypress run -e tags="@test-019 and @consumption and @formats" -s "cypress/e2e/server.basics.feature"