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

Add a new argument to the SHACL generator to exclude imported elements #2508

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

vincentkelleher
Copy link
Contributor

@vincentkelleher vincentkelleher commented Jan 21, 2025

The new --exclude-imports argument is meant to allow end-users to allow generate SHACL triples that corresponding to the currently being processed schema hence ignoring the schemas in the imports: section.

This is relevant in the case where someone just wants to validate a certain class that inherits attributes/slots or in the case where one has a base SHACL file that can be merged with any number of custom SHACL files (built with --exclude-imports) to support new entities.

@vincentkelleher vincentkelleher force-pushed the exclude_imports_shacl_generator branch 4 times, most recently from 137ab37 to 4109813 Compare January 21, 2025 14:02
Copy link

codecov bot commented Jan 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.28%. Comparing base (2fdf8b3) to head (4109813).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2508   +/-   ##
=======================================
  Coverage   81.27%   81.28%           
=======================================
  Files         120      120           
  Lines       13398    13404    +6     
  Branches     3768     3771    +3     
=======================================
+ Hits        10889    10895    +6     
  Misses       1892     1892           
  Partials      617      617           

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

…s (--exclude-imports)

Signed-off-by: Vincent Kelleher <[email protected]>
@vincentkelleher vincentkelleher force-pushed the exclude_imports_shacl_generator branch from 4109813 to 77ed611 Compare January 29, 2025 14:26
@vincentkelleher
Copy link
Contributor Author

I think I found a solution to make this implementation even simpler by using self.all_classes(import=(..)) rather than filtering the classes myself 😇

@vincentkelleher
Copy link
Contributor Author

Strangely CodeSpell is failing on a file I didn't modify 🤔
Furthermore, the fail isn't justified as anc is a diminutive for ancestor.

image

@vincentkelleher vincentkelleher force-pushed the exclude_imports_shacl_generator branch from fc3c707 to 0b10f86 Compare January 29, 2025 15:10
Signed-off-by: Vincent Kelleher <[email protected]>
@vincentkelleher vincentkelleher force-pushed the exclude_imports_shacl_generator branch from 0b10f86 to 0573762 Compare January 29, 2025 15:15
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.

1 participant