PolesApi Resource

GET /poles

For an authenticated user, this method retrieves the list of pole which the user can edit

 https://ethersource.gavagai.se/ethersource/rest/v2/poles
 

Response Body
media type data type description
application/json PolesResponse (JSON) The poles which the user can edit

Example

Request
GET /poles
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "size" : 12345,
  "poles" : [ {
    "parts" : [ {
      "term" : "...",
      "weight" : 12345.0
    }, {
      "term" : "...",
      "weight" : 12345.0
    } ],
    "id" : 12345,
    "language" : "...",
    "description" : "...",
    "name" : "..."
  }, {
    "parts" : [ {
      "term" : "...",
      "weight" : 12345.0
    }, {
      "term" : "...",
      "weight" : 12345.0
    } ],
    "id" : 12345,
    "language" : "...",
    "description" : "...",
    "name" : "..."
  } ]
}
                
              

POST /poles

For an authenticated user, this method allows the user to create a pole

 https://ethersource.gavagai.se/ethersource/rest/v2/poles
 

Request Body
media type data type description
application/json Pole (JSON) The pole to be created in json structure { "name":"POS EN", "description":"Positive ENGLISH", "language":"EN", "parts":[ { "term":"(*^^*)", "weight":1.0 } ]}
Response Body
media type data type description
application/json Pole (JSON) The created pole, with the id

Example

Request
POST /poles
Content-Type: application/json
Accept: application/json

                
{
  "parts" : [ {
    "term" : "...",
    "weight" : 12345.0
  }, {
    "term" : "...",
    "weight" : 12345.0
  } ],
  "language" : "KR",
  "description" : "...",
  "name" : "..."
}
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
{
  "parts" : [ {
    "term" : "...",
    "weight" : 12345.0
  }, {
    "term" : "...",
    "weight" : 12345.0
  } ],
  "id" : 12345,
  "language" : "...",
  "description" : "...",
  "name" : "..."
}
                
              

DELETE /poles/{id}

For an authenticated user, this method deletes a pole, if he has sufficient rights

 https://ethersource.gavagai.se/ethersource/rest/v2/poles/1/
 

Request Parameters
name type description constraints
id path The poleId which is to be deleted required, min: 1
Response Body
media type data type description
application/json Pole (JSON) The deleted pole

Example

Request
DELETE /poles/{id}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
{
  "parts" : [ {
    "term" : "...",
    "weight" : 12345.0
  }, {
    "term" : "...",
    "weight" : 12345.0
  } ],
  "id" : 12345,
  "language" : "...",
  "description" : "...",
  "name" : "..."
}
                
              

GET /poles/{id}

For an authenticated user, this method retrieves the details of a pole specified by an id, if the user has access to it.

 https://ethersource.gavagai.se/ethersource/rest/v2/poles/1
 

Request Parameters
name type description constraints
id path The id of the pole to retrieve required, min: 1
Response Body
media type data type description
application/json Pole (JSON) The requested pole

Example

Request
GET /poles/{id}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "parts" : [ {
    "term" : "...",
    "weight" : 12345.0
  }, {
    "term" : "...",
    "weight" : 12345.0
  } ],
  "id" : 12345,
  "language" : "...",
  "description" : "...",
  "name" : "..."
}
                
              

PUT /poles/{id}

For an authenticated user, this method allows the user to update a pole, if he has access to it

 https://ethersource.gavagai.se/ethersource/rest/v2/poles
 

Request Parameters
name type description default constraints
id path The id of the pole to be updated   required, min: 1
clearContents query If this flag is set, the pole parts are cleared and are populated with the pole parts in the json payload. If it is not set, the pole parts in the payload are appended to the existing pole parts true boolean
Request Body
media type data type description
application/json Pole (JSON) The pole, in json structure { "name":"POS EN", "description":"Positive ENGLISH", "language":"EN", "parts":[ { "term":"(*^^*)", "weight":1.0 } ]}
Response Body
media type data type description
application/json Pole (JSON) The updated pole, with the id

Example

Request
PUT /poles/{id}
Content-Type: application/json
Accept: application/json

                
{
  "parts" : [ {
    "term" : "...",
    "weight" : 12345.0
  }, {
    "term" : "...",
    "weight" : 12345.0
  } ],
  "language" : "TK",
  "description" : "...",
  "name" : "..."
}
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
{
  "parts" : [ {
    "term" : "...",
    "weight" : 12345.0
  }, {
    "term" : "...",
    "weight" : 12345.0
  } ],
  "id" : 12345,
  "language" : "...",
  "description" : "...",
  "name" : "..."
}
                
              

GET /poles/{id}/suggest

For an authenticated user, this method retrieves suggestions for a pole, if he has access to it

 https://ethersource.gavagai.se/ethersource/rest/v2/poles/1/suggest
 

Request Parameters
name type description constraints
id path The poleId for which suggestions are required required, min: 1
Response Body
media type data type description
application/json PoleSuggestions (JSON) The suggestions with the pole itself

Example

Request
GET /poles/{id}/suggest
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "suggestions" : [ {
    "term" : "...",
    "sumCosine" : 12345.0,
    "cosine" : 12345.0,
    "frequency" : 12345,
    "neighbourCounter" : 12345,
    "forWord" : "...",
    "stringSimilarity" : true,
    "reciprocal" : true
  }, {
    "term" : "...",
    "sumCosine" : 12345.0,
    "cosine" : 12345.0,
    "frequency" : 12345,
    "neighbourCounter" : 12345,
    "forWord" : "...",
    "stringSimilarity" : true,
    "reciprocal" : true
  } ],
  "pole" : {
    "parts" : [ {
      "term" : "...",
      "weight" : 12345.0
    }, {
      "term" : "...",
      "weight" : 12345.0
    } ],
    "id" : 12345,
    "language" : "...",
    "description" : "...",
    "name" : "..."
  }
}