Using the ICAT API to ingest business and experiment metadata Tom Griffin, STFC ISIS Facility NOBUGS 2012 ICAT Workshop

Slides:



Advertisements
Similar presentations
Towards an information model for I2S2
Advertisements

ICAT + Information Model Brian Matthews Scientific Information Group E-Science Centre STFC Rutherford Appleton Laboratory
CE203 - Application Programming Autumn 2013CE203 Part 51 Part 5.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Clarity Educational Community Clarity Educational Community Integration Interface Strategies and Methods.
ASP.NET Programming with C# and SQL Server First Edition Chapter 8 Manipulating SQL Server Databases with ASP.NET.
Security in SQL Jon Holmes CIS 407 Fall Outline Surface Area Connection Strings Authenticating Permissions Data Storage Injections.
Swami NatarajanJuly 14, 2015 RIT Software Engineering Reliability: Introduction.
Microsoft Office Word 2013 Expert Microsoft Office Word 2013 Expert Courseware # 3251 Lesson 4: Working with Forms.
Managing Data Interoperability with FME Tony Kent Applications Engineer IMGS.
Using a Simple Python Script to Download Data Rob Letzler Goldman School of Public Policy July 2005.
The ATLAS Production System. The Architecture ATLAS Production Database Eowyn Lexor Lexor-CondorG Oracle SQL queries Dulcinea NorduGrid Panda OSGLCG The.
DEV-07: Increasing Productivity with Tools for Business Logic Gikas Principal Software Engineer.
Managing the development and purchase of information systems (Part 1)
My Resource for Excellence. Canadian Heritage Information Network Collections Management Software Criteria Checklist Heather Dunn, CHIN.
Taming the facility data explosion The ICAT system explained Damian Flannery NOBUGS 2008 Sydney ICAT.
Attacking Applications: SQL Injection & Buffer Overflows.
Errors And How to Handle Them. GIGO There is a saying in computer science: “Garbage in, garbage out.” Is this true, or is it just an excuse for bad programming?
Marianne BargiottiBK Workshop – CERN - 6/12/ Bookkeeping Meta Data catalogue: present status Marianne Bargiotti CERN.
Secure Credential Manager Claes Nilsson - Sony Ericsson
Exploring an Open Source Automation Framework Implementation.
The ICAT pluggable authentication system Tom Griffin, STFC ISIS Facility NOBUGS 2012 ICAT Workshop
DB Installation and Care Carmine Cioffi Database Administrator and Developer ICAT Developer Workshop, The Cosener's House August
ILDG Middleware Status Chip Watson ILDG-6 Workshop May 12, 2005.
Data Validation OPEN Development Conference September 19, 2008 Sushmita De Systems Analyst.
Copyright © 2010 Certification Partners, LLC -- All Rights Reserved Perl Specialist.
Copyright © 2003 ProsoftTraining. All rights reserved. Perl Fundamentals.
David Adams ATLAS DIAL: Distributed Interactive Analysis of Large datasets David Adams BNL August 5, 2002 BNL OMEGA talk.
TopCAT Use Cases Priorities User Interface 1 ICAT developer workshop, August 2009 Laurent Lerusse – STFC
1 © Donald F. Ferguson, All rights reserved.Modern Internet Service Oriented Application Development – Lecture 2: REST Details and Patterns Some.
ICAT Schema Current Schema organization What’s there but not yet implemented What could we want in the future 1 ICAT developer workshop, August 2009.
Mantid Stakeholder Review Nick Draper 01/11/2007.
 Shopping Basket  Stages to maintain shopping basket in framework  Viewing Shopping Basket.
ICM – API Server & Forms Gary Ratcliffe.
RESTful Web Services What is RESTful?
Updates made to latest draft since Herndon Sony Corporation Toshiaki Kojima.
13 Copyright © 2004, Oracle. All rights reserved. Adding Validation and Error Handling.
ICAT Integration at ISIS Tom Griffin, ISIS Facility ICAT Developer Workshop The Cosener’s House, Abingdon August 2009
CyVerse-enabled NCBI Sequence Read Archive (SRA) Submission Pipeline
Software. Because databases can get very big, it is important to decide exactly what is going to be stored in each field. Fields can be text, number,
TestZilla A Test Manager System Kevin Huang Sam Van Dalfsen.
JISC / CETIS eLearning Conference. Metadata Quality Expose Archive Federation Search Deliver Destroy Harvest Embedded Metadata [Metadata in, e.g. content.
Defensive Programming. Good programming practices that protect you from your own programming mistakes, as well as those of others – Assertions – Parameter.
NVS New Zealand National Vegetation Survey. What is NVS? NVS (National Vegetation Survey) – New Zealand’s largest archive facility for plot-based vegetation.
Python: Building Geoprocessing Tools David Wynne, Ghislain Prince.
CAA Database Overview Sinéad McCaffrey. Metadata ObservatoryExperiment Instrument Mission Dataset File.
ICAT Status Alistair Mills Project Manager Scientific Computing Department.
0 Copyright 2012 FUJITSU Interstage BOP SQL Query Tutorial Todd Palmer October 2012.
13 Copyright © 2007, Oracle. All rights reserved. Using the Data Recovery Advisor.
This was written with the assumption that workbooks would be added. Even if these are not introduced until later, the same basic ideas apply Hopefully.
CRISP WP 17 1 / 2 Proposed Metadata Catalogue Architecture Document.
FILES AND EXCEPTIONS Topics Introduction to File Input and Output Using Loops to Process Files Processing Records Exceptions.
CSE 332: C++ Exceptions Motivation for C++ Exceptions Void Number:: operator/= (const double denom) { if (denom == 0.0) { // what to do here? } m_value.
Presented by Alexey Vedishchev Developing Web-applications with Grails framework American University of Nigeria, 2016 Part VI: Mapping URLs.
Architecture and design
ASP.NET Programming with C# and SQL Server First Edition
ATS Application Programming: Java Programming
Node.js Express Web Services
ICAT- Experience and activities at ISIS
Lawrence Livermore National Laboratory
Final Project: Read from a csv file and write to a database table
Lecture 12: Data Wrangling
Helping a friend out Guidelines for better software
Lecture 2 - SQL Injection
CISC101 Reminders Assignment 3 due next Friday. Winter 2019
Pre-assessment Questions
Use Cases Simple Machine Translation (using Rainbow)
PHP-II.
Presentation transcript:

Using the ICAT API to ingest business and experiment metadata Tom Griffin, STFC ISIS Facility NOBUGS 2012 ICAT Workshop

Overview Assumes the user has permissions (see later) Basic process ‘Business’ metadata ‘Experiment’ metadata Tools for ingesting Nexus and XML ‘Post experiment’ file Exceptions

Basic data flow Business metadata Experiment metadata

‘Business’ metadata - Sources Proposal system User database Risk assessment / COSHH / Sample tracking Visits system

‘Business’ metadata - Creation Investigation InvestigationParameters (Users) Sample SampleParameters

‘Business’ metadata - Creation

Code will be mainly facility specific Probably a common general flow Will assume users are in the User table already

‘Business’ metadata - Creation Investigation invOne = new Investigation(); inv.instrument = (Instrument)port.search(sessionId, "Instrument[name=‘” + proposal.instrument + “']").get(0); inv.title = proposal.title inv.facility = (Facility)port.search(sessionId, "Facility[name='ISIS']").get(0); inv.type = (InvestigationType)port.search(sessionId, "InvestigationType[name='experiment']").get(0); inv.name = investigationTitle inv.releaseDate = Now + inv.facility.daysUntilRelease; inv.id = port.create(sessionId, invOne); for (User proposalUser : experimenters) { InvestigationUser iu= new InvestigationUser(); iu.investigation = inv; iu.user = (User)port.search(sessionId, "User[name='" + proposalUser.name + "']").get(0); iu.role = proposalUser.role ; //e.g. Principal Investigator iu.id = port.create(sessionId, iu); }

‘Business’ metadata - Creation

‘Business’ metadata - DOIs See talk by Brian Matthews/Micheal Wilson Issued by DataCite/British Library Previously issued on demand Now issued at start of experiment Defined by DOI issuer – us doi: /ISIS.E Prefix (STFC) E = Experiment D = Dataset F = DataFile Object ID

Experiment metadata - Sources Datafiles –Nexus –Binary

Experiment metadata - Extraction ISIS – ‘WriteRaw’ –Custom binary reader – outputs ICAT friendly XML ISIS – ‘NXIngest’ –Flexible Nexus reader – outputs ICAT friendly XML SNS – ‘ingestNexus’ –Simple Python script – direct input to ICAT

Experiment metadata - Creation Investigation update Dataset Datafile Dataset and Datafile Parameters Updates to Sample

Experiment metadata - Creation

Python - ingestNexus Go to code…. n%2Fcontrib%2Fscripts

XMLIngest – a good idea? ICAT 3.3 exposed an XML schema ingestMetadata(string sessionId, string xml) Removed in ICAT 4.0

NXIngest Part of the nexus package Highly customizable by a mapping file Different mapping file per nexus ‘style’ Go to XML files…..

Post-Experiment Reduced, Derived, Analysed Data All can be created in the same way as raw data/metadata

Exceptions Single exception: IcatException_Exception A wrapper around the real exception which in turn includes an enumerated code to identify the kind of exception and the usual message.

Exceptions BAD_PARAMETER -generally indicates a problem with the arguments made to a call. INTERNAL -may be caused by network problems, database problems, glassfish problems or bugs in ICAT. INSUFFICIENT_PRIVILEGES -indicates that the authorization rules have not matched your request. NO_SUCH_OBJECT_FOUND -thrown when something is not found. OBJECT_ALREADY_EXISTS -thrown when type to create something but there is already one with the same values of the constraint fields.

Exceptions SESSION -is used when the sessionId you have passed into a call is not valid or if you are unable to authenticate. VALIDATION -marks an exception which was thrown instead of placing the database in an invalid state.

Exceptions Operations which work on a list of objects, such as createMany, may fail because of failure to process one of the objects. In this case the state of the database will be rolled back offset is set to the index of the entry in the list causing the error

Exceptions String sessionId; try { sessionId = icat.login("db", credentials); } catch (IcatException_Exception e) { IcatException ue = e.getFaultInfo(); System.out.println("IcatException " + ue.getType() + " " + ue.getMessage() + (ue.getOffset() >= 0 ? " at offset " + ue.getOffset() : "")); }

Summary Explained my ingest process (typical?) Creating Investigations, Parameters, Samples Creating Datasets, Datafiles, Parameters Existing tools available to help Consider XML ingest Post experiment data Exceptions

Questions? code.google.com/p/icatproject