File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,23 @@ export default class SkohubProvider extends BaseProvider {
49
49
this . _schemeCache = { }
50
50
}
51
51
52
+ /**
53
+ * Used by `registryForScheme` (see src/lib/CocodaSDK.js) to determine a provider config for a concept schceme.
54
+ *
55
+ * @param {Object } options
56
+ * @param {Object } options.url API URL for BARTOC instance
57
+ * @param {Object } options.scheme scheme for which the config is requested
58
+ * @returns {Object } provider configuration
59
+ */
60
+ static _registryConfigForBartocApiConfig ( { url, scheme } = { } ) {
61
+ if ( ! url || ! scheme ) {
62
+ return null
63
+ }
64
+ // Save scheme with "url" as main URI, add other identifier
65
+ const newScheme = { uri : url , identifier : jskos . getAllUris ( scheme ) . filter ( uri => uri !== url ) }
66
+ return { schemes : [ newScheme ] }
67
+ }
68
+
52
69
async _loadScheme ( { scheme, ...config } ) {
53
70
const uris = jskos . getAllUris ( scheme )
54
71
for ( let uri of uris ) {
You can’t perform that action at this time.
0 commit comments