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

genshacl: fix the propagation of types to SHACL sh:datatype and sh:nodeKind #2102

Merged
merged 2 commits into from
May 11, 2024

Conversation

jsheunis
Copy link
Contributor

@jsheunis jsheunis commented May 9, 2024

In the previous state, the edited code was never reached. With this change, a linkml or custom type as slot range will propagate to the property's sh:datatype in SHACL. In addition, a sh:nodekind of sh:Literal is added for such properties (based on my interpretation of this comment)

This PR is intended to close #1299. It does pretty much the same as #1300, but that PR has been stagnant for over a year and is based on old state of main. So I though a fresh PR might be useful to get the fix merged. Happy to close again if the preference would be to rather update the existing PR.

TODO:

  • test updates

In the pervious state, the edited code was never reached. With this
change, a linkml or custom type as slot range will propagate to the
property's sh:datatype in SHACL. In addition, a nodekind of sh:Literal
is added for such properties.
@cmungall
Copy link
Member

cmungall commented May 9, 2024

🙏

let us know if you want help with the test output. This is failing on the compliance tests. It may be the case that we want to change the test itself. You may find it useful to run this test with --with-output and examine the results in detail

In b415224 a change was made to add
'sh:nodeKind sh:Literal' to a property shape for a slot with a type
as range. This required an update to the expected shacl output used
in 'test_compliance/test_core_compliance.py::test_cardinality'.
Copy link

codecov bot commented May 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.92%. Comparing base (0440402) to head (3105e89).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2102      +/-   ##
==========================================
+ Coverage   79.88%   79.92%   +0.04%     
==========================================
  Files         109      109              
  Lines       12249    12250       +1     
  Branches     3489     3489              
==========================================
+ Hits         9785     9791       +6     
+ Misses       1874     1869       -5     
  Partials      590      590              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jsheunis jsheunis marked this pull request as ready for review May 10, 2024 12:47
@cmungall cmungall merged commit a6275bc into linkml:main May 11, 2024
14 checks passed
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

Successfully merging this pull request may close these issues.

shaclgen not generating nodeKind/datatype
2 participants