Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Differences between the toCubeShape used in Cube Creator vs b59-cube #304

Open
tpluscode opened this issue May 20, 2024 · 1 comment
Open
Assignees

Comments

@tpluscode
Copy link
Contributor

tpluscode commented May 20, 2024

As discussed, in all cases the sh:in gets separated between the sh:or alternative shapes.

This would make it difficult for consumers to analyse the cube contents

In the cases when there are multiple sh:in lists, they should be merged and appear in the property shape itself.

Dimension with ""^^:cube:Undefined

--- before.ttl	2024-05-20 10:31:34
+++ after.ttl	2024-05-20 10:32:16
@@ -2,17 +2,19 @@
     sh:or (
               [
                   sh:datatype xsd:string ;
+                  sh:in (
+                            "incomplete series"
+                        ) ;
               ]
               [
                   sh:datatype <https://cube.link/Undefined> ;
+                  sh:in (
+                            ""^^<https://cube.link/Undefined>
+                        ) ;
               ]
           ) ;
-    sh:in (
-              "incomplete series"
-              ""^^<https://cube.link/Undefined>
-          ) ;
     sh:maxCount 1 ;
     sh:minCount 1 ;
     sh:nodeKind sh:Literal ;
     sh:path rdfs:comment ;
 ]

Numeric dimension with ""^^cube:Undefined literals

--- before.ttl	2024-05-20 10:40:23
+++ after.ttl	2024-05-20 10:39:30
@@ -2,15 +2,18 @@
     sh:or (
               [
                   sh:datatype <https://cube.link/Undefined> ;
+                  sh:in (
+                            ""^^<https://cube.link/Undefined>
+                        ) ;
               ]
               [
+                  sh:maxInclusive 500 ;
+                  sh:minInclusive "1"^^xsd:int ;
                   sh:datatype xsd:int ;
               ]
           ) ;
-    sh:maxInclusive "500"^^xsd:int ;
-    sh:minInclusive "1"^^xsd:int ;
     sh:maxCount 1 ;
     sh:minCount 1 ;
     sh:nodeKind sh:Literal ;
     sh:path <https://environment.ld.admin.ch/foen/ubd/28/dimension/limitvalue> ;
 ]

Dimension with mixed IRIs and Literals

--- before.ttl	2024-05-20 10:37:26
+++ after.ttl	2024-05-20 10:37:41
@@ -1,19 +1,28 @@
 [
-    sh:in (
-              <https://cube.link/Undefined>
-              unit:MicroGM-PER-M3
-              "count"
-              "ppb"
-              "mg/m3"
-              "1/cm3"
-              "ng/m3"
-              "mg/(m²·d)"
-              "µg/(m²·d)"
-              "µg CH4/m3"
-              "ppm·h"
+    sh:or (
+              [
+                  sh:datatype xsd:string ;
+                  sh:in (
+                            "count"
+                            "ppb"
+                            "mg/m3"
+                            "1/cm3"
+                            "ng/m3"
+                            "mg/(m²·d)"
+                            "µg/(m²·d)"
+                            "µg CH4/m3"
+                            "ppm·h"
+                        ) ;
+              ]
+              [
+                  sh:in (
+                            <https://cube.link/Undefined>
+                            unit:MicroGM-PER-M3
+                        ) ;
+              ]
           ) ;
+    sh:nodeKind sh:IRIOrLiteral ;
     sh:maxCount 1 ;
     sh:minCount 1 ;
-    sh:nodeKind sh:IRI ;
     sh:path <https://environment.ld.admin.ch/foen/ubd/28/unit> ;
 ]
@tpluscode
Copy link
Contributor Author

tpluscode commented May 20, 2024

Here's what we could expect respectively

  1. Same as before
  2. Alternative between numeric range and other values: https://s.zazuko.com/7yhdfz
  3. Top level sh:in and alternative between datatype and node kind https://s.zazuko.com/3m3mUg9

What do you think?

@giacomociti giacomociti mentioned this issue May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants