datalog

mauricio.szabo 2021-04-15T19:38:59.076400Z

A simple-ish question: I'm quite in love with Pathom, but it only supports queries in EQL. Is there an easy-ish way to translate EQL into Datalog (or even into a subset of datalog)?

mauricio.szabo 2021-04-15T19:41:03.076900Z

(I think I already asked this question on another channel, right? I my memory didn't fail me πŸ˜„)

lilactown 2021-04-15T19:55:26.077800Z

are you trying to write to do EQL->datalog so that you can run the query on a database that doesn't support EQL, or are you trying to use datalog with pathom specifically?

mauricio.szabo 2021-04-15T20:16:06.078100Z

Datalog with Pathom would be good πŸ™‚

mauricio.szabo 2021-04-15T20:17:38.079200Z

To be honest, I saw this post: https://petevilter.me/post/datalog-typechecking/ The idea (on the post) was to expose some functionalities of the IDE as datalog queries

mauricio.szabo 2021-04-15T20:18:42.080500Z

I really liked the idea of "I can configure and compose whatever I want just by writing datalog queries and maybe calling some APIs with the results" so I went by and experimented with EQL (because of Pathom) in my plug-ins Chlorine and Clover. So far, it's been a great success

mauricio.szabo 2021-04-15T20:20:10.081800Z

But I think that EQL is harder to read, and there's also the issue that it returns data in a specific format only, so you have to re-filter it and mix-and-match with client-side code...

lilactown 2021-04-15T20:26:26.082200Z

OK, based on that, it sounds like what you are looking for is a way to use datalog with pathom? not convert EQL to datalog

lilactown 2021-04-15T20:26:39.082500Z

you would like to author queries in datalog and use them with pathom

lilactown 2021-04-15T20:27:49.083Z

I don't know of any way of writing datalog queries that leverage pathom. might be a good question for #pathom

Joe Lane 2021-04-15T20:28:32.084100Z

Wouldn't you expose pathom resolvers that have datalog underneath them?

Joe Lane 2021-04-15T20:28:50.084500Z

Or take queries as args?

lilactown 2021-04-15T20:28:50.084600Z

I know that @wilkerlucio has been working on pathom3 which provides the ability to use "smart maps" instead of EQL. it might be interesting to explore datalog as a 3rd alternative interface to pathom

🎸 1
lilactown 2021-04-15T20:29:31.085400Z

@lanejo01 I don't think that @mauricio.szabo is trying to figure out how to use a database inside of a pathom resolver; I think he wants to author queries in datalog and execute them against a pathom graph

lilactown 2021-04-15T20:29:37.085600Z

unless I am misunderstanding!

mauricio.szabo 2021-04-15T20:29:52.086Z

> to author queries in datalog and execute them against a pathom graph Yes, exactly πŸ™‚

wilkerlucio 2021-04-15T20:33:20.090200Z

about Pathom and Datalog, if you get a datalog engine that can work with standard maps (and I believe most of them can), you could give it smart maps and ask for stuff, so pathom would do the data traversing, while datalog does the matching engine

wilkerlucio 2021-04-15T20:33:50.090900Z

that said, its also part of the pathom design to keep reshaping data (specially on Pathom 3 that supports nested inputs, so a resolver can do a full query and just reshape it in some other way)

lilactown 2021-04-15T20:36:10.091400Z

> reshaping data what do you mean by this?

wilkerlucio 2021-04-15T20:46:09.091800Z

what I’m thinking is a more generic version of it, you can always compress or expand some data via a resolver, this allows to β€œpick” parts of a complex nested structure and re-shape into another structure (flat or nested in some other format)

wilkerlucio 2021-04-15T20:46:17.092Z

makes sense?

lilactown 2021-04-15T21:01:08.092200Z

yeah I think so