generated from kevinxin90/typescript_template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ✨ Allow access and traverse BioLink Class Tree Hierarchy
- Loading branch information
1 parent
9478d02
commit 4801d67
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import loader from './loader/loader_factory'; | ||
import BioLinkClassTree from './class_tree'; | ||
import { BioLinkJSON, BioLinkClassTreeObject } from './types/types' | ||
|
||
export class BioLink { | ||
private _biolink_json: BioLinkJSON; | ||
private _biolink_class_tree: BioLinkClassTreeObject; | ||
|
||
constructor() { | ||
this._biolink_json = {} as BioLinkJSON; | ||
} | ||
|
||
async load(source: string = undefined) { | ||
const l = loader(source); | ||
this._biolink_json = await l.load(source); | ||
this._biolink_class_tree = new BioLinkClassTree(this._biolink_json.classes); | ||
this._biolink_class_tree.construct(); | ||
} | ||
|
||
get classTree() { | ||
return this._biolink_class_tree; | ||
} | ||
|
||
get biolinkJSON() { | ||
return this._biolink_json; | ||
} | ||
|
||
} |