-
Notifications
You must be signed in to change notification settings - Fork 3
Service: Virtual Corpus Creation
Eliza Margaretha Illig edited this page Oct 25, 2024
·
31 revisions
Virtual corpus (VC) is a collection of documents generated according to a given corpus query. This service facilitates creating a new VC or updates an existing (VC). 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
When a PRIVATE or PROJECT VC be made available for public, its type changed to PUBLISHED. This service allows creating and publishing VC simultaneously by setting the type PUBLISHED.
This service requires authorization scope: create_vc.
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 | String (see ResourceType) | 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 |
| queryType | no | determine if the query is a virtual corpus or query reference. Default: VIRTUAL_CORPUS | String (see QueryType ) | VIRTUAL_CORPUS QUERY |
| HTTP Status Code | Description |
|---|---|
| 201 Created | when creating a new VC |
| 204 No Content | when updating an existing VC |
| 400 Bad request | when the request entity in JSON is not specified, the maximum number of VC has been reached, the corpus query is invalid, or VC name is invalid |
| 401 Unauthorized | when the operation is not permitted, e.g. user doesn't log in, tries to create a SYSTEM VC |
| 415 Unsupported Media Type | when content-type is not specified |
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
- Setting LDAP
- Setting initial super client
- Setting a custom environment
- Setting resources for CLARIN FCS
- Disabling query rewrites
- Named virtual corpora
- Importing Kustvakt to Eclipse
- Installing Lombok
- Setting annotation processors
- Setting a test environment
- HTTP Basic Authentication
- OAuth2 authorization scopes
- OAuth2 authorization request
- OAuth2 token request
- OAuth2 token revocation
- 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
- VC creation and update
- VC deletion
- VC list
- VC info
- VC KoralQuery
- VC statistics
- VC statistics with KoralQuery