-
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
Code generation #56
Code generation #56
Changes from all commits
11aecd7
52aca72
719144d
ade2f21
8c49196
acc94c0
610ded6
e63c9fa
f820d7e
b54dce7
2fe08ad
b74dba5
ae61785
5006731
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 |
---|---|---|
@@ -1,106 +1,107 @@ | ||
 | ||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.0.31903.59 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{2EB71559-9BE4-4E02-9763-9092876D1E4A}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sln", "sln", "{CE1B84FD-33DE-48E4-A97A-A4BDC34E08F0}" | ||
ProjectSection(SolutionItems) = preProject | ||
.gitignore = .gitignore | ||
.github\workflows\build-and-test.yml = .github\workflows\build-and-test.yml | ||
build.cmd = build.cmd | ||
build.sh = build.sh | ||
global.json = global.json | ||
LICENSE = LICENSE | ||
package.json = package.json | ||
playground.fsx = playground.fsx | ||
.github\workflows\publish-docs.yml = .github\workflows\publish-docs.yml | ||
README.md = README.md | ||
RELEASE_NOTES.md = RELEASE_NOTES.md | ||
EndProjectSection | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{67DA0DCC-75F4-4F30-91C3-309A48B13D49}" | ||
EndProject | ||
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "ControlledVocabulary", "src\ControlledVocabulary\ControlledVocabulary.fsproj", "{F8E5EFC0-C74B-4C3C-BC22-7A5286A31DF6}" | ||
EndProject | ||
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "ControlledVocabulary.Tests", "tests\ControlledVocabulary.Tests\ControlledVocabulary.Tests.fsproj", "{2CBEE59D-07E4-460E-8B97-9267965D3F46}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{3DB2A5F4-23F6-4A06-9AE5-CEAC0707735B}" | ||
ProjectSection(SolutionItems) = preProject | ||
build.cmd = build.cmd | ||
build.sh = build.sh | ||
global.json = global.json | ||
EndProjectSection | ||
EndProject | ||
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Build", "build\Build.fsproj", "{ED24D0E3-BA79-4F6D-9A30-D05FF4EBAFDB}" | ||
EndProject | ||
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "ARCTokenization", "src\ARCTokenization\ARCTokenization.fsproj", "{24D99DC2-DF18-45A3-B444-B60351F131DB}" | ||
EndProject | ||
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "ARCTokenization.Tests", "tests\ARCTokenization.Tests\ARCTokenization.Tests.fsproj", "{30177EF1-3980-4FFE-9B49-90B75DCEBDA3}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{551D4715-5ECD-4CAB-8A4A-41E246F4A7B5}" | ||
ProjectSection(SolutionItems) = preProject | ||
docs\index.ipynb = docs\index.ipynb | ||
EndProjectSection | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ARCTokenization", "ARCTokenization", "{699C5B9A-EA4B-4D25-B05D-16CA14320CFB}" | ||
ProjectSection(SolutionItems) = preProject | ||
docs\ARCTokenization\Introduction.ipynb = docs\ARCTokenization\Introduction.ipynb | ||
EndProjectSection | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ControlledVocabulary", "ControlledVocabulary", "{524F5156-C079-4AEF-822E-F01DAE6874AA}" | ||
ProjectSection(SolutionItems) = preProject | ||
docs\ControlledVocabulary\CvParam.ipynb = docs\ControlledVocabulary\CvParam.ipynb | ||
docs\ControlledVocabulary\Introduction.ipynb = docs\ControlledVocabulary\Introduction.ipynb | ||
EndProjectSection | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".ci", ".ci", "{4805A6D8-8D85-48F5-8902-57CECF872AE6}" | ||
ProjectSection(SolutionItems) = preProject | ||
.github\workflows\build-and-test.yml = .github\workflows\build-and-test.yml | ||
.github\workflows\publish-docs.yml = .github\workflows\publish-docs.yml | ||
EndProjectSection | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{F8E5EFC0-C74B-4C3C-BC22-7A5286A31DF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{F8E5EFC0-C74B-4C3C-BC22-7A5286A31DF6}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{F8E5EFC0-C74B-4C3C-BC22-7A5286A31DF6}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{F8E5EFC0-C74B-4C3C-BC22-7A5286A31DF6}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{2CBEE59D-07E4-460E-8B97-9267965D3F46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{2CBEE59D-07E4-460E-8B97-9267965D3F46}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{2CBEE59D-07E4-460E-8B97-9267965D3F46}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{2CBEE59D-07E4-460E-8B97-9267965D3F46}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{ED24D0E3-BA79-4F6D-9A30-D05FF4EBAFDB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{ED24D0E3-BA79-4F6D-9A30-D05FF4EBAFDB}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{ED24D0E3-BA79-4F6D-9A30-D05FF4EBAFDB}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{ED24D0E3-BA79-4F6D-9A30-D05FF4EBAFDB}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{24D99DC2-DF18-45A3-B444-B60351F131DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{24D99DC2-DF18-45A3-B444-B60351F131DB}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{24D99DC2-DF18-45A3-B444-B60351F131DB}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{24D99DC2-DF18-45A3-B444-B60351F131DB}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{30177EF1-3980-4FFE-9B49-90B75DCEBDA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{30177EF1-3980-4FFE-9B49-90B75DCEBDA3}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{30177EF1-3980-4FFE-9B49-90B75DCEBDA3}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{30177EF1-3980-4FFE-9B49-90B75DCEBDA3}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(NestedProjects) = preSolution | ||
{F8E5EFC0-C74B-4C3C-BC22-7A5286A31DF6} = {67DA0DCC-75F4-4F30-91C3-309A48B13D49} | ||
{2CBEE59D-07E4-460E-8B97-9267965D3F46} = {2EB71559-9BE4-4E02-9763-9092876D1E4A} | ||
{ED24D0E3-BA79-4F6D-9A30-D05FF4EBAFDB} = {3DB2A5F4-23F6-4A06-9AE5-CEAC0707735B} | ||
{24D99DC2-DF18-45A3-B444-B60351F131DB} = {67DA0DCC-75F4-4F30-91C3-309A48B13D49} | ||
{30177EF1-3980-4FFE-9B49-90B75DCEBDA3} = {2EB71559-9BE4-4E02-9763-9092876D1E4A} | ||
{699C5B9A-EA4B-4D25-B05D-16CA14320CFB} = {551D4715-5ECD-4CAB-8A4A-41E246F4A7B5} | ||
{524F5156-C079-4AEF-822E-F01DAE6874AA} = {551D4715-5ECD-4CAB-8A4A-41E246F4A7B5} | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {933E3470-7D09-4F22-A056-2407458B9600} | ||
EndGlobalSection | ||
EndGlobal | ||
 | ||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.0.31903.59 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{2EB71559-9BE4-4E02-9763-9092876D1E4A}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sln", "sln", "{CE1B84FD-33DE-48E4-A97A-A4BDC34E08F0}" | ||
ProjectSection(SolutionItems) = preProject | ||
.gitignore = .gitignore | ||
.github\workflows\build-and-test.yml = .github\workflows\build-and-test.yml | ||
build.cmd = build.cmd | ||
build.sh = build.sh | ||
global.json = global.json | ||
codeGenTestScript.fsx = codeGenTestScript.fsx | ||
LICENSE = LICENSE | ||
package.json = package.json | ||
playground.fsx = playground.fsx | ||
.github\workflows\publish-docs.yml = .github\workflows\publish-docs.yml | ||
README.md = README.md | ||
RELEASE_NOTES.md = RELEASE_NOTES.md | ||
EndProjectSection | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{67DA0DCC-75F4-4F30-91C3-309A48B13D49}" | ||
EndProject | ||
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "ControlledVocabulary", "src\ControlledVocabulary\ControlledVocabulary.fsproj", "{F8E5EFC0-C74B-4C3C-BC22-7A5286A31DF6}" | ||
EndProject | ||
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "ControlledVocabulary.Tests", "tests\ControlledVocabulary.Tests\ControlledVocabulary.Tests.fsproj", "{2CBEE59D-07E4-460E-8B97-9267965D3F46}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{3DB2A5F4-23F6-4A06-9AE5-CEAC0707735B}" | ||
ProjectSection(SolutionItems) = preProject | ||
build.cmd = build.cmd | ||
build.sh = build.sh | ||
global.json = global.json | ||
EndProjectSection | ||
EndProject | ||
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Build", "build\Build.fsproj", "{ED24D0E3-BA79-4F6D-9A30-D05FF4EBAFDB}" | ||
EndProject | ||
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "ARCTokenization", "src\ARCTokenization\ARCTokenization.fsproj", "{24D99DC2-DF18-45A3-B444-B60351F131DB}" | ||
EndProject | ||
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "ARCTokenization.Tests", "tests\ARCTokenization.Tests\ARCTokenization.Tests.fsproj", "{30177EF1-3980-4FFE-9B49-90B75DCEBDA3}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{551D4715-5ECD-4CAB-8A4A-41E246F4A7B5}" | ||
ProjectSection(SolutionItems) = preProject | ||
docs\index.ipynb = docs\index.ipynb | ||
EndProjectSection | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ARCTokenization", "ARCTokenization", "{699C5B9A-EA4B-4D25-B05D-16CA14320CFB}" | ||
ProjectSection(SolutionItems) = preProject | ||
docs\ARCTokenization\Introduction.ipynb = docs\ARCTokenization\Introduction.ipynb | ||
EndProjectSection | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ControlledVocabulary", "ControlledVocabulary", "{524F5156-C079-4AEF-822E-F01DAE6874AA}" | ||
ProjectSection(SolutionItems) = preProject | ||
docs\ControlledVocabulary\CvParam.ipynb = docs\ControlledVocabulary\CvParam.ipynb | ||
docs\ControlledVocabulary\Introduction.ipynb = docs\ControlledVocabulary\Introduction.ipynb | ||
EndProjectSection | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".ci", ".ci", "{4805A6D8-8D85-48F5-8902-57CECF872AE6}" | ||
ProjectSection(SolutionItems) = preProject | ||
.github\workflows\build-and-test.yml = .github\workflows\build-and-test.yml | ||
.github\workflows\publish-docs.yml = .github\workflows\publish-docs.yml | ||
EndProjectSection | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{F8E5EFC0-C74B-4C3C-BC22-7A5286A31DF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{F8E5EFC0-C74B-4C3C-BC22-7A5286A31DF6}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{F8E5EFC0-C74B-4C3C-BC22-7A5286A31DF6}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{F8E5EFC0-C74B-4C3C-BC22-7A5286A31DF6}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{2CBEE59D-07E4-460E-8B97-9267965D3F46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{2CBEE59D-07E4-460E-8B97-9267965D3F46}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{2CBEE59D-07E4-460E-8B97-9267965D3F46}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{2CBEE59D-07E4-460E-8B97-9267965D3F46}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{ED24D0E3-BA79-4F6D-9A30-D05FF4EBAFDB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{ED24D0E3-BA79-4F6D-9A30-D05FF4EBAFDB}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{ED24D0E3-BA79-4F6D-9A30-D05FF4EBAFDB}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{ED24D0E3-BA79-4F6D-9A30-D05FF4EBAFDB}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{24D99DC2-DF18-45A3-B444-B60351F131DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{24D99DC2-DF18-45A3-B444-B60351F131DB}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{24D99DC2-DF18-45A3-B444-B60351F131DB}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{24D99DC2-DF18-45A3-B444-B60351F131DB}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{30177EF1-3980-4FFE-9B49-90B75DCEBDA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{30177EF1-3980-4FFE-9B49-90B75DCEBDA3}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{30177EF1-3980-4FFE-9B49-90B75DCEBDA3}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{30177EF1-3980-4FFE-9B49-90B75DCEBDA3}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(NestedProjects) = preSolution | ||
{F8E5EFC0-C74B-4C3C-BC22-7A5286A31DF6} = {67DA0DCC-75F4-4F30-91C3-309A48B13D49} | ||
{2CBEE59D-07E4-460E-8B97-9267965D3F46} = {2EB71559-9BE4-4E02-9763-9092876D1E4A} | ||
{ED24D0E3-BA79-4F6D-9A30-D05FF4EBAFDB} = {3DB2A5F4-23F6-4A06-9AE5-CEAC0707735B} | ||
{24D99DC2-DF18-45A3-B444-B60351F131DB} = {67DA0DCC-75F4-4F30-91C3-309A48B13D49} | ||
{30177EF1-3980-4FFE-9B49-90B75DCEBDA3} = {2EB71559-9BE4-4E02-9763-9092876D1E4A} | ||
{699C5B9A-EA4B-4D25-B05D-16CA14320CFB} = {551D4715-5ECD-4CAB-8A4A-41E246F4A7B5} | ||
{524F5156-C079-4AEF-822E-F01DAE6874AA} = {551D4715-5ECD-4CAB-8A4A-41E246F4A7B5} | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {933E3470-7D09-4F22-A056-2407458B9600} | ||
EndGlobalSection | ||
EndGlobal |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#I "src/ControlledVocabulary/bin/Debug/netstandard2.0" | ||
#I "src/ControlledVocabulary/bin/Release/netstandard2.0" | ||
#r "ControlledVocabulary.dll" | ||
#I "src/ARCTokenization/bin/Debug/netstandard2.0" | ||
#I "src/ARCTokenization/bin/Release/netstandard2.0" | ||
#r "ARCTokenization.dll" | ||
|
||
#r "nuget: OBO.NET" | ||
#r "nuget: FSharpAux" | ||
|
||
|
||
open ControlledVocabulary | ||
open ARCTokenization | ||
open OBO.NET | ||
open FSharpAux | ||
|
||
|
||
[<Literal>] | ||
let baseString = """module INVSMO = | ||
|
||
""" | ||
|
||
let onto = OboOntology.fromFile false @"C:\Repos\nfdi4plants\ARCTokenization\src\ARCTokenization\structural_ontologies\investigation_metadata_structural_ontology.obo" | ||
|
||
let toUnderscoredName (term : OboTerm) = | ||
term.Name | ||
|> String.replace " " "_" | ||
|
||
let toTermSourceRef (term : OboTerm) = | ||
term.Id | ||
|> String.takeWhile ((<>) ':') | ||
|
||
let toCodeString (term : OboTerm) = | ||
$" let {toUnderscoredName term} = CvTerm.create(\"{term.Id}\", \"{term.Name}\", \"{toTermSourceRef term}\"){System.Environment.NewLine}{System.Environment.NewLine}" | ||
|
||
toCodeString onto.Terms.Head | ||
|
||
let toSourceCode (onto : OboOntology) = | ||
let concattedSingleValues = String.init onto.Terms.Length (fun i -> $"{toCodeString onto.Terms[i]}") | ||
$"{baseString}{concattedSingleValues}" | ||
|
||
toSourceCode onto | ||
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. Please stop committing test scripts to repos. Pls refactor anything relevant to actual unit tests or do not commit it at all. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#r "nuget: FSharpAux" | ||
//#r "nuget: FsOboParser" | ||
#r "nuget: OBO.NET" | ||
#r "nuget: FsSpreadsheet.ExcelIO, 4.1.0" | ||
|
||
|
@@ -11,7 +12,9 @@ | |
|
||
open FsSpreadsheet | ||
open FsSpreadsheet.ExcelIO | ||
//open FsOboParser | ||
open OBO.NET | ||
//open FsSpreadsheet.DSL | ||
open ControlledVocabulary | ||
open type ControlledVocabulary.ParamBase | ||
open ARCTokenization | ||
|
@@ -47,6 +50,12 @@ let its = Investigation.parseMetadataSheetsFromTokens() afts | |
|
||
|
||
|
||
|
||
let ot = List.head Terms.InvestigationMetadata.ontology.Terms | ||
|
||
ARCTokenization.StructuralOntology.CodeGeneration.toCodeString ot | ||
CodeGeneration.toSourceCode "Investigation" Terms.InvestigationMetadata.ontology | ||
|
||
System.IO.Directory.GetCurrentDirectory() | ||
let fakePath = CvParam(cvTerm = AFSO.``File Path``, v = System.IO.Directory.GetCurrentDirectory() + "/tests/ARCTokenization.Tests/Fixtures/correct/investigation_simple.xlsx") | ||
|
||
|
@@ -124,7 +133,7 @@ let expectedTermValuesSimple = | |
[""] | ||
[""] | ||
[""] | ||
[""; "Maus"; "Keider"; "müller"; "oih"] | ||
[""; "Maus"; "Keider"; "müller"; "oih"] | ||
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. you seriously need to fix your encoding problems 😆 |
||
[""; "Oliver"; "andreas"] | ||
[""; "L. I."; "C."] | ||
[""; "[email protected]"] | ||
|
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.
While it seems to work, i really do not like this circular dependency, where the build project is dependent on one of the projects it is supposed to build.