ISQL command execution on Virtuoso Docker

Hi everybody,

I have installed an Openlink Virtuoso 07.20.3229 on a Docker. I am trying to execute an ISQL command without having to enter the actual ISQL interface. My objective is to develop a script that can be used to execute some ISQL commands related to the upload of RDF files and deletion of RDF Graphs.

I am trying to execute the following commands:

sudo docker exec -i -t virtuoso isql-v -U dba -P dba ld_dir('/usr/local/virtuoso-opensource/share/virtuoso/vad/', 'myfile.rdf', 'http:/myGraph');

Error: -bash: syntax error near unexpected token (’`

sudo docker exec -i -t virtuoso isql-v -U dba -P dba "ld_dir('/usr/local/virtuoso-opensource/share/virtuoso/vad/', 'myfile.rdf', 'http:/myGraph')";

Error: *** Error S2801: [Virtuoso Driver]CL033: Connect failed to ld_dir('/usr/local/virtuoso-opensource/share/virtuoso/vad/', 'myfile.rdf', 'http://myGraph') = 'http://myGraph').
at line 0 of Top-Level:

I have tried many different variants of these commands, but I couldn’t manage to execute them.

Does anyone know what is going on?

Thanks in advance,

@iesnaola: I presume this is a docker image built by yourself from a Virtuoso open source build, rather than using one of the official OpenLink Virtuoso Docker Images ?

Looking at your command it is missing the Virtuoso “isql” tool’s exec option to execute the Virtuoso commands/queries against it, see the isql documentation for usage information.

Thus using our Virtuoso open source docker, I can successfully execute the following:

De-iMac-2692:vos hwilliams$ docker exec -it vos /opt/virtuoso-opensource/bin/isql -U dba -P mysecret exec="ld_dir('/opt/virtuoso-opensource/vad/', 'myfile.rdf', 'http:/myGraph');"
OpenLink Virtuoso Interactive SQL (Virtuoso)
Version 07.20.3230 as of Sep 13 2019
Type HELP; for help and EXIT; to exit.
Connected to OpenLink Virtuoso
Driver: 07.20.3230 OpenLink Virtuoso ODBC Driver

Done. -- 0 msec.
De-iMac-2692:vos hwilliams$ 
1 Like

@hwilliams thank you for your response. The commands you suggested worked! :slight_smile: