Skip to main content

Class: DefaultDataLocaleProvider

Defined in: editor/dataLocaleProvider.ts:79

Provides a default graph data locale provider implementation.

The default provider uses rdfs.label and schema.thumbnailUrl properties to get labels and image URLs unless overridden with options.

Implements

Constructors

Constructor

new DefaultDataLocaleProvider(options): DefaultDataLocaleProvider

Defined in: editor/dataLocaleProvider.ts:87

Parameters

ParameterType

options

DefaultDataLocaleProviderOptions

Returns

DefaultDataLocaleProvider

Methods

formatEntityLabel()

formatEntityLabel(entity, language): string

Defined in: editor/dataLocaleProvider.ts:152

Formats a graph entity label.

By default: uses selectEntityLabel to get entity labels and Translation.formatLabel to select one based on the DiagramModel.language.

Parameters

ParameterTypeDescription

entity

ElementModel

entity to format label for

language

string

target language code

Returns

string

Implementation of

DataLocaleProvider.formatEntityLabel


formatEntityTypeList()

formatEntityTypeList(entity, language): string

Defined in: editor/dataLocaleProvider.ts:165

Formats a graph entity types into a list.

By default: returns a sorted comma-separated list of formatted type labels.

Parameters

ParameterTypeDescription

entity

ElementModel

entity to format label for

language

string

target language code

Returns

string

Implementation of

DataLocaleProvider.formatEntityTypeList


formatIri()

formatIri(iri): string

Defined in: editor/dataLocaleProvider.ts:132

Formats an IRI (unique identifier) for a graph content item.

By default:

  • usual IRIs are enclosed in <IRI>;
  • anonymous element IRIs displayed as (blank node).

Parameters

ParameterType

iri

string

Returns

string

Implementation of

DataLocaleProvider.formatIri


selectEntityImageUrl()

selectEntityImageUrl(entity): undefined | string

Defined in: editor/dataLocaleProvider.ts:113

Selects a preferred image URL for an entity.

Parameters

ParameterType

entity

ElementModel

Returns

undefined | string

Implementation of

DataLocaleProvider.selectEntityImageUrl


selectEntityLabel()

selectEntityLabel(entity): readonly Literal[]

Defined in: editor/dataLocaleProvider.ts:100

Selects a preferred set of localized labels for an entity.

Parameters

ParameterType

entity

ElementModel

Returns

readonly Literal[]

Implementation of

DataLocaleProvider.selectEntityLabel