Classes
Members
(static, constant) defaultMappingType
- Source
(static, constant) objectTypes
JSKOS Concept Types indexed by primary name.
- Source
Methods
(static) addContext(jskos)
Add @context URI to a JSKOS resource or to an array of JSKOS resources.
Name | Type | Description |
---|---|---|
jskos | object | object or array of objects |
- Source
(static) addMappingIdentifiers()
- Source
(static) clean(jskos)
Recursively cleans JSKOS object by removing properties starting with _ or containing only uppercase letters. Warning: Works directly on the object without creating a copy!
Name | Type | Description |
---|---|---|
jskos | object |
- Source
(static) compare(object1, object2)
Compares two objects based on their URIs, using getAllUris.
Name | Type | Description |
---|---|---|
object1 | object | |
object2 | object |
- Source
(static) compareMappingMembers()
- Source
(static) compareMappings()
- Source
(static) compareMappingsDeep()
Compare two mappings based on their properties. Concept sets and schemes are compared by URI.
- Source
(static) conceptsOfMapping(mapping, side)
Returns a list of concepts for a mapping.
Name | Type | Description |
---|---|---|
mapping | * | |
side | * | Either |
- Source
(static) copyDeep(object, replaceCircular, skipUnderscore)
Creates a deep copy of a JSKOS object, replacing possibly circular structures with open world [null] statements. All properties starting with an underscore (_) will be ignored.
Name | Type | Default | Description |
---|---|---|---|
object | object | ||
replaceCircular | array | additional property names that should be replace with open world [null] statements | |
skipUnderscore | bool | true | whether to skip properties starting with |
- Source
(static) csvSerializer()
Returns a function to serialize an array as CSV row as configured. See CSV Dialect (https://frictionlessdata.io/specs/csv-dialect/).
- Source
(static) flattenMapping()
- Source
(static) getAllUris(object)
Returns all possible URIs for a JSKOS object. Takes into consideration both the uri and identifier properties.
Name | Type | Description |
---|---|---|
object | object |
- Source
(static) guessObjectType(jskos|name|uri, shortname)
Guess the JSKOS Concept Type name from an object or name.
Name | Type | Description |
---|---|---|
jskos|name|uri | object | | object or string to guess from |
shortname | boolean | return short name if enabled (false by default) |
- Source
(static) isConcept()
Checks whether JSKOS object is a concept based on type property.
- Source
(static) isContainedIn()
Checks whether an object is contained in a list of objects using compare.
- Source
(static) isScheme()
Checks whether JSKOS object is a concept scheme based on type property.
- Source
(static) mappingCSV(options)
Returns an object of preconfigured conversion functions to convert mappings into CSV.
Name | Type | Description |
---|---|---|
options | object | Possible options:
|
- Source
(static) mappingContentIdentifier()
Returns a mapping content identifier. The identifier starts with urn:jskos:mapping:content:
and takes concepts and type into consideration. It uses the mappingContent
function to get relevant properties from the mapping.
- Source
(static) mappingMembersIdentifier()
- Source
(static) mappingTypeByType()
- Source
(static) mappingTypeByUri()
- Source
(static) matchObjectTypes(a, b)
Checks if two objects have a matching object type. Returns false only if types for both objects could be guessed and they did not match.
Name | Type | Description |
---|---|---|
a | object | |
b | object |
- Source
(static) merge(a, b, options)
Merges two JSKOS objects. Object properties will be merged deeply. Array properties will be combined (and URIs will be used for comparison if it's an array of objects).
The options
property allows for different options:
mergeUris
(boolean, defaultfalse
) - appends b's URI to the result'sidentifier
property if necessary, removes a's URI from the result'sidentifier
property if necessary (useful for merging ConceptSchemes)detectMismatch
(array of strings, default[]
) - throws an error if the value at a certain path does not match between the two objects (allows for deep properties, e.g.prefLabel.de
)skipPaths
(array of strings, default[]
) - provide paths to completely skip when merging
Name | Type | Description |
---|---|---|
a | object | |
b | object | |
options | object | optional, see above |
- Source
(static) mergeUris(a, b)
Merge URIs of two objects a
and b
into a
by adding/removing URIs from identifier property.
Name | Type | Description |
---|---|---|
a | object | |
b | object |
- Source
(static) minifyMapping()
- Source
(static) sortConcepts(concepts)
Sorts a list of concepts by their notation, then URI.
Name | Type | Description |
---|---|---|
concepts | * |
- Source
(static) sortSchemes(schemes)
Sorts a list of schemes by their prefLabel (German or English), then notation, then URI.
Name | Type | Description |
---|---|---|
schemes | * |
- Source