Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


Note: This repository is now mantained by QAnswer, it can be found here.

The SummaServer provides a service for entity summarizatioimg over RDF graphs. For example for the entity "Die Zeit", a German weekly newspaper, the summary over Wikidata is:

The following KB are currently supported: Wikidata, DBpedia, MusicBrainz, Dblp, Scigraph and Freebase.

Setting up

Running the service is simple. Compile it using:

mvn clean package

Run it using:

java -jar target/summaServer-0.1.0.jar

This will start the server at port 3031 and expose the summarization service at:


To change the port or the name of the host change the following file.


The service is accessible both using GET and POST requests. For "Die Zeit" the requests are:


curl "localhost:3031/wikidata/sum?entity="


curl -d "[ a <> ; \
    <> \
    <> ; \
    <> '5' ] ." -H "content-type: text/turtle" -H "accept: application/ld+json"           localhost:3031/wikidata/sum

The response is encoded using the SUMMA ( and vRank ( vocabularies.


A running demo can be found under:

Moreover the summa server is used by the question answering system WDAqua-core0. A demo can be found at:

Extending to a new Knowledge Base (KB)

In the following we want to explain how to extend the service to new Knowledge Bases. As a running example we use the conrete case of the Wikidata KB.

  • You need to set up a triplestore containing the KB together with the PageRank scores expressed in the vRank vocabulary. The PageRank scores can be computed using the command line tool [PageRankRDF]{}. We generally relay on SPARQL endpoints over HDT files like describe here.

  • Next you have to implement the following abstract class. This basically reduces to the following:

    • implements getName() indicating the name of the service, for example { return "wikidata"} will create a service under localhost:3031/wikidata/sum.

    • implement getRepository() indicating the address of the SPARQL endpoint with the RDF KB and the corresponding PageRank scores

    • implement getQuery0(), this method returns a query. It retrives for an ENTITY the corresponding label in the language LANG. For Wikidata the query is.

         PREFIX rdfs: <>
         WHERE {
             <ENTITY> rdfs:label ?l . 
             FILTER regex(lang(?l), "LANG", "i") . 
    • implement getQuery1(), this method returns a query. It returns the resources connected to the resource ENTITY, order them according to the PageRank score and take the first TOPK. Moreover it retrieves the labels of the founded resources in the language LANG. For Wikidata the query is.

      PREFIX rdf: <>
      PREFIX vrank: <> 
      PREFIX wdd: <>
      SELECT DISTINCT ?o ?l ?pageRank 
      WHERE {
          <ENTITY> ?p ?o . 
              FILTER (?p != rdf:type && ?p != wdd:P31 
              && ?p != wdd:P735 && wdd:P21> 
              && ?p != wdd:P972 && wdd:P421> 
              && ?p != wdd:P1343 ) 
          ?o rdfs:label ?l . 
              FILTER STRENDS(lang(?l), "LANG") . 
          graph <> { 
              ?o vrank:pagerank ?pageRank . 
      ORDER BY DESC (?pageRank) LIMIT TOPK 
    • implement getQuery2(), this method returns a query. It returns, given two resource ENTITY and OBJECT, the label of the property between them in the language LANG. For Wikidata we use the following query:

      PREFIX rdf: <>
      PREFIX vrank:<>
      SELECT ?p ?l 
      WHERE {
          <ENTITY> ?p <OBJECT> . 
          OPTIONAL { 
              ?o <> ?p . 
              ?o rdfs:label ?l . 
              FILTER regex(lang(?l), "LANG", "i")
      ORDER BY asc(?p) LIMIT 1

Example of implementations can be found under:

Note: This repository is now mantained by QAnswer, it can be found here.

Copyright © 2014-2017 UJMS. This source code is licensed under the MIT license found in the LICENSE.txt file.

Made by Andreas Thalhammer & Dennis Diefenbach


Service providing a summarisation service for entities in RDF graphs





No releases published


No packages published