Vocabulary Creation, Edition and Publish - ABO

Back Office Integration Guide

Product
ABO
AFS_Version
7.9
Category
Reference Guides
language
English

These APIs allow to create a vocabulary, update its content and publish it.

A vocabulary creation API request takes the following form:

curl -H Expect: -H "Content-Type:application/json" --data
"{\"x:type\":\"bows.vocabulary\",\"key\":{\"name\":\"my name\"},\"mimeType\":\"application/rdf+xml\",\"description\":\"my description\",\"languages\":{\"x:type\":\"collection\",\"x:values\":[\"FRENCH\",\"ENGLISH\"]},\"tags\":{\"x:type\":\"collection\",\"x:values\":[\"my tag1\",\"my tag2\"]},\"type\":\"STEMMER\"}"
"http://$HOST/bo-ws/service/$SERVICE_ID/instance/$SERVICE_STATUS/vocabulary?afs:login=login://$USER:$PASSWORD@$AUTHENTICATION_AUTHORITY"

Hereafter, more details about the post data:

{
"x:type": "bows.vocabulary",

"key": {
"name": "my name" // Name of the vocabulary (Mandatory)
},
"mimeType": "application/rdf+xml",
"description": "my description", // Description of the vocabulary
"languages": { // (Mandatory, should not be empty)
"x:type": "collection",
"x:values": [
"FRENCH", // Lang 1
"ENGLISH" // Lang 2 (unlimited)
]
},
"tags": { // (Mandatory even if empty list)
"x:type": "collection",
"x:values": [
"my tag1", // Tag 1
"my tag2" // Tag 2 (unlimited)
]
},
"type": "STEMMER" // Type of the Vocabulary. Can be STEMMER or THESAURUS
}


A vocabulary update (upload) API request takes the following form:

curl -H Expect: --form file="@/path/to/my_vocabulary.rdf;type=application/rdf+xml" "http://$HOST/bo-ws/service/$SERVICE_ID/instance/$SERVICE_STATUS/vocabulary/$VOCABULARY_NAME/content?afs:login=login://$USER:$PASSWORD@$AUTHENTICATION_AUTHORITY"

Method: POST

The list of parameters and their possible values are enumerated below.

  • $HOST is the server hosting the Back Office.
  • $SERVICE_ID is the number of the desired service.
  • $SERVICE_STATUS is the status of the desired service.
  • $VOCABULARY_NAME is the name of the vocabulary.

In this example, /path/to/my_vocabulary.rdf is the vocabulary file to be sent to the Back Office. It can be located anywhere.

A GET request on the POST URL gives the list of existing vocabularies for the instance, including associated $VOCABULARY_NAME.

A vocabulary publish API request takes the following form:

curl -H Expect: -H "Content-Type:application/json" --request PUT --data "{\"x:reference\":\"/bo-ws/service/${Service_Number}/instance/<instance_status>/vocabulary/<vocabulary_name>\"}" "http://$HOST/bo-ws/service/$SERVICE_ID/instance/$SERVICE_STATUS/publish/vocabulary/$VOCABULARY_NAME?afs:login=login://$USER:$PASSWORD@$AUTHENTICATION_AUTHORITY"

Method: PUT

The list of parameters and their possible values are enumerated below.

  • $HOST is the server hosting the Back Office.
  • $SERVICE_ID is the number of the desired service.
  • $SERVICE_STATUS is the status of the desired service.
  • $VOCABULARY_NAME is the name of the vocabulary.

Use the POST method the first time in order to publish the first version of the Vocabulary. In this case, the request URL is:
http://$HOST/bo-ws/service/$SERVICE_ID/instance/$SERVICE_STATUS/publish/vocabulary
If the Vocabulary already exists, use the PUT method in order to publish it again.

To delete a Vocabulary, use DELETE method on the Vocabulary URL:
http://$HOST/bo-ws/service/$SERVICE_ID/instance/$SERVICE_STATUS/vocabulary/$VOCABULARY_NAME

A GET request on the POST URL gives the list of existing published Vocabularies for the instance, including associated $VOCABULARY_NAME.

CURL is used for these examples. Any other HTTP client can be used.