china science challenge

35
Developer Network INTRODUCTION

Upload: remko-caprio

Post on 01-Nov-2014

1.455 views

Category:

Education


7 download

DESCRIPTION

 

TRANSCRIPT

Page 1: China Science Challenge

Developer Network

INTRODUCTION

Page 2: China Science Challenge

Developer NetworkElsevier and SciVerse

Elsevier publishes 25% of the world’s Scientific, Technical and Medical (STM) content: - more than 10 million full-text articles from 2600 journals in ScienceDirect, - more than 40 million abstracts and author, affiliation information in Scopus. - all content from Elsevier and scientific world wide web in Hub.

SciVerse embeds applications within scientific content, giving developers and apps access via framework and content APIs.

SciVerse is an extension of Apache Shindig, an implementation of OpenSocial. Sciverse apps can access content via open APIs.

Page 3: China Science Challenge

Developer Network2011 The WAR of the INTERNETS

Page 4: China Science Challenge

Developer NetworkSocial Apps WebBoth Facebook and Google are the same type of social network with applications. Facebook owns the social network, Google owns search.

Elsevier’s SciVerse is social apps for scientific search.

OpenSocialSciVerse uses OpenSocial standards. OpenSocial is a specification for creating an app-based social network. This spec is originally based on iGoogle by Google. SciVerse extends Apache Shindig, making apps contextual.

The OpenSocial standard is worldwide used by sites with around 900 million users (Facebook has 500 million users): Hi5 MySpace Orkut Friendster ZDNet RenRen LinkedIn Ning SalesForce Hyves Imeem Yahoo Net SciVerse

Page 5: China Science Challenge

Developer NetworkElsevier SciVerse – science, there’s an app for that

iPhone Apps1 billion downloads350,000 apps

Facebook Apps500 million users

Browser Apps

Page 6: China Science Challenge

Developer Network2011 – Social Apps based Business

Page 7: China Science Challenge

Developer Network

Page 8: China Science Challenge

Developer NetworkSTM Publishing

ScienceDirect: 10 million full text articles in 2,500 journals Scopus: 42 million abstracts, citations, authors and affiliations Hub: plus web content covering 18,000 titles from over 5,000 publishersAnd META-DATA

Elsevier publishes 25% of the world’s Science, Technology and Medical (STM) Publications

Page 9: China Science Challenge

Developer Network

A list of search results with facets in SciVerse Hub

Page 10: China Science Challenge

Developer NetworkElsevier | Developer Network

With SciVerse APPS (search result analysis app)

Page 11: China Science Challenge

Developer Network

an abstract for a scientific article with tables and references

Page 12: China Science Challenge

Developer Network

Elsevier | Developer Network

With SciVerse APPS (genome viewer and protein network viewer)

Page 13: China Science Challenge

Developer Network

Full text article in ScienceDirect with popup APP (related content by nextbio)

Page 14: China Science Challenge

Developer Network

PART 1 – TECHNOLOGY PLATFORM

Page 15: China Science Challenge

Developer NetworkOpenSocial Architecture

Shindig Server

HTTP SERVER

Gadget Renderer Servlet

Gadget Server

Gadget

Data Handler

Data Service Servlet

People

Activities

App Data

Javascript Libraries

Gadget.xml

DB1

IFRAMEhttp

request

DB2

Container

Apache Shindig is an implementation of the OpenSocial specification.

Page 16: China Science Challenge

Developer NetworkSciVerse Architecture

SciVerse extends Apache Shindig. SciVerse gadgets can access the context of the page in which they appear via so called Framework APIs.

Page 17: China Science Challenge

Developer Network

17

SciVerse – Integration Points

view Integration point

profile Hub- Home page, Search Results pageScienceDirect- Full Text Article page, Search Results pageScopus- Record page

canvas New full page

sciverseResults View

Hub- Search Results page (under each result)ScienceDirect- Search Results page (under each result)

hover Hub- Home page, Search Results pageScienceDirect- Search Results page, Full Text Article pageScopus- Search Results page, Record page, Author Details page

Apps appear as iframes in so-called views or integration points in the webpage.

Page 18: China Science Challenge

Developer NetworkOpenSocial Gadgets What is a Gadget? The IFRAME Revolution

A gadget is a client-side application in the form of an HTML iFrame that appears in the context of a webpage and uses client-side scripting languages like JavaScript.

IFRAME<iframe src="iframe1.html" width=“400" height=“200">Hello World!</iframe>

GADGET.XML (example 1)<?xml version="1.0" encoding="UTF-8"?><Module> <ModulePrefs title=“HellowWorld1" author_email=“[email protected]"> <Require feature="opensocial-0.9" /> </ModulePrefs> <Content type="html" view="profile"><![CDATA[ <script type=‘text/javascript’>

function fnWrite() { getElementById(‘content-div’).innerHTML = “Hello World”;}

</script> <div id=‘content-div’></div> ]]></Content></Module>

Page 19: China Science Challenge

Developer NetworkExample 1 – OpenSocial Definition File or gadget.xml

<?xml version="1.0" encoding="UTF-8"?><Module> <ModulePrefs title="SciVerseExamples-ContentAPICall1" author_email="[email protected]"> <Require feature="opensocial-0.9" /> <Require feature="sciverse" /> <Require feature="hub" /> <Require feature="org.jquery.core-1.4.2" /> </ModulePrefs> <Content type="html" view="canvas"><![CDATA[<!-- The code for Canvas view is here. -->]]></Content> <Content type="html" view="profile"><![CDATA[ Profile View]]></Content> <Content type="html" view="sciverseResultsView"><![CDATA[

<!-- The code for Sciverse ResultsView view is here. --><div>Sciverse Results View view for SciVerseExamples-ContentAPICall1.</div>

]]></Content></Module>

Page 20: China Science Challenge

Developer NetworkObject Oriented JavaScript

JavaScript originally mainly added dynamic features to an otherwise static HTML page, creating DHTML. But with the advent of DOM, AJAX and gadget programming, JavaScript is now more than a simple client side scripting language, and has become a sophisticated application programming language.

Therefore, follow Object Oriented design principles and create ‘un-obtrusive’ code:

Model View Control (MVC): separate data from model (JavaScript) and view (HTML).

Where possible create Object Oriented code that you can re-use

Create packages to separate namespaces to avoid naming conflicts

Create re-usable libraries for common code

In addition test, debug and compress your code to improve performance and increase stability.

Page 21: China Science Challenge

Developer NetworkExample 2 – Object Oriented JavaScript

// create a class for SciVerseSearchfunction SciverseSearch() {

…}// create a static class variableSciverseSearch.View = { STANDARD: 'STANDARD', COMPLETE: 'COMPLETE'}// create a method instance for a query methodSciverseSearch.prototype.execute = function(query) {

…}// create a setter for the view variable SciverseSearch.prototype.setView = function(view) { this.view = view;}

// Now instantiate the class and call its methodvar sciverse = new SciverseSearch();sciverse.setView(SciverseSearch.View.COMPLETE); sciverse.execute(query);

Page 22: China Science Challenge

Developer NetworkDebugging JavaScript

Opera DragonflyOpera Browser has Dragonfly built-in.

Firefox FirebugFor FireFox you can install the Firebug add-on.

Safari Web Inspector On a Mac, there is Web Inspector for Safari.

Chrome Developer ToolsGoogle Chrome comes with Developer Tools.

The Developer Blog has an article with a Complete overview of debuggers for the main4 browsers at http://developer.sciverse.com/blog

Blog Post: Complete Overview: Debugging JavaScript and SciVerse Apps in FireFox, Opera, Safari, Chrome, IE

Page 23: China Science Challenge

Developer Network

PART 2 – GADGET PROGRAMMING

Page 24: China Science Challenge

Developer NetworkSciVerse APIs

There are two main APIs for SciVerse:1. Framework API – with access to context and methods on the page2. Content API – for search and retrieval of articles, authors and affiliations

Page 25: China Science Challenge

Developer NetworkSciVerse – Framework API

The Framework API allows the app to access context and methods of the page. http://developer.sciverse.com/frameworkapi

Page 26: China Science Challenge

Developer NetworkSciVerse – Framework APIgadgets.sciverse.closeAllMyHoversgadgets.sciverse.closeHovergadgets.sciverse.getAllResultsgadgets.sciverse.getArticleContentgadgets.sciverse.getContextInfogadgets.sciverse.getPageUrlgadgets.sciverse.getResultsgadgets.sciverse.invokeResultsViewgadgets.sciverse.makeContentApiRequestgadgets.sciverse.makeMeInvisiblegadgets.sciverse.makeRequestgadgets.sciverse.makeMeVisiblegadgets.sciverse.linkTextgadgets.sciverse.returnQuerySuggestionsgadgets.sciverse.showHoverViewgadgets.sciverse.subscribeToQuerygadgets.sciverse.subscribeToResults

Page 27: China Science Challenge

Developer NetworkSciVerse – Framework API - ContextInfo

Most of the information visible on the page, is accessible by the gadget via the Framework API. The ContextInfo object returns among other the following information:

accountId, artNum, au1, au1First, au1Init, au1Suffix, au1Sur, auCorp, authorKeywords, date, docTitle, doi, entitlement, genre, indexTerms, individualUser, isbn, issn, issue, keywords, offset, originPage, otherKeywords, pageContentDivTagName, pages, pageType, part, partTitle, partValue, pii, platform, scDocId, scopusFlag, searchQuery, searchTerms, secureAuthtoken, sortOrder, sPage, srcTitle, ssn, timestamp, volume, year

// retrieving the authtoken via the GetContextInfo method’s callbackfunction getContextInfoCallback(result){ // get authtoken for content API call var authtoken = result.secureAuthtoken; var searchterm = result.searchTerms;}

// retrieving the authToken via the gadget preferences<script type="text/javascript"> var prefs = new gadgets.Prefs(); var authtoken = prefs.getString("secureAuthtoken");                               </script>

Page 28: China Science Challenge

Developer NetworkExample - How to retrieve the authToken for the Content API call?

function init(){ gadgets.sciverse.getContextInfo(getContextInfoCallback); // this parameter is the callback method}function getContextInfoCallback(result){ // get authtoken for content API call var authtoken = result.secureAuthtoken; var searchterm = result.searchTerms;}// after pageload finishes, this executes the init method, which will trigger following functionsgadgets.util.registerOnLoadHandler(init);

OR

<UserPref name="contentApiKey" datatype="hidden" default_value="your-api-key-here" /> <UserPref name="secureAuthtoken" datatype="hidden" /> …<script type="text/javascript"> var prefs = new gadgets.Prefs(); var authToken = prefs.getString("secureAuthtoken"); </script>

Also, see the example code at https://github.com/sciversedev/examples/

Page 29: China Science Challenge

Developer NetworkSciVerse Content API

Content API - Searchhttp://api.elsevier.com/content/search/index:CLUSTER?query=xx&view=VIEW

CLUSTER HUB, SCIDIR, SCOPUS, AUTHOR, AFFILIATION

VIEW STANDARD, COMPLETE

query

date

Content API - Retrievalhttp://api.elsevier.com/content/CONTENT-CATEGORY/LABEL:ID?view=VIEW

CONTENT-CATEGORY article, abstract, author, affiliation

LABEL EID, PII, DOI, SCOPUS_ID, AUTHOR_ID, AFFIL_ID, PUBMED_ID

VIEW META, REF, FULL, LIGHT, STANDARD

The Content API provides access to ScienceDirect and Scopus data. This is the backbone of the Elsevier content. The Content API can be accessed via building the query URL as follows:

Page 30: China Science Challenge

Developer NetworkExample - Content API - search

Hub Searchhttp://api.elsevier.com/content/search/index:HUB?query=heart+attackSearches for documents in Hub that mention the term ‘heart attack’

ScienceDirect Searchhttp://api.elsevier.com/content/search/index:SCIDIR?query=TITLE(decay)&date=2007 Searches for documents in ScienceDirect that have ‘decay’ in the title and that were published in 2007

Scopus search http://api.elsevier.com/content/search/index:SCOPUS?query=AUTHLASTNAME(mckinley)%20AND%20SUBJAREA(CHEM)Searches for documents in Scopus in the area of chemistry written by people with last name “McKinley”

Author search http://api.elsevier.com/content/search/index:AUTHOR?query=af-id(60032114)%20AND%20authlast(smith) Searches for authors that are affiliated with the institute that has affiliationID ‘60032114’ and whose last name is ‘smith’

Affiliation search http://api.elsevier.com/content/search/index:AFFILIATION?query=affil(rotterdam) Searches for affiliation profiles (i.e. institutes) with Rotterdam in their name or description

Page 31: China Science Challenge

Developer NetworkExample - Content API - retrieval

Full-text retrieval (ScienceDirect) http://api.elsevier.com/content/article/DOI:10.1016/0092-8674(93)90500-P?view=FULL Retrieves the full-text version of the ScienceDirect document with DOI ‘10.1016/0092-8674(93)90500-P’

Abstract retrieval (Scopus) http://api.elsevier.com/content/abstract/SCOPUS_ID:0027359827 Retrieves the Scopus document with Scopus ID ‘0027359827’

Author retrieval http://api.elsevier.com/content/author/AUTHOR_ID:44372231200?view=STANDARD Retrieves a ‘standard’ view of the author profile with Scopus author ID ‘44372231200’

Affiliation retrieval http://api.elsevier.com/content/affiliation/AFFILIATION_ID:60016849?view=COMPLETE Retrieves a ‘complete’ view of the profile of the institute that has Scopus affiliationID ‘60016849’

Serial title information http://api.elsevier.com/content/serial/title?ISSN=07400551 Searches for/retrieves information about the journal of which the ISSN is ‘07400551’

Page 32: China Science Challenge

Developer NetworkVIEWS and FIELDS

A request to retrieve information can specify the fields that you want to retrieve. You can use a view with predefined fields or you can specify which particular fields you seek to return. Which views and which fields are available depends on the content-category: article (full text), abstract, author, or affiliation.

View

META Metadata

META_ABS Metadata and Abstract

META_ABS_REF Metadata, Abstract and References

REF Resolved References

FULL Full Text

PDF Full Text PDF

http://developer.sciverse.com/sciversecontentapiretrievalviews

Page 33: China Science Challenge

Developer NetworkVIEWS and FIELDS

The {content-category} identifies the type of content. This is divided into:article–Serial and non-serial full text documents from journals and books published by Elsevierabstract– Abstracts from Scopusauthor– Author profiles generated from Scopus data.affiliation – Affiliation profiles generated from Scopus data.

The {identifier_label} distinguishes the type of identifier :DOI - for full-text documents, SCOPUS_ID, AUTHOD_ID - Elsevier identifier tied to an individual author, AFFIL_ID -Elsevier identifier tied to an institution (for use as an affiliation)

Other available unique identifiers available for use:PII - Publisher Item Identifier , PUBMED_ID

Page 34: China Science Challenge

Developer NetworkSearch Facets

Page 35: China Science Challenge

Developer NetworkSciVerse – Mashup

<script type=‘text/javascript’>var myapikey = ‘aaaass223ssss’;function fnCreateMashup(){ gadgets.sciverse.getContextInfo(fnContextInfoCallback);}

funtion fnContentInfoCallback(response){ var search = response.searchQuery; var url = ‘http://api.nytimes.com/svc/search/v1/article?query=‘+search+’&api-key=‘+myapikey+ ‘format=json’; var params = { ‘href’ : url, ‘format’ : ‘json’, ‘authz’ : ‘none’ }; osapi.http.get(params1).execute(fnNyTimesCallback);}

function fnNyTimesCallback(nytimesResponse) { var output = ‘’; // using jquery $.each(nytimesResponse.content.results, function(I, result){ output = output + result.data + ‘ – ‘ + result.title; }}gadgets.util.registerOnLoadHandler(fnCreateMashup);</script>