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

Require hierarchy name #143

Open
tpluscode opened this issue Feb 8, 2024 · 9 comments
Open

Require hierarchy name #143

tpluscode opened this issue Feb 8, 2024 · 9 comments

Comments

@tpluscode
Copy link
Contributor

tpluscode commented Feb 8, 2024

    Found an interesting edge-case: [https://s.zazuko.com/xmbYnD]()

    We have here a cube, with a dimension with 13 distinct hierarchies parallel to each other. Using `cat cube-constraint.ttl | npx barnard59 cube check-metadata --profile https://cube.link/latest/shape/standalone-constraint-constraint` returns no errors.
    
    Nevertheless, Visualize can't handle this case:
    ![image](https://github.com/zazuko/cube-link/assets/95312586/5c5905a3-6f13-4cae-b6ca-3ced6fe89832)
    
    The visualization issue can be fixed rather easily by giving each hierarchy a distinct name. Would it be possible to catch this issue in the `standalone-constraint-constraint.ttl`?
    
    cc @Rdataflow @tpluscode

Originally posted by @kronmar in #114 (comment)

@tpluscode
Copy link
Contributor Author

I created this issue referencing your comment @kronmar, but I find that schema:name is already required by the shape. Cube Creator also enforces it. Where are these offending cubes coming from?

[
sh:path schema:name;
sh:minCount 1;
sh:message "inHierarchy requires schema:name"
],

@kronmar
Copy link
Contributor

kronmar commented Feb 8, 2024

The offending cubes come from our own pipeline.

The issue is, that standalone-constraint-constraint checks that all hierarchies (that is in this specific cubes all parallel hierarchies) have a name. But they can have all the same name. Which breaks visualize and begs the question whether it would actually make sense for parallel hierarchies to have the same name?

cc @Rdataflow

@tpluscode
Copy link
Contributor Author

I don't understand. Would you share a query showing such a cube?

@kronmar
Copy link
Contributor

kronmar commented Feb 9, 2024

Just realised, the link in the initial comment wasn't working. Fixed it, but here as well https://s.zazuko.com/3C25xc2

@tpluscode
Copy link
Contributor Author

Yes, it's weird that all these hierarchies are called Classification. Unfortunately, I think it may be difficult to handle enforce such uniqueness with plain SHACL.

I don't think it's really harmful "enough" to enforce with standard profiles.

@kronmar
Copy link
Contributor

kronmar commented Feb 9, 2024

Does the validator support SPARQL-based constraints?

@tpluscode
Copy link
Contributor Author

Not the current implementation. It's certainly on our radar. Either by switching to a different tool or implementing ourselves: zazuko/rdf-validate-shacl#104

@kronmar
Copy link
Contributor

kronmar commented Feb 12, 2024

Found a possible solution without using SPARQL-based constraints:

https://s.zazuko.com/ERuwjt
It's not an ideal solution, as it targets all hierarchies, maybe that could be solved tho.

@tpluscode
Copy link
Contributor Author

That does not work, because targets are not combined. That shape will actually target everything that has schema:name. Not only hierarchies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants