curie-util-es5
Advanced tools
Comparing version 1.0.0 to 1.2.0
@@ -5,6 +5,2 @@ | ||
//======================================================================= | ||
@@ -48,5 +44,10 @@ // | ||
// | ||
// Utility function to convert CURIE <-> IRI | ||
// Utility Class to convert CURIE <-> IRI | ||
// | ||
//======================================================================= | ||
/** | ||
* | ||
* @param {*} mapping A Bidirectional Map of CURIE <-> IRI created through parseContext(context.jsonld) | ||
*/ | ||
function CurieUtil(mapping) { | ||
@@ -69,2 +70,6 @@ this.trie = new Trie(); | ||
/** | ||
* Return the CURIE associated to the given IRI if any exists. Return null otherwise | ||
* @param {*} iri The IRI of an entity (e.g. http://identifiers.org/zfin/ZDB-GENE-031112-7, http://identifiers.org/mgi/MGI:34340) | ||
*/ | ||
CurieUtil.prototype.getCurie = function(iri) { | ||
@@ -80,2 +85,6 @@ var prefix = this.trie.getMatchingPrefix(iri); | ||
/** | ||
* Return the IRI associated to the given CURIE if any exists. Return null otherwise | ||
* @param {*} curie The CURIE of an entity (e.g. ZFIN:ZDB-GENE-031112-7, MGI:MGI:34340) | ||
*/ | ||
CurieUtil.prototype.getIri = function(curie) { | ||
@@ -100,2 +109,6 @@ if(!curie) | ||
/** | ||
* Returns a BiDirectional Map of the @context of a JSON-LD file | ||
* @param {} jsonObject A JSON-LD file with a @context field | ||
*/ | ||
function parseContext(jsonObject) { | ||
@@ -115,2 +128,3 @@ try { | ||
module.exports.parseContext = parseContext; | ||
module.exports.CurieUtil = CurieUtil; |
{ | ||
"name": "curie-util-es5", | ||
"version": "1.0.0", | ||
"version": "1.2.0", | ||
"description": "Javascript Library to Translate CURIEs to IRIs and vice versa. ES5 Version.", | ||
@@ -5,0 +5,0 @@ "main": "curie-util.js", |
# curie-util-js | ||
Javascript utility library to translate CURIEs to IRIs and vice versa. | ||
Javascript Library to translate CURIEs to IRIs and vice versa. | ||
ES5 Version based on the Java Implementation: https://github.com/prefixcommons/curie-util | ||
@@ -4,0 +4,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7394
188