Label Resolution and Full-Text Search¤
Introduction¤
Label resolution translates resource identifiers (URI/IRI) into human readable labels. This resolution and, by extension, the full text search is configurable for different scenarios.
Configuration¤
eccenca Explore backend (DataPlatform) offers three configuration options: labelProperties (line 2) languagePreferences (line 5) and languagePreferencesAnyLangFallback (line 8).
These properties define not only which properties and languages should be considered, but also the precedence of languages and properties over each other.
The retrieval process can be simplified to the following procedure:
- First, when determining the label for a resource, the language is evaluated, then the property is considered.
- Consequently, for a resource in the default case:
- An english value for
rdfs:labelis searched. - A literal of the property
rdfs:labelwithout a language tag is searched (which is why there is an entry""). - An english value of
skos:prefLabelis searched. - A literal of the property
skos:prefLabelwithout a language tag is searched. - If nothing is found, Explore backend (DataPlatform) tries to create a prefixed URI, otherwise the last segment of the resource identifier is used.
- An english value for
Additionally, in case more than one label could be retrieved, for example by conflicting values, the alphabetically first entry is used.
Example¤
How labels are resolved is best explained using these default settings and some examples.
:Resource1 rdfs:label "Leipzig"@en.
:Resource2 :someOtherProperty "Berlin"@en.
:Resource3 rdfs:label "Stuttgart"@de
:Resource4 rdfs:label "Hanover"@en
:Resource4 rdfs:label "Another Label for Hanover"@en
- For
:Resource1the label will beLeipzigas the englishrdfs:labelwill be retrieved. - For
:Resource2the label cannot be retrieved from the Knowledge Graph since no known property is used. Hence the fallback. - For
:Resource3the label will be retrieved asStuttgart, if thelanguagePreferencesAnyLangFallbackistrue. - While there is a well-known property used, none of the used languages match. Using the fallback, the alphabetically first match is retrieved in this case.
- For
:Resource4multiple label candidates could be determined. - In this case,
Another Label for Hanoveris retrieved as it is the first value in the alphanumerical comparison.
Client API¤
The label resolution functionality can also be used by client systems.
This functionality is exposed as an API endpoint (<dp_url>/api/explore/title).