-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement first POC of ISA ROCrate profile
- Loading branch information
Showing
16 changed files
with
854 additions
and
139 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace ARCtrl.ROCrate | ||
|
||
/// Base interface implemented by all explicitly known objects in our ROCrate profiles. | ||
type IROCrateObject = | ||
abstract member SchemaType : string | ||
abstract member Id: string | ||
abstract member AdditionalType: string option |
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
namespace ARCtrl.ROCrate | ||
|
||
open DynamicObj | ||
open Fable.Core | ||
|
||
/// | ||
[<AttachMembers>] | ||
type Assay(id: string) = | ||
// inheritance | ||
inherit Dataset(id, "Assay") | ||
static member create( | ||
// mandatory | ||
id, | ||
// Properties from Thing | ||
identifier, | ||
// optional | ||
// Properties from CreativeWork | ||
// Properties from Dataset | ||
?measurementMethod, | ||
?measurementTechnique, | ||
?variableMeasured, | ||
// Properties from CreativeWork | ||
?about, | ||
?comment, | ||
?creator, | ||
?hasPart, | ||
?url | ||
) = | ||
let ds = Assay(id = id) | ||
|
||
// Properties from Dataset | ||
DynObj.setValueOpt ds (nameof measurementMethod) measurementMethod | ||
DynObj.setValueOpt ds (nameof measurementTechnique) measurementTechnique | ||
DynObj.setValueOpt ds (nameof variableMeasured) variableMeasured | ||
|
||
// Properties from CreativeWork | ||
DynObj.setValueOpt ds (nameof about) about | ||
DynObj.setValueOpt ds (nameof comment) comment | ||
DynObj.setValueOpt ds (nameof creator) creator | ||
DynObj.setValueOpt ds (nameof hasPart) hasPart | ||
DynObj.setValueOpt ds (nameof url) url | ||
|
||
// Properties from Thing | ||
DynObj.setValue ds (nameof identifier) identifier | ||
|
||
ds |
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
namespace ARCtrl.ROCrate | ||
|
||
open DynamicObj | ||
open Fable.Core | ||
|
||
/// | ||
[<AttachMembers>] | ||
type Data(id: string, ?additionalType: string) = | ||
inherit DynamicObj() | ||
|
||
let mutable _schemaType = "schema.org/MediaObject" | ||
let mutable _additionalType = additionalType | ||
|
||
member this.Id | ||
with get() = id | ||
|
||
member this.SchemaType | ||
with get() = _schemaType | ||
and set(value) = _schemaType <- value | ||
|
||
member this.AdditionalType | ||
with get() = _additionalType | ||
and set(value) = _additionalType <- value | ||
|
||
//interface implementations | ||
interface IROCrateObject with | ||
member this.Id with get () = this.Id | ||
member this.SchemaType with get (): string = this.SchemaType | ||
member this.AdditionalType with get (): string option = this.AdditionalType | ||
|
||
static member create( | ||
// mandatory | ||
id, | ||
name, | ||
?comment, | ||
?encodingFormat, | ||
?disambiguatingDescription | ||
) = | ||
let d = Data(id) | ||
|
||
DynObj.setValue d (nameof name) name | ||
|
||
DynObj.setValueOpt d (nameof comment) comment | ||
DynObj.setValueOpt d (nameof encodingFormat) encodingFormat | ||
DynObj.setValueOpt d (nameof disambiguatingDescription) disambiguatingDescription | ||
|
||
d |
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
namespace ARCtrl.ROCrate | ||
|
||
open DynamicObj | ||
open Fable.Core | ||
|
||
/// | ||
[<AttachMembers>] | ||
type Dataset (id: string, ?additionalType: string) = | ||
inherit DynamicObj() | ||
|
||
let mutable _schemaType = "schema.org/Dataset" | ||
let mutable _additionalType = additionalType | ||
|
||
member this.Id | ||
with get() = id | ||
|
||
member this.SchemaType | ||
with get() = _schemaType | ||
and set(value) = _schemaType <- value | ||
|
||
member this.AdditionalType | ||
with get() = _additionalType | ||
and set(value) = _additionalType <- value | ||
|
||
//interface implementations | ||
interface IROCrateObject with | ||
member this.Id with get () = this.Id | ||
member this.SchemaType with get (): string = this.SchemaType | ||
member this.AdditionalType with get (): string option = this.AdditionalType |
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
namespace ARCtrl.ROCrate | ||
|
||
open DynamicObj | ||
open Fable.Core | ||
|
||
/// | ||
[<AttachMembers>] | ||
type Investigation(id: string) = | ||
|
||
inherit Dataset(id, "Investigation") | ||
|
||
static member create( | ||
id, | ||
// Properties from Thing | ||
identifier, | ||
// optional | ||
// Properties from CreativeWork | ||
?citation, | ||
?comment, | ||
?creator, | ||
?dateCreated, | ||
?dateModified, | ||
?datePublished, | ||
?hasPart, | ||
?headline, | ||
?mentions, | ||
?url, | ||
// Properties from Thing | ||
?description | ||
) = | ||
let ds = Investigation(id = id) | ||
|
||
// Properties from CreativeWork | ||
DynObj.setValueOpt ds (nameof citation) citation | ||
DynObj.setValueOpt ds (nameof comment) comment | ||
DynObj.setValueOpt ds (nameof creator) creator | ||
DynObj.setValueOpt ds (nameof dateCreated) dateCreated | ||
DynObj.setValueOpt ds (nameof dateModified) dateModified | ||
DynObj.setValueOpt ds (nameof datePublished) datePublished | ||
DynObj.setValueOpt ds (nameof hasPart) hasPart | ||
DynObj.setValueOpt ds (nameof headline) headline | ||
DynObj.setValueOpt ds (nameof mentions) mentions | ||
DynObj.setValueOpt ds (nameof url) url | ||
|
||
// Properties from Thing | ||
DynObj.setValueOpt ds (nameof description) description | ||
DynObj.setValue ds (nameof identifier) identifier | ||
|
||
ds |
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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
namespace ARCtrl.ROCrate | ||
|
||
open DynamicObj | ||
open Fable.Core | ||
|
||
/// | ||
[<AttachMembers>] | ||
type LabProcess(id: string, ?additionalType: string) = | ||
inherit DynamicObj() | ||
|
||
let mutable _schemaType = "bioschemas.org/LabProcess" | ||
let mutable _additionalType = additionalType | ||
|
||
member this.Id | ||
with get() = id | ||
|
||
member this.SchemaType | ||
with get() = _schemaType | ||
and set(value) = _schemaType <- value | ||
|
||
member this.AdditionalType | ||
with get() = _additionalType | ||
and set(value) = _additionalType <- value | ||
|
||
//interface implementations | ||
interface IROCrateObject with | ||
member this.Id with get () = this.Id | ||
member this.SchemaType with get (): string = this.SchemaType | ||
member this.AdditionalType with get (): string option = this.AdditionalType | ||
|
||
static member create( | ||
// mandatory | ||
id, | ||
name, | ||
agent, | ||
object, | ||
result, | ||
// optional | ||
?additionalType, | ||
?executesLabProtocol, | ||
?parameterValue, | ||
?endTime, | ||
?disambiguatingDescription | ||
) = | ||
let lp = LabProcess(id) | ||
|
||
DynObj.setValue lp (nameof name) name | ||
DynObj.setValue lp (nameof agent) agent | ||
DynObj.setValue lp (nameof object) object | ||
DynObj.setValue lp (nameof result) result | ||
|
||
DynObj.setValueOpt lp (nameof additionalType) additionalType | ||
DynObj.setValueOpt lp (nameof executesLabProtocol) executesLabProtocol | ||
DynObj.setValueOpt lp (nameof parameterValue) parameterValue | ||
DynObj.setValueOpt lp (nameof endTime) endTime | ||
DynObj.setValueOpt lp (nameof disambiguatingDescription) disambiguatingDescription | ||
|
||
lp |
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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
namespace ARCtrl.ROCrate | ||
|
||
open DynamicObj | ||
open Fable.Core | ||
|
||
/// | ||
[<AttachMembers>] | ||
type LabProtocol(id: string, ?additionalType: string) = | ||
inherit DynamicObj() | ||
|
||
let mutable _schemaType = "bioschemas.org/LabProtocol" | ||
let mutable _additionalType = additionalType | ||
|
||
member this.Id | ||
with get() = id | ||
|
||
member this.SchemaType | ||
with get() = _schemaType | ||
and set(value) = _schemaType <- value | ||
|
||
member this.AdditionalType | ||
with get() = _additionalType | ||
and set(value) = _additionalType <- value | ||
|
||
//interface implementations | ||
interface IROCrateObject with | ||
member this.Id with get () = this.Id | ||
member this.SchemaType with get (): string = this.SchemaType | ||
member this.AdditionalType with get (): string option = this.AdditionalType | ||
|
||
static member create( | ||
// mandatory | ||
id, | ||
?name, | ||
?intendedUse, | ||
?description, | ||
?url, | ||
?comment, | ||
?version, | ||
?labEquipment, | ||
?reagent, | ||
?computationalTool | ||
) = | ||
let lp = LabProcess(id) | ||
|
||
DynObj.setValueOpt lp (nameof name) name | ||
DynObj.setValueOpt lp (nameof intendedUse) intendedUse | ||
DynObj.setValueOpt lp (nameof description) description | ||
DynObj.setValueOpt lp (nameof url) url | ||
DynObj.setValueOpt lp (nameof comment) comment | ||
DynObj.setValueOpt lp (nameof version) version | ||
DynObj.setValueOpt lp (nameof labEquipment) labEquipment | ||
DynObj.setValueOpt lp (nameof reagent) reagent | ||
DynObj.setValueOpt lp (nameof computationalTool) computationalTool | ||
|
||
lp |
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 |
---|---|---|
@@ -0,0 +1,61 @@ | ||
namespace ARCtrl.ROCrate | ||
|
||
open DynamicObj | ||
open Fable.Core | ||
|
||
/// | ||
[<AttachMembers>] | ||
type Person(id: string, ?additionalType: string) = | ||
inherit DynamicObj() | ||
|
||
let mutable _schemaType = "schema.org/Person" | ||
let mutable _additionalType = additionalType | ||
|
||
member this.Id | ||
with get() = id | ||
|
||
member this.SchemaType | ||
with get() = _schemaType | ||
and set(value) = _schemaType <- value | ||
|
||
member this.AdditionalType | ||
with get() = _additionalType | ||
and set(value) = _additionalType <- value | ||
|
||
//interface implementations | ||
interface IROCrateObject with | ||
member this.Id with get () = this.Id | ||
member this.SchemaType with get (): string = this.SchemaType | ||
member this.AdditionalType with get (): string option = this.AdditionalType | ||
|
||
static member create( | ||
// mandatory | ||
id, | ||
givenName, | ||
?familyName, | ||
?email, | ||
?identifier, | ||
?affiliation, | ||
?jobTitle, | ||
?additionalName, | ||
?address, | ||
?telephone, | ||
?faxNumber, | ||
?disambiguatingDescription | ||
) = | ||
let p = Person(id) | ||
|
||
DynObj.setValue p (nameof givenName) givenName | ||
|
||
DynObj.setValueOpt p (nameof familyName) familyName | ||
DynObj.setValueOpt p (nameof email) email | ||
DynObj.setValueOpt p (nameof identifier) identifier | ||
DynObj.setValueOpt p (nameof affiliation) affiliation | ||
DynObj.setValueOpt p (nameof jobTitle) jobTitle | ||
DynObj.setValueOpt p (nameof additionalName) additionalName | ||
DynObj.setValueOpt p (nameof address) address | ||
DynObj.setValueOpt p (nameof telephone) telephone | ||
DynObj.setValueOpt p (nameof faxNumber) faxNumber | ||
DynObj.setValueOpt p (nameof disambiguatingDescription) disambiguatingDescription | ||
|
||
p |
Oops, something went wrong.