JSKOS Tools (jskos-tools)
Tools for working with the JSKOS data format.
This repository contains tools for working with the JSKOS data format for knowledge organization systems.
Table of Contents
- Mapping Identifiers
npm i jskos-tools
const jskos =
let concept =...jskosvalidate // returns true or false// or jskos.validate.scheme(scheme)// or jskos.validate.mapping(mapping)// ...
bin also contains a command line script for validation.
Returns the version of the JSKOS specification that's used for validation.
jskosversion // 0.4.2
let mapping =...
mappingContentIdentifier 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.
let contentIdentifier = jskos
mappingMembersIdentifier starts with urn:jskos:mapping:members: and only takes concepts into consideration. It uses the
mappingMembers function to get relevant properties from the mapping.
let membersIdentifier = jskos
addMappingIdentifiers creates a new mapping with property "identifiers", containing mappingContentIdentifier and mappingMembersIdentifier.
let mappingWithIdentifiers = jskos
compareMappings compares two mappings based on their
if jskos ...
compareMappingMembers compares two mappings based on their
if jskos ...
@context URI to a JSKOS object or to an array of JSKOS objects.
Removes properties starting with
_ or containing only uppercase letters from a JSKOS object.
Creates a deep copy of a JSKOS object, replacing possibly circular structures with open world
Returns all possible URIs for a JSKOS object. Takes into consideration both the uri and identifier properties, as well as different variants of those identifiers. Returns an empty array if object is
Compares two objects based on their URIs, using
true if both objects are
Checks whether JSKOS object is a concept based on type property.
Checks whether JSKOS object is a concept scheme based on type property.
// Checks whether an object is contained in a list of objects using
Sorts a list of concepts by their notation, then URI. Returns a copy of the list.
Sorts a list of schemes by their German prefLabel, then URI. Returns a copy of the list.
Removes unnecessary properties from mapping before export or saving. In particular, all properties except for
creator on the mapping will be removed, and all properties except for
notation on concepts and schemes will be removed.
let newMapping = jskos
An array of mapping types in form of objects. Objects can have the following properties:
notation- an array of notations (in this case symbols)
uri- the URI of the mapping type
prefLabel- a language maps of labels
broader- array of broader mapping types for this type
related- array of related mapping types
RELEVANCE- relevance label for GND terms (low, medium, high, very high)
short- a short name for the type, used for CSV import/export
Returns a mapping type object for an URI.
Returns a mapping type for a JSKOS type property. This is usually an array where the first type is taken, but a workaround for string types is included as well.
The default mapping type (currently
Returns a configured converter from JSKOS mapping to CSV line. For now only simple 1-to-1 mappings and 1-to-0 mappings are supported.
let mappingToCsv = jskos
Concept labels are included only if configuration field
language is set. The order of CSV fields is fromNotation, (fromLabel,) toNotation, (toLabel,) mappingType.
Returns an array of concepts contained in a mapping.
side can either be
side is left out, concepts from both sides will be returned.
git clone --recursive https://github.com/gbv/jskos-tools.gitcd jskos-tools/npm install
Small note: If editing the README, please conform to the standard-readme specification.
MIT © 2018 Verbundzentrale des GBV (VZG)