How to load data in Virtuoso?

Loading DBpedia in Virtuoso. A complete guide!

Photo by Charles Deluvio on Unsplash

I assume that you have already setup Virtuoso locally. Now, if you need to load turtle/owl data files to Virtuoso, then follow these steps where I have loaded DBpedia ontology TBOX and ABOX instance to Virtuoso:

In the same way, you need to load some ABOX instances (Note that as this involves a large file, some commands might take several minutes to execute). The commands are:

sudo wget http://downloads.dbpedia.org/2014/en/instance_types_en.nt.bz2 
sudo bzip2 -d instance_types_en.nt.bz2
sudo touch instance_types_en.nt.graph
sudo nano instance_types_en.nt.graph

Now, open the browser and go to http://localhost:8890 and login with the credentials ‘dba’ ‘dba’. To load the downloaded files, go to the tab Database / Interactive SQL and run the following commands (Note that some commands might take several minutes to execute):

ld_dir (‘/usr/local/virtuoso-opensource/share/virtuoso/vad’, ‘*.owl’, ‘http://localhost:8890/dbpedia') ; rdf_loader_run(); ld_dir (‘/usr/local/virtuoso-opensource/share/virtuoso/vad’, ‘*.nt’, ‘http://localhost:8890/dbpedia') ; rdf_loader_run();

Finally, you may go to the tab Linked Data / Graphs and check if there is a graph with the name http://localhost:8890/dbpedia. If so, go to the tab Linked Data/SPARQL and put http://localhost:8890/dbpedia as the graph name and try to load the following query:

SELECT COUNT (*) WHERE { ?a ?b ?c }

The Virtuoso SPARQL endpoint can also be accessed directly at http://localhost:8890/sparql.

Note: You need to replace owl with ttl in the above instructions to load turtle files.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store