-
Notifications
You must be signed in to change notification settings - Fork 3
Service: Virtual Corpus Creation
Eliza Margaretha edited this page Apr 24, 2023
·
27 revisions
Creates or updates an existing a virtual corpus (VC) based on the given JSON. If the specified VC exists, the service returns HTTP status 204 No Content, otherwise 201 Created. There are four types of VC:
- PRIVATE: VC available only to the VC creator/owner
- PROJECT: VC available only to a group of users
- PUBLISHED: user-defined VC made available for public
- SYSTEM: VC defined by system-admins or auto-generated by the system
This service allows creating and publishing a VC at the same time by setting the virtual corpus type with value PUBLISHED.
Available in: full version
Method: PUT
Service URL: root/vc/~{vc_creator}/{vc_name}
Header Parameters
Name | Required | Description | Value |
---|---|---|---|
Authorization | yes | HTTP authentication with scheme: Bearer | OAuth2 access token |
Content-Type | yes | content type of the input data | application/json |
Path Parameters
Name | Required | Description | Type | Example |
---|---|---|---|---|
vc_creator | yes | URL-encoded username of the vc creator, must be the same as the authenticated user or a system admin | String | dory |
vc_name | yes | virtual corpus name consisting only of alphabets, underscores, dashes or fullstops | String | Goethe-VC |
Request body
A JSON object with the following attributes:
Name | Required | Description | Type | Value /Example |
---|---|---|---|---|
type | yes | virtual corpus type | VirtualCorpusType (enum) | SYSTEM PROJECT PRIVATE PUBLISHED |
corpusQuery | yes | corpus query defining the VC | String | corpusSigle=GOE & creationDate since 1820 |
definition | no | a link to a VC definition file | String | |
description | no | description of the virtual corpus | String | collection of Goethe works published since 1982 |
status | no | the status of the virtual corpus | String | e.g. experimental, stable |
isCached | no | determine if the VC is to be cached | boolean | default false |
Request with cURL
curl --request PUT -H 'Content-Type: application/json' -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1MTM1MzI3O TAxMzQsInN1YiI6InVzZXJuYW1lIiwiaXNzIjoiaHR0cDpcL1wva29yYXAuaWRzLW1 hbm5oZWltLmRlIn0.p4jHIGeVwTpYAPFiWAd0R8Zcazyg7e9_tUGxOyFGUlo' -d '{"type": "PRIVATE", "corpusQuery": "corpusSigle=GOE & creationDate since 1820"}' http://localhost:8089/api/v1.0/vc/~username/Goethe-VC
Request with Basic Authentication (for testing only)
curl --request PUT -H 'Content-Type: application/json' -H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' -d '{"type": "PRIVATE", "corpusQuery": "corpusSigle=GOE & creationDate since 1820"}' http://localhost:8089/api/v1.0/vc/~username/Goethe-VC
Response
HTTP/1.1 201 Created (when creating a new VC)
or
HTTP/1.1 204 No Content (when updating an existing VC)
- OAuth2 client registration
- OAuth2 client info
- OAuth2 client deregistration
- OAuth2 client secret reset
- Plugin registration
- Plugin list (Marketplace)
- Plugin installation
- Plugin uninstallation
- Installed plugin list
- User group creation
- User group deletion
- User group list
- Member invitation
- Member deletion
- Approval of member invitation
- Rejection of member invitation
- Member role management
- Virtual corpus creation and update
- Virtual corpus deletion
- Virtual corpus list
- Virtual corpus retrieval
- Virtual corpus statistics
- Virtual corpus statistics with KoralQuery