https://en.wikipedia.org/wiki/Subject%E2%80%93object%E2%80%93verb_word_order

quite interesting, in fact by number there is more human languages that use this syntax format than any other. subject being the first on the stack, object being the second, and verb being the last, that then places the result on the stack for the next object and verb.

it's the most efficient encoding and doesn't require parenthesisation of anything.

anyway, i can't think of how it's useful for me writing a query system. the query is just a matching filter.

Reply to this note

Please Login to reply.

Discussion

Yes, for simple filters it doesn't get you much. It is when you want to choose how to AND OR NOT several filters that it comes in handy. Usually you just assume everything is an AND, but it doesn't take long before someone wants something more complex. "I want all the posts from these authors from after this timestamp that don't contain these words but I do want them if they mention my favorite hashtag... Etc.

yeah, i made a filter that does all of that negation. it allows fetch by id, OR fetch by any set of pubkey/tag, THEN a since/until time window filter, AND NOT ids/pubkey/tags and then sort ascending/descending by timestamp

well, to be fair, i wrote the basic part and then i made the AI write the rest for me, with tests.

one has to put some kind of cap on the depth of logic for a relay event filter search i think. everything beyond what i just listed kinda gets into application logic i think. this is part of what i consider to be a domain error of many database query systems also, pushing so much app logic into the query engine. data formats also play a part in this, the generic event format is very nice with the metadata/author/content that can basically put anything inside it... you can even grandfather in metadata using label events, as well, though that kinda has to be kept from getting too deep.