*/
public PlainLiteral getBestLabel(UriRef nameField, String language){
Entity rep = getEntity();
//start with the matched label -> so if we do not find a better one
//we will use the matched!
PlainLiteral matchedLabel = getMatchedLabel();
PlainLiteral label = matchedLabel;
// 1. check if the returned Entity does has a label -> if not return null
// add labels (set only a single label. Use "en" if available!
Iterator<PlainLiteral> labels = rep.getText(nameField);
boolean matchFound = false;
while (labels.hasNext() && !matchFound) {
PlainLiteral actLabel = labels.next();
if(label == null){
label = actLabel;
}
//now we have already a label check the language
Language actLang = actLabel.getLanguage();
//use startWith to match also en-GB and en-US ...
if (actLang != null && actLang.toString().startsWith(language)) {
//prefer labels with the correct language
label = actLabel;
if(matchedLabel != null && matchedLabel.getLexicalForm().equalsIgnoreCase(label.getLexicalForm())){