Deployed anzograph on Docker running on Mac.
Trying to load data using using the sample movie actors file using the following insert command within the query console,
INSERT { GRAPH <actors> {
?MovieIRI a <Movie> ;
<MovieTitle> ?MovieTitle .
?ActorIRI a <Actor> ;
<ActorName> ?ActorName .
?ActorIRI <ActedIn> ?MovieIRI .
}
}
WHERE { TABLE <file:/home/usera/movie-actors.csv>
('csv','leader',',',true,'MovieID:long,MovieTitle:char,ActorID:long,ActorName:char')
BIND(IRI(CONCAT("Movie",str(?MovieID))) as ?MovieIRI)
BIND(IRI(CONCAT("Actor",str(?ActorID))) as ?ActorIRI)
}
After executing, I receive error,
Error - /home/usera/movie-actors.csv; No such file or directory
What is odd is the file exists in the directory above.
The database is looking for the file inside the docker container where Anzograph is running and not on your local/host machine where your file is located.
You will need to actually move/copy the file to the docker container before executing the insert command.
In Docker, run the following command to access the AnzoGraph file system, the /opt/anzograph directory:
sudo docker exec -it anzograph_container_name /bin/bash
Where anzograph_container_name is the name of the AnzoGraph container whose file system you want to access. For example: sudo docker exec -it anzograph /bin/bash
Determine where on the file system you would like to place the load files and create a new directory if necessary. For example: mkdir /opt/anzograph/csv/
Type exit to exit the container.
Run the following Docker command to copy files from the host server to a location in the AnzoGraph container. sudo docker cp /path/filename anzograph_container_name:/path/dir
For example: sudo docker cp /home/usera/movie-actors.csv anzograph:/opt/anzograph/csv/
Or this command copies a directory to the container:
sudo docker cp -r /path/dirname anzograph_container_name:/path
For example: sudo docker cp -r /home/user/movie-actors.csv anzograph:/opt/anzograph/csv/
Modify the path in the WHERE clause in your INSERT query to reflect new location.