Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Div
stylefont-weight:bold;font-size:1.2em;
Vocabulary Service Home

Brief Description

Wiki Markup
{multi-excerpt-include:Vocabulary Service Description and Assumptions|name=brief-description|nopanel=true}
For a full description, visit the Service Description and Assumptions page.

...

Creates a new Vocabulary record. Assigns a unique, service-specified /wiki/spaces/collectionspace/pages/666274321 to that Vocabulary record. Follows standard Create model. See the documentation of the Vocabulary schema, below. Example:

Code Block
POST /cspace-services/vocabularies HTTP/1.1

Anchor
read
read

Read a Vocabulary

Reads an existing Vocabulary record, specified by its /wiki/spaces/collectionspace/pages/666274321. Follows standard Read model. See the documentation of the Vocabulary schema, below.

General form:

GET /cspace-services/vocabularies/{id} HTTP/1.1
Code Block

Example, reading an existing record with a CSID of e450e8e8-9f12-49f3-aba4-43b7c46344a2:

Code Block

GET /cspace-services/vocabularies/e450e8e8-9f12-49f3-aba4-43b7c46344a2 HTTP/1.1

An alternate form reads an existing Vocabulary record, specified by its /wiki/spaces/collectionspace/pages/666273476, which matches the value of the shortIdentifier field in the record. Otherwise follows standard Read model. See the documentation of the Vocabulary schema, below.

General form:

GET /cspace-services/vocabularies/urn:cspace:name({id}) HTTP/1.1
Code Block

Example, reading an existing record with a shortIdentifier value of myDefaultVocabulary:

GET /cspace-services/vocabularies/urn:cspace:name(myDefaultVocabulary) HTTP/1.1
Code Block
Update a Vocabulary

Updates an existing Vocabulary record, specified by its /wiki/spaces/collectionspace/pages/666274321. Follows standard Update model. See the documentation of the Vocabulary schema, below. Example:

Code Block
PUT /cspace-services/vocabularies/{id} HTTP/1.1
Delete a Vocabulary

Deletes an existing Vocabulary record, specified by its /wiki/spaces/collectionspace/pages/666274321. Follows standard Delete model. Example:

Code Block
DELETE /cspace-services/vocabularies/{id} HTTP/1.1
List Vocabulary instances

Lists existing Vocabulary records, with summary information for each. Follows standard List model. See the documentation of the Vocabulary-List schema, below.

Examples:

GET /cspace-services/vocabularies HTTP/1.1
Code Block

List supports query parameters for customizing list results, such as pagination controls, query filters, and sorting options. For example:

Code Block

GET /cspace-services/vocabularies?pgSz=10 HTTP/1.1

List also supports query parameters for searching for matching records, including keyword search. For example:

GET /cspace-services/vocabularies?kw=foo&pgSz=10 HTTP/1.1
Code Block

Vocabulary REST payload schemas

...

Validation constraints: Values for shortIdentifier must be non-null and may only include word characters ("a-zA-Z0-9_"), or call will return 400 Bad Request.

Code Block
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<ns2:vocabularies-common xmlns:ns2="http://services.collectionspace.org/vocabulary">
  <displayName>Gender Values</displayName>
  <shortIdentifier>gender</shortIdentifier>
  <refName>urn:cspace:org.collectionspace.demo:vocabulary:name(gender)'Gender Values'</refName>
  <vocabType>enum</vocabType>
</ns2:vocabularies-common>

Read will return the above, plus additional fields (uri and csid) for access:

Code Block
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<ns2:vocabularies-common xmlns:ns2="http://services.collectionspace.org/vocabulary">
  ...
  <uri>/vocabularies/f0cf4c50-8f8a-4df0-869a</uri>
  <csid>f0cf4c50-8f8a-4df0-869a</csid>
</ns2:vocabularies-common>
Vocabulary-List schema

List (and variants) will return the following schema. Note the standard pagination support.

<?xml version="1.0" encoding="utf-8" standalone="yes"?> <ns2:vocabularies-common-list xmlns:ns2="http://services.collectionspace.org/vocabulary"> <pageNum>0</pageNum> <pageSize>40</pageSize> <totalItems>3</totalItems> <vocabulary-list-item> <displayName>Gender Values</displayName> <refName>urn:cspace:org.collectionspace.demo:vocabulary:name(gender)'Gender Values'</refName> <vocabType>enum</vocabType> <uri>/vocabularies/f0cf4c50-8f8a-4df0-869a</uri> <csid>f0cf4c50-8f8a-4df0-869a</csid> </vocabulary-list-item> ... </ns2:vocabularies-common-list>
Code Block

VocabularyItem CRUD+L services

...

Creates a new VocabularyItem record. Assigns a unique, service-specified /wiki/spaces/collectionspace/pages/666274321 to that VocabularyItem record. Follows standard Create model. See the documentation of the VocabularyItem schema, below. Example:

Code Block
POST /cspace-services/vocabularies/{vocabulary-id}/items HTTP/1.1
Read a VocabularyItem in a Vocabulary

Reads an existing VocabularyItem record, specified by its /wiki/spaces/collectionspace/pages/666274321. Follows standard Read model. See the documentation of the VocabularyItem schema, below. Example:

Code Block
GET /cspace-services/vocabularies/{vocabulary-id}/items/{id} HTTP/1.1
Update a VocabularyItem in a Vocabulary

Updates an existing VocabularyItem record, specified by its /wiki/spaces/collectionspace/pages/666274321. Follows standard Update model. See the documentation of the VocabularyItem schema, below. Example:

PUT /cspace-services/vocabularies/{vocabulary-id}/items/{id} HTTP/1.1
Code Block
Delete a VocabularyItem in a Vocabulary

Deletes an existing VocabularyItem record, specified by its /wiki/spaces/collectionspace/pages/666274321. Follows standard Delete model. Example:

DELETE /cspace-services/vocabularies/{vocabulary-id}/items/{id} HTTP/1.1
Code Block
List VocabularyItem instances in a Vocabulary

Lists existing VocabularyItem records, with summary information for each. Follows standard List model. The vocabulary may be specified either using the CSID or the shortIdentifier, using the syntax described for vocabulary read, described above. See the documentation of the VocabularyItem-List schema, below.

Examples:

GET /cspace-services/vocabularies/{vocabulary-id}/items HTTP/1.1
Code Block

List supports query parameters for customizing list results, such as pagination controls, query filters, and sorting options. For example:

Code Block

GET /cspace-services/vocabularies/{vocabulary-id}/items?pgSz=10 HTTP/1.1

List also supports query parameters for searching for matching records, including:

  • keyword search
  • partial term matching search, for term completion
  • term status filtering, to exclude (filter out) records matching one or more statuses

For example:

Code Block

GET /cspace-services/vocabularies/{vocabulary-id}/items?pt=foo&pgSz=10 HTTP/1.1

VocabularyItem REST payload schemas

...

Validation constraints: On create and update, displayName must be non-null and at least 2 characters long, or call will return 400 Bad Request. Values for shortIdentifier must be non-null and may only include word characters ("a-zA-Z0-9_").

Code Block
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
  <ns2:vocabularyitems-common xmlns:ns2="http://services.collectionspace.org/vocabulary">
  <inVocabulary>f0cf4c50-8f8a-4df0-869a</inVocabulary>
  <displayName>Male Gender</displayName>
  <shortIdentifier>male</shortIdentifier>
  <refName>
    urn:cspace:org.collectionspace.demo:vocabulary:name(gender):item:name(male)'Male Gender'
  </refName>
</ns2:vocabularyitems-common>

Note: You might need to wrap some of the payload in <document> tags, e.g.,

Code Block
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<document name="vocabularyitems">
    <ns2:vocabularyitems_common xmlns:ns2="http://collectionspace.org/services/vocabulary" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <inAuthority>42f984c3-4e24-4702-8825</inAuthority>
        <termStatus>active</termStatus>
        <displayName>box</displayName>
        <shortIdentifier>box</shortIdentifier>
        <refName>urn:cspace:ucjeps.cspace.berkeley.edu:vocabularies:name(locationtype):item:name(box)'box'</refName>
    </ns2:vocabularyitems_common>
</document>

Read will return the above, plus additional fields (uri and csid) for access:

Code Block
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<ns2:vocabularyitems-common xmlns:ns2="http://services.collectionspace.org/vocabulary">
...
<uri>/vocabularies/f0cf4c50-8f8a-4df0-869a/items/a256aed3-0b0a-44e6-84b0</uri>
<csid>a256aed3-0b0a-44e6-84b0</csid>
</ns2:vocabularyitems-common>
VocabularyItem-List schema

List (and variants) will return the following schema. Note the standard pagination support.

<?xml version="1.0" encoding="utf-8" standalone="yes"?> <ns2:vocabularyitems-common-list xmlns:ns2="http://services.collectionspace.org/vocabulary"> <pageNum>0</pageNum> <pageSize>40</pageSize> <totalItems>3</totalItems> <vocabulary-list-item> <displayName>male</displayName> <refName> urn:cspace:org.collectionspace.demo:vocabulary:name(Gender):item:name(male)'Male Gender'  </refName> <uri>/vocabularies/f0cf4c50-8f8a-4df0-869a/items/a256aed3-0b0a-44e6-84b0</uri> <csid>a256aed3-0b0a-44e6-84b0</csid> </vocabulary-list-item> ... </ns2:vocabularyitems-common-list>
Code Block