Members
compareFunctions
An object of compare functions (can be used by array.sort for example).
TODO: Add more functions.
- Source
(constant) sha1
Module to calculate JSKOS mapping identifiers.
- Source
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 |
- Source
annotationCreatorName(annotation)
Returns the craetor name for an annotation.
Name | Type | Description |
---|---|---|
annotation | object | a JSKOS annotation |
- Source
annotationCreatorUri(annotation)
Returns the creator URI for an annotation.
Name | Type | Description |
---|---|---|
annotation | object | a JSKOS annotation |
- Source
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:
|
- Source
getLanguages()
Get the preference list either from store or from defaults (fallback)
isValidUri(uri)
Checks whether a string is a valid URI.
Name | Type | Description |
---|---|---|
uri | string | URI to be tested |
- 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:
|
- Source
mappingRegistryIsStored(registry)
Returns whether a mapping registry has stored mappings (true
= database) or not (false
= recommendations).
Name | Type | Description |
---|---|---|
registry | object | JSKOS registry |
- Source
normalize(data)
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.
Name | Type | Description |
---|---|---|
data | * |
- Source
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) |
- Source
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:
|
- Source
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 |
userOwnsMapping(user, mapping)
Returns true
if the user owns the mapping (i.e. is first creator), false
if not.
Name | Type | Description |
---|---|---|
user | * | a login-server compatible user object |
mapping | * | a JSKOS mapping |
- Source