Skip to content
StephanOepen edited this page Mar 26, 2016 · 27 revisions

Background

To provide a programmatic interface to the ERG on-line demonstrator, a sub-set of its functionality is available via a RESTful (HTTP-based) application programming interface (API). Through this interface, parsing requests can be submitted anonymously to a server at the University of Oslo, and processing results will be returned in machine-readable form to the requester.

As of Easter 2016, this service is still under development and has not been broadly tested. The following terse sections aim to provide minimal documentation to users who might want to obtain ERG parses without creating their own installation of the DELPH-IN software stack.

A First Example

In a nutshell, the API is accessed through HTTP GET requests to the following base URI: http://erg.delph-in.net/rest/0.9/parse. There is one required parameter, named input, to provide a string for the parser to analyze. The HTTP response will be of type application/json and will contain some high-level statistics about the parsing process (e.g. the number of distinct readings and overall parsing time), as well as an array of result structures. At present, two perspectives on each parsing result are provided by default: its derivation tree (e.g. the full recipe for deriving this analysis; see the ItsdbDerivations page) and a simplification of the associated semantics as an Elementary Dependency Structure (EDS; see the EdsTop page for background).

For example, the query http://erg.delph-in.net/rest/0.9/parse?input=Abrams%20arrived. will request the on-line service to parse the string Abrams arrived. (note how some special characters, including whitespace, in the input need to be percent-encoded). The JSON document returned for this query will include the following pieces of information:

  {"readings": 1, "tcpu": 0.05,
   "results":
   [{"result-id": 0,
     "derivation": [...]
     "eds": [...]}]}

Parameterizing the Parser

  • nresults: integer (default: 1)

  • derivation: json (default), udf, or null

  • eds: json (default), native, or null

Clone this wiki locally