-
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.
Rework CvTerm and CvUnit as record, use unified naming for their fiel…
…ds (Accession, Value, RefUri)
- Loading branch information
Showing
18 changed files
with
139 additions
and
151 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
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
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
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
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
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
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
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
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 |
---|---|---|
@@ -1,37 +1,31 @@ | ||
namespace ControlledVocabulary | ||
|
||
/// Represents a term from a controlled vocabulary (Cv) | ||
/// in the form of: id|accession * name|value * refUri | ||
/// in the form of: id|accession ; name|value ; refUri | ||
// ?Maybe [<Struct>] | ||
//[<Struct>] | ||
type CvTerm = string * string * string | ||
type CvTerm = { | ||
Accession: string | ||
Value: string | ||
RefUri: string | ||
} with | ||
static member create( | ||
accession: string, | ||
value: string, | ||
ref : string | ||
) = | ||
{Accession = accession; Value = value; RefUri = ref} | ||
|
||
module CvTerm = | ||
|
||
/// gets the name of the CvTerm | ||
let getName (cvTerm : CvTerm) = | ||
match cvTerm with | ||
| id, name, refUri -> name | ||
|
||
/// gets the name of the CvTerm | ||
let getId (cvTerm : CvTerm) = | ||
match cvTerm with | ||
| id, name, refUri -> id | ||
static member create( | ||
value: string | ||
) = | ||
CvTerm.create( | ||
value = value, | ||
accession = "", | ||
ref = "" | ||
) | ||
|
||
/// gets the source reference of the CvTerm | ||
let getRef (cvTerm : CvTerm) = | ||
match cvTerm with | ||
| id, name, refUri -> refUri | ||
|
||
/// creates a CvTerm from name | ||
let fromName (name : string) : CvTerm= | ||
"", name, "" | ||
|
||
/// creates a CvTerm from a term triplet | ||
let create id name ref : CvTerm = | ||
id,name,ref | ||
|
||
/// Represents a unit term from the unit ontology | ||
/// in the form of: id|accession * name * refUri | ||
// ?Maybe [<Struct>] | ||
type CvUnit = string * string * string | ||
type CvUnit = CvTerm |
Oops, something went wrong.