Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Dact/AlpinoCorpus web API

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 src
Octocat-spinner-32 README.md
Octocat-spinner-32 alpinocorpus-server.cabal
README.md

AlpinoCorpus-Server

Introduction

alpinocorpus-server is a web API/server for querying and reading Alpino treebanks. alpinocorpus-server uses the AlpinoCorpus[1] Haskell module to process Alpino treebanks.

Installation

With the latest Haskell Platform and alpinocorpus module installed, run:

cabal configure
cabal build
cabal install

API

The API for alpinocorpus-server returns JSON, with two exceptions:

  • Errors are reported using HTTP status codes.
  • Syntactic trees are returned as XML data.

Retrieving a list of corpora

A list of corpora can be retrieved via the API root:

http://[hostname]/corpora

The corpora are returned as a list of objects, where each object has three fields: name, shortDesc, and longDesc.

Retrieving a list of corpus entries

A list of corpus entries can be retrieved in the following manner:

http://[hostname]/[corpusname]/entries

If you want to restrict the list of entries to those that match a given XPath query, use the query parameter:

http://[hostname]/[corpusname]/entries?query=[query]

If the query matches more than one node in an entry, the entry will be returned as many times as a matching node is found. This behavior can be changed using the unique parameter:

http://[hostname]/[corpusname]/entries?query=[query]?unique=1

Retrieving an entry

An entry is retrieved by using an URL of the following form:

http://[hostname]/[corpusname]/entry/[entryname]

You can also ask the server to mark nodes that match a given query using a special attribute and value. Use the markerQuery, markerAttr, and markerValue parameters for this functionality.

Todo

  • Consider: do we want to return each entry as often as it matches a query?
  • Consider: do we want to provide SVG tree output?

References

[1] https://github.com/rug-compling/alpinocorpus

Something went wrong with that request. Please try again.