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
Parameter | Type |
---|---|
|
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
Parameter | Type | Description |
---|---|---|
| entity to format label for | |
|
| 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
Parameter | Type | Description |
---|---|---|
| entity to format label for | |
|
| 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
Parameter | Type |
---|---|
|
|
Returns
string
Implementation of
selectEntityImageUrl()
selectEntityImageUrl(
entity
):undefined
|string
Defined in: editor/dataLocaleProvider.ts:113
Selects a preferred image URL for an entity.
Parameters
Parameter | Type |
---|---|
|
Returns
undefined
| string
Implementation of
DataLocaleProvider
.selectEntityImageUrl
selectEntityLabel()
selectEntityLabel(
entity
): readonlyLiteral
[]
Defined in: editor/dataLocaleProvider.ts:100
Selects a preferred set of localized labels for an entity.
Parameters
Parameter | Type |
---|---|
|
Returns
readonly Literal
[]