Class: DefaultDataLocaleProvider
Defined in: src/editor/dataLocaleProvider.ts:91
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: src/editor/dataLocaleProvider.ts:99
Parameters
| Parameter | Type |
|---|---|
|
Returns
DefaultDataLocaleProvider
Methods
formatEntityLabel()
formatEntityLabel(
entity,language):string
Defined in: src/editor/dataLocaleProvider.ts:164
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: src/editor/dataLocaleProvider.ts:177
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: src/editor/dataLocaleProvider.ts:144
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
prepareAnchor()
prepareAnchor(
targetIri):Pick<React.ComponentProps<"a">,"draggable"|"href"|"target"|"rel"|"onClick">
Defined in: src/editor/dataLocaleProvider.ts:198
Provides props for an anchor (<a> link) to a resource IRI.
By default: returns
{
href: targetIri,
target: '_blank',
rel: 'noreferrer',
}
Parameters
| Parameter | Type |
|---|---|
|
|
Returns
Pick<React.ComponentProps<"a">, "draggable" | "href" | "target" | "rel" | "onClick">
Implementation of
DataLocaleProvider.prepareAnchor
resolveAssetUrl()
resolveAssetUrl(
assetIri,options):Promise<string>
Defined in: src/editor/dataLocaleProvider.ts:214
Asynchronously resolves an IRI/URL to referenced data asset for display or download, e.g. an image (thumbnail) or a downloadable file.
By default: returns the asset IRI/URL as-is.
Parameters
| Parameter | Type |
|---|---|
|
|
| { |
|
|
Returns
Promise<string>
Implementation of
DataLocaleProvider.resolveAssetUrl
selectEntityImageUrl()
selectEntityImageUrl(
entity):undefined|string
Defined in: src/editor/dataLocaleProvider.ts:125
Selects a preferred image URL for an entity.
Parameters
| Parameter | Type |
|---|---|
|
Returns
undefined | string
Implementation of
DataLocaleProvider.selectEntityImageUrl
selectEntityLabel()
selectEntityLabel(
entity): readonlyLiteral[]
Defined in: src/editor/dataLocaleProvider.ts:112
Selects a preferred set of localized labels for an entity.
Parameters
| Parameter | Type |
|---|---|
|
Returns
readonly Literal[]