TomR
TomR

Reputation: 3036

Can SWI Prolog program get its facts from the external database?

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

Answers (1)

mat
mat

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

Related Questions