Skip to content

Commit

Permalink
functions for CURIE
Browse files Browse the repository at this point in the history
  • Loading branch information
schristley committed Dec 5, 2023
1 parent 25898e9 commit 7658f59
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lang/js/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ module.exports = function(airr, schema) {
//console.log('airr-js schema:', JSON.stringify(schema, null, 2));
airr.Schema = {"specification": schema};

airr.get_specification = function() {
if (!airr.Schema) throw new Error('AIRR schema is not loaded.');
return airr.Schema['specification'];
}

// return schemas in format appropriate for API doc
airr.get_schemas = function() {
if (! airr.Schema['specification']) return null;
Expand All @@ -73,6 +78,16 @@ module.exports = function(airr, schema) {
return airr.Schema['specification']['Info'];
}

airr.get_curie_map = function() {
if (!airr.Schema) throw new Error('AIRR schema is not loaded.');
return airr.Schema['specification']['CURIEMap'];
}

airr.get_iri_providers = function() {
if (!airr.Schema) throw new Error('AIRR schema is not loaded.');
return airr.Schema['specification']['InformationProvider'];
}

airr.SchemaDefinition = function(definition) {
if (!airr.Schema) throw new Error('AIRR schema is not loaded.');

Expand Down

0 comments on commit 7658f59

Please sign in to comment.