-
Notifications
You must be signed in to change notification settings - Fork 568
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
Allow multi subjects & objects in graph funcs #3086
Conversation
@nicholascar Is this a feature for v7.x or v8.0? Is this too much feature-overlap with |
Good pick on that overlap. I do want to slim down all the various graph functions so we have fewer but more capable ones than now. This is because it's too hard to remember many functions. Easier to remember fewer and then see their permissive signatures for all the options. So I'd like to boil down |
@@ -847,26 +847,32 @@ def set( | |||
def subjects( | |||
self, | |||
predicate: Union[None, Path, _PredicateType] = None, | |||
object: Optional[_ObjectType] = None, | |||
object: Optional[Union[_ObjectType, List[_ObjectType]]] = None, |
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.
@nicholascar : Was there a reason this used List[...]
instead of Sequence[...]
?
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.
The use case I have in mind: I often load set
s with URIRef
instead of list
s to de-duplicate.
@@ -847,26 +847,32 @@ def set( | |||
def subjects( | |||
self, | |||
predicate: Union[None, Path, _PredicateType] = None, |
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.
If object
gets a plurality expansion, why not predicate
too (and likewise with other functions)? Something to do with Path
?
This PR allows
graph.subjects()
&graph.objects()
to receive a list of objects & subjects respectively, rather than just single values