ARC
The core entity of ARCtrl is of course the ARC object. It’s an in-memory representation of an ARC Scaffold.
This class contains three properties:
ISAof typeARCInvestigationCWLFileSystemof typeFileSystem
The constructor takes these three values as inputs, but you can also initialize an empty ARC in memory.
open ARCtrl
let arc = ARC()import {ARC} from "@nfdi4plants/arctrl";
let arc = new ARC()from arctrl import ARC
arc = ARC()ARCtrl offers a variety of IO functionality to read and write ARCs.
The load function reads the ARC Scaffold representation for a given path.
open ARCtrl
let myArcPath = @"arcs/myARC/"
let arc = ARC.load(myArcPath)import {ARC} from "@nfdi4plants/arctrl";
let myArcPath = "arcs/myARC/"
ARC.loadAsync(myArcPath)from arctrl.arc import ARC
myArcPath = "arcs/myARC/"
arc = ARC.load(myArcPath)The write function writes the whole ARC as its Scaffold representation to a given path. It will overwrite all metadata files like isa.assay.xlsx and such.
open ARCtrl
let myArcPath = @"arcs/myARC/"
arc.Write(myArcPath)import {ARC} from "@nfdi4plants/arctrl";
let myArcPath = "arcs/myARC/"
arc.WriteAsync(myArcPath)from arctrl.arc import ARC
myArcPath = "arcs/myARC/"
arc.Write(myArcPath)The update function updates the ARC as its Scaffold representation to a given path.
It will only write those entities which have changed in the datamodel since the last load, write or update operation.
open ARCtrl
let myArcPath = @"arcs/myARC/"
arc.Update(myArcPath)import {ARC} from "@nfdi4plants/arctrl";
let myArcPath = "arcs/myARC/"
arc.UpdateAsync(myArcPath)from arctrl.arc import ARC
myArcPath = "arcs/myARC/"
arc.Update(myArcPath)ARCs can seemlessly be read from and parsed to their RO-Crate JSON-LD string representation:
let jsonString = arc.ToROCrateJsonString(spaces = 2)
let arc2 = ARC.fromROCrateJsonString(jsonString)let jsonString = arc.ToROCrateJsonString(2)
let arc2 = ARC.fromROCrateJsonString(jsonString)jsonString = arc.ToROCrateJsonString(spaces = 2)
arc2 = ARC.from_rocrate_json_string(jsonString)