Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

odbc or other database-like interface TO Prolog

2 views
Skip to first unread message

Weston

unread,
Nov 27, 2006, 3:28:30 PM11/27/06
to
13 years after doing some academic stuff in Turbo Prolog, I'm looking
at a potential project and realizing some aspects of it might be
simplified by using Prolog as a database and query mechanism rather
than a traditional SQL. However, I'm really not interested in writing
the entire app in Prolog. What I'd rather do is pick a scripting
language, and then make queries to a Prolog-server with an interface
much like one frequently sees to the commonly used SQL databases. To
use a perl/php-esque example, something that would enable a sequence
like this if I were trying to find a car that were red in a db of
prolog facts:

$prolog_query = "car(X,'red')";

$rsrc = odbc_connect("DRIVER={Prolog ODBC Driver};
CommLinks=tcpip(Host=$db_host);
DatabaseName=$db_name;",$db_user,$db_pass);

$result = odbc_exec($rsrc,$prolog_query);

Is there anything out there like this?

Thanks,

Weston

Neo

unread,
Dec 1, 2006, 5:22:05 PM12/1/06
to


While Prolog can store and query the data you want, it doesn't appear
you can access these capabilities from outside Prolog. Others here can
probably give a more definitive answer. What scripting language are you
using? Why not manage your data in a regular database like MS Access.
It's true it won't accept "car(x, 'red')" but you could you get the
same results with SELECT queries, couldn't you? What kind of data is
involved in your project?

A.L.

unread,
Dec 1, 2006, 5:47:03 PM12/1/06
to
On 27 Nov 2006 12:28:30 -0800, "Weston"
<notsew-reversePrec...@canncentral.org> wrote:

>13 years after doing some academic stuff in Turbo Prolog, I'm looking
>at a potential project and realizing some aspects of it might be
>simplified by using Prolog as a database and query mechanism rather
>than a traditional SQL. However, I'm really not interested in writing
>the entire app in Prolog. What I'd rather do is pick a scripting
>language, and then make queries to a Prolog-server with an interface
>much like one frequently sees to the commonly used SQL databases. To
>use a perl/php-esque example, something that would enable a sequence
>like this if I were trying to find a car that were red in a db of
>prolog facts:
>
> $prolog_query = "car(X,'red')";
>
> $rsrc = odbc_connect("DRIVER={Prolog ODBC Driver};
>CommLinks=tcpip(Host=$db_host);
>DatabaseName=$db_name;",$db_user,$db_pass);

Check PrologBeans in SICStus Prolog

A.L.

A.L.

unread,
Dec 1, 2006, 5:47:33 PM12/1/06
to
On 1 Dec 2006 14:22:05 -0800, "Neo" <neo5...@hotmail.com> wrote:

>
>While Prolog can store and query the data you want, it doesn't appear
>you can access these capabilities from outside Prolog.

Why not?...

A.L.

Neo

unread,
Dec 1, 2006, 7:31:30 PM12/1/06
to
> >While Prolog can store and query the data you want, it doesn't appear
> >you can access these capabilities from outside Prolog.
>
> Why not?...

Thx for the correction.

0 new messages