Free Web Hosting Provider - Web Hosting - E-commerce - High Speed Internet - Free Web Page
Search the Web

Web-service com.datascience.gal.service.Service documentation
DSaS API Documentation

The DSaS API is organized around REST. Our API is designed to have predictable, resource-oriented URLS, to use HTTP response codes to indicate API errors, and to use built-in HTTP features. JSON will be returned in all responses from the API, including errors.

Service

Class com.datascience.gal.service.Service is a web-service container, binded to the http://23.21.128.180:8080/GetAnotherLabel/rest url, could be runned locally on [SERVER HOST:PORT]/GetAnotherLabel/rest.

Be aware that url is not correct till the right web-method [with parameter[s]] `s[`ve] been added, such as (please be familiar with Summary of Resource URL Patterns section) reset, exists, loadCategories e.g.

Brief Intro

To setup locally the project you may need Maven (3.x.x) (cmd mvn --version), Tomcat 6, JRE/JDK(1.6, 6.x.0_x), MySQL.

MSQL is needed ONLY if you are suppose to use Web-Service named Service, for other purposes of using DSaS you may be interested in reading How to run DSaS

What for do we need database? Which Pitfalls could we be faced with?

We need database to save to/load from by Id any data structure, such as BatchDawidSkene/IncrementalDawidSkene, Category, various collections e.g.

Every web-method which contain id parameter always refers to the specific record of the table in database. Yes, right, ONE table, which gives a hand every entity, of any type, any time. Web-methods are NOT syncronized at the current stage of development. Table COULD contain duplicate data.

Which type of data is expected? How to test? In which order? Is it critical to keep some ordering of calling?

Usually id may not be only numeric, you may try any characters
Data should has JSON type, to generate Category or Collection of categories you may use Composer Also you may try cURL.

Web-methods are splitted by two groups, POST and GET oriented. To test GET methods you may just type in browser specific url, to test POST web-methods you may create simple html file with form.

Order of testing is important because you need to be sure that data which you treat exists.

Order of calling depends of previous executions. For instance every method name of which starts from load (loadCategories, loadGoldLabels) stores/updates object BatchDawidSkene/IncrementalDawidSkene to/into the database. Afterwards any other web-method may use that object by specific id which you may keep in mind. None of the methods return list of objects, JFYI.
Libraries

Library available here, need to be built as .WAR and deployed on Tomcat 6.xx

API Endpoint

available here, just add web-method name and parameters

Summary of Resource URL Patterns
GET ping
GET reset?id={id}
GET exists?id={id}
POST loadCategories?categories={categories}&id={id}&incremental={incremental}
POST loadCosts?loadCosts={loadCosts}&id={id}
POST loadWorkerAssignedLabel?data={data}&id={id}
POST loadWorkerAssignedLabels?data={data}&id={id}
POST loadGoldLabel?data={data}&id={id}
POST loadGoldLabels?data={data}&id={id}
GET majorityVote?id={id}&objectName={objectName}
POST majorityVotes?id={id}&objects={objects}
GET majorityVotes?id={id}
POST objectProbs?id={id}&objects={objects}
GET objectProb?id={id}&object={object}
GET computeBlocking?iterations={iterations}&id={id}
GET printWorkerSummary?verbose={verbose}&id={id}
GET printObjectsProbs?entropy={entropy}&id={id}
GET objectProbs?object={object}&entropy={entropy}&id={id}
GET printPriors?id={id}
GET classPriors?id={id}
GET getDawidSkene?id={id}
EXAMPLE REQUEST
<form method="post" action="http://23.21.128.180:8080/GetAnotherLabel/rest/loadCategories" name="formOne" enctype="application/json; charset=utf-8"> <input name="id" value="2"/><input name="incremental" value="10"/> <textarea name="categories">[{"name":"name1","prior":-1.0,"misclassification_cost":{}},{"name":"name2","prior":-1.0,"misclassification_cost":{}}]</textarea> <button type="submit">Compute</button> </form>