Semantic Tagging Extension
Last modified by Vincent Massol on 2024/07/05 18:14
Extends the tagging mechanism of the XWiki Platform |
Type | Other |
Category | |
Developed by | Oana Florea, Anna-Maria Metzak |
Rating | |
License | GNU Lesser General Public License 2.1 |
Table of contents
Description
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())
<li>
<a class="suggested-tag" href="#">$suggestedTag.name</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>
#else
$msg.get("semtags.nodetails")
#end
<div id="more-at">$msg.get("semtags.poweredBy")<a href="http://www.dbpedia.org"><img src='$dbpediaImg' alt="Dbpedia"/></a></div></span>
</li>
#end
#foreach($suggestedTag in $suggestedList)
#set($ok = $tagger.fetchFirstSemanticDetail($suggestedTag))
#set($details = $suggestedTag.getSemanticDetails())
<li>
<a class="suggested-tag" href="#">$suggestedTag.name</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>
#else
$msg.get("semtags.nodetails")
#end
<div id="more-at">$msg.get("semtags.poweredBy")<a href="http://www.dbpedia.org"><img src='$dbpediaImg' alt="Dbpedia"/></a></div></span>
</li>
#end
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
Installation Guide:
- Download the Zemanta API for Java from http://developer.zemanta.com.
- 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.