SlideShare uma empresa Scribd logo
1 de 2
Baixar para ler offline
IRODS Cheat Sheet (version 3+) 
Version 0.9 by Samuel Lampa, BILS (bils.se) 
Contact author: samuel dot lampa at bils dot se 
Numeric Literals 
1 # integer 
1.0 # double 
Strings 
'A 'string', ' ++ "another ”string”" 
# Some valid escape characters: 
“n, r, t, , ', ", $, *" 
Boolean constants 
true # True 
false # False 
Boolean comparison 
! # Not 
&& # And 
|| # Or 
%% # Or used in the "##" syntax 
Arithmetic operators 
- # Negation 
^ # Power 
* # Multiplication 
/ # Division 
% # Modulors 
- # Subtraction 
+ # Addition 
Arithmetic comparison 
> # Greater than 
< # Less than 
>= # Greater than or equal 
<= # Less than or equal 
Arithmetic functions 
exp(<num>) 
log(<num>) 
abs(<num>) 
floor(<num>) # always returns integer 
ceiling(<num>) # always returns integer 
average(<num>, <num>, ...) 
max(<num>, <num>, ...) 
min(<num>, <num> , ...) 
String functions 
writeLine("stdout", "Hi!"); 
Prints out “Hi!.” 
"This “++”is”++” a string." 
Equals to “This is a string.” 
"This is a string." like "This is*" 
Equals to true 
"This is." like regex "Th.*is[.]" 
Equals to true 
substr("This is a string.", 0, 4) 
Output: This 
strlen("This is a string.") 
Output: 17 
split("This is a string.", " ") 
Equals to: [This,is,a,string.] 
writeLine("stdout", triml("This is a 
string.", " ")); 
Equals to: is a string. 
trimr("This is a string.", " ") 
Equals to: This is a 
List functions 
list(<elem>, <elem>, ...) 
Creates a new list, Ex: 
list("This","is","a","list") 
elem(<list>, <index>) 
Retrieves elements from a list (0-indexed). Ex: 
elem(list("This","is","a","list"),0) 
# returns “This” 
setelem(<list>, <index>, <value>) 
Updates an item in a list. Ex: 
setelem(list("A","list"),0,"My") 
# Evaluates to list("My","list"). 
size(<list>) 
Gives the size of a list. Ex: 
size(list("This","is","a","list")) 
# evaluates to 4. 
hd(<list>) 
Gives the head of a list, Ex: 
hd(list("This","is","a","list")) 
# Evaluates to "This" 
tl(<list>) 
Gives the tail of a list. Ex: 
tl(list("This","is","a","list")) 
# Evaluates to list("is","a","list") 
cons(<element>, <list>) 
Add elements to a list. Ex: 
cons("My",list("list")) 
# Evaluates to list("My","list"). 
Tuples 
Tuples are created like so: 
( <component>, ..., <component> ) 
If statements 
Logical if: 
if <expr> then { <actions> } 
else { <actions> } 
Logical if example: 
if (*A==1) then { true; } else { 
false; } 
Functional if (returning value of any type): 
if <expr> then <expr> else <expr> 
Functional if example: 
if true then 1 else 0 
if *A==1 then true else false 
The following abbreviation are allowed (the red 
striked part can be abbreviated) in functional ifs: 
if (...) then { ... } else { ... } 
if (...) then { ... } else { if (...) 
then {...} else {...} } 
Multiple abbreviations can be combined for 
example: 
if (*X==1) { *A = "Mon"; } 
else if (*X==2) {*A = "Tue"; } 
else if (*X==3) {*A = "Wed"; } 
Foreach loops 
Without iterator: 
foreach(*C) { 
writeLine("stdout", *C); 
} 
With the iterator variable (*E in this case): 
foreach(*E in *C) { 
writeLine("stdout", *E); 
}
Defining functions 
Functions can be thought of as microservices written 
in the rule language and are defined like this: 
<name>(<param>, ..., <param>) = <expr> 
Example: 
square(*n) = *n * *n 
Variables in functions: The let expression 
As function definitions are based on expressions 
rather than action sequences, we cannot put an 
assignment directly inside an expression. For 
example, the following is not a valid function 
definition: 
quad(*n) = *t = *n * *n; *t * *t 
To solve this problem, the let expression provides 
scoped values in an expression. The general syntax for 
the let expression is: 
let <assignment> in <expr> 
For example: 
quad(*n) = let *t = *n * *n in *t * *t 
The variable on the left hand side of the assignment in 
the let expression is a let-bound variable. The scope of 
such a variable is within the let expression. A let 
bound variable should not be reassigned inside the let 
expression. 
Defining Rules 
Define rules with nontrivial rule conditions like this: 
<name>(<param>, ..., <param>) { 
on(<condition>) { <actions> } 
} 
The rule condition can be skipped for rules with trivial 
or non-existent conditions: 
<name>(<param>, ..., <param>) { 
<actions> 
} 
A rule can have multiple conditional expressions: 
<name>(<param>, ..., <param>) { 
on(<condition>) { <actions> } … 
on(<condition>) { <actions> } 
} 
Generating and Capturing Errors 
In a rule, we can also prevent the rule from failing 
when a microservice fails: 
errorcode(msi) 
The errormsg microservice captures the error 
message, allows further processing of the error 
message, and avoids the default logging of the error 
message, like so: 
errormsg(msi, *msg) 
In a rule, the fail() and failmsg() microservices can be 
used to generate errors. 
fail(errorcode) generates an error with an error code. 
Example: 
fail(-1) 
failmsg(<errorcode>, <errormsg>) generates an 
error with an error code and an error message. 
Example: 
failmsg(-1, "this is an error message") 
The msiExit microservice is similar to failmsg: 
msiExit("-1", "msi") 
Inductive Data Types 
The features discussed in this section are currently 
under development! 
An inductive data type is a data type for values that 
can be defined inductively, i.e. more complex values 
can be constructed from simpler values using 
constructors. General syntax: 
data <name> [ ( <type parameter 
list> ) ] = 
| : <data constructor type> 
… 
| <data constructor name> : <data 
constructor type> 
For example, a data type that represents the natural 
numbers can be defined as 
data nat = 
| zero : nat 
| succ : nat -> nat 
Here the type name defined is “nat.” The type 
parameter list is empty. If the type parameter list is 
empty, we may omit it. There are two data 
constructors. The first constructor “zero” has type 
“nat,” which means that “zero” is a nullary constructor 
of nat. We use “zero” to represent “0”. The second 
constructor “succ” has type “nat -> nat” which means 
that “succ” is unary constructor of nat. We use “succ” 
to represent the successor. With these two 
constructors we can represent all natural 
numbers: zero, succ(zero), succ(succ(zero)). 
Pattern matching 
If a data type has more than one data structure, then 
the "match" expression is useful: 
match <expr> with 
| <pattern> => <expr> 
… 
| <pattern> => <expr> 
For example, given the nat data type we defined 
earlier, we can define the following function using the 
match expression: 
add(*x, *y) = 
match *x with 
| zero => *y 
| succ(*z) => succ(add(*z, *y)) 
For another example, given the "tree" data type we 
defined earlier, we can define the following function 
size(*t) = 
match *t with 
| empty => 0 
| node(*v, *l, *r) => 1 + 
size(*l) + size(*r)

Mais conteúdo relacionado

Mais procurados

Mais procurados (19)

List in Python
List in PythonList in Python
List in Python
 
Python Workshop Part 2. LUG Maniapl
Python Workshop Part 2. LUG ManiaplPython Workshop Part 2. LUG Maniapl
Python Workshop Part 2. LUG Maniapl
 
Functions in python
Functions in pythonFunctions in python
Functions in python
 
Java: Introduction to Arrays
Java: Introduction to ArraysJava: Introduction to Arrays
Java: Introduction to Arrays
 
Introduction to python programming
Introduction to python programmingIntroduction to python programming
Introduction to python programming
 
Python Cheat Sheet
Python Cheat SheetPython Cheat Sheet
Python Cheat Sheet
 
[1062BPY12001] Data analysis with R / April 26
[1062BPY12001] Data analysis with R / April 26[1062BPY12001] Data analysis with R / April 26
[1062BPY12001] Data analysis with R / April 26
 
Arrays In Python | Python Array Operations | Edureka
Arrays In Python | Python Array Operations | EdurekaArrays In Python | Python Array Operations | Edureka
Arrays In Python | Python Array Operations | Edureka
 
Pytho_tuples
Pytho_tuplesPytho_tuples
Pytho_tuples
 
Arrays in java
Arrays in javaArrays in java
Arrays in java
 
Lists
ListsLists
Lists
 
Array Introduction One-dimensional array Multidimensional array
Array Introduction One-dimensional array Multidimensional arrayArray Introduction One-dimensional array Multidimensional array
Array Introduction One-dimensional array Multidimensional array
 
Pytho dictionaries
Pytho dictionaries Pytho dictionaries
Pytho dictionaries
 
Arrays in python
Arrays in pythonArrays in python
Arrays in python
 
Python3 cheatsheet
Python3 cheatsheetPython3 cheatsheet
Python3 cheatsheet
 
Python programming Part -6
Python programming Part -6Python programming Part -6
Python programming Part -6
 
1 D Arrays in C++
1 D Arrays in C++1 D Arrays in C++
1 D Arrays in C++
 
Python Variable Types, List, Tuple, Dictionary
Python Variable Types, List, Tuple, DictionaryPython Variable Types, List, Tuple, Dictionary
Python Variable Types, List, Tuple, Dictionary
 
Arrays
ArraysArrays
Arrays
 

Destaque

2nd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse
2nd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse2nd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse
2nd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in BioclipseSamuel Lampa
 
Hooking up Semantic MediaWiki with external tools via SPARQL
Hooking up Semantic MediaWiki with external tools via SPARQLHooking up Semantic MediaWiki with external tools via SPARQL
Hooking up Semantic MediaWiki with external tools via SPARQLSamuel Lampa
 
SciPipe - A light-weight workflow library inspired by flow-based programming
SciPipe - A light-weight workflow library inspired by flow-based programmingSciPipe - A light-weight workflow library inspired by flow-based programming
SciPipe - A light-weight workflow library inspired by flow-based programmingSamuel Lampa
 
The RDFIO Extension - A Status update
The RDFIO Extension - A Status updateThe RDFIO Extension - A Status update
The RDFIO Extension - A Status updateSamuel Lampa
 
Continuous modeling - automating model building on high-performance e-Infrast...
Continuous modeling - automating model building on high-performance e-Infrast...Continuous modeling - automating model building on high-performance e-Infrast...
Continuous modeling - automating model building on high-performance e-Infrast...Ola Spjuth
 
Python Generators - Talk at PySthlm meetup #15
Python Generators - Talk at PySthlm meetup #15Python Generators - Talk at PySthlm meetup #15
Python Generators - Talk at PySthlm meetup #15Samuel Lampa
 
NAGARA: SRB and iRODS
NAGARA: SRB and iRODSNAGARA: SRB and iRODS
NAGARA: SRB and iRODSMark Conrad
 
Green Shoots: Research Data Management Pilot at Imperial College London
Green Shoots:Research Data Management Pilot at Imperial College LondonGreen Shoots:Research Data Management Pilot at Imperial College London
Green Shoots: Research Data Management Pilot at Imperial College LondonTorsten Reimer
 
Thesis presentation Samuel Lampa
Thesis presentation Samuel LampaThesis presentation Samuel Lampa
Thesis presentation Samuel LampaSamuel Lampa
 
Research Data Management en bibliotheken
Research Data Management en bibliothekenResearch Data Management en bibliotheken
Research Data Management en bibliothekenSaskia Scheltjens
 
iRODS/Dataverse Project by Jonathan Crabtree
iRODS/Dataverse Project by Jonathan CrabtreeiRODS/Dataverse Project by Jonathan Crabtree
iRODS/Dataverse Project by Jonathan Crabtreedatascienceiqss
 
Data Management for Grown Ups
Data Management for Grown UpsData Management for Grown Ups
Data Management for Grown UpsAll Things Open
 
iRODS User Group Meeting 2016 - MUMC+
iRODS User Group Meeting 2016 - MUMC+iRODS User Group Meeting 2016 - MUMC+
iRODS User Group Meeting 2016 - MUMC+Maarten Coonen
 
Agile large-scale machine-learning pipelines in drug discovery
Agile large-scale machine-learning pipelines in drug discoveryAgile large-scale machine-learning pipelines in drug discovery
Agile large-scale machine-learning pipelines in drug discoveryOla Spjuth
 
Batch import of large RDF datasets into Semantic MediaWiki
Batch import of large RDF datasets into Semantic MediaWikiBatch import of large RDF datasets into Semantic MediaWiki
Batch import of large RDF datasets into Semantic MediaWikiSamuel Lampa
 
Access HDF-EOS data with OGC Web Coverage Service - Earth Observation Applica...
Access HDF-EOS data with OGC Web Coverage Service - Earth Observation Applica...Access HDF-EOS data with OGC Web Coverage Service - Earth Observation Applica...
Access HDF-EOS data with OGC Web Coverage Service - Earth Observation Applica...The HDF-EOS Tools and Information Center
 

Destaque (20)

2nd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse
2nd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse2nd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse
2nd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse
 
Hooking up Semantic MediaWiki with external tools via SPARQL
Hooking up Semantic MediaWiki with external tools via SPARQLHooking up Semantic MediaWiki with external tools via SPARQL
Hooking up Semantic MediaWiki with external tools via SPARQL
 
SciPipe - A light-weight workflow library inspired by flow-based programming
SciPipe - A light-weight workflow library inspired by flow-based programmingSciPipe - A light-weight workflow library inspired by flow-based programming
SciPipe - A light-weight workflow library inspired by flow-based programming
 
The RDFIO Extension - A Status update
The RDFIO Extension - A Status updateThe RDFIO Extension - A Status update
The RDFIO Extension - A Status update
 
Continuous modeling - automating model building on high-performance e-Infrast...
Continuous modeling - automating model building on high-performance e-Infrast...Continuous modeling - automating model building on high-performance e-Infrast...
Continuous modeling - automating model building on high-performance e-Infrast...
 
Python Generators - Talk at PySthlm meetup #15
Python Generators - Talk at PySthlm meetup #15Python Generators - Talk at PySthlm meetup #15
Python Generators - Talk at PySthlm meetup #15
 
NAGARA: SRB and iRODS
NAGARA: SRB and iRODSNAGARA: SRB and iRODS
NAGARA: SRB and iRODS
 
Green Shoots: Research Data Management Pilot at Imperial College London
Green Shoots:Research Data Management Pilot at Imperial College LondonGreen Shoots:Research Data Management Pilot at Imperial College London
Green Shoots: Research Data Management Pilot at Imperial College London
 
Thesis presentation Samuel Lampa
Thesis presentation Samuel LampaThesis presentation Samuel Lampa
Thesis presentation Samuel Lampa
 
Research Data Management en bibliotheken
Research Data Management en bibliothekenResearch Data Management en bibliotheken
Research Data Management en bibliotheken
 
iRODS/Dataverse Project by Jonathan Crabtree
iRODS/Dataverse Project by Jonathan CrabtreeiRODS/Dataverse Project by Jonathan Crabtree
iRODS/Dataverse Project by Jonathan Crabtree
 
Data Management for Grown Ups
Data Management for Grown UpsData Management for Grown Ups
Data Management for Grown Ups
 
UDT
UDTUDT
UDT
 
ODSC and iRODS
ODSC and iRODSODSC and iRODS
ODSC and iRODS
 
iRODS User Group Meeting 2016 - MUMC+
iRODS User Group Meeting 2016 - MUMC+iRODS User Group Meeting 2016 - MUMC+
iRODS User Group Meeting 2016 - MUMC+
 
Agile large-scale machine-learning pipelines in drug discovery
Agile large-scale machine-learning pipelines in drug discoveryAgile large-scale machine-learning pipelines in drug discovery
Agile large-scale machine-learning pipelines in drug discovery
 
Batch import of large RDF datasets into Semantic MediaWiki
Batch import of large RDF datasets into Semantic MediaWikiBatch import of large RDF datasets into Semantic MediaWiki
Batch import of large RDF datasets into Semantic MediaWiki
 
HDF5 iRODS
HDF5 iRODSHDF5 iRODS
HDF5 iRODS
 
Access HDF-EOS data with OGC Web Coverage Service - Earth Observation Applica...
Access HDF-EOS data with OGC Web Coverage Service - Earth Observation Applica...Access HDF-EOS data with OGC Web Coverage Service - Earth Observation Applica...
Access HDF-EOS data with OGC Web Coverage Service - Earth Observation Applica...
 
iRODS: Interoperability in Data Management
iRODS: Interoperability in Data ManagementiRODS: Interoperability in Data Management
iRODS: Interoperability in Data Management
 

Semelhante a IRODS Cheat Sheet

The Ring programming language version 1.7 book - Part 26 of 196
The Ring programming language version 1.7 book - Part 26 of 196The Ring programming language version 1.7 book - Part 26 of 196
The Ring programming language version 1.7 book - Part 26 of 196Mahmoud Samir Fayed
 
Python programming workshop
Python programming workshopPython programming workshop
Python programming workshopBAINIDA
 
The Ring programming language version 1.5.4 book - Part 23 of 185
The Ring programming language version 1.5.4 book - Part 23 of 185The Ring programming language version 1.5.4 book - Part 23 of 185
The Ring programming language version 1.5.4 book - Part 23 of 185Mahmoud Samir Fayed
 
The Ring programming language version 1.5.2 book - Part 22 of 181
The Ring programming language version 1.5.2 book - Part 22 of 181The Ring programming language version 1.5.2 book - Part 22 of 181
The Ring programming language version 1.5.2 book - Part 22 of 181Mahmoud Samir Fayed
 
Functions In Scala
Functions In Scala Functions In Scala
Functions In Scala Knoldus Inc.
 
The Ring programming language version 1.3 book - Part 14 of 88
The Ring programming language version 1.3 book - Part 14 of 88The Ring programming language version 1.3 book - Part 14 of 88
The Ring programming language version 1.3 book - Part 14 of 88Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 31 of 212
The Ring programming language version 1.10 book - Part 31 of 212The Ring programming language version 1.10 book - Part 31 of 212
The Ring programming language version 1.10 book - Part 31 of 212Mahmoud Samir Fayed
 
JBUG 11 - Scala For Java Programmers
JBUG 11 - Scala For Java ProgrammersJBUG 11 - Scala For Java Programmers
JBUG 11 - Scala For Java ProgrammersTikal Knowledge
 
The Ring programming language version 1.8 book - Part 94 of 202
The Ring programming language version 1.8 book - Part 94 of 202The Ring programming language version 1.8 book - Part 94 of 202
The Ring programming language version 1.8 book - Part 94 of 202Mahmoud Samir Fayed
 
C++11 - A Change in Style - v2.0
C++11 - A Change in Style - v2.0C++11 - A Change in Style - v2.0
C++11 - A Change in Style - v2.0Yaser Zhian
 
The Ring programming language version 1.9 book - Part 31 of 210
The Ring programming language version 1.9 book - Part 31 of 210The Ring programming language version 1.9 book - Part 31 of 210
The Ring programming language version 1.9 book - Part 31 of 210Mahmoud Samir Fayed
 
The Ring programming language version 1.8 book - Part 29 of 202
The Ring programming language version 1.8 book - Part 29 of 202The Ring programming language version 1.8 book - Part 29 of 202
The Ring programming language version 1.8 book - Part 29 of 202Mahmoud Samir Fayed
 
The Ring programming language version 1.7 book - Part 25 of 196
The Ring programming language version 1.7 book - Part 25 of 196The Ring programming language version 1.7 book - Part 25 of 196
The Ring programming language version 1.7 book - Part 25 of 196Mahmoud Samir Fayed
 
The Ring programming language version 1.5.1 book - Part 21 of 180
The Ring programming language version 1.5.1 book - Part 21 of 180The Ring programming language version 1.5.1 book - Part 21 of 180
The Ring programming language version 1.5.1 book - Part 21 of 180Mahmoud Samir Fayed
 
Java script introducation & basics
Java script introducation & basicsJava script introducation & basics
Java script introducation & basicsH K
 

Semelhante a IRODS Cheat Sheet (20)

The Ring programming language version 1.7 book - Part 26 of 196
The Ring programming language version 1.7 book - Part 26 of 196The Ring programming language version 1.7 book - Part 26 of 196
The Ring programming language version 1.7 book - Part 26 of 196
 
Python : Functions
Python : FunctionsPython : Functions
Python : Functions
 
Python programming workshop
Python programming workshopPython programming workshop
Python programming workshop
 
The Ring programming language version 1.5.4 book - Part 23 of 185
The Ring programming language version 1.5.4 book - Part 23 of 185The Ring programming language version 1.5.4 book - Part 23 of 185
The Ring programming language version 1.5.4 book - Part 23 of 185
 
The Ring programming language version 1.5.2 book - Part 22 of 181
The Ring programming language version 1.5.2 book - Part 22 of 181The Ring programming language version 1.5.2 book - Part 22 of 181
The Ring programming language version 1.5.2 book - Part 22 of 181
 
Functions In Scala
Functions In Scala Functions In Scala
Functions In Scala
 
R Basics
R BasicsR Basics
R Basics
 
Mysql1
Mysql1Mysql1
Mysql1
 
The Ring programming language version 1.3 book - Part 14 of 88
The Ring programming language version 1.3 book - Part 14 of 88The Ring programming language version 1.3 book - Part 14 of 88
The Ring programming language version 1.3 book - Part 14 of 88
 
The Ring programming language version 1.10 book - Part 31 of 212
The Ring programming language version 1.10 book - Part 31 of 212The Ring programming language version 1.10 book - Part 31 of 212
The Ring programming language version 1.10 book - Part 31 of 212
 
JBUG 11 - Scala For Java Programmers
JBUG 11 - Scala For Java ProgrammersJBUG 11 - Scala For Java Programmers
JBUG 11 - Scala For Java Programmers
 
The Ring programming language version 1.8 book - Part 94 of 202
The Ring programming language version 1.8 book - Part 94 of 202The Ring programming language version 1.8 book - Part 94 of 202
The Ring programming language version 1.8 book - Part 94 of 202
 
C++11 - A Change in Style - v2.0
C++11 - A Change in Style - v2.0C++11 - A Change in Style - v2.0
C++11 - A Change in Style - v2.0
 
The Ring programming language version 1.9 book - Part 31 of 210
The Ring programming language version 1.9 book - Part 31 of 210The Ring programming language version 1.9 book - Part 31 of 210
The Ring programming language version 1.9 book - Part 31 of 210
 
The Ring programming language version 1.8 book - Part 29 of 202
The Ring programming language version 1.8 book - Part 29 of 202The Ring programming language version 1.8 book - Part 29 of 202
The Ring programming language version 1.8 book - Part 29 of 202
 
bobok
bobokbobok
bobok
 
The Ring programming language version 1.7 book - Part 25 of 196
The Ring programming language version 1.7 book - Part 25 of 196The Ring programming language version 1.7 book - Part 25 of 196
The Ring programming language version 1.7 book - Part 25 of 196
 
The Ring programming language version 1.5.1 book - Part 21 of 180
The Ring programming language version 1.5.1 book - Part 21 of 180The Ring programming language version 1.5.1 book - Part 21 of 180
The Ring programming language version 1.5.1 book - Part 21 of 180
 
Java script introducation & basics
Java script introducation & basicsJava script introducation & basics
Java script introducation & basics
 
130717666736980000
130717666736980000130717666736980000
130717666736980000
 

Mais de Samuel Lampa

Using Flow-based programming to write tools and workflows for Scientific Comp...
Using Flow-based programming to write tools and workflows for Scientific Comp...Using Flow-based programming to write tools and workflows for Scientific Comp...
Using Flow-based programming to write tools and workflows for Scientific Comp...Samuel Lampa
 
Linked Data for improved organization of research data
Linked Data  for improved organization  of research dataLinked Data  for improved organization  of research data
Linked Data for improved organization of research dataSamuel Lampa
 
How to document computational research projects
How to document computational research projectsHow to document computational research projects
How to document computational research projectsSamuel Lampa
 
Reproducibility in Scientific Data Analysis - BioScience Seminar
Reproducibility in Scientific Data Analysis - BioScience SeminarReproducibility in Scientific Data Analysis - BioScience Seminar
Reproducibility in Scientific Data Analysis - BioScience SeminarSamuel Lampa
 
Vagrant, Ansible and Docker - How they fit together for productive flexible d...
Vagrant, Ansible and Docker - How they fit together for productive flexible d...Vagrant, Ansible and Docker - How they fit together for productive flexible d...
Vagrant, Ansible and Docker - How they fit together for productive flexible d...Samuel Lampa
 
AddisDev Meetup ii: Golang and Flow-based Programming
AddisDev Meetup ii: Golang and Flow-based ProgrammingAddisDev Meetup ii: Golang and Flow-based Programming
AddisDev Meetup ii: Golang and Flow-based ProgrammingSamuel Lampa
 
First encounter with Elixir - Some random things
First encounter with Elixir - Some random thingsFirst encounter with Elixir - Some random things
First encounter with Elixir - Some random thingsSamuel Lampa
 
Profiling go code a beginners tutorial
Profiling go code   a beginners tutorialProfiling go code   a beginners tutorial
Profiling go code a beginners tutorialSamuel Lampa
 
Flow based programming an overview
Flow based programming   an overviewFlow based programming   an overview
Flow based programming an overviewSamuel Lampa
 
My lightning talk at Go Stockholm meetup Aug 6th 2013
My lightning talk at Go Stockholm meetup Aug 6th 2013My lightning talk at Go Stockholm meetup Aug 6th 2013
My lightning talk at Go Stockholm meetup Aug 6th 2013Samuel Lampa
 
3rd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse
3rd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse3rd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse
3rd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in BioclipseSamuel Lampa
 

Mais de Samuel Lampa (11)

Using Flow-based programming to write tools and workflows for Scientific Comp...
Using Flow-based programming to write tools and workflows for Scientific Comp...Using Flow-based programming to write tools and workflows for Scientific Comp...
Using Flow-based programming to write tools and workflows for Scientific Comp...
 
Linked Data for improved organization of research data
Linked Data  for improved organization  of research dataLinked Data  for improved organization  of research data
Linked Data for improved organization of research data
 
How to document computational research projects
How to document computational research projectsHow to document computational research projects
How to document computational research projects
 
Reproducibility in Scientific Data Analysis - BioScience Seminar
Reproducibility in Scientific Data Analysis - BioScience SeminarReproducibility in Scientific Data Analysis - BioScience Seminar
Reproducibility in Scientific Data Analysis - BioScience Seminar
 
Vagrant, Ansible and Docker - How they fit together for productive flexible d...
Vagrant, Ansible and Docker - How they fit together for productive flexible d...Vagrant, Ansible and Docker - How they fit together for productive flexible d...
Vagrant, Ansible and Docker - How they fit together for productive flexible d...
 
AddisDev Meetup ii: Golang and Flow-based Programming
AddisDev Meetup ii: Golang and Flow-based ProgrammingAddisDev Meetup ii: Golang and Flow-based Programming
AddisDev Meetup ii: Golang and Flow-based Programming
 
First encounter with Elixir - Some random things
First encounter with Elixir - Some random thingsFirst encounter with Elixir - Some random things
First encounter with Elixir - Some random things
 
Profiling go code a beginners tutorial
Profiling go code   a beginners tutorialProfiling go code   a beginners tutorial
Profiling go code a beginners tutorial
 
Flow based programming an overview
Flow based programming   an overviewFlow based programming   an overview
Flow based programming an overview
 
My lightning talk at Go Stockholm meetup Aug 6th 2013
My lightning talk at Go Stockholm meetup Aug 6th 2013My lightning talk at Go Stockholm meetup Aug 6th 2013
My lightning talk at Go Stockholm meetup Aug 6th 2013
 
3rd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse
3rd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse3rd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse
3rd Proj. Update: Integrating SWI-Prolog for Semantic Reasoning in Bioclipse
 

Último

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 

Último (20)

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 

IRODS Cheat Sheet

  • 1. IRODS Cheat Sheet (version 3+) Version 0.9 by Samuel Lampa, BILS (bils.se) Contact author: samuel dot lampa at bils dot se Numeric Literals 1 # integer 1.0 # double Strings 'A 'string', ' ++ "another ”string”" # Some valid escape characters: “n, r, t, , ', ", $, *" Boolean constants true # True false # False Boolean comparison ! # Not && # And || # Or %% # Or used in the "##" syntax Arithmetic operators - # Negation ^ # Power * # Multiplication / # Division % # Modulors - # Subtraction + # Addition Arithmetic comparison > # Greater than < # Less than >= # Greater than or equal <= # Less than or equal Arithmetic functions exp(<num>) log(<num>) abs(<num>) floor(<num>) # always returns integer ceiling(<num>) # always returns integer average(<num>, <num>, ...) max(<num>, <num>, ...) min(<num>, <num> , ...) String functions writeLine("stdout", "Hi!"); Prints out “Hi!.” "This “++”is”++” a string." Equals to “This is a string.” "This is a string." like "This is*" Equals to true "This is." like regex "Th.*is[.]" Equals to true substr("This is a string.", 0, 4) Output: This strlen("This is a string.") Output: 17 split("This is a string.", " ") Equals to: [This,is,a,string.] writeLine("stdout", triml("This is a string.", " ")); Equals to: is a string. trimr("This is a string.", " ") Equals to: This is a List functions list(<elem>, <elem>, ...) Creates a new list, Ex: list("This","is","a","list") elem(<list>, <index>) Retrieves elements from a list (0-indexed). Ex: elem(list("This","is","a","list"),0) # returns “This” setelem(<list>, <index>, <value>) Updates an item in a list. Ex: setelem(list("A","list"),0,"My") # Evaluates to list("My","list"). size(<list>) Gives the size of a list. Ex: size(list("This","is","a","list")) # evaluates to 4. hd(<list>) Gives the head of a list, Ex: hd(list("This","is","a","list")) # Evaluates to "This" tl(<list>) Gives the tail of a list. Ex: tl(list("This","is","a","list")) # Evaluates to list("is","a","list") cons(<element>, <list>) Add elements to a list. Ex: cons("My",list("list")) # Evaluates to list("My","list"). Tuples Tuples are created like so: ( <component>, ..., <component> ) If statements Logical if: if <expr> then { <actions> } else { <actions> } Logical if example: if (*A==1) then { true; } else { false; } Functional if (returning value of any type): if <expr> then <expr> else <expr> Functional if example: if true then 1 else 0 if *A==1 then true else false The following abbreviation are allowed (the red striked part can be abbreviated) in functional ifs: if (...) then { ... } else { ... } if (...) then { ... } else { if (...) then {...} else {...} } Multiple abbreviations can be combined for example: if (*X==1) { *A = "Mon"; } else if (*X==2) {*A = "Tue"; } else if (*X==3) {*A = "Wed"; } Foreach loops Without iterator: foreach(*C) { writeLine("stdout", *C); } With the iterator variable (*E in this case): foreach(*E in *C) { writeLine("stdout", *E); }
  • 2. Defining functions Functions can be thought of as microservices written in the rule language and are defined like this: <name>(<param>, ..., <param>) = <expr> Example: square(*n) = *n * *n Variables in functions: The let expression As function definitions are based on expressions rather than action sequences, we cannot put an assignment directly inside an expression. For example, the following is not a valid function definition: quad(*n) = *t = *n * *n; *t * *t To solve this problem, the let expression provides scoped values in an expression. The general syntax for the let expression is: let <assignment> in <expr> For example: quad(*n) = let *t = *n * *n in *t * *t The variable on the left hand side of the assignment in the let expression is a let-bound variable. The scope of such a variable is within the let expression. A let bound variable should not be reassigned inside the let expression. Defining Rules Define rules with nontrivial rule conditions like this: <name>(<param>, ..., <param>) { on(<condition>) { <actions> } } The rule condition can be skipped for rules with trivial or non-existent conditions: <name>(<param>, ..., <param>) { <actions> } A rule can have multiple conditional expressions: <name>(<param>, ..., <param>) { on(<condition>) { <actions> } … on(<condition>) { <actions> } } Generating and Capturing Errors In a rule, we can also prevent the rule from failing when a microservice fails: errorcode(msi) The errormsg microservice captures the error message, allows further processing of the error message, and avoids the default logging of the error message, like so: errormsg(msi, *msg) In a rule, the fail() and failmsg() microservices can be used to generate errors. fail(errorcode) generates an error with an error code. Example: fail(-1) failmsg(<errorcode>, <errormsg>) generates an error with an error code and an error message. Example: failmsg(-1, "this is an error message") The msiExit microservice is similar to failmsg: msiExit("-1", "msi") Inductive Data Types The features discussed in this section are currently under development! An inductive data type is a data type for values that can be defined inductively, i.e. more complex values can be constructed from simpler values using constructors. General syntax: data <name> [ ( <type parameter list> ) ] = | : <data constructor type> … | <data constructor name> : <data constructor type> For example, a data type that represents the natural numbers can be defined as data nat = | zero : nat | succ : nat -> nat Here the type name defined is “nat.” The type parameter list is empty. If the type parameter list is empty, we may omit it. There are two data constructors. The first constructor “zero” has type “nat,” which means that “zero” is a nullary constructor of nat. We use “zero” to represent “0”. The second constructor “succ” has type “nat -> nat” which means that “succ” is unary constructor of nat. We use “succ” to represent the successor. With these two constructors we can represent all natural numbers: zero, succ(zero), succ(succ(zero)). Pattern matching If a data type has more than one data structure, then the "match" expression is useful: match <expr> with | <pattern> => <expr> … | <pattern> => <expr> For example, given the nat data type we defined earlier, we can define the following function using the match expression: add(*x, *y) = match *x with | zero => *y | succ(*z) => succ(add(*z, *y)) For another example, given the "tree" data type we defined earlier, we can define the following function size(*t) = match *t with | empty => 0 | node(*v, *l, *r) => 1 + size(*l) + size(*r)