2 ms·
When I saw the title I hopes this would be schema aware. Looking into the current proof of concept they allow to write prolog definitions. How cool would be be
by madsbuch 3y ago
When I saw the title I hopes this would be schema aware. Looking into the current proof of concept they allow to write prolog definitions.
How cool would be be, if all relations in a Postgres database would be lifted into the scope of a prolog process to work directly on the relations.
- kevindamm 3y agoIf your entire database can be lifted into the application's heap, it's probably small enough that I wonder why you've got it stored in an RDBMS... and because Prolog is lexically sensitive (order of sentences and the order of clauses in the sentence affect the eval result) then you would need to effectively load all related DB entries -- or maybe some cursor tricks to load domain entries lazily and the many small queries that entails. What I've usually seen instead is starting from Datalog (declarative, order-independent) instead of Prolog, and converting that into the relevant SQL queries then loading the results into variables within the datalog context. This splits the knowledge base into IDB and EDB parts.
- naasking 3y ago> If your entire database can be lifted into the application's heap, it's probably small enough that I wonder why you've got it stored in an RDBMS I think he meant lifting the database schema, not the whole database. This would help with auto completion and other static checks before trying to run queries.
- Izkata 3y agoMuch much more important would be the foreign keys. If I remember my prolog correctly, this: parent(alice,bob). is duplicating information that could already be found in the schema's relationships.
- madsbuch 3y agoSomething like this! So that you can naturally query your data defining relationships and constraints (This can already be done using joins, but that is not very ergonomical, especially when a lot of relations are at play)