private String getClassLabel ( EntityIdValue entityIdValue ) { ClassRecord classRecord = this . classRecords . get ( entityIdValue ) ; String label ; if ( classRecord == null || classRecord . itemDocument == null ) { label = entityIdValue . getId ( ) ; } else { label = getLabel ( entityIdValue , classRecord . itemDocument ) ; } EntityIdValue labelOwner = this . labels . get ( label ) ; if ( labelOwner == null ) { this . labels . put ( label , entityIdValue ) ; return label ; } else if ( labelOwner . equals ( entityIdValue ) ) { return label ; } else { return label + " (" + entityIdValue . getId ( ) + ")" ; } }
Returns a string that should be used as a label for the given item . The method also ensures that each label is used for only one class . Other classes with the same label will have their QID added for disambiguation .