News for hackers. Stuff that matters.
Re:Turning the IDE Inside Out with Datalog by disposedtrolley on Sunday July 19, 2020 @06:56AM (#23888491)
Are there any examples of "programs as databases" being applied to structured text like JSON or YAML? Something like a generic system which takes a set of rules/facts and the source data, and transforms these into a queryable data structure.

I'm working with a lot of OpenAPI [1] specifications currently, some of which span tens of thousands of lines. Heaps of parent, child, sibling type relationships, and objects which are defined-once and referenced in many places. It would be nice if I could perform a search like "select all schemas used in this path" or "select the count of references to this parameter".

[1] https://github.com/OAI/OpenAPI-Specification/blob/master/ver...

Re:Turning the IDE Inside Out with Datalog by sjg007 on Sunday July 19, 2020 @11:48AM (#23890121)
I mean, put them into leucene, elastic search or maybe mongodb?
Re:Turning the IDE Inside Out with Datalog by disposedtrolley on Sunday July 19, 2020 @06:30PM (#23892990)
Well yes, but that doesn't solve the parsing problem right?

My point is that some YAML or JSON documents conform to a specification which can be codified as a set of rules, which combined with the data form facts. I'm asking if there are existing systems to parse these files given I write these rules in a particular syntax, spitting out a queryable representation of the data.