DBpedia Lookup Service - Find DBpedia URIs for keywords
This documentation page might be outdated. Please also check https://github.com/dbpedia/lookup
The DBpedia Lookup Service can be used to look up DBpedia URIs by related keywords. Related means that either the label of a resource matches, or an anchor text that was frequently used in Wikipedia to refer to a specific resource matches (for example the resource http://dbpedia.org/resource/United_Statescan be looked up by the string "USA"). The results are ranked by the number of inlinks pointing from other Wikipedia pages at a result page.
Two APIs are offered: KeywordSearch and PrefixSearch. The URL has the form
Example: Places that have the related keyword "berlin"
The PrefixSearch API can be used to implement autocomplete input boxes. For a given partial keyword like berl the API returns URIs of related DBpedia resources like http://dbpedia.org/resource/Berlin.
Example: Top five resources for which a keyword starts with "berl"
The three parameters are
- QueryString: a string for which a DBpedia URI should be found.
- QueryClass: a DBpedia class from the Ontology that the results should have (for owl#Thing and untyped resource, leave this parameter empty).
- CAUTION: specifying any values that do not represent a DBpedia class will lead to no results (contrary to the previous behavior of the service).
- MaxHits: the maximum number of returned results (default: 5)
DBpedia Lookup currently contains data from DBpedia 3.8. Resources of redirect
You can install the DBpedia Lookup and run it in your server. Instructions are available here.
This documentation page might be outdated. Please also check the README at https://github.com/dbpedia/lookup
git clone git://github.com/dbpedia/lookup.git cd lookup mvn clean install
You can download the necessary index from here:
wget http://spotlight.dbpedia.org/download/lookup_index.tgz tar zxvf lookup_index.tgz
Then you can just run the server:
If the default port 1111 is already busy, then you have to modify a file
"However, with the standard configuration the jersey server tries to listen on port 1111. Unfortunately, on my machine I already have Virtuoso installed, and isql listens on the same port. In order to solve this conflict, I had to manually edit the source file: ./src/main/scala/org/dbpedia/lookup/server/Server.scala at the following line: val serverURI = new URI("http://localhost:1111/";) where I changed 1111 with 1112."
To run the indexer:
mvn scala:run -Dlauncher=Indexer
To create the necessary index, you can run:
mvn scala:run -Dlauncher=Indexer "-DaddArgs=indexDir|redirectsFile|data"
indexDir is the output directory that will hold the searchable structures
redirectsFile is the homonymous dbpedia data set
data is a collection of files with the properties you want to index.