Members
(constant) compareFunctions
An object of compare functions (can be used by array.sort for example).
TODO: Add more functions.
(constant) isValidUri
Checks whether a string is a valid URI.
(constant) normalize
Applies recursive unicode normalization to data.
- If data is an array, it will recursively normalize all elements of that array.
- If data is an object, it will recursively normalize all property values of that object.
- If data is a string, it will apply unicode normalization to that string.
- If data is of any other type, it will be returned as is.
(constant) userOwnsMapping
Returns true
if the user owns the mapping (i.e. is first creator), false
if not.
Methods
annotationCreatorMatches(annotation, uris)
Matches an annotation's creator URI against a list of URIs (e.g. from a user).
Name | Type | Description |
---|---|---|
annotation | object | a JSKOS annotation |
uris | array | array of user URIs |
annotationCreatorName(annotation)
Returns the craetor name for an annotation.
Name | Type | Description |
---|---|---|
annotation | object | a JSKOS annotation |
annotationCreatorUri(annotation)
Returns the creator URI for an annotation.
Name | Type | Description |
---|---|---|
annotation | object | a JSKOS annotation |
definition(item, options)
Returns the definition of a JSKOS Item as an array. If there is no definition, an empty array will be returned.
Name | Type | Description |
---|---|---|
item | * | |
options | object | options object:
|
getLanguages()
Get the preference list either from store or from defaults (fallback)
- Source
languageMapContent(item, prop, options)
Returns the content of a language map for a JSKOS Item.
Name | Type | Description |
---|---|---|
item | * | a JSKOS Item |
prop | string | property of interest in the item |
options | object | options object:
|
mappingRegistryIsStored(registry)
Returns whether a mapping registry has stored mappings (true
= database) or not (false
= recommendations).
Name | Type | Description |
---|---|---|
registry | object | JSKOS registry |
notation(item, type)
Returns the primary notation for a JSKOS Item. If there is no notation, it will return an empty string. Scheme notations will be uppercased.
Name | Type | Description |
---|---|---|
item | object | a JSKOS Item |
type | string | type of item (optional) |
prefLabel(item, options)
Returns the prefLabel of a JSKOS Item. If there is no label, it will return the URI. If there is no URI, it will return an empty string.
Name | Type | Description |
---|---|---|
item | * | |
options | object | options object:
|
selectLanguage(languageMap)
Selects a language tag from a language map or null if no language was found.
Name | Type | Description |
---|---|---|
languageMap | object | map to select language tag from |
- Source