-
Notifications
You must be signed in to change notification settings - Fork 561
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 cbd_subject() method #2366
Conversation
This method determines whether the graph is a Concise Bounded Description and, if it is, for what subject
Thanks for the PR @Natureshadow, as this is an enhancement I will want some feedback from other maintainers also, and I will still think about it a bit and maybe extend the docstrings a bit just to make sure I understand the intent. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting use case, can see your requirement and its potential generality. Also nice to see RDFLib being used to contribute to the development of the fediverse and impressed that Melvin is both taking an interest and endorsing your stance.
PRs to V6 is closed until further notice. See this for more details: |
We will be open for PRs again once this is resolved: |
I will leave this open but as of right now my main priority is improving quality. |
I've reviewed this, and I'm not particularly sure of its utility. I don't think "roots" of a graph is a real linked-data or RDF concept. It looks like it returns all nodes that are in the subject position in any triple in the graph, but never in the object position of any triple in the graph. That really only works where properties are top-down, eg a DCAT Catalog, where all children defined on the catalog with The assertion that a CBD graph will contain exactly 1 root is also incorrect. Finally, the use of |
Summary of changes
This PR adds a new
Graph.cbd_subject()
method. It is the counter-part toGraph.cbd()
: It checks whether the graph is a CBD for some resource and, if it is, returns the subject of that resource.I need this for implementing federation between graphs, where incoming pushes shall be ckecked to be CBDs because CBDs are nice to test against ACLs (cf. https://socialhub.activitypub.rocks/t/formalizing-inbox-posts-to-be-cbds/3123)
It also adds a
Graph.roots()
method returning the roots of the graph, used as a utility incbd_subject
, but also useful otherwise.Checklist
the same change.
./examples
for new features.CHANGELOG.md
).so maintainers can fix minor issues and keep your PR up to date.