4

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?

Randall
  • 2,859
  • 1
  • 21
  • 24

1 Answers1

6

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.

Randall
  • 2,859
  • 1
  • 21
  • 24
  • I notice you're apparently running the very old Virtuoso 6.1. [Virtuoso 7.2.4](https://virtuoso.openlinksw.com/dataspace/doc/dav/wiki/Main/VOSNews) is recommended for all users. [This answer](http://serverfault.com/a/678864/245036) may help you get there. – TallTed Dec 22 '16 at 14:56