Type | Other |
Category | |
Developed by | Unknown |
Rating | |
License | Unknown |
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 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 to the webapps/xwiki/WEB-INF/lib folder in the XWiki platform.
- Apply the patch for XWiki Enterprise: override the tags.js file in the webapps/xwiki/resources/uicomponents/viewers/ folder and also the documentTags.vm and htmlheader.vm template files in webapps/xwiki/templates.
- Copy the component jar to the webapps/xwiki/WEB-INF/lib folder in the XWiki platform
- Start the server ./start_xwiki.sh
- (Optional) Install the Semantic Tagging XWiki Application.