profiles/profiles#

Interfaces#

IsAChoice#

Defined in: editor/src/profiles/profiles.ts:374

The systems an “is a” is stated in, each with the catalogue’s patterns there.

Properties#

label#

readonly label: string

Defined in: editor/src/profiles/profiles.ts:376

options#

readonly options: readonly PatternOption[]

Defined in: editor/src/profiles/profiles.ts:377

system#

readonly system: string

Defined in: editor/src/profiles/profiles.ts:375


LookupChoice#

Defined in: editor/src/profiles/profiles.ts:478

A system a profile may look its values up in.

Properties#

id#

readonly id: string

Defined in: editor/src/profiles/profiles.ts:479

label#

readonly label: string

Defined in: editor/src/profiles/profiles.ts:480


PatternOption#

Defined in: editor/src/profiles/profiles.ts:365

A pattern the “is a” of a profile may take in a system, with the catalogue types stating it.

Properties#

key#

readonly key: string

Defined in: editor/src/profiles/profiles.ts:366

pattern#

readonly pattern: JsonObject

Defined in: editor/src/profiles/profiles.ts:367

text#

readonly text: string

Defined in: editor/src/profiles/profiles.ts:368

types#

readonly types: readonly string[]

Defined in: editor/src/profiles/profiles.ts:370

The labels of the catalogue types with this “is a” there, in catalogue order.


Profile#

Defined in: editor/src/profiles/profiles.ts:45

A type of thing the viewer defined.

Properties#

id#

readonly id: string

Defined in: editor/src/profiles/profiles.ts:46

is_a#

readonly is_a: Readonly<Record<string, readonly ProfilePattern[]>>

Defined in: editor/src/profiles/profiles.ts:49

The “is a” alternatives per catalogue system.

label#

readonly label: string

Defined in: editor/src/profiles/profiles.ts:47

lookup#

readonly lookup: readonly string[]

Defined in: editor/src/profiles/profiles.ts:53

Catalogue systems and service:<id> systems, most preferred first.

verbs#

readonly verbs: readonly string[]

Defined in: editor/src/profiles/profiles.ts:51

Catalogue verb IDs, in the order the composer offers them.


ProfilePattern#

Defined in: editor/src/profiles/profiles.ts:40

One “is a” alternative of a profile: a statements fragment without slots.

Properties#

pattern#

readonly pattern: JsonObject

Defined in: editor/src/profiles/profiles.ts:41


Profiles#

Defined in: editor/src/profiles/profiles.ts:57

The profiles and services of one file, or of the browser.

Properties#

profiles#

readonly profiles: readonly Profile[]

Defined in: editor/src/profiles/profiles.ts:58

services#

readonly services: readonly Service[]

Defined in: editor/src/profiles/profiles.ts:59

Variables#

NO_PROFILES#

const NO_PROFILES: Profiles

Defined in: editor/src/profiles/profiles.ts:63

No profile and no service: the shipped catalogue alone.


PROFILES_FILE#

const PROFILES_FILE: FileKind

Defined in: editor/src/profiles/profiles.ts:66

A profile file to import or export.


PROFILES_FILE_NAME#

const PROFILES_FILE_NAME: "profiles.yaml" = "profiles.yaml"

Defined in: editor/src/profiles/profiles.ts:72

The name a profile file is exported under.

Functions#

isAChoices()#

isAChoices(catalogue): readonly IsAChoice[]

Defined in: editor/src/profiles/profiles.ts:386

The “is a” choices a profile is edited with: every system the catalogue’s “is a” verb has a pattern in, in catalogue order (the fallback labelled “Other vocabularies”), each with the distinct “is a” patterns of the catalogue’s types there, in the order the types first state them.

Parameters#

catalogue#

Catalogue

Returns#

readonly IsAChoice[]


lookupChoices()#

lookupChoices(catalogue, services): readonly LookupChoice[]

Defined in: editor/src/profiles/profiles.ts:488

The lookup systems a profile chooses among: the catalogue’s systems that are looked up somehow (all but those whose lookup route is none), then the services, in their order.

Parameters#

catalogue#

Catalogue

services#

readonly Service[]

Returns#

readonly LookupChoice[]


movedVerb()#

movedVerb(profile, index, by): Profile

Defined in: editor/src/profiles/profiles.ts:438

profile with the verb at index moved one place up (-1) or down (1); unchanged at an end.

Parameters#

profile#

Profile

index#

number

by#

-1 | 1

Returns#

Profile


newProfile()#

newProfile(taken, from): Profile

Defined in: editor/src/profiles/profiles.ts:515

A new profile: a copy of the catalogue type from (its “is a” patterns without their notes and conditions, its verbs, its lookup systems) under its ID, so it replaces that type, or <id>_2, … where a profile has the ID; else an empty profile type_1, type_2, … labelled “new type”.

Parameters#

taken#

readonly string[]

from#

CatalogueType | null

Returns#

Profile


parseProfiles()#

parseProfiles(text, catalogue): string | Profiles

Defined in: editor/src/profiles/profiles.ts:295

The profiles of a file’s text, or what is wrong with it.

Parameters#

text#

string

catalogue#

Catalogue

Returns#

string | Profiles


patternKey()#

patternKey(pattern): string

Defined in: editor/src/profiles/profiles.ts:360

The one text two equal patterns share, whatever the order of their keys.

Parameters#

pattern#

JsonObject

Returns#

string


patternText()#

patternText(pattern): string

Defined in: editor/src/profiles/profiles.ts:346

The words of a pattern: each pair as property and value, type items as type <class>, comma-separated.

Parameters#

pattern#

JsonObject

Returns#

string


profilesText()#

profilesText(profiles): string

Defined in: editor/src/profiles/profiles.ts:290

The profile file of profiles: canonical YAML, as Export writes it and the browser keeps it.

Parameters#

profiles#

Profiles

Returns#

string


readProfiles()#

readProfiles(value, catalogue): string | Profiles

Defined in: editor/src/profiles/profiles.ts:261

The profiles and services value holds, or the first problem, its path written profiles/0/verbs/1: …. Read in this order: the root’s members; the services (an ID twice is refused); each profile’s members, ID, label, “is a” (catalogue systems, patterns whose IRIs are absolute or under the catalogue’s prefixes), verbs (catalogue verbs, none twice) and lookup systems (catalogue systems and the file’s services, none twice); and last an ID given to two profiles.

Parameters#

value#

unknown

catalogue#

Catalogue

Returns#

string | Profiles


withLookup()#

withLookup(profile, system, chosen, order): Profile

Defined in: editor/src/profiles/profiles.ts:449

profile with system among its lookup systems or not, kept in the order of order.

Parameters#

profile#

Profile

system#

string

chosen#

boolean

order#

readonly string[]

Returns#

Profile


withPattern()#

withPattern(profile, system, pattern, stated): Profile

Defined in: editor/src/profiles/profiles.ts:420

profile with pattern stated in system (appended) or not.

Parameters#

profile#

Profile

system#

string

pattern#

JsonObject

stated#

boolean

Returns#

Profile


withProfiles()#

withProfiles(catalogue, profiles): Catalogue

Defined in: editor/src/profiles/profiles.ts:332

catalogue with profiles: the profiles first as types, then the catalogue’s types no profile replaces; the catalogue’s systems, then one per service. Without profiles or services, catalogue itself.

Parameters#

catalogue#

Catalogue

profiles#

Profiles

Returns#

Catalogue


withServiceLookup()#

withServiceLookup(profile, from, to): Profile

Defined in: editor/src/profiles/profiles.ts:467

profile following a change of the service from: its lookup system service:<from> becomes service:<to> in its place (the service’s ID changed to to), or is taken out (to null: the service deleted).

Parameters#

profile#

Profile

from#

string

to#

string | null

Returns#

Profile