PhyxWrapper
The PhyxWrapper wraps an entire Phyx document.
Constructor Summary
Public Constructor | ||
public |
constructor(phyx: Object, newickParser: function(newick: string): {name) Wraps an entire PHYX document. |
Member Summary
Public Members | ||
public get |
|
|
public |
newickParser: * |
|
public |
phyx: * |
Method Summary
Public Methods | ||
public |
Generate an executable ontology from this Phyx document. |
|
public |
Generate an executable ontology from this Phyx document as N-Quads. |
Public Constructors
public constructor(phyx: Object, newickParser: function(newick: string): {name) source
Wraps an entire PHYX document.
Params:
Name | Type | Attribute | Description |
phyx | Object | The Phyx structure to wrap. |
|
newickParser | function(newick: string): {name |
|
A method that accepts a Newick string and returns a list of nodes. Each node should have a 'children' key with its children and optionally a 'name' key with its label. This code previously depended on phylotree.js, whose newick_parser() function works exactly like this. This option allows you to drop in Phylotree's newick_parser() or -- if you prefer -- any other option. |
Public Members
public get defaultNomenCode: * source
public newickParser: * source
public phyx: * source
Public Methods
public asJSONLD(baseIRI: string): Object source
Generate an executable ontology from this Phyx document. The document is mostly in JSON-LD already, except for three important things:
- We have to convert all phylogenies into a series of statements relating to the nodes inside these phylogenies.
- We have to convert phylogenies into OWL restrictions.
- Insert all matches between taxonomic units in this file.
Params:
Name | Type | Attribute | Description |
baseIRI | string |
|
The base IRI to use when generating this Phyx document.
This should include a trailing '#' or '/'. Use '' to indicate that relative IDs
should be generated in the produced ontology (e.g. '#phylogeny1'). Note that if a
baseIRI is provided, then relative IDs already in the Phyx file (identified by an
initial '#') will be turned into absolute IDs by removing the initial |
public toRDF(baseIRI: string, filePath: string): Promise[string] source
Generate an executable ontology from this Phyx document as N-Quads. Under the hood, we generate an OWL/JSON-LD representation of this Phyx document, and then convert it into N-Quads so that OWLAPI-supporting tools can directly consume it.
Params:
Name | Type | Attribute | Description |
baseIRI | string |
|
The base IRI to use when generating this Phyx document.
This should include a trailing '#' or '/'. Use '' to indicate that relative IDs
should be generated in the produced ontology (e.g. '#phylogeny1'). Note that if a
baseIRI is provided, then relative IDs already in the Phyx file (identified by an
initial '#') will be turned into absolute IDs by removing the initial |
filePath | string |
|
The path of the Phyx file being converted.
Used only if the |
Return:
Promise[string] | A Promise to return this Phyx document as a string that can be written to an N-Quads file. |