-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expand file tokenisation #53
Changes from 7 commits
5d22ada
d4bed3b
2d30573
26757d1
ae4af8f
d952ecf
16669aa
43ed75d
1037fb0
a384133
d09ff31
f3df422
6519f26
9c643e1
14000b8
0831fd5
ddce451
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ open ControlledVocabulary | |
open FsSpreadsheet | ||
open MetadataSheet | ||
open ARCTokenization.Terms | ||
open ARCtrl | ||
open ARCtrl.ISA | ||
|
||
module Tokenization = | ||
|
@@ -158,3 +159,40 @@ module Tokenization = | |
at.Columns | ||
|> Array.map CompositeColumn.tokenize | ||
|> List.ofArray | ||
|
||
module SpecificTokens = | ||
kMutagene marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rename SpecificTokens -> ArcFileSystem |
||
|
||
/// Represents the type of file system entity (Directory or File) | ||
type PType = | ||
| File | ||
| Directory | ||
|
||
/// Matches a CvParam based on the relative path and file system type | ||
let matchFileSystemTokenByRelativePath (pType:PType) (relativePath: string) = | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rename |
||
match pType with | ||
| PType.Directory -> | ||
match (relativePath.Split '/') with | ||
| [|Path.StudiesFolderName|] -> StructuralOntology.AFSO.``Studies Directory`` |> fun t -> CvParam(t,relativePath) | ||
| [|Path.StudiesFolderName; _|] -> StructuralOntology.AFSO.``Study Directory`` |> fun t -> CvParam(t,relativePath) | ||
| [|Path.AssaysFolderName|] -> StructuralOntology.AFSO.``Assays Directory`` |> fun t -> CvParam(t,relativePath) | ||
| [|Path.AssaysFolderName; _|] -> StructuralOntology.AFSO.``Assay Directory`` |> fun t -> CvParam(t,relativePath) | ||
| [|Path.RunsFolderName|] -> StructuralOntology.AFSO.``Runs Directory`` |> fun t -> CvParam(t,relativePath) | ||
| [|Path.RunsFolderName; _|] -> StructuralOntology.AFSO.``Run Directory`` |> fun t -> CvParam(t,relativePath) | ||
| [|Path.WorkflowsFolderName|] -> StructuralOntology.AFSO.``Workflows Directory`` |> fun t -> CvParam(t,relativePath) | ||
| [|Path.WorkflowsFolderName; _|] -> StructuralOntology.AFSO.``Study Directory`` |> fun t -> CvParam(t,relativePath) | ||
| _ -> StructuralOntology.AFSO.``Directory Path`` |> fun t -> CvParam(t,relativePath) | ||
| PType.File -> | ||
match relativePath with | ||
| _ when relativePath.EndsWith "isa.investigation.xlsx" -> StructuralOntology.AFSO.``Investigation File`` |> fun t -> CvParam(t,relativePath) | ||
| _ when relativePath.EndsWith "isa.assay.xlsx" -> StructuralOntology.AFSO.``Assay File`` |> fun t -> CvParam(t,relativePath) | ||
| _ when relativePath.EndsWith "isa.dataset.xlsx" -> StructuralOntology.AFSO.``Dataset File`` |> fun t -> CvParam(t,relativePath) | ||
| _ when relativePath.EndsWith "isa.study.xlsx" -> StructuralOntology.AFSO.``Study File`` |> fun t -> CvParam(t,relativePath) | ||
| _ when relativePath.EndsWith ".yml" -> StructuralOntology.AFSO.``YML File`` |> fun t -> CvParam(t,relativePath) | ||
| _ when relativePath.EndsWith ".cwl" -> StructuralOntology.AFSO.``CWL File`` |> fun t -> CvParam(t,relativePath) | ||
| _ -> StructuralOntology.AFSO.``File Path`` |> fun t -> CvParam(t,relativePath) | ||
|
||
/// Gets CvParams based on the root path, file system type, and full path | ||
let getSpecificTokens (rootPath:string) (pType:PType) (path:string) = | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rename |
||
let relativePath = path.Replace(rootPath,"") | ||
matchFileSystemTokenByRelativePath pType relativePath | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,126 @@ | ||
!This file was auto generated on 2024-01-10. Do not edit it. All manual changes will be overwritten by the next generator run eventually. | ||
format-version: 1.2 | ||
data-version: init/2023-10-26 | ||
saved-by: Kevin Schneider | ||
default-namespace: afso | ||
ontology: AFSO | ||
|
||
[Term] | ||
id: AFSO:00000001 | ||
name: File | ||
def: "" | ||
|
||
[Term] | ||
id: AFSO:00000002 | ||
name: Directory | ||
def: "" | ||
|
||
[Term] | ||
id: AFSO:00000003 | ||
name: File Type | ||
def: "" | ||
|
||
[Term] | ||
id: AFSO:00000004 | ||
name: Extension | ||
def: "" | ||
|
||
[Term] | ||
id: AFSO:00000005 | ||
name: File Name | ||
def: "" | ||
|
||
[Term] | ||
id: AFSO:00000006 | ||
name: Directory Name | ||
def: "" | ||
|
||
[Term] | ||
id: AFSO:00000007 | ||
name: Full Name | ||
def: "" | ||
|
||
[Term] | ||
id: AFSO:00000008 | ||
name: Path | ||
def: "" | ||
|
||
[Term] | ||
id: AFSO:00000009 | ||
name: File Path | ||
def: "" | ||
|
||
[Term] | ||
id: AFSO:00000010 | ||
name: Directory Path | ||
def: "" | ||
!This file was auto generated on 26.02.2024. Do not edit it. All manual changes will be overwritten by the next generator run eventually. | ||
format-version: 1.2 | ||
data-version: init/2023-10-26 | ||
saved-by: Kevin Schneider | ||
default-namespace: afso | ||
ontology: AFSO | ||
|
||
[Term] | ||
id: AFSO:00000001 | ||
name: File | ||
def: "" | ||
|
||
[Term] | ||
id: AFSO:00000002 | ||
name: Directory | ||
def: "" | ||
|
||
[Term] | ||
id: AFSO:00000003 | ||
name: File Type | ||
def: "" | ||
|
||
[Term] | ||
id: AFSO:00000004 | ||
name: Extension | ||
def: "" | ||
|
||
[Term] | ||
id: AFSO:00000005 | ||
name: File Name | ||
def: "" | ||
|
||
[Term] | ||
id: AFSO:00000006 | ||
name: Directory Name | ||
def: "" | ||
|
||
[Term] | ||
id: AFSO:00000007 | ||
name: Full Name | ||
def: "" | ||
|
||
[Term] | ||
id: AFSO:00000008 | ||
name: Path | ||
def: "" | ||
|
||
[Term] | ||
id: AFSO:00000009 | ||
name: File Path | ||
def: "" | ||
|
||
[Term] | ||
id: AFSO:00000010 | ||
name: Directory Path | ||
def: "" | ||
|
||
[Term] | ||
id: AFSO:00000011 | ||
name: Studies Directory | ||
def: "" | ||
|
||
[Term] | ||
id: AFSO:00000012 | ||
name: Assays Directory | ||
def: "" | ||
|
||
[Term] | ||
id: AFSO:00000013 | ||
name: Runs Directory | ||
def: "" | ||
|
||
[Term] | ||
id: AFSO:00000014 | ||
name: Workflows Directory | ||
def: "" | ||
|
||
[Term] | ||
id: AFSO:00000015 | ||
name: Study Directory | ||
def: "" | ||
|
||
[Term] | ||
id: AFSO:00000016 | ||
name: Assay Directory | ||
def: "" | ||
|
||
[Term] | ||
id: AFSO:00000017 | ||
name: Run Directory | ||
def: "" | ||
|
||
[Term] | ||
id: AFSO:00000018 | ||
name: Workflow Directory | ||
def: "" | ||
|
||
[Term] | ||
id: AFSO:00000019 | ||
name: Investigation File | ||
def: "" | ||
|
||
[Term] | ||
id: AFSO:00000020 | ||
name: Study File | ||
def: "" | ||
|
||
[Term] | ||
id: AFSO:00000021 | ||
name: Assay File | ||
def: "" | ||
|
||
[Term] | ||
id: AFSO:00000022 | ||
name: Dataset File | ||
def: "" | ||
|
||
[Term] | ||
id: AFSO:00000023 | ||
name: CWL File | ||
def: "" | ||
|
||
[Term] | ||
id: AFSO:00000024 | ||
name: YML File | ||
def: "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use
internal
instead ofprivate