Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

ErgoAI Java RestAPI - concept

34 views
Skip to first unread message

Joey Couk

unread,
Jul 25, 2023, 3:15:05 PM7/25/23
to ErgoAI and XSB Users Forum
Hello!  

I'm in the early stages of trying to build a containerized java application to host my ErgoAI projects in the cloud and make it accessible via a REST API.  We are trying to find the best way to save and load session data.  We have experimented with the persistence module, but we would prefer that our Java application be in control of maintaining that session data.  Is it possible to manually dump and load session data from a module outside of a direct connection to a database? 

We have encountered the errors below from an ErgoAI terminal when attempting to use the persistentmodules on Windows 11 Pro 64 bit

Thank you!

Errors:

Loading the persistentmodules:
`
ergo> load{persistentmodules>>pm}.
++Error[Ergo]>  [LOADER] Module name is too long
`

MySQL connection error:
`
ergo> mysql[open(id2,'172.17.0.2:3306',myDB,myUser,'password')]@\sql.

        1 file(s) copied.
        1 file(s) copied.

++Warning[XSB]: [Runtime/C] Cannot load library mysql_driver.dll or C:\Users\joeyc\Coherent\ERGOAI-3.0\XSB\packages\dbdrivers\mysql\cc\mysql_driver.dll; error #126

++Error[Ergo]> Error in loading file C:/Users/joeyc/Coherent/ERGOAI-3.0/XSB/packages/dbdrivers/mysql/cc/mysql_driver.xwam.SAGA-7264
`

Marc Hadfield

unread,
Jul 25, 2023, 3:33:26 PM7/25/23
to ErgoAI and XSB Users Forum

Hello - 

I'm not familiar with the latest ErgoAI release, but for the prior Flora-2 releases I have an integration between Java and Flora-2.  I ran into performance issues trying to handoff data (in both directions) using the interprolog library, so somewhat counter-intuitively the fastest method I found was to write data to disk and then read it in on the other side and use interprolog just to trigger this process and hand-off a filename.  This was for a few thousand data elements or more.  I used data in CSV and flr files for the handoffs although any parseable file format would do.  At the time I thought this was a bit of a hack so if there is a better way I'd be happy to hear it.

-- Marc





--
You received this message because you are subscribed to the Google Groups "ErgoAI and XSB Users Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ErgoAI-XSB-for...@coherentknowledge.com.
To view this discussion on the web visit https://groups.google.com/a/coherentknowledge.com/d/msgid/ErgoAI-XSB-forum/6d0cc991-c316-4cba-98f6-f52e8363615an%40coherentknowledge.com.

Michael Kifer

unread,
Jul 25, 2023, 4:15:17 PM7/25/23
to ErgoAI-X...@coherentknowledge.com

yes, passing the data through files in csv, json, etc., formats is the fastest.

Interprolog is not efficient for that.


Or are you trying to save the assertions and retractions and pass them to a new session?

In that case, you might try to use persistent modules when they are fixed (see below).


There is also the save{...} primitive but it has not been used much by the users, so I am not sure it has been maintained well.


As to the

[LOADER] Module name is too long

error, it is a breakage in XSB, introduced relatively recently.  I am checking with the xsb people .

--

       --- michael


 

Joey Couk

unread,
Jul 25, 2023, 4:36:20 PM7/25/23
to ErgoAI and XSB Users Forum, Michael Kifer
The save{...} primitive looks promising!  I'll do some testing with that.   As always, it's rtfm!

Once we get the persistence module working we do have concerns maintaining odbc connections in a containerized environment.

Thanks so much!

Reply all
Reply to author
Forward
0 new messages