Project Nimbus

Data and Services Marketplace for Innovators

Project Nimbus Preview is On!

leave a comment »

Yes! We have the first cut of Project Nimbus data services ready for public preview. To find out more on how you can get started to innovate with the available data services, click the “Getting Started” icon on the right navigation bar or here:
http://projectnimbus.org/getting-started/

Rock On!

Written by projectnimbus

March 1, 2010 at 3:07 pm

Posted in Uncategorized

Authentication Information in the request header

with one comment

Hi Innovators,

We hope you have been viewing the quick start videos.Those videos are meant to give you a better understanding on how the Project Nimbus  data services can be of help for you.

Some of you have gotten your tokens and have been using the data services. We thank your enthusiasm.

This post is for those who may need a little more help with the authentication with the process.

In the below example, we are using the scenario when an innovator is make a data service call to https://api.projectnimbus.org/HGWoDataService.svc/RestaurantSet
The header information in the request will look something like below:

GET /hgwodataservice.svc/RestaurantSet HTTP/1.1

AccountKey: mAnf12J0x9V6vnql2kbePuoWUJs-
UniqueUserID: 00000000000000000000000000000001
Accept: */*
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)
Accept-Language: en-SG
Accept-Encoding: GZIP
Host: api.projectnimbus.org
Connection: Keep-Alive

The 2 piece of necessary information required is the AccountKey & UniqueUserID. 

The AccountKey is  a pre-generated string of characters that we  issue to innovators who will like to access the Nimbus API. Just insert your accountkey properly in this part of the header.
The UniqueUserID is  a globally unique identifier or GUID (see http://en.wikipedia.org/wiki/Globally_Unique_Identifier for more information) it is a  string of 32 hexadecimal characters. The UniqueUserID  is a desgin decision as a required information  to facilitate future features of the data service. (We will write about this soon)
It is safe to say that you can use any system-generated GUID  for your request headers for now. (Please note that  a string of Zeros.”0″ will not do the trick :P )

Both Valid Account Key value and UniqueUserID value (GUID) are  required to successfully authenticate with data service. If not, a 403 error will occur with an error message stating ”Authentication Headers are not present”.

Hope this helps. Check out the following links to see related information.

Refer to http://projectnimbus.org/getting-started/ on how you can get your UserID and look within  the code samples on how  are the information added to the request headers.
The video on the post: http://projectnimbus.org/2010/02/23/what-is-returned-from-data-service/ covers in brief how the authentication works.

Written by projectnimbus

March 3, 2010 at 8:46 am

Posted in Uncategorized

AJAX & JSON

leave a comment »

Hi Developers!

Want to check out a neat trick to work with JSON and AJAX for your applications with Nimbus? Check this out!

Video Highlights

  • Using AJAX & JSON
    - Workaround for using ajax for a data service on a different domain.
    - Converting array of objects to JSON encoding using ‘json_encode()’
    - Displaying out JSON string on a page
    - Consuming JSON page with JQuery Javascript Framework.

Check out the below links for more information on the $filter functions, sample code and JQuery help.

Hope you’ve enjoyed this trick.

Sample Source Code: http://cid-d24f60570e158b5f.skydrive.live.com/self.aspx/Public/phpSample.zip

JQuery Javascript Framework: http://www.jquery.com

Written by projectnimbus

March 1, 2010 at 2:58 pm

Posted in Uncategorized

Data sets Available in Project Nimbus Preview

leave a comment »

Hi Innovators,

Following from the post on how the data results from the Project Nimbus services look like:
http://projectnimbus.org/2010/02/23/what-is-returned-from-data-service
We are briefly sharing  with you on what Data Sets are available  in the Preview release of  Project Nimbus.

Amongst the plentiful line-up of datasets which our gracious content providers have given us, we have selected restaurant data, traffic data, weather data and library data for the preview. (see the links below)

In general, we refer the  URL with the ‘*.svc/’ as the ‘Service End-point’ .
You will notice that we have assigned a  unique Service End-point to each content owner. Though a single content provider may offer one or more datasets, these datasets will have the same service end-points. You will access the different datasets via the suffix you append the call. (Do not worry, we will be providing more details soon and these will be clearer to you as you start using the data services. :) )

At this phase in the Nimbus preview, you can look at the available Data Sets from each of the content providers with their  service endpoint. If you want to find out exactly what fields and attributes are available with regards to the Data Sets, you append “$metadata” to the service end-point.   You can do all these with a web browser, no authentication to take a peek at the list of data sets or the meta-data :P

For example, if we are to take a look at what information is available from our  weather data content provider,
we’ll  hit this: https://nea.projectnimbus.org/neaodataservice.svc/
You will see that there are 2 sets of data available, namely Forecast and Nowcast.
If you’ll like to see the attributes /fields you will get for the query results, hit this: https://nea.projectnimbus.org/neaodataservice.svc/$metadata

It’s easy. :) Look to the blog post on “What is returned from Data Service” and the other posts to see how you can use the results in your applications!

Hack away, Innovate and Rock on!

P.S.: Please include the “/” at the end of the URL of the Service End-point. It’s part of it. :)

Restaurant Data:
List of Data Sets: https://hgw.projectnimbus.org/hgwodataservice.svc/
Metadata: https://hgw.projectnimbus.org/hgwodataservice.svc/$metadata

Traffic Data:
List of Data Sets: https://lta.projectnimbus.org/ltaodataservice.svc/
Metadata:  https://lta.projectnimbus.org/ltaodataservice.svc/$metadata

Weather Data:
List of Data Sets: https://nea.projectnimbus.org/neaodataservice.svc/
Metadata: https://nea.projectnimbus.org/neaodataservice.svc/$metadata

Library Data:
List of Data Sets: https://nlb.projectnimbus.org/nlbodataservice.svc/
Metadata: https://nlb.projectnimbus.org/nlbodataservice.svc/$metadata

Written by projectnimbus

March 1, 2010 at 5:16 am

Posted in Uncategorized

C# Proxy Classes

with one comment

Hi all! 

Here are all the proxy classes for the current data sets. 

Hungry Go Where: http://cid-d24f60570e158b5f.skydrive.live.com/self.aspx/Work/Nimbus/C%5E3%20Proxy%20Classes/HungryGoWhereProxy.cs 

Land Transport Authority: http://cid-d24f60570e158b5f.skydrive.live.com/self.aspx/Work/Nimbus/C%5E3%20Proxy%20Classes/LTAProxy.cs 

National Envionment Agency: http://cid-d24f60570e158b5f.skydrive.live.com/self.aspx/Work/Nimbus/C%5E3%20Proxy%20Classes/NEAProxy.cs 

National Library Board: http://cid-d24f60570e158b5f.skydrive.live.com/self.aspx/Work/Nimbus/C%5E3%20Proxy%20Classes/NLBProxy.cs 

— 

Exploring CS file contents: 

I would advise everyone to peek into the CS file to see what it has. There are 2 main things to take note before using the class file namely the ‘Namespace’, ‘Entity Name’ and ‘Data Service URI’.

The ’Data Service URI’ is self explanatory. Taking Hungry Go Where as example, the value will be:
https://api.projectnimbus.org/hgwodataservice.svc/ 

Lets take Hungry-Go-Where’s CS File for example. At the very top of the file after the namespace, you will see this: 

partial class HGWEntities : global::System.Data.Services.Client.DataServiceContext 

In this case, our ‘Entity Name’ is “HGWEntities” 

In our next phase, we would be using ‘Namespace’, ‘Entity Name’ and ‘Data Service URI’ as reference to these mentioned in the current phase. 

Usage: 

  1. Include the cs file in your project.
  2. Create a new instance of the Entity.
    e.g; Namespace.EntityName newInstance = new Namespace.EntityName(new Uri(“Data Service URI”));
  3. Add a static void method to modify request headers,
    e.g;  private static void ModifyRequest(object sender, SendingRequestEventArgs e)
            {
                e.Request.Headers.Add(“AccountKey”, “AccountKeyHere“);
                e.Request.Headers.Add(“UniqueUserID”, Guid.NewGuid().ToString());
            }
    Note: You must change the AccountKey with your own Account Key value and you may choose to change the UniqueUserID to any GUID.
  4. Add an event handler to intercept the request before sending the request to the data service.
    e.g;  newInstance.SendingRequest += ModifyRequest;

You all all ready to go by now. :) Next is using the methods inside the newInstance which you have instantiated.

For Hungry Go Where, there is a collection named RestaurantSet (refer to data service uri: https://api.projectnimbus.org/hgwodataservice.svc/  ) so you can use it by simply calling ‘newInstance.RestaurantSet’ .

Have fun playing with the data service ;)

Written by projectnimbus

March 1, 2010 at 4:55 am

Posted in Uncategorized

Akang Datang: Nimbus Data Services Preview

leave a comment »

Hi Innovators @ SG,

Thank you for your patience and support.
It’s been a while since our last post as we were busy building the data services for the information provided by our generous Content Providers. (You know who you are, thumbs up to you!)Well, for those who have been waiting to see and taste how the Nimbus services look and taste like, the wait will soon be over.

We will be announcing  a preview of the  data services  next week.

You will be getting:
- tokens to access the preview API (by email invitations)
- “How-to” videos
- Sample codes
- Quick start guides

Some of the above mentioned contents will be slowly made available over this weekend.

So look out for the next few post, and put on your innovators’ cap and get ready to Innovate.

Rock On!

Written by projectnimbus

February 26, 2010 at 11:59 am

Posted in Uncategorized

Consuming Data Services via Java/Android

leave a comment »

In this video, we will demonstrate how we connect JAVA/Android application to the Nimbus data services.

Video Highlights 

  • Introduction
    -
    In JAVA/Android, we don’t have any utility to generate Entity Classes compared to .NET or PHP, in other words, we have to do it manually.
  • Querying Data Service
    - The same idea as querying the Data Service from your Web Browser.
    - Creating a URLConnection.
    Eg; URL url = new URL(“{Data Service URI Here}” + “[?$filter={filters here}(Optional)]“);
    - Adding Authentication Information.
    Eg; conn.addRequestProperty(“AccountKey”, “{Account Key Value Here}”);
           conn.addRequestProperty(“UniqueUserID”, “{GUID Value Here}”);
    - Executing the URLConnection and getting the result in Atom Feed format.
    Eg; BufferedReader bf = new BufferedReader(new InputStreamReader(conn.getInputStream()),8000);
  • Parsing Atom Feed (Easy/Lazy Way)
    - The properties of the Entity in the results is encapsulated by the ”<m:properties>” tag.
    - Assuming that the atom feed is stored in a String variable myAtomFeed, we can get the entities by splitting by the string “<m:properties>”.
    Eg; myAtomFeed.split(“<m:properties>”); //it will return you an array of String
    - You can easily iterate through this array of String and get the properties values out by doing a getStringBetween() custom function to extract the values between the two string values found in the specified string.
    getStringBetween() source (for the lazy ones like me :P ):
     public static String getStringBetween(String src, String start, String end){
      StringBuilder sb = new StringBuilder();
      int startIdx = src.indexOf(start) + start.length();
      int endIdx = src.indexOf(end);
      while(startIdx < endIdx){
       sb.append(“” + String.valueOf(src.charAt(startIdx)));
       startIdx++;
      }
      return sb.toString();
     }
    usage: if we have a string variable called myAtomFeed = “<d:CuisineType>Malay</d:CuisineType>”,
    by executing this: getStringBetween(myAtomFeed,”<d:CuisineType>”,”</d:CuisineType>”); we will get the string “Malay” back. :D This is as simple as that!- Once you have access to the property’s value, you can construct a class and create objects and store it inside an Array or ArrayList. :) So in short, you have just completed your simplest parser.         

Written by projectnimbus

February 24, 2010 at 8:48 am

Posted in Uncategorized

Consuming Data Service in VS2010

leave a comment »

Hi .NET Developers!

This post is dedicated to you! In the following video, we will walk you through on how you can readily add the Nimbus data services as reference service to your .NET project! 

Video Highlights

  • Pre Generated C# Classes
    - Due to the modifications of the service, you cannot generate the Entity Classes via Visual Studio. We will provide you with a C# file to consume the web service.
  • Making a request & adding filters via Linq
    - Simply create an instance of the object to make requests to the data service.
    - Further filter the query by using Linq statements. Format: InstanceName.Where(x => x.Column < 10);
    - Using results as an Array of Objects or List of Object via the ToArray() or ToList() function.
       eg; InstanceName[] instanceArr = InstanceName.Where(x => x.Column < 10).ToArray();

Well, using C# to access our data services can be a plus because we have generated the entity classes you need for you to use free of charge! :) See the link below for the C# entity classes and code sample.
http://projectnimbus.org/2010/03/01/csharp-proxy-classes/

That aside, I hope you find this resources useful on your journey of learning how to consume data services from Nimbus Project.

Rock On!

Written by projectnimbus

February 24, 2010 at 7:27 am

Posted in Uncategorized

PHP Toolkit for ADO.NET Data Services

leave a comment »

Hi Innovators,

For those who favours PHP and AJAX for your approach to apps, this post is dedicated to you! :P

In the 2 clips below,  Jason will walk through how you can use the Project Nimbus data service in your PHP apps!

Video Highlights

  • PHP ADO.NET Toolkit
    - A set of tools to help you generate the Entity classes for PHP to access the data services. | Download: http://phpdataservices.codeplex.com/ 
  • Generating Entity Classes
    - Using command prompt (cmd.exe), run PHPDataSvcUtil.php using the php.exe binary
    - Usage: php PHPDataSvcUtil.php /uri:{Data Service URI}
    Eg; php php PHPDataSvcUtil.php /uri:http://lta.projectnimbus.org/ltaodataservice.svc/After which, an Entity Class will be generated in the same directory as PHPDataSvcUtil.php named LTAEntities.php
  • Using Generated Entity Classes
    -
    include the generated class in your PHP page.
    - ‘ExecuteQuery’ function to query from Data Service. | Format: ExecuteQuery(“{Data Set Name}+[{filters}]“);

Hope you have fun coding your PHP applications with the above tools and the newly-available data sets from Project Nimbus.
Check out the below links for more information on the $filter functions, sample code and JQuery help.

Till the next post!
Hack away!

$filter functions: http://blogs.msdn.com/marcelolr/archive/2008/01/15/arithmetic-and-built-in-functions-for-filter.aspx

Sample Source Code: http://cid-d24f60570e158b5f.skydrive.live.com/self.aspx/Public/phpSample.zip

JQuery Javascript Framework: http://www.jquery.com

Written by projectnimbus

February 23, 2010 at 8:39 am

Posted in Uncategorized

What is returned from Data Service

with 2 comments

Hi Innovators!

This is the first of many other videos where we will be showing how you can access and make the best use of the Nimbus data services to help you with your innovations.
In this video, we will show you how you can make a query to the Nimbus data service and what results you will be getting.

Video Highlights

  • Accessing Data Service via a Web Browser
    -  format: [DATA SERVICE URI]+[Data Set Name]+[AuthenticationDetails(AccountKey & UniqueUserID)]+[Filters (Optional) ]
    - Authentication will be placed into the ‘Request Header’ instead of the QueryString in Release 1 of Project Nimbus.
    - Authentication comprises of the ‘AccountKey’ which is similar to an API Key and a ‘UniqueUserID’ which is just a GUID.
    - Authentication is needed for metering/billing
  • Content Returned
    - Default content is an Atom Feed.
    - If ‘Accept’ in your request header is set to “application/json” a JSON formatted string will be returned to the client. 

Hi everyone! Really hope you found the video useful.

Here are some of the links you can try in your browser to test the services.

http://nimbusproject.cloudapp.net/neaodataservice.svc/ForecastSet?AccountKey=NimbusAdmin&UniqueUserID=A66D951F49F54A63B040CFAA2FD553C0

http://nimbusproject.cloudapp.net/neaodataservice.svc/NowcastSet?AccountKey=NimbusAdmin&UniqueUserID=A66D951F49F54A63B040CFAA2FD553C0

Please take note that the authentication details “AccountKey” & “UniqueUserID” is now appended in the URI as QueryString parameters. In Release 1, you will have to put these authentication details in the Request Header instead. A little more information about ’AccountKey’ and ‘UniqueUserID’: http://projectnimbus.org/2010/03/03/authentication-information-in-the-request-header/

Written by projectnimbus

February 23, 2010 at 8:29 am

Posted in Uncategorized