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

Check RDF for abstract classes #179

Open
zvr opened this issue Jan 13, 2025 · 2 comments · May be fixed by #181
Open

Check RDF for abstract classes #179

zvr opened this issue Jan 13, 2025 · 2 comments · May be fixed by #181

Comments

@zvr
Copy link
Member

zvr commented Jan 13, 2025

@JPEWdev has contributed this code to generate RDF regarding abstract classes:

if c.metadata["Instantiability"] == "Abstract":
bnode = BNode()
g.add((node, SH.property, bnode))
g.add((bnode, SH.path, RDF.type))
notNode = BNode()
g.add((bnode, SH["not"], notNode))
hasValueNode = BNode()
g.add((notNode, SH["hasValue"], node))
msg = Literal(
f"{node} is an abstract class and should not be instantiated directly. Instantiate a subclass instead.",
lang="en",
)
g.add((bnode, SH.message, msg))

Can we re-check it, please?
I do not like that line 105 creates hasValueNode which is never used...

Don't submit a PR, let's simply discuss what needs to be changed and I'll integrate it to the large set of changes I have ready to merge...

@JPEWdev
Copy link
Contributor

JPEWdev commented Jan 13, 2025

I'm pretty sure line 105 is extraneous and can be removed

@zvr
Copy link
Member Author

zvr commented Jan 13, 2025

Thanks, Joshua.
So, the currently generated SHACL is correct, we were simply creating an extra blank node that was never used.

@zvr zvr linked a pull request Jan 17, 2025 that will close this issue
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 a pull request may close this issue.

2 participants