Based on your distribution, see Docker installation instructions.
- Virtuoso Docker image - if needed (or curious), check the instructions there for more details.
Create a docker-compose.yml
file containing the following:
db:
image: tenforce/virtuoso:1.3.1-virtuoso7.2.2
environment:
SPARQL_UPDATE: "true"
DEFAULT_GRAPH: "http://www.example.com/my-graph"
DBA_PASSWORD: "admin"
volumes:
- ./data/virtuoso:/data
ports:
- "8890:8890"
Then start docker:
sudo service docker start
And run docker-compose:
sudo docker-compose up
Create a run.sh
file containing the following:
docker run --name my-virtuoso \
-p 8890:8890 -p 1111:1111 \
-e DBA_PASSWORD=admin \
-e SPARQL_UPDATE=true \
-e DEFAULT_GRAPH=http://www.example.com/my-graph \
-v ./data:/data \
-d tenforce/virtuoso
Once the server is up and running, in your browser go to: http://localhost:8890/conductor
And login with dba
and password admin
.
Running the following script will generate the trusty nanopubs for the nanopubs in the repository, then load them in the Virtuoso triple store Docker image indicated above: sudo ./reload.sh
. Run this script in a different terminal window while the virtuoso server is up and running.
If you want to do all the steps manually yourself instead of running the script above to load the data in the triple store:
./np
./np help
./np op help
./np check nanopubs_V1.trig
./np mktrusty -r nanopubs_V1.trig
./np check trusty.nanopubs_V1.trig
- Place files to load into the triplestore (
trusty.\*.nq
files) into a folder like/<path>/virtuoso/dumps
- Modifiy the
virtuoso.ini
file in/<path>/virtuoso
such that the folder where you placed your dump files are in theDirsAllowed
:- example:
DirsAllowed = ., /usr/local/virtuoso-opensource/share/virtuoso/vad, ./dumps
- example:
- Restart your server
- Find out the name of your docker instance in the
NAMES
field:sudo docker ps
- Loading data manually in Virtuoso, assuming the name of your Docker instance is
virtuoso_db_1
(replace with the corresponding output of the previous command):
sudo docker exec -it virtuoso_db_1 bash
isql-v -U dba -P $DBA_PASSWORD
SQL> ld_dir ('./dumps', '*.nq', 'http://example.com');
SQL> rdf_loader_run();
select * from DB.DBA.load_list;
In case you want to delete the triples in the store:
SQL> log_enable(3,1);
SQL> DELETE FROM rdf_quad WHERE g = iri_to_id ('http://example.com');
After starting the server and logging in the browser interface (see Step 3 above), you can run the following SPARQL queries on the newly loaded triples: statistics dataset, competency questions, various queries.