zazuko / cube-creator

A tool to create RDF cubes from CSV files
GNU Affero General Public License v3.0
11 stars 2 forks source link

minInclusive/maxInclusive constraints on optional dimension #1470

Open giacomociti opened 10 months ago

giacomociti commented 10 months ago

Describe the bug

sh:minInclusive and sh:maxInclusive constraints on a property with cube:Undefined values make it impossible to validate the data.

Affected functionalities (all that apply)

Relevant links

[query](https://s.zazuko.com/yDZVWX) showing an example of dimension having both `cube:Undefined` values and `sh:minInclusive` constraint **To Reproduce** Steps to reproduce the behavior: 1. create a cube from CSV with some empty fields in a numeric column 2. Apply transformation 3. Edit metadata 4. Publish **Expected behavior**

The sh:minInclusive and sh:maxInclusive constraints should be omitted because there are undefined values. Alternatively, they can be nested with the data type:

sh:or (
            [ sh:datatype xsd:decimal ; sh:minInclusive "1"^^xsd:decimal ; sh:maxInclusive "5"^^xsd:decimal ] 
            [ sh:datatype cube:Undefined ]
         ) ;

Screenshots

Desktop (please complete the following information):

Additional context

tpluscode commented 4 months ago

This will no longer apply once we switch to cube.link shapes, right?

giacomociti commented 4 months ago

yes, cube.link shapes may catch the anomaly, but it would be useful to use the latest shapes builder to generate correct shapes

AdMSilvan commented 3 months ago

@rdataflow created a query to highlight this error in action https://s.zazuko.com/LrBtqX

tpluscode commented 3 months ago

As discussed on the call today, the right way to improve this would be to update Cube Creator to use the newest barnard59 step for building the cube shape

Unfortunately, that proved problematic already since it requires updating barnard59 to a newer major release. Hence, a conservative estimate here.