-
Notifications
You must be signed in to change notification settings - Fork 2
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
Is there a way to get a specific index of the pointer? #7
Comments
If the method is added, it should be The ptrs are in order of the given predicates, but if there are multiple triples with the same predicate, the order depends on how It would be possible to access a specific index with |
Yes my use case is about one predicate with multiple values. at() sounds great and I see a bit more now about the complexity. Thanks! |
What do you mean with "A missing triple also ruins the index."? |
If you have the following triples: <>
propertyA "a";
propertyC "c". Now you traverse them with Grapoi like this: const result = ptr.out([ns.ex.predicateA, ns.ex.predicateB, ns.ex.predicateC]) You may expect that -> You don't have the guarantee that the predicate index matches the result index. |
Ah, I see. |
An alternative could be: const firstPointer = pointer.out(predicate).at(1)
// firstPointer is a grapoi pointer with only the first ptr. const firstPointer = pointer.out([predicate]).at(1)
// Throws exception, .at() can only be used on one predicate. |
@bergos what do you think of this last idea? |
I have the following code:
A possible syntax might be:
What do you think? Is something like this already in the library or would you be open to a PR for this?
The text was updated successfully, but these errors were encountered: