Div | ||
---|---|---|
| ||
Table of Contents |
---|
Brief Description
...
Creates a new ConceptAuthority record. Assigns a unique, service-specified /wiki/spaces/collectionspace/pages/666274321 to that ConceptAuthority record. Follows standard Create model. See the documentation of the ConceptAuthority schema, below. Example:
Code Block |
---|
Read a ConceptAuthority
Reads an existing ConceptAuthority record, specified by its /wiki/spaces/collectionspace/pages/666274321. Follows standard Read model. See the documentation of the ConceptAuthority schema, below. Example:
Code Block |
---|
Update a ConceptAuthority
Updates an existing ConceptAuthority record, specified by its /wiki/spaces/collectionspace/pages/666274321. Follows standard Update model. See the documentation of the ConceptAuthority schema, below. Example:
Code Block |
---|
Delete a ConceptAuthority
Deletes an existing ConceptAuthority record, specified by its /wiki/spaces/collectionspace/pages/666274321. Follows standard Delete model. Example:
Code Block |
---|
List ConceptAuthority instances
...
- pgSz for page size
- pgNum for page size
Examples:
Code Block |
---|
ConceptAuthority REST payload schemas
...
Create and Update should use the following schema. The value of vocabType must be "ConceptAuthority".
Code Block |
---|
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<document name="conceptauthorities">
<ns2:conceptauthorities_common xmlns:ns2="http://services.collectionspace.org/concept">
<displayName>Materials Authority</displayName>
<vocabType>ConceptAuthority</vocabType>
...
</ns2:conceptauthorities_common>
</document>
|
Read will return the above, plus additional fields (uri and csid) for access:
Code Block |
---|
ConceptAuthority-List schema
List (and variants) will return the following schema:
Code Block |
---|
Concept CRUD+L services
Concept instances are only accessible via the owning ConceptAuthority. The sub-resource is accessed with "items" (for consistency across all vocabulary-like services). In the examples below, the {concept-auth-id} parameter represents the CSID value of an existing ConceptAuthority instance.
...
Creates a new Concept record. Assigns a unique, service-specified /wiki/spaces/collectionspace/pages/666274321 to that Concept record. Follows standard Create model. Must See the documentation of the Concept schema, below. Example:
Code Block |
---|
You may also POST a part called
Code Block |
---|
and any new relations there will be created. For example, this POST will add a relationship. Note that you must know beforehand the CSIDs of related terms. These are the CSIDs of two other Concept records, which must exist before this call. The special variable ${itemCSID} will be expanded to the CSID of the newly created Concept. (For Java use, please use the constant in CommonAPI.AuthorityItemCSID_REPLACE )
Code Block |
---|
<?xml version="1.0" encoding="UTF-8"?>
<document name="concepts">
<ns2:concepts_common xmlns:ns2="http://collectionspace.org/services/concept" xmlns:ns3="http://collectionspace.org/services/jaxb">
<inAuthority>6ca3db57-7c96-47b6-b17d</inAuthority>
<shortIdentifier>copper</shortIdentifier>
<refName>urn:cspace:core.collectionspace.org:conceptauthorities:name(materials):item:name(copper)'Copper'</refName>
<displayName>Copper</displayName>
...
</ns2:concepts_common>
<ns3:relations-common-list xmlns:ns3="http://collectionspace.org/services/relation" xmlns:ns2="http://collectionspace.org/services/jaxb">
<relation-list-item>
<predicate>hasBroader</predicate>
<subject>
<csid>${itemCSID}</csid>
<documentType>Conceptitem</documentType>
</subject>
<object>
<csid>a6d62e30-2bd6-439b-b19f</csid>
<uri>/cspace-services/conceptauthorities/urn:cspace:name(concept)/items/a6d62e30-2bd6-439b-b19f</uri>
<documentType>Conceptitem</documentType>
</object>
</relation-list-item>
<relation-list-item>
<predicate>hasBroader</predicate>
<subject>
<csid>0f33de2c-3dd5-4e5b-b6b6</csid>
<uri>/cspace-services/conceptauthorities/urn:cspace:name(concept)/items/0f33de2c-3dd5-4e5b-b6b6</uri>
<documentType>Conceptitem</documentType>
</subject>
<object>
<csid>${itemCSID}</csid>
<documentType>Conceptitem</documentType>
</object>
</relation-list-item>
<relation-list-item>
<predicate>hasBroader</predicate>
<subject>
<uri>/cspace-services/conceptauthorities/urn:cspace:name(concept)/items/b439ca2f-448c-4251-a2d9</uri>
<csid>b439ca2f-448c-4251-a2d9</csid>
<documentType>Conceptitem</documentType>
</subject>
<object>
<csid>${itemCSID}</csid>
<documentType>Conceptitem</documentType>
</object>
</relation-list-item>
<relation-list-item>
<predicate>hasBroader</predicate>
<subject>
<uri>/cspace-services/conceptauthorities/urn:cspace:name(concept)/items/8c7853a1-f1d3-4ae5-8511</uri>
<csid>8c7853a1-f1d3-4ae5-8511</csid>
<documentType>Conceptitem</documentType>
</subject>
<object>
<csid>${itemCSID}</csid>
<documentType>Conceptitem</documentType>
</object>
</relation-list-item>
</ns3:relations-common-list>
</document>
|
NOTE: if you wish to delete related items,
simply send relations-common-list as an empty element.
This is shown in a comment here:
http://wiki.collectionspace.org/display/collectionspace/Person+Service+REST+APIs?focusedCommentId=72220749&#comment-72220749
...
Reads an existing Concept record, specified by its /wiki/spaces/collectionspace/pages/666274321. Follows standard Read model. See the documentation of the Concept schema, below. Example:
Code Block |
---|
There are additional query parameters to get the relations for this item.
Query Parameters are defined and explained here, with examples: Authority REST API for Hierarchies\
...
Updates an existing Concept record, specified by its /wiki/spaces/collectionspace/pages/666274321. Follows standard Update model. See the documentation of the Concept schema, below. Example:
Code Block |
---|
You may also PUT a part called
Code Block |
---|
and any new relations there will be created. Relations to the updated item which are missing from the relations list in the PUT will be deleted from persistence. No target records are deleted, just the relations records that point to target records. e.g. POST to authority with Concept "Drawing", with relations-common-list that has an entry for ${itemCSID} hasBroader "Art" creates a relations record that references both Art and Drawing. When a PUT is made that does not have the relation for Art, then Drawing has no relations, so the relations record for Drawing==>hasBroader==>Art is deleted, but both "Drawing" and "Art" Concept records remain.
...
Deletes an existing Concept record, specified by its /wiki/spaces/collectionspace/pages/666274321. Follows standard Delete model. Example:
Code Block |
---|
DELETE /cspace-services/conceptauthorities/{concept-auth-id}/items/{id} HTTP/1.1
|
List Concept instances in a ConceptAuthority
...
- pgSz for page size
- pgNum for page size
- pt for partial-term matching, to support term completion.
Examples:
Code Block |
---|
Concept REST payload schemas
...
Here's an example payload for creating a new instance:
Code Block |
---|
<?xml version="1.0" encoding="UTF-8"?>
<document name="concepts">
<ns2:concepts_common xmlns:ns2="http://collectionspace.org/services/concept" xmlns:ns3="http://collectionspace.org/services/jaxb">
<inAuthority>6ca3db57-7c96-47b6-b17d</inAuthority>
<shortIdentifier>copper</shortIdentifier>
<refName>urn:cspace:core.collectionspace.org:conceptauthorities:name(materials):item:name(copper)'Copper'</refName>
<displayName>Copper</displayName>
<termLanguage>urn:cspace:core.collectionspace.org:vocabularies:name(languages):item:name(eng)'English'</termLanguage>
...
</ns2:concepts_common>
</document>
|
Read will return the above, plus additional fields (uri and csid) for access:
Code Block |
---|
<?xml version="1.0" encoding="UTF-8"?>
<document name="concepts">
<ns2:collectionspace_core xmlns:ns2="http://collectionspace.org/collectionspace_core/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
...
<uri>/conceptauthorities/6ca3db57-7c96-47b6-b17d/items/d286deaa-245c-4505-8b6d</uri>
...
</ns2:collectionspace_core>
<ns2:concepts_common xmlns:ns2="http://collectionspace.org/services/concept" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
...
<csid>d286deaa-245c-4505-8b6d</csid>
...
</ns2:concepts_common>
...
</document>
|
Concept-List schema
List (and variants) will return a schema similar to the following example:
Code Block |
---|