Semantic Tagging Extension

Last modified by Vincent Massol on 2021/03/17 21:59

cogExtends the tagging mechanism of the XWiki Platform
Developed by

Oana Florea, Anna-Maria Metzak

0 Votes
LicenseGNU Lesser General Public License 2.1


The Semantic Tagging XWiki component enriches the tagging mechanism for the XWiki Platform using the Zemanta content recommendation tool and the DBpedia knowledge base.

How to use it

The Semantic Tagging component can be used from a velocity script for example:

#set($suggestedList = $tagger.getSuggestions("get suggestions for this text"))
#foreach($suggestedTag in $suggestedList)
  #set($ok = $tagger.fetchFirstSemanticDetail($suggestedTag))
  #set($details = $suggestedTag.getSemanticDetails())
   <a class="suggested-tag" href="#">$</a>
   <span class="suggested-tag-info" style="display: none">$details.get(0).getDescription()
    #if("$details.get(0).getUri()" != "")
     <br/><a href="$details.get(0).getUri()">Visit</a>
   <div id="more-at">$msg.get("semtags.poweredBy")<a href=""><img src='$dbpediaImg' alt="Dbpedia"/></a></div></span>

The Semantic Tagging application is a use case for this component.

You can find more details about the project in this article: Semantic Tagging for the XWiki Platform with Zemanta and DBpedia.

Prerequisites & Installation Instructions

The Zemanta API allows a maximum of 1000 calls/day. 

Installation Guide: 

  • Download the Zemanta API for Java from
  • Compile the API using ant jar to generate your libs. Add the zemanta-api JARs to the webapps/xwiki/WEB-INF/lib folder in your XWiki instance.
  • Apply the following patch for XWiki Enterprise:
    • Override the tags.js file in the webapps/xwiki/resources/uicomponents/viewers/ folder with the tags.js file provided in the ZIP download
    • Override the documentTags.vm and htmlheader.vm template files in webapps/xwiki/templates with the corresponding files provided in the ZIP download.
  • Copy the xwiki-semtag-component JAR to the webapps/xwiki/WEB-INF/lib folder in your XWiki instance.
  • Start XWiki
  • (Optional) Install the Semantic Tagging XWiki Application.

Get Connected