Home > Archive > Prolog > December 2006 > odbc or other database-like interface TO Prolog
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
odbc or other database-like interface TO Prolog
|
|
| Weston 2006-11-27, 7:01 pm |
| 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
| |
|
| > 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?
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?
| |
|
| On 27 Nov 2006 12:28:30 -0800, "Weston"
<notsew- reversePreceedingAndRemoveThis@canncentr
al.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.
| |
|
| On 1 Dec 2006 14:22:05 -0800, "Neo" <neo55592@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.
| |
|
| > >While Prolog can store and query the data you want, it doesn't appear
>
> Why not?...
Thx for the correction.
|
|
|
|
|