diff --git a/src/Ontology.NET/ExtensionMethods.fs b/src/Ontology.NET/ExtensionMethods.fs new file mode 100644 index 0000000..5a77daa --- /dev/null +++ b/src/Ontology.NET/ExtensionMethods.fs @@ -0,0 +1,25 @@ +namespace Ontology.NET.OBO + + +open Ontology.NET + + +[] +module Extensions = + + type OboOntology with + + /// + /// Returns the corresponding Ontology from the OboOntology, with the term IDs as node keys, the terms as CvTerms as node data and the relations as edges. + /// + /// If a relation points to a term that is not present in the given OboOntology, initializes them as new CvTerms but with name and ref = "<missing>". + member this.ToOntology() = + Ontology.fromOboOntology this + + /// + /// Returns the corresponding Ontology from the given OboOntology, with the term IDs as node keys, the terms as CvTerms as node data and the relations as edges. + /// + /// The OboOntology that serves as the basis for the respective Ontology. + /// If a relation points to a term that is not present in the given OboOntology, initializes them as new CvTerms but with name and ref = "<missing>". + static member toOntology (oboOnto : OboOntology) = + oboOnto.ToOntology() \ No newline at end of file diff --git a/src/Ontology.NET/Ontology.NET.fsproj b/src/Ontology.NET/Ontology.NET.fsproj index 5f0925a..e3bc0b5 100644 --- a/src/Ontology.NET/Ontology.NET.fsproj +++ b/src/Ontology.NET/Ontology.NET.fsproj @@ -32,10 +32,9 @@ + - - Heinrich Lukas Weil, Oliver Maus, F# open source contributors A library to work with ontologies and ontology-related file formats. diff --git a/src/Ontology.NET/Ontology.fs b/src/Ontology.NET/Ontology.fs index 52525aa..f1a0451 100644 --- a/src/Ontology.NET/Ontology.fs +++ b/src/Ontology.NET/Ontology.fs @@ -62,6 +62,7 @@ type Ontology() = /// /// Takes a given OboOntology and returns the corresponding Ontology, with the term IDs as node keys, the terms as CvTerms as node data and the relations as edges. /// + /// The OboOntology that serves as the basis for the respective Ontology. /// If a relation points to a term that is not present in the given OboOntology, initializes them as new CvTerms but with name and ref = "<missing>". static member fromOboOntology (oboOnto : OboOntology) = @@ -1325,6 +1326,7 @@ type Ontology() = /// /// Returns the given Ontology as a collection of Triplets. /// + /// The Ontology that serves as the informational basis for the Triplet collection. /// A collection of Triplets in the form of SourceTerm * Relation * TargetTerm. static member toTriplets (onto : Ontology) = onto.ToTriplets() \ No newline at end of file