Virtuoso ISQL data import can't stat file

1.9k views Asked by At

In isql-vt (the Ubuntu name for Virtuoso's isql), I am trying to import a test .ttl file, but get the error "Can't stat file":

SQL> DB.DBA.TTLP(file_to_string_output('./scratch/ttl/granule.ttl'),'','http://origin.mytest.org/');

*** Error 42000: [Virtuoso Driver][Virtuoso Server]FA112: Can't stat file './scratch/ttl/granule.ttl', error (2) : No such file or directory

However, the file is definitely there; I can even cat it:

SQL> !cat ./scratch/ttl/granule.ttl;
@prefix datacite: <http://purl.org/spar/datacite/> .
@prefix prov: <http://www.w3.org/ns/prov#> .
<http://0.0.0.0:3000/granule/MOD09.A2016278.0110.006.2016279074214.hdf>
   datacite:identifier "MOD09.A2016278.0110.006.2016279074214.hdf";
   prov:wasGeneratedBy <http://0.0.0.0:3000/run/MODAPS_456056327>;
   a prov:entity .

SQL> 

Why is the DB.DBA.TTLP command saying it can't stat it?

1

There are 1 answers

1
Randall On BEST ANSWER

Trying to use the full path gave a much better error message:

SQL> DB.DBA.TTLP(file_to_string_output('/home/ubuntu/Origin/scratch/ttl/granule.ttl'),'','http://origin.nasa.gov/');

*** Error 42000: [Virtuoso Driver][Virtuoso Server]FA003: Access to 
'/home/ubuntu/Origin/scratch/ttl/granule.ttl' is denied due to access control in ini file

So, the solution was to add the path in /etc/virtuoso-opensource-6.1/virtuoso.ini, eg:

...
DirsAllowed  = ., /usr/share/virtuoso-opensource-6.1/vad, /home/ubuntu/Origin
...

and restart virtuoso for the change to take effect.