MyCoReProvider

MyCoRe Classification API

See also: https://github.com/gbv/cocoda-sdk/issues/50

To use it in a registry, specify provider as "MyCoRe" and provide the API URL as api:

{
 "uri": "http://coli-conc.gbv.de/registry/mycore-shbsg",
 "provider": "MyCoRe",
 "api": "https://bibliographie.schleswig-holstein.de/api/v2/classifications/shbib_sachgruppen.json"
}

Specifying schemes is currently not required and it will not be used. Currently supports only one vocabulary per registry.

Constructor

new MyCoReProvider()

Methods

_categoryToJSKOS()

Converts a category to a JSKOS concept.

  • Also saves that concept in data
  • Also adds the concept's prefLabels to the search index

? Question: Should scopeNotes be part of the search index?

(async) _loadSchemeData()

Loads the data from the API. Only called from getSchemes and only called once.

_removeNarrower()

Helper function that replaces narrower key with [null] if it has values. Use this before returning concepts.

_schemeInfoToJSKOS()

Converts scheme info (full scheme data that comes from the API) to a JSKOS scheme

Returns concept search results.

Parameters:
NameTypeDescription
configObject
Properties
NameTypeAttributesDefaultDescription
searchstring

search string

schemeObject<optional>

concept scheme to search in

limitnumber<optional>
100

maximum number of search results

Returns:

array of JSKOS concept objects

Type: 
Array

(async) suggest(config) → {Array}

Returns suggestion result in OpenSearch Suggest Format.

Parameters:
NameTypeDescription
configObject
Properties
NameTypeAttributesDefaultDescription
searchstring

search string

schemeObject<optional>

concept scheme to search in

limitnumber<optional>
100

maximum number of search results

Returns:

result in OpenSearch Suggest Format

Type: 
Array

(static) _registryConfigForBartocApiConfig(options) → {Object}

Used by registryForScheme (see src/lib/CocodaSDK.js) to determine a provider config for a concept schceme.

Parameters:
NameTypeDescription
optionsObject
Properties
NameTypeDescription
urlObject

API URL for BARTOC instance

schemeObject

scheme for which the config is requested

Returns:

provider configuration

Type: 
Object