Data Applied: Developer Quicklook

343 views
314 views

Published on

Data Applied: Developer Quicklook

Published in: Technology, News & Politics
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
343
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Data Applied: Developer Quicklook

  1. 1. 5<br /> Data-Applied.com: Quick Look For Developers<br />
  2. 2. Getting started<br />To get the login username and password, register at:<br />http://www.data-applied.com/App/<br />This will work in only those browsers which support Microsoft Silverlight<br />Confirm the registration from your email account<br />The username and password set will be used to login before one can use there XML based API<br />One can also use there XML based API to do the registration (to be covered later)<br />
  3. 3. XML based API<br />One can communicate with data-applied using there XML based API<br />Requests and Replies from data-applied are sent in XML format<br />Request XML should be in UTF-8 format<br />Requests needs to be submitted at http://www.data-applied.com/app/Execute/default.aspx<br />
  4. 4. A quick example<br />Now we will demonstrate how to do:<br />Quick login<br />Obtain a ticket in response which is a must to validate further queried<br />We have the login XML in file login.xml:<br />&lt;LogonMessage&gt;<br /> &lt;Instance&gt; <br /> &lt;UserInfo&gt; <br /> &lt;Password&gt;passwor&lt;/Password&gt; <br /> &lt;Name&gt;xyz&lt;/Name&gt; <br /> &lt;/UserInfo&gt; <br /> &lt;/Instance&gt;<br /> &lt;/LogonMessage&gt; <br />
  5. 5. A quick example<br />We read this file, login.xml, in a string:<br />login _string = open(‘login.xml’,’r’).read()<br />Convert the string to UTF-8<br /> login_string_utf = unicode(login_string,’utf-8’)<br />Now we are ready to send our request. Sending this request using HTTP (in a quick but inefficient way, just for demonstration):<br /> reply = urllib.urlopen(“http://www.data-applied.com/app/Execute/default.aspx”, login_string_utf)<br />If the credentials provided were correct, then the reply will give us the XML in reply to our request<br />reply_xml = reply.read()<br />
  6. 6. A quick example<br />Reply XML looks like:<br />&lt;LogonMessage&gt;<br /> &lt;Instance&gt;<br /> &lt;UserInfo&gt;<br /> &lt;Id&gt;id&lt;/Id&gt;<br /> &lt;Name&gt;username&lt;/Name&gt;<br /> &lt;FirstName&gt;fname&lt;/FirstName&gt;<br /> &lt;LastName&gt;lname&lt;/LastName&gt;<br /> &lt;EmailAddress&gt;xyz@zyz.com&lt;/EmailAddress&gt;<br /> &lt;DateCreated&gt;01/12/2010 02:25:35&lt;/DateCreated&gt;<br />&lt;LicenseKey&gt;Organization=*;Workspaces=1;Tables=1;Rows=500;Fields=6;FileSize=102400;Tasks=1;Priority=0;;UserName=username;:*&lt;/LicenseKey&gt;<br /> &lt;/UserInfo&gt;<br /> &lt;/Instance&gt;<br /> &lt;Version&gt;1.1&lt;/Version&gt;<br /> &lt;Ticket&gt;ticket&lt;/Ticket&gt;<br />&lt;/LogonMessage&gt;<br />And by parsing this XML all the relevant information can be extracted<br />
  7. 7. Brief overview of the API<br />Important components of the API are:<br />Entities<br />Messages<br />Entities are transmitted as a part of messages<br />Messages represent actions<br /><ul><li>More details regarding submission of requests, Serializing, Versioning Messages can be viewed at http://data-applied.com/Web/Developers/Recipies.aspx</li></li></ul><li>Brief overview of the API<br />Entities <br />Represent objects such as workspaces, tables, fields, tasks, or task results<br />Entities are transmitted through messages<br />Entities should be serialized to XML<br />Each entity has some properties, and these properties can be of the three types:<br />Calculated: Calculated properties are automatically set by the system, and cannot be changed using update request<br />Set Once: Set once properties can be set by the user upon entity creation, but cannot subsequently be changed (only read)<br />Filtered: Filtered properties are removed or filtered because they contain confidential information (searches referencing them are also blocked)<br /><ul><li>The whole message specification can be viewed at http://data-applied.com/Web/Developers/Entities.aspx</li></li></ul><li>Brief overview of the API<br />Messages <br />Represent actions such as create, retrieve, update, or delete<br />Messages can transmit entities<br />Messages should be serialized to XML and are sent as HTTP request/response<br />Each message has some properties, and these properties can be of the three types:<br />Entity: Indicates that the property contains a wrapped entity. Depending on the type of message, only some properties of the entity may need to be set<br />Object: Indicates that the property contains a wrapped object which is not an entity. For example, this could be a condition restriction object.<br />Array: Indicates that the property is in fact an array containing multiple simple values, multiple wrapped entities, etc.<br /><ul><li>The whole message specification can be viewed at http://data-applied.com/Web/Developers/Messages.aspx</li></li></ul><li>An Example<br />We want upload chunks of data from a local CSV file to one of our workspace on data-applied<br />For this we will use:<br />Entity: ChunkInfo<br />Message: CreateMessage<br />
  8. 8. An Example<br />ChunkInfoentity has the following properties:<br />
  9. 9. An Example<br />So using the properties of ChunkInfo , our message will look like:<br />&lt;CreateMessage&gt;<br /> &lt;Instance&gt;&lt;ChunkInfo&gt;   &lt;WorkspaceInfoId&gt;4f5ad0e3-8ef5-...&lt;/WorkspaceInfoId&gt;   &lt;TableInfoId&gt;ddb37ed0-cc91-...&lt;/TableInfoId&gt;   &lt;FileName&gt;data.csv&lt;/FileName&gt;   &lt;Content&gt;...[base64 data]...&lt;/Content&gt;   &lt;HasFieldHeader&gt;True&lt;/HasFieldHeader&gt; &lt;/ChunkInfo&gt;<br /> &lt;/Instance&gt;<br /> &lt;Ticket&gt;...&lt;/Ticket&gt;<br />&lt;/CreateMessage&gt;<br />
  10. 10. Current status of API<br />As of now data –applied has a functional C# library over its XML based API<br /><ul><li>http://data-applied.com/Web/Downloads/csharp_v1.0.zip</li></ul>For user wanting to use some other language, one has to create there own XML messages and send them using HTTP<br />As communicated by Data-applied, we ‘might’ have XML templates available later<br />
  11. 11. Visit more self help tutorials<br /><ul><li>Pick a tutorial of your choice and browse through it at your own pace.
  12. 12. The tutorials section is free, self-guiding and will not involve any additional support.
  13. 13. Visit us at www.dataminingtools.net</li>

×