Difference between revisions of "Discovery Hack-a-thon Details"

From Earth Science Information Partners (ESIP)
Line 175: Line 175:
 
*[http://wsnews.jpl.nasa.gov:8100/opensearch/osdd_granule?dataset=NEWS%20Regrid%20airs.aqua%201.0hr%20Nearest%20Neighbor%200.50x0.50degrees%20v1.0 JPL NEWS AIRS/Aqua Regrid 1-hour 0.5x0.5 degrees v1.0 OpenSearch Description Document]
 
*[http://wsnews.jpl.nasa.gov:8100/opensearch/osdd_granule?dataset=NEWS%20Regrid%20airs.aqua%201.0hr%20Nearest%20Neighbor%200.50x0.50degrees%20v1.0 JPL NEWS AIRS/Aqua Regrid 1-hour 0.5x0.5 degrees v1.0 OpenSearch Description Document]
 
*[https://api.echo.nasa.gov:443/echo-esip/search/granuleOsdd.xml?dataCenter=LARC&shortName=MIL3DAE&versionId=4&spatialType=NORMAL&clientId= NASA ECHO Granule-level Search (MISR L3 Aerosols)] Note that ECHO asks clients to supply a client_id, like the name of your application
 
*[https://api.echo.nasa.gov:443/echo-esip/search/granuleOsdd.xml?dataCenter=LARC&shortName=MIL3DAE&versionId=4&spatialType=NORMAL&clientId= NASA ECHO Granule-level Search (MISR L3 Aerosols)] Note that ECHO asks clients to supply a client_id, like the name of your application
 +
 +
===Sample Code===
 +
* Java - [https://scm.escience.rpi.edu/svn/public/esip/discovery/java-tutorial/]
  
 
= Example URLs =
 
= Example URLs =

Revision as of 13:48, July 17, 2012

Overview

Overview Slides

What's the Plan? Get together to make some simple Discovery clients! All are welcome, no previous experience or coding skills necessary!

  • Two back-to-back sessions:
  1. Tuesday, July 17, 2012. 1:30pm-3:00pm
  2. Tuesday, July 17, 2012. 3:30pm-5:00pm

Abstract: The set of ESIP Discovery services encompass the overlapping conventions of Earth science federated OpenSearch, Collection Casting, Granule Casting, and Service Casting feed standards. To help lower the barrier of entry, we will provide a set of hands-on and simple approaches to using Discovery services. These include walking through some "low-hanging fruit" approaches to calling OpenSearch, Collection Casting, Granule Casting, and Service Casting.

Tuesday, July 17, 2012. 1:30pm-3:00pm: Non-Coders

Discovery Hack-a-thon Overview (20-mins)

Quick overview of ESIP Discovery services and set the stage for call the ESIP Discovery services from various simple clients.

Poll the audience for interest.

Hack-a-thon Breakout (70-mins)

Geoportal

We will have a Geoportal from our testbed up and running. You'll learn what protocols the geoportal already supports for service validation, how to use the geoportal to validate and register data and services, and how to add configurations for validation to a geoportal instance. Or, just take the Discovery Cluster geoportal instance out for a spin!

Mentor: Christine White

Browsers and News Readers

It's even possible to interact with both Data "casts" and OpenSearch servers using a simple browser. Also, News Readers, especially useful for Data casts!

Mentors: Ruth Duerr and ...

Cast Publishing and Aggregation

Learn how to use existing web apps create 1-off data casts. Come, create a cast or two and then see it found (that's the idea anyway).

Mentors: Ruth Duerr and ...

Command line

Yes, you can interact with an OpenSearch server or a Data Cast using basic command-line URL getters, like wget (available for all platforms) and curl.

Mentors: Hook Hua and Chris Lynnes


Tuesday, July 17, 2012. 3:30pm-5:00pm: Coders

Discovery Hack-a-thon Overview (15-mins)

Quick overview of ESIP Discovery services and set the stage for call the ESIP Discovery services from various simple clients.

Poll the audience for interest.

Hack-a-thon Breakout (75-mins)

Perl Monks

Learn how to hack a quick client together. Particularly useful for doing scripted search/acquire for datasets following your own, possibly idiosyncratic needs.

Sample code: Media:esip_fedsearch2.pl.txt

Mentors: Chris Lynnes and ...

Python Scripters

Learn how to use Python, an easy to use, but powerful scripting language, to interact with OpenSearch servers and find the data you need.

Mentors: Nga Chung and ...

Java Programmers

Mentors: Eric Rozell and ...

XSL Transforms

Learn how to generate simple interfaces to OpenSearch cast feeds. ESIP Discovery casts extend the Atom casts format and thus these transforms will expose additional information to the user interface.

The XSLT processors we'll try out are

  1. your modern browser
  2. Saxon-HE 9.4 (open source home edition)


Getting Saxon


A complete working example tutorial of an XSL to process Atom 1.0 to XHTML


Edit the xsl to add namespaces relevant for OpenSearch. Add namespaces to the top-level <xsl:stylesheet> element:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:a="http://www.w3.org/2005/Atom"
  xmlns:xhtml="http://www.w3.org/1999/xhtml" 
  xmlns="http://www.w3.org/1999/xhtml" 
  xmlns:time="http://a9.com/-/opensearch/extensions/time/1.0/"
  xmlns:geo="http://a9.com/-/opensearch/extensions/geo/1.0/"
  exclude-result-prefixes="a xhtml time">

...


Download a sample ESIP OpenSearch granule response.

Edit the OpenSearch response to include the sytle-sheet directive.

<?xml version='1.0' encoding='UTF-8'?>

<?xml-stylesheet type="text/xsl" href="opensearch2xhtml.xsl"?>

<feed xmlns="http://www.w3.org/2005/Atom" xmlns:os="http://a9.com/-/spec/opensearch/1.1/" xmlns:time="http://a9.com/-/opensearch/extensions/time/1.0/" xmlns:geo="http://a9.com/-/opensearch/extensions/geo/1.0/" xmlns:nsidc="http://nsidc.org/ns/opensearch/1.1/">

...

Open the local OpenSearch feed xml with your browser or transform with Saxon command-line.


Saxon command-line interface

# -t  Display version and timing information to the standard error output. The output also traces the files that are read and writing, and extension modules that are loaded.
# -tree:(linked|tiny|tinyc)  Selects the implementation of the internal tree model. -tree:tiny selects the "tiny tree" model (the default). -tree:linked selects the linked tree model. -tree:tinyc selects the "condensed tiny tree" model. 

java -cp saxon9he.jar  net.sf.saxon.Transform  -tree:linked -t -s:{source-xml-filename}  -xsl:{xsl-filename}  -o:{output-filename}


Mentors: Hook Hua and ...

Hack-a-thon Resources

Casts

Collection Casts

Granule-level Casts

Service Casts

OpenSearch Description Documents

Top Level (search for datasets)

Granule-level Examples

Sample Code

Example URLs

OpenSearch

How-To Guides


Back to Discovery_Hack-a-thon