Giter VIP home page Giter VIP logo

dockerised-dbpedia-virtuoso-endpoint-setup-guide's Introduction

DBpedia Virtuoso Docker Setup Guide

Downloading DBpedia

Manual-downloading

To setup your endpoint with custom files

  • Download your favorite version of DBpedia dataset (from the [https://downloads.dbpedia.org/{release-year}/])
  • I downloaded the .bz2 files from /core/ & /core-i18n/en/ locations to setup my english version of DBpedia. You can choose yours!
  • unpack (i.e. unzip the ttl or nt files) the downloaded files. [skip the next script-downloading part]

Script-downloading

Get the download commands from the following repository:

git clone https://github.com/AKSW/DBpedia-docker

Edit the Makefile, specifying the urls or the dataset version you wish to download. Now to download the files and ontology, run

make download

Then to unzip the downloaded files, run:

make unpack

You can also write your custom scripts. Also note the above script has issues downloading the files from [https://downloads.dbpedia.org/{release-year}//core/] so you might want to look into this.

Running Virtuoso docker

If you do not have docker do:

docker pull tenforce/virtuoso

If you already have it, skip the above step. Then, run:

docker run --name dbpedia-virtuoso -p 8890:8890 -p 1111:1111 -v /path/to/virtuoso -v /path/to/data -d tenforce/virtuoso

Move the data to /dumps folder of the virtuoso

Move the unpacked .ttl files to the /db/dumps/ folder of the virtuoso docker repository that you created before.

mv /path/to/data/ /path/to/virtuoso/db/dumps

If there is an access related problem, use the above command with sudo

Loading DBpedia into Virtuoso

To load the data follow the following steps:

docker exec -it dbpedia-virtuoso bash

You will now be inside the docker virtuoso, then run

Isql-v -U dba -P dba

You will now be inside the ISQL terminal of the virtuoso docker.

You will first need to load the ontology file (can be also loaded later, I tried it myself. What is important that you load it) to the graph [http://dbpedia.org/resource/classes#]. This will allow you to browse/query through your local endpoint like the public one, i.e. [https://dbpedia.org/sparql]. Which means you can query all the dbpedia resources in the same way you query the public endpoint at:

[http://{your-cname}:{your-port}/resource/{resource-name}]

To do this, run:

ld_add('dumps/{ontology-filename}.owl', 'http://dbpedia.org/resource/classes#');

Now, we can start loading the data (RDF triples) from the ttl files. To do so, run:

ld_dir(‘dumps/’, ’*.*’, ’http://dbpedia.org/’);

In the above command, the first argument is the path of the dumps/ repository, second specifies the files to be loaded (. - everything in dumps, .ttl - for only ttl files in dumps, etc); and last argument is the named graph where you want all your data to be loaded. _Please make sure all your .ttl files are in the /dumps repository!!

Then run the rdf loader to start loading the triples in to the database, run:

rdf_loader_run();

Querying the virtuoso SPARQL endpoint

The SPARQL endpoint will be exposed at the ports declared during the docker run command. If you forgot to declare them back then, you are screwed. There is no way to do so now. Start over. Game over!

If you did declare them (as in our case, cf. docker run command), goto: http://localhost:8890/sparql

And you should be able to see the SPARQL interface.

Enjoy!

dockerised-dbpedia-virtuoso-endpoint-setup-guide's People

Contributors

harsh9t avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.