View Source

KIM supports various model representations of the entity labels within its repository.

Currently, there are two basic models:
* Aliases (default)
* Labels

*Aliases*. The Aliases model representation allows adding supplementary metadata about the entity labels. For example, information about the source of the item can be added. However, this representation requires more statements to be stored within the semantic repository. Entities have two kinds of aliases - exactly one _main alias_ and many _secondary aliases_. Aliases are connected to corresponding literals using the rdfs:label predicate.

*Labels*. This is the more simple model. It stores the connections between entities and labels directly. There can be two types of relations for each entity: exactly one _main label_ and many _secondary labels_. The predicates used in this case are <http://proton.semanticweb.org/2006/05/protons#mainLabel> and rdfs:label.

In KIM 3.7, we have provided the capability of the administrator selecting custom predicates based on the *Labels* model representation. In order to select custom labels model, one have to set the {{com.ontotext.kim.KIMConstants.ENTITY_DESCR}} to {{Custom}} and then enlist all required predicates as value of the {{com.ontotext.kim.KIMConstants.MAIN_LABEL_PREDICATES}} (a comma-separated list).

A sample configuration:

{code:title=install.properties}
...

com.ontotext.kim.KIMConstants.ENTITY_DESCR = Custom

# Represents a list of predicates to serve as relations to the main labels used
# At the end of the list, by default, <http://proton.semanticweb.org/2006/05/protons#mainLabel> is added
# This property is only read if com.ontotext.kim.KIMConstants.ENTITY_DESCR is set to 'Custom'
com.ontotext.kim.KIMConstants.MAIN_LABEL_PREDICATES= http://xmlns.com/foaf/0.1/name, http://www.ontotext.com/proton/protonsys#name, http://www.geonames.org/ontology/name

...
{code}

As can be seen from the comments in this example, there is one predicate that is always added - the default Labels model predicate

Another improvement allows filtering the labels by their language (if such is provided within the literal object from the semantic repository). The user needs to set the {{com.ontotext.kim.KIMConstants.Label_LANGUAGES}} property value to the desired list of language abbreviations. Check the example:

{code:title=install.properties}
...

# A list of languages that returned labels should be from.
# Internally, several values are added alongside this collection: <null>, <empty>, "en"
# This property is only read if com.ontotext.kim.KIMConstants.ENTITY_DESCR is set to 'Custom'
com.ontotext.kim.KIMConstants.LABEL_LANGUAGES=nl, fr

...
{code}

As can be seen, there are again default values that are always added to the list.