Skip to content

3 Running the webservice

Diego Moussallem edited this page Apr 26, 2017 · 23 revisions

Run your own webservice

  1. Download AGDISTIS
git clone https://github.com/AKSW/AGDISTIS.git
  1. The important data for running AGDISTIS on DBpedia is stored in a Lucene 4.4 Index. You should download one of the following indices into you AGDISTIS clone:
cd AGDISTIS
wget http://titan.informatik.uni-leipzig.de/rusbeck/agdistis/en/indexdbpedia_en_2014.7z
wget http://titan.informatik.uni-leipzig.de/rusbeck/agdistis/de/indexdbpedia_de_2014.7z
wget http://titan.informatik.uni-leipzig.de/rusbeck/agdistis/zh/indexdbpedia_zh_2014.7z

Newest indexes from DBpedia dump 2016-04. Note, Chinese index could not be created because there are missing files from DBpedia dump.

cd AGDISTIS
wget http://hobbitdata.informatik.uni-leipzig.de/agdistis/dbpedia_index_2016-04/en/indexdbpedia_en_2016.zip
wget http://hobbitdata.informatik.uni-leipzig.de/agdistis/dbpedia_index_2016-04/en/index_bycontext.zip

wget http://hobbitdata.informatik.uni-leipzig.de/agdistis/dbpedia_index_2016-04/de/indexdbpedia_de_2016.zip
wget http://hobbitdata.informatik.uni-leipzig.de/agdistis/dbpedia_index_2016-04/de/index_bycontext.zip

wget http://hobbitdata.informatik.uni-leipzig.de/agdistis/dbpedia_index_2016-04/fr/indexdbpedia_fr_2016.zip
wget http://hobbitdata.informatik.uni-leipzig.de/agdistis/dbpedia_index_2016-04/es/indexdbpedia_es_2016.zip
wget http://hobbitdata.informatik.uni-leipzig.de/agdistis/dbpedia_index_2016-04/it/indexdbpedia_it_2016.zip
wget http://hobbitdata.informatik.uni-leipzig.de/agdistis/dbpedia_index_2016-04/ja/indexdbpedia_ja_2016.zip
wget http://hobbitdata.informatik.uni-leipzig.de/agdistis/dbpedia_index_2016-04/nl/indexdbpedia_nl_2016.zip
  1. Edit the src/main/resources/config/agdistis.properties file according to your settings.

  2. For running AGDISTIS on your machine go to the root directory of AGDISTIS and execute

mvn tomcat:run 

Now a webservice is running on localhost:8080

Running with Docker

  1. Pull image from docker hub using docker pull aksw/agdistis (https://hub.docker.com/r/aksw/agdistis/)
  2. Download (see above) or build an index and rename it if needed to index
  3. Run AGDISTIS while attaching an index as volume using docker run -d -p 8080:8080 -v `pwd`/index:/usr/local/tomcat/index aksw/agdistis

Create your own docker image

  1. Clone this repo
  2. Build application war by running mvn package -Dmaven.test.skip=true
  3. Build docker image by running docker build -t aksw/agdistis .

Running from source in Java

The easiest way of running AGDISTIS from source is to have a look at the Java Class AGDISTISTest.java.

Create your own index

To create your own index you have to git clone AGDISTIS and additionally files for your ontology comprising rdf:type, rdfs:label and meaning full object properties.

For example, download all files for a DBpedia 2014 index with this script

wget http://data.dws.informatik.uni-mannheim.de/dbpedia/2014/en/instance_types_en.ttl.bz2
wget http://data.dws.informatik.uni-mannheim.de/dbpedia/2014/en/mappingbased_properties_en.ttl.bz2
wget http://data.dws.informatik.uni-mannheim.de/dbpedia/2014/en/specific_mappingbased_properties_en.ttl.bz2
wget http://data.dws.informatik.uni-mannheim.de/dbpedia/2014/en/disambiguations_en.ttl.bz2
wget http://data.dws.informatik.uni-mannheim.de/dbpedia/2014/en/labels_en.ttl.bz2
wget http://data.dws.informatik.uni-mannheim.de/dbpedia/2014/en/redirects_transitive_en.ttl.bz2

or for German DBpedia:

wget http://data.dws.informatik.uni-mannheim.de/dbpedia/2014/de/instance_types_de.ttl.bz2
wget http://data.dws.informatik.uni-mannheim.de/dbpedia/2014/de/mappingbased_properties_de.ttl.bz2
wget http://data.dws.informatik.uni-mannheim.de/dbpedia/2014/de/specific_mappingbased_properties_de.ttl.bz2
wget http://data.dws.informatik.uni-mannheim.de/dbpedia/2014/de/disambiguations_de.ttl.bz2
wget http://data.dws.informatik.uni-mannheim.de/dbpedia/2014/de/labels_de.ttl.bz2
wget http://data.dws.informatik.uni-mannheim.de/dbpedia/2014/de/redirects_transitive_de.ttl.bz2

The Chinese DBpedia version 2014 is incomplete as of 09/16/2014. Therefore, we provide the needed files on our server and some on the central DBpedia server. (disambiguations_zh.ttl is missing at all):

wget http://titan.informatik.uni-leipzig.de/rusbeck/agdistis/zh/zh_resources_files_for_index_v2014.zip.zip

Create your own context index

All files from a given Knowledge Base should be downloaded and the user has to create a folder called context inside the same folder from the other main index(explained above). But, the user also needs to separate the file which contains labels from the others. Then, the user creates a subfolder called "update" containing the other files. For example:

folderWithTTLFiles=</Path/to/folder/context>

Uses cases: DBPedia has natural language URIs then we are able to extract label from them. But, Wikidata and other such as BabelNet just contain codes. Thus, we need to set an endpoint and perform a SPARQL query for gathering their rdfs:label. The endpoint is set in agdistis.properties file e.g endpoint=https://query.wikidata.org/sparql

Afterwards you need to configure the config/agdistis.en.properties file according to your prefered knowledge base. Especially, configure those two lines:

folderWithTTLFiles=</Path/to/folder>
surfaceFormTSV=</Path/to/folder/surfaceforms/tsv/OPTIONAL>

and then run:

mvn exec:java -Dexec.mainClass="org.aksw.agdistis.util.TripleIndexCreator"

Surface forms are available from here: http://139.18.2.164/rusbeck/agdistis/surfaceforms/

These files were created by D. Gerber (http://aksw.org/Projects/BOA.html)

If you have any issues, please let us know!

Clone this wiki locally