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

Instance http://localhost:8080/kbo/by-name?substring=& doesn't have a rdf:type tree:Node #776

Closed xdxxxdx closed 10 months ago

xdxxxdx commented 1 year ago

That is very specific bug, only occurs to the tree:Node http://localhost:8080/kbo/by-name?substring=& for substring fragmentations. I think it is an error when processing “&”。 This issue doesn't occur to other fragmented pages: e,g.

Prerequitests:

Scenario:

  1. Post KBO event stream configuration to the server endpoint by
    @prefix ldes: <https://w3id.org/ldes#> .  
    @prefix custom: <http://example.org/> .  
    @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 kbo: <http://localhost:8080/kbo/> .  
    @prefix legal: <http://www.w3.org/ns/legal#> .  
    @base <http://localhost:8080> .  

    server:kbo a ldes:EventStream ;  
    ldes:timestampPath dcterms:issued;  
    ldes:versionOfPath dcterms:isVersionOf ;  
    custom:memberType legal:legalEntity;  
    tree:shape kbo:shape .  

    kbo:shape a sh:NodeShape ;  
    sh:nodeShape [  
    sh:closed true ;  
    sh:propertyShape []  
    ] ;  
    sh:deactivated true .
  1. Post the BEL 20 data to the LDES Server
  2. Post substring fragmentation view by
    @prefix ldes: <https://w3id.org/ldes#> .  
    @prefix custom: <http://example.org/> .  
    @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 server: <http://localhost:8080/kbo/> .  
    @prefix legal: <http://www.w3.org/ns/legal#> .  
    @base <http://localhost:8080> .  

    </kbo/by-name> a tree:Node ;  
    tree:viewDescription [ a tree:ViewDescription ;  
    tree:fragmentationStrategy ([  
    a tree:SubstringFragmentation ;  
    tree:memberLimit "2"^^xsd:integer ;  
    tree:fragmentationPath legal:legalName ;  
    ]) ;  
    ] .

Current result Brower to http://localhost:8080/kbo/by-name?substring=&, there is no triples indicating the current node is a tree:Node. e,g,

"
<http://localhost:8080/kbo/by-name?substring=&>
        rdf:type        tree:Node ;
        terms:isPartOf  <http://localhost:8080/kbo> .
"

But for any other fragmented pages e.g. http://localhost:8080/kbo/by-name?substring=c. it has

"
<http://localhost:8080/kbo/by-name?substring=c>
        rdf:type        tree:Node ;
        terms:isPartOf  <http://localhost:8080/kbo> .
 "

According to the Tree Spec: https://treecg.github.io/specification/#traversing

A tree:Relation MUST have one tree:node object of the type tree:Node.

As In the page http://localhost:8080/kbo/by-name?substring= http://localhost:8080/kbo/by-name?substring=& is a tree:node of a tree:Relation

       tree:relation   [ rdf:type    tree:SubstringRelation ;
                              tree:node   <http://localhost:8080/kbo/by-name?substring=&> ;
                              tree:path   legal:legalName ;
                              tree:value  "&"
                            ] ;

There should be

"
<http://localhost:8080/kbo/by-name?substring=&>
        rdf:type        tree:Node ;
        terms:isPartOf  <http://localhost:8080/kbo> .
"

In the whole RDF graph. The turtle file with what is in the content when pinging http://localhost:8080/kbo/by-name?substring=& substring_&.zip

Yalz commented 1 year ago

Hi @xdxxxdx ,

Could you provide a total data dump from your mongo? (Through whatever medium possible) The issue seems to come from not escaping sensitive HTML characters. We'll investigate

xdxxxdx commented 1 year ago

Hello @Yalz , here is the full data dump :) mongo_dump_776.zip

pj-cegeka commented 1 year ago

This issue has been fixed. The problem was not escaping sensitive HTML characters in the url of fragments. These characters in the urls are now encoded.

xdxxxdx commented 1 year ago

Hello @WLefever-Cegeka @pj-cegeka , This issue occurs again on the version: ldes/ldes-server:1.4.0-SNAPSHOT The turtle file with what is in the content when pinging http://localhost:8080/kbo/by-name?substring=& substringbug.zip

Same issue occurs on : 2.0.0-SNAPSHOT Thanks

pj-cegeka commented 10 months ago

Substring fragmentation has been deprecated so this issue with escaping sensitive HTML characters in the url of fragments can't happen anymore.

xdxxxdx commented 10 months ago

A great done