Reputation: 3036
I am planning SWI Prolog program (semantic natural language parser) which has huge and dynamic set of facts (lexicon with some 30.000 entries). Is it possible to store those facts in external database. Due to other requirements I am considering Apache TinkerPop/JanusGraph/Cassandra as my database but I can be satisfied with SQL/JDBC/ODBC database backed as well.
Upvotes: 3
Views: 394
Reputation: 40768
Yes, this is of course possible, and even via several different approaches:
A straight-forward approach is to use sockets or pipes to communicate with an external database.
A different approach is to use the C-interface of SWI-Prolog and the API of the external database.
Yet another approach is to use CQL, a high-level constraint interface that blends in naturally with Prolog code.
Other than that, a database with 30 000 entries is nothing, so you can very likely simply use Prolog facts and stay completely within Prolog, without any external dependencies.
Upvotes: 5