Key

Brief description

Version

To discover the version and other metadata about deployed service code that fulfills this API, please utilize the Service Catalog Service.

Overview and Definitions

The Morphological Analysis Service responds to requests for morphological analysis of texts, submits them to the appropriate morphology engine for processing and returns the results in XML adhering to a standard morphology schema. The Service supports retrieval of texts for analysis from remote repositories as well as user-supplied chunks of text. URL based and CTS repositories are supported. Where retrieval from a CTS enabled repository is requested CTS URNs are supported as document identifiers. Where retrieval from a URL based repository is requested, URIs are supported as document identifiers.

Response

Exceptions

If an error occurred, some non-2xx code will be returned. Check the HTTP Status Code that is returned in the response's HTTP headers for the specific error. The following errors may be returned in response to the Get request:

Error (Status Code)

Meaning

Returned When

400

Bad Request

Request is missing required parameters

404

Not Found

The requested document does not exist and/or the requested analysis returned no results

500

Internal Server Error

A service error occurred

List an Engine

Lists a specific morphology engine configured for this instance of the service.

Calling Method and Arguments

Invoked as an HTTP GET method. Send an HTTP request of the form:

Code Block

GET /morphologyservice/engine/{EngineId}

Parameter

Supported Values

Accept Header

application/xml,text/xml,application/json

Example:

Code Block

GET /morphologyservice/engine/morpheus HTTP/1.1

Response

On success, a response with a "202 Accepted" HTTP status code will be returned:

Exceptions

If an error occurred, some non-2xx code will be returned. Check the HTTP Status Code that is returned in the response's HTTP headers for the specific error. The following errors may be returned in response to the Get request:

Error (Status Code)

Meaning

Returned When

400

Bad Request

Request is missing required parameters

404

Not Found

The requested document does not exist and/or the requested analysis returned no results

500

Internal Server Error

A service error occurred

Text Repository

A repository from which texts/documents can be retrieved for analysis. The 1.1.0 version of the services supports both CTS repositories and repositories which can respond to URI based requests.

List Repository instances

List the text repositories configured for this instance of the service.

Calling Method and Arguments

Invoked as an HTTP GET method. Send an HTTP request of the form:

Code Block

GET /morphologyservice/repository

Parameter

Supported Values

Accept Header

application/xml,text/xml,application/json

Response

On success, a response with a "202 Accepted" HTTP status code will be returned:

Exceptions

If an error occurred, some non-2xx code will be returned. Check the HTTP Status Code that is returned in the response's HTTP headers for the specific error. The following errors may be returned in response to the Get request:

Error (Status Code)

Meaning

Returned When

400

Bad Request

Request is missing required parameters

404

Not Found

The requested document does not exist and/or the requested analysis returned no results

500

Internal Server Error

A service error occurred

List a Repository

List a specific text repository configured for this instance of the service.

Calling Method and Arguments

Invoked as an HTTP GET method. Send an HTTP request of the form:

Code Block

GET /morphologyservice/repository/{RepoId}

Parameter

Supported Values

Accept Header

application/xml,text/xml,application/json

Example:

Code Block

GET /morphologyservice/repository/xmlRepository HTTP/1.1

Response

On success, a response with a "202 Accepted" HTTP status code will be returned:

Exceptions

If an error occurred, some non-2xx code will be returned. Check the HTTP Status Code that is returned in the response's HTTP headers for the specific error. The following errors may be returned in response to the Get request:

Error (Status Code)

Meaning

Returned When

400

Bad Request

Request is missing required parameters

404

Not Found

The requested document does not exist and/or the requested analysis returned no results

500

Internal Server Error

A service error occurred

Analysis (Word)

Produce a morphological analyses of a supplied word or list of words.

Create a morphological analysis of a word or list of words

Calling Method and Arguments

Invoked as an HTTP GET or HTTP POST. Send an HTTP request of the form:

Response

On success, a response with a "201 Created" HTTP status code will be returned:

A response with HTTP 201 (CREATED) status will be returned.

Parameter

Meaning

HTTP Body

one or more OAC Annotations with the morphological analysis results as the annotation body(ies) (analysis output adheres to the schema identified in the output_schema request parameter (for release 1.0 this will be the alpheios lexicon schema).The morphology engine and version used to produce the output will be supplied as the foaf:Agent of the dcterms:creator element of the OAC Annotation.

Exceptions

If an error occurred, some non-2xx code will be returned. Check the HTTP Status Code that is returned in the response's HTTP headers for the specific error. The following errors may be returned in response to the request:

Response

On success, a response with a "201 Created" HTTP status code will be returned:

A response with HTTP 201 (CREATED) status will be returned.

Parameter

Meaning

HTTP Body

For synchronous requests (param wait=true) A response with HTTP 201 (CREATED) status will be returned. The response data will contain the OAC Annotations with morphological analyses as annotation body(s), adhering to the schema identified in the output_schema request parameter (for release 1.0 this will be the alpheios lexicon schema).

For asynchronous requests (param wait=false) a response will with HTTP 202 (ACCEPTED) status will be returned. The response data will contain single annotation which represents a summary annotation for the document. The rdf:about value for the Annotation itself will be set to a urn representing a unique identifer for the request. The rdf:about value for the Annotation Body will be the url identifying the location the results will be stored at when complete. |

Exceptions

If an error occurred, some non-2xx code will be returned. Check the HTTP Status Code that is returned in the response's HTTP headers for the specific error. The following errors may be returned in response to the request:

Error (Status Code)

Meaning

Returned When

400

Bad Request

Request is missing required parameters

404

Not Found

The requested document was not found or the analysis returned no results

415

Unsupported Media Type

Returned by the analysis/text request if the mime type of the supplied text is not supported

500

Internal Server Error

A service error occurred

Parameter

Meaning

HTTP Body

XML document with MorphologyServiceError as root element containing a descriptive message. For asynchronous requests that fail, the error message will be stored in cached result document.

Analysis (Text)

Tokenize the supplied text and produce morphological analyses of the words contained within it.

Create morphological analyses of the words in the supplied text.

Calling Method and Arguments

Invoked as an HTTP GET or HTTP POST. Send an HTTP request of the form:

Response

On success, a response with a "201 Created" HTTP status code will be returned:

A response with HTTP 201 (CREATED) status will be returned.

Parameter

Meaning

HTTP Body

For synchronous requests (param wait=true) A response with HTTP 201 (CREATED) status will be returned. The response data will contain the OAC Annotations with morphological analyses as annotation body(s), adhering to the schema identified in the output_schema request parameter (for release 1.0 this will be the alpheios lexicon schema). If a text_uri was supplied, that will be the uri of the annotation target (token identification in URI TBD). If a text_uri was not supplied, a uri supplied by the service will be the uri of the annotation target (e.g. to a location in the result set cache at which the supplied text was stored).

For asynchronous requests (param wait=false) a response will with HTTP 202 (ACCEPTED) status will be returned. The response data will contain single annotation which represents a summary annotation for the document. The rdf:about value for the Annotation itself will be set to a urn representing a unique identifer for the request. The rdf:about value for the Annotation Body will be the url identifying the location the results will be stored at when complete. |

Exceptions

If an error occurred, some non-2xx code will be returned. Check the HTTP Status Code that is returned in the response's HTTP headers for the specific error. The following errors may be returned in response to the request:

Error (Status Code)

Meaning

Returned When

400

Bad Request

Request is missing required parameters

404

Not Found

The requested document was not found or the analysis returned no results

415

Unsupported Media Type

Returned by the analysis/text request if the mime type of the supplied text is not supported

500

Internal Server Error

A service error occurred

Parameter

Meaning

HTTP Body

XML document with MorphologyServiceError as root element containing a descriptive message. For asynchronous requests that fail, the error message will be stored in cached result document.

SOA Layer API

See Javadoc.

Notifications

If the notify parameter has been supplied and set to an email address an email will be sent to that address upon completion of the request. If the notify parameter is set to a bamboo person id, notifications will be sent according to user preferences. The body of the notification messages will contain the unique identifier for the request (as returned in the rdf:about value for the annotation returned by the requested), the current status, and the location at which the results can be retrieved.

Tests

See Tests at ${REPOSITORY_ROOT}/platform-services/morphology-service/trunk/morphology-service/resource/src/test/test.html