I have created an easy to follow step-by-step guide to setup virtuoso server and add DBpedia data to it.
1. Download open-link virtuoso using following link:
https://sourceforge.net/projects/virtuoso/
2. Place it in home directory or any other directory of your preference.
cd ~
tar -xvzf virtuoso-7.2.4.2.tar.gz
cd virtuoso-opensource-7.2.4.2
3. Update dependencies:
sudo aptitude install dpkg-dev build-essential
sudo apt-get install autoconf automake libtool flex bison gperf gawk m4 make odbcinst libxml2-dev libssl-dev libreadline-dev
4. Configure:
./configure --prefix=/usr/local/ --with-readline --program-transform-name="s/isql/isql-v/"
5. Build and Install:
nice make
sudo make install
Now, we are done with the installation of virtuoso in the system. Next, we need to start the server and upload ttl files from DBpedia.
6. Start Server:
cd /usr/local/var/lib/virtuoso/db
sudo virtuoso-t -fd
The above cmd runs the server in foreground with debugging information. For the first time, Virtuoso creates a files (virtuoso.db, virtuoso.trx,..), and installs the Conductor VAD package, e.g., /usr/local/share/virtuoso/vad/ directory) into the database.
Virtuoso will stop on closing the terminal. Use the following command to keep it running in the background:
sudo virtuoso-t -f
7. Download *ttl files from DBpedia:
Download the required ttl files from http://wiki.dbpedia.org/downloads-2016-10.
I used the following subset to create a minimalist version:
persondata_en.ttl
infobox_properties_en.ttl
genders_en.ttl
specific_mappingbased_properties_en.ttl
geo_coordinates_en.ttl
mappingbased_literals_en.ttl
mappingbased_objects_en.ttl
instance_types_transitive_en.ttl
Also, download the ontology file: dbpedia_2016-10.owl
We need to add the ttl files to virtuoso with following steps:
8. Update virtuoso.ini file:
Add the directory path with DBpedia files on virtuoso.ini file. Add DBpedia path to DirsAllowd in the file, e.g. DirsAllowd = usr/local/var/lib/virtuoso/db/virtuoso.ini
9. Start iSQL console:
isql 1111 dba dba or isql-v 1111 dba dba
-Load directory where data is present:
SQL> ld_dir('/path_to_/dbpedia_data/', '*.ttl', 'http://dbpedia.org');
first paramater- path to dbpedia data
second parameter - refers to all .ttl files.
third parameter- the URI of the graph. You can change it to 'http://wikidata.org' for wikidata data, 'http://yago-knowledge.org' for Yago data.
- Run the loader:
rdf_loader_run();
This command will take a while.
After completion, you can use following steps to verify successful installation.
10. Check Graph loaded so far on virtuoso:
-Check for available graphs:
Go to http://localhost:8890/conductor
Then, linked data->graphs.
Use credentials dba dba
-Check Files Loaded in isql
SQL> select * from DB.DBA.LOAD_LIST;
-Testing your local mirror
Go to the sparql-endpoint of your server http://your-server:8890/sparql (or in isql prefix with: SPARQL)
sparql SELECT count(*) WHERE { ?s ?p ?o } ;
-Check all the graphs and number of triples in them:
sparql SELECT ?g COUNT(*) { GRAPH ?g {?s ?p ?o.} } GROUP BY ?g ORDER BY DESC 2;
=========================================================================
References:
https://joernhees.de/blog/2014/04/23/setting-up-a-local-dbpedia-3-9-mirror-with-virtuoso-7/
http://vos.openlinksw.com/owiki/wiki/VOS/VOSUbuntuNotes#Using%20Virtuoso
1. Download open-link virtuoso using following link:
https://sourceforge.net/projects/virtuoso/
2. Place it in home directory or any other directory of your preference.
cd ~
tar -xvzf virtuoso-7.2.4.2.tar.gz
cd virtuoso-opensource-7.2.4.2
3. Update dependencies:
sudo aptitude install dpkg-dev build-essential
sudo apt-get install autoconf automake libtool flex bison gperf gawk m4 make odbcinst libxml2-dev libssl-dev libreadline-dev
4. Configure:
./configure --prefix=/usr/local/ --with-readline --program-transform-name="s/isql/isql-v/"
5. Build and Install:
nice make
sudo make install
Now, we are done with the installation of virtuoso in the system. Next, we need to start the server and upload ttl files from DBpedia.
6. Start Server:
cd /usr/local/var/lib/virtuoso/db
sudo virtuoso-t -fd
The above cmd runs the server in foreground with debugging information. For the first time, Virtuoso creates a files (virtuoso.db, virtuoso.trx,..), and installs the Conductor VAD package, e.g., /usr/local/share/virtuoso/vad/ directory) into the database.
Virtuoso will stop on closing the terminal. Use the following command to keep it running in the background:
sudo virtuoso-t -f
7. Download *ttl files from DBpedia:
Download the required ttl files from http://wiki.dbpedia.org/downloads-2016-10.
I used the following subset to create a minimalist version:
persondata_en.ttl
infobox_properties_en.ttl
genders_en.ttl
specific_mappingbased_properties_en.ttl
geo_coordinates_en.ttl
mappingbased_literals_en.ttl
mappingbased_objects_en.ttl
instance_types_transitive_en.ttl
Also, download the ontology file: dbpedia_2016-10.owl
We need to add the ttl files to virtuoso with following steps:
8. Update virtuoso.ini file:
Add the directory path with DBpedia files on virtuoso.ini file. Add DBpedia path to DirsAllowd in the file, e.g. DirsAllowd = usr/local/var/lib/virtuoso/db/virtuoso.ini
9. Start iSQL console:
isql 1111 dba dba or isql-v 1111 dba dba
-Load directory where data is present:
SQL> ld_dir('/path_to_/dbpedia_data/', '*.ttl', 'http://dbpedia.org');
first paramater- path to dbpedia data
second parameter - refers to all .ttl files.
third parameter- the URI of the graph. You can change it to 'http://wikidata.org' for wikidata data, 'http://yago-knowledge.org' for Yago data.
- Run the loader:
rdf_loader_run();
This command will take a while.
After completion, you can use following steps to verify successful installation.
10. Check Graph loaded so far on virtuoso:
-Check for available graphs:
Go to http://localhost:8890/conductor
Then, linked data->graphs.
Use credentials dba dba
-Check Files Loaded in isql
SQL> select * from DB.DBA.LOAD_LIST;
-Testing your local mirror
Go to the sparql-endpoint of your server http://your-server:8890/sparql (or in isql prefix with: SPARQL)
sparql SELECT count(*) WHERE { ?s ?p ?o } ;
-Check all the graphs and number of triples in them:
sparql SELECT ?g COUNT(*) { GRAPH ?g {?s ?p ?o.} } GROUP BY ?g ORDER BY DESC 2;
=========================================================================
References:
https://joernhees.de/blog/2014/04/23/setting-up-a-local-dbpedia-3-9-mirror-with-virtuoso-7/
http://vos.openlinksw.com/owiki/wiki/VOS/VOSUbuntuNotes#Using%20Virtuoso
No comments:
Post a Comment