China Science Challenge


Published on

Published in: Education
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

China Science Challenge

  1. 1. Developer Network<br />INTRODUCTION<br />
  2. 2. Developer Network<br />Elsevier and SciVerse<br />Elsevier publishes 25% of the world’s Scientific, Technical and Medical (STM) content: <br /><ul><li>more than 10 million full-text articles from 2600 journals in ScienceDirect,
  3. 3. more than 40 million abstracts and author, affiliation information in Scopus.
  4. 4. all content from Elsevier and scientific world wide web in Hub. </li></ul>SciVerse embeds applications within scientific content, giving developers and apps access via framework and content APIs. <br />SciVerse is an extension of Apache Shindig, an implementation of OpenSocial. Sciverse apps can access content via open APIs.<br />
  5. 5. Developer Network<br />2011 The WAR of the INTERNETS<br />
  6. 6. Developer Network<br />Social Apps Web<br />Both Facebook and Google are the same type of social network with applications. Facebook owns the social network, Google owns search. <br />Elsevier’s SciVerse is social apps for scientific search. <br />OpenSocial<br />SciVerse 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.<br />The OpenSocial standard is worldwide used by sites with around 900 million users (Facebook has 500 million users):<br /><ul><li>Hi5
  7. 7. MySpace
  8. 8. Orkut
  9. 9. Friendster
  10. 10. ZDNet
  11. 11. RenRen
  12. 12. LinkedIn
  13. 13. Ning
  14. 14. SalesForce
  15. 15. Hyves
  16. 16. Imeem
  17. 17. Yahoo
  18. 18. Net
  19. 19. SciVerse</li></li></ul><li>Developer Network<br />Elsevier SciVerse – science, there’s an app for that<br />Browser Apps <br />iPhone Apps<br />1 billion downloads<br />350,000 apps<br />Facebook Apps<br />500 million users<br />
  20. 20. Developer Network<br />2011 – Social Apps based Business<br />
  21. 21. Developer Network<br />
  22. 22. Developer Network<br />STM Publishing<br />Elsevier publishes 25% of the world’s Science, Technology and Medical (STM) Publications<br />ScienceDirect: 10 million full text articles in 2,500 journals <br />Scopus: 42 million abstracts, citations, authors and affiliations <br />Hub: plus web content covering 18,000 titles from over 5,000 publishers<br />And META-DATA <br />
  23. 23. Developer Network<br />A list of search results with facets in SciVerse Hub<br />
  24. 24. Developer Network<br />Elsevier | Developer Network<br />With SciVerse APPS (search result analysis app)<br />
  25. 25. Developer Network<br />an abstract for a scientific article with tables and references <br />
  26. 26. Developer Network<br />Elsevier | Developer Network<br />With SciVerse APPS (genome viewer and protein network viewer)<br />
  27. 27. Developer Network<br />Full text article in ScienceDirect with popup APP (related content by nextbio)<br />
  28. 28. Developer Network<br />PART 1 – TECHNOLOGY PLATFORM <br />
  29. 29. Developer Network<br />OpenSocial Architecture<br />IFRAME<br />http request<br />HTTP SERVER<br />Shindig Server<br />Gadget Renderer Servlet<br />Data Service Servlet<br />Apache Shindig is an implementation of the OpenSocial specification.<br />Gadget Server<br />Data Handler<br />Container<br />People<br />Activities<br />Gadget <br />App Data<br />DB1<br />DB2<br />Javascript Libraries<br />Gadget.xml<br />
  30. 30. Developer Network<br />SciVerse Architecture<br />SciVerse extends Apache Shindig. SciVerse gadgets can access the context of the page in which they appear via so called Framework APIs.<br />
  31. 31. Developer Network<br />SciVerse – Integration Points<br />Apps appear as iframes in so-called views or integration points in the webpage.<br />17<br />
  32. 32. Developer Network<br />What is a Gadget? The IFRAME Revolution<br />OpenSocial Gadgets<br />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.<br />IFRAME<br /><iframesrc="iframe1.html" width=“400" height=“200"><br />Hello World!<br /></iframe><br />GADGET.XML (example 1)<br /><?xml version="1.0" encoding="UTF-8"?><br /><Module><br /> <ModulePrefs title=“HellowWorld1" author_email=“"><br /> <Require feature="opensocial-0.9" /><br /> </ModulePrefs><br /> <Content type="html" view="profile"><![CDATA[<br /> <script type=‘text/javascript’> <br />function fnWrite() {<br />getElementById(‘content-div’).innerHTML = “Hello World”;<br />}<br /> </script><br /> <div id=‘content-div’></div><br /> ]]></Content><br /></Module><br />
  33. 33. Developer Network<br />Example 1 – OpenSocial Definition File or gadget.xml<br /><?xml version="1.0" encoding="UTF-8"?><br /><Module><br /> <ModulePrefs title="SciVerseExamples-ContentAPICall1" author_email="CaprioR@your.domain"><br /> <Require feature="opensocial-0.9" /><br /> <Require feature="sciverse" /><br /> <Require feature="hub" /><br /> <Require feature="org.jquery.core-1.4.2" /><br /> </ModulePrefs><br /> <Content type="html" view="canvas"><![CDATA[<br /><!-- The code for Canvas view is here. --><br />]]></Content><br /> <Content type="html" view="profile"><![CDATA[<br />Profile View<br />]]></Content><br /> <Content type="html" view="sciverseResultsView"><![CDATA[<br /><!-- The code for SciverseResultsViewview is here. --><br /><div>Sciverse Results View view for SciVerseExamples-ContentAPICall1.</div><br /> ]]></Content><br /></Module><br />
  34. 34. Developer Network<br />Object Oriented JavaScript<br />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. <br />Therefore, follow Object Oriented design principles and create ‘un-obtrusive’ code:<br /><ul><li> Model View Control (MVC): separate data from model (JavaScript) and view (HTML).
  35. 35. Where possible create Object Oriented code that you can re-use
  36. 36. Create packages to separate namespaces to avoid naming conflicts
  37. 37. Create re-usable libraries for common code</li></ul> In addition test, debug and compress your code to improve performance and increase stability.<br />
  38. 38. Developer Network<br />Example 2 – Object Oriented JavaScript<br />// create a class for SciVerseSearch<br />function SciverseSearch() {<br /> …<br />}<br />// create a static class variable<br />SciverseSearch.View = {<br /> STANDARD: 'STANDARD',<br /> COMPLETE: 'COMPLETE'<br />}<br />// create a method instance for a query method<br />SciverseSearch.prototype.execute = function(query) {<br /> …<br />}<br />// create a setter for the view variable<br />SciverseSearch.prototype.setView = function(view) {<br />this.view = view;<br />}<br />// Now instantiate the class and call its method<br />varsciverse = new SciverseSearch();<br />sciverse.setView(SciverseSearch.View.COMPLETE); <br />sciverse.execute(query);<br />
  39. 39. Developer Network<br />Debugging JavaScript <br />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.<br />The Developer Blog has an article with a <br />Complete overview of debuggers for the main<br />4 browsers at<br />Blog Post:<br />Complete Overview: Debugging JavaScript and SciVerse Apps in FireFox, <br />Opera, Safari, Chrome, IE<br />
  40. 40. Developer Network<br />PART 2 – GADGET PROGRAMMING<br />
  41. 41. Developer Network<br />SciVerse APIs<br />There are two main APIs for SciVerse:<br />Framework API – with access to context and methods on the page<br />Content API – for search and retrieval of articles, authors and affiliations<br />
  42. 42. Developer Network<br />SciVerse – Framework API<br />The Framework API allows the app to access context and methods of the page. <br /><br />
  43. 43. Developer Network<br />
  44. 44. Developer Network<br />SciVerse – Framework API - ContextInfo<br />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:<br />accountId, artNum, au1, au1First, au1Init, au1Suffix, au1Sur, auCorp, <br />authorKeywords, date, docTitle, doi, entitlement, genre, <br />indexTerms, individualUser, isbn, issn, issue, keywords, offset, originPage, <br />otherKeywords, pageContentDivTagName, pages, pageType, part, partTitle, <br />partValue, pii, platform, scDocId, scopusFlag, searchQuery, searchTerms, <br />secureAuthtoken, sortOrder, sPage, srcTitle, ssn, timestamp, volume, year<br />// retrieving the authtokenvia the GetContextInfo method’s callback<br />function getContextInfoCallback(result){<br /> // get authtoken for content API call<br />varauthtoken = result.secureAuthtoken;<br />varsearchterm = result.searchTerms;<br />}<br />// retrieving the authToken via the gadget preferences<br /><script type="text/javascript"><br />varprefs = new gadgets.Prefs();<br />varauthtoken= prefs.getString("secureAuthtoken");                               <br /></script><br />
  45. 45. Developer Network<br />Example - How to retrieve the authToken for the Content API call?<br />function init(){<br />gadgets.sciverse.getContextInfo(getContextInfoCallback); // this parameter is the callback method<br />}<br />function getContextInfoCallback(result){<br /> // get authtoken for content API call<br />varauthtoken = result.secureAuthtoken;<br />varsearchterm = result.searchTerms;<br />}<br />// after pageload finishes, this executes the init method, which will trigger following functions<br />gadgets.util.registerOnLoadHandler(init);<br />OR <br /><UserPref name="contentApiKey" datatype="hidden" default_value="your-api-key-here" /> <br /><UserPref name="secureAuthtoken" datatype="hidden" /> <br />…<br /><script type="text/javascript"><br />varprefs = new gadgets.Prefs();<br />varauthToken = prefs.getString("secureAuthtoken"); <br /></script><br />Also, see the example code at <br /><br />
  46. 46. Developer Network<br />SciVerse Content API<br />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:<br />
  47. 47. Developer Network<br />Example - Content API - search<br />Hub Search<br /><br />Searches for documents in Hub that mention the term ‘heart attack’ <br />ScienceDirect Search<br /><br />Searches for documents in ScienceDirect that have ‘decay’ in the title and that were published in 2007 <br />Scopus search<br />Searches for documents in Scopus in the area of chemistry written by people with last name “McKinley” <br />Author search <br /><br />Searches for authors that are affiliated with the institute that has affiliationID ‘60032114’ and whose last name is ‘smith’ <br />Affiliation search <br /><br />Searches for affiliation profiles (i.e. institutes) with Rotterdam in their name or description <br />
  48. 48. Developer Network<br />Example - Content API - retrieval<br />Full-text retrieval (ScienceDirect) <br /><br />Retrieves the full-text version of the ScienceDirect document with DOI ‘10.1016/0092-8674(93)90500-P’ <br />Abstract retrieval (Scopus) <br /><br />Retrieves the Scopus document with Scopus ID ‘0027359827’ <br />Author retrieval <br /><br />Retrieves a ‘standard’ view of the author profile with Scopus author ID ‘44372231200’ <br />Affiliation retrieval <br /><br />Retrieves a ‘complete’ view of the profile of the institute that has Scopus affiliationID ‘60016849’ <br />Serial title information <br /><br />Searches for/retrieves information about the journal of which the ISSN is ‘07400551’<br />
  49. 49. Developer Network<br />VIEWS and FIELDS<br />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.<br /><br />
  50. 50. Developer Network<br />VIEWS and FIELDS<br />The {content-category} identifies the type of content. This is divided into:<br />article–Serial and non-serial full text documents from journals and books published by Elsevier<br />abstract– Abstracts from Scopus<br />author– Author profiles generated from Scopus data.<br />affiliation – Affiliation profiles generated from Scopus data.<br />The {identifier_label} distinguishes the type of identifier :<br />DOI - for full-text documents, <br />SCOPUS_ID, <br />AUTHOD_ID - Elsevier identifier tied to an individual author, AFFIL_ID -Elsevier identifier tied to an institution (for use as an affiliation)<br />Other available unique identifiers available for use:<br />PII - Publisher Item Identifier , <br />PUBMED_ID<br />
  51. 51. Developer Network<br />Search Facets<br />
  52. 52. Developer Network<br />SciVerse – Mashup<br /><script type=‘text/javascript’><br />varmyapikey = ‘aaaass223ssss’;<br />function fnCreateMashup(){<br />gadgets.sciverse.getContextInfo(fnContextInfoCallback);<br />}<br />funtionfnContentInfoCallback(response){<br />var search = response.searchQuery;<br />varurl = ‘‘+search+’&api-key=‘+myapikey+<br /> ‘format=json’;<br />varparams = {<br /> ‘href’ : url,<br /> ‘format’ : ‘json’,<br /> ‘authz’ : ‘none’<br /> };<br />osapi.http.get(params1).execute(fnNyTimesCallback);<br />}<br />function fnNyTimesCallback(nytimesResponse) {<br />var output = ‘’;<br /> // using jquery<br /> $.each(nytimesResponse.content.results, function(I, result){<br /> output = output + + ‘ – ‘ + result.title;<br /> }<br />}<br />gadgets.util.registerOnLoadHandler(fnCreateMashup);<br /></script><br />