Skip to content

Service: Virtual Corpus Creation

Eliza Margaretha Illig edited this page Oct 25, 2024 · 31 revisions

** WARNING: This service is experimental and may change without any notice.

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}

Parameters

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

Response Codes

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

Examples

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

Advanced Setting

Developer Setting

Search services

Metadata services

Authentication and Authorization services

Client services

Super client services

Plugin services

User services

User group services

Virtual corpus (VC) services

VC sharing services

Administrative services

Description services

Clone this wiki locally