Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
  • F framework
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 483
    • Issues 483
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 13
    • Merge requests 13
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • cdlicdli
  • framework
  • Merge requests
  • !149

Inscription REST API

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Lars Willighagen requested to merge phoenix/feature/inscription-api into phoenix/develop Jul 08, 2020
  • Overview 16
  • Commits 4
  • Pipelines 0
  • Changes 10

Fixes Partially addresses #126 (closed)

Description

  • Adds a redirect from artifacts to latest inscription (when one of the below formats is requested)
  • ATF and CDLI-CoNLL output, and a base for CoNLL-U*

* CDLI-CoNLL is in the database, to convert to CoNLL-U we need the Python converter.

Type of PR This PR is a feature.

Technicalities

  • Adds a Inscription controller to handle inscription output (HTML output may be removed later)
  • Defines custom, unregistered MIME types to describe inscription formats
  • Uses a component to recognize inscription formats across the Artifact and Inscription controllers
  • Uses separate views for every format to leverage CakePHP's built-in SerializedView
  • Goes down the list of acceptable response type to find one that is available for an inscription (not all have CoNLL)
  • Returns 406 NOT ACCEPTABLE if no type is fullfillable

Tests

  • Run curl -LH 'Accept: text/x-c-atf' http://127.0.0.1:2354/inscriptions/2309985
  • Run curl -LH 'Accept: text/x-cdli-conll' http://127.0.0.1:2354/inscriptions/2309985 → HTTP 406
  • Run curl -LH 'Accept: text/x-cdli-conll' http://127.0.0.1:2354/inscriptions/2341997
  • Redirect does not work yet since is_latest is not filled in the database yet. Change the value to 1 for any artifact (say P000001) and
    run curl -LH 'Accept: text/x-c-atf' http://127.0.0.1:2354/artifacts/1

Checklist:

  • My pull request has a descriptive title (not a vague title like "Update index.md").
  • My pull request targets the phoenix/develop branch of the repository.
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.
Edited Aug 05, 2020 by Lars Willighagen
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: phoenix/feature/inscription-api