STANBOL-1132: Applied the patch provided by Cristian Petroaca with minor modifications (adding Apache headers, adding some TODOs). See the 3rd comment on the issue for more details.

git-svn-id: https://svn.apache.org/repos/asf/stanbol/trunk@1532246 13f79535-47bb-0310-9956-ffa450edef68