Open stevekrouse opened 2 years ago
filter ?user follows ?person, ?post author ?person, ?post datetime ?datetime, ?post text ?text | index feed ?user ?datetime ?person ?text
scan feed >chet "2021-2021-10-18 12:04" <chet MAX
So you can do comparisons for deeper fields and it will component-wise sort.
>chet date <chet MAX
... huh?!The following tuples are in the correct order.
[]
[a]
[a, a]
[a, b]
[b]
[b, a]
[b, b]
If I scan this index with >a !1
then I'm not going to get [b]
, I'm going to get [a, a]
! So if I want to get the first tuple that doesn't start with a, then I need to say "greater than the last tuple that starts with a", that is [a, MAX]
. Sure, I could use z
instead of MAX
, but even that isn't entirely correct. I'd need to use \xff
but that's going to be encoding-dependent. Because what if I store numbers after strings... Then after [a, \xff]
is going to be [a, -12]
... Thus MAX basically indicates the largest possible value.
I think I finally get it. I should parse >chet "2021-2021-10-18 12:04" <chet MAX
as
>[chet, "2021-2021-10-18 12:04"] and <[chet, MAX]
, where you do the comparison on each element of the tuple in left-to-right order.
So it's saying get me all the elements in the index after [chet, "2021-2021-10-18 12:04"]
but before [chet, MAX]
.
Is that right? If so, the lack of grouping is confusing!
Exactly
On Thu, Oct 14, 2021 at 08:10 Steve Krouse @.***> wrote:
I think I finally get it. I should parse >chet "2021-2021-10-18 12:04" <chet MAX as
[chet, "2021-2021-10-18 12:04"] and <[chet, MAX], where you do the comparison on each element of the tuple in left-to-right order.
So it's saying get me all the elements in the index after [chet, "2021-2021-10-18 12:04"] but before [chet, MAX].
Is that right? If so, the lack of grouping is confusing!
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/ccorcos/triplestore-repl/issues/4#issuecomment-943452214, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANWDXZEAZL6EUE7CJ2IGHTUG3XFFANCNFSM5F4QTCIA .
filter ?person color ?color
. It wasn't immediately obvious to me that the first "color" is the attribute name and the second one is the variable name (and can be anything).