Class SubjectAreaTermRESTResource

java.lang.Object
org.odpi.openmetadata.accessservices.subjectarea.server.spring.SubjectAreaTermRESTResource

@RestController @RequestMapping("/servers/{serverName}/open-metadata/access-services/subject-area") public class SubjectAreaTermRESTResource extends Object
The SubjectAreaRESTServicesInstance provides the server-side implementation of the SubjectArea Open Metadata Access Service (OMAS). This interface provides term authoring interfaces for subject area experts.
  • Constructor Details

    • SubjectAreaTermRESTResource

      public SubjectAreaTermRESTResource()
      Default constructor
  • Method Details

    • createTerm

      @PostMapping(path="/users/{userId}/terms") public SubjectAreaOMASAPIResponse<Term> createTerm(@PathVariable String serverName, @PathVariable String userId, @RequestBody Term suppliedTerm)
      Create a Term

      The name needs to be specified - as this is the main identifier for the term. The name should be unique for canonical glossaries. This API does not police the uniqueness in this case.

      The qualifiedName can be specified and will be honoured. If it is specified then the caller may wish to ensure that it is unique. If this qualifiedName is not specified then one will be generated as GlossaryTerm concatenated with the guid.

      Failure to create the Terms classifications, link to its glossary or its icon, results in the create failing and the term being deleted

      Parameters:
      serverName - serverName under which this request is performed, this is used in multi tenanting to identify the tenant
      userId - userId
      suppliedTerm - term to create
      Returns:
      response, when successful contains the created term. when not successful the following Exception responses can occur
      • UserNotAuthorizedException the requesting user is not authorized to issue this request.
      • MetadataServerUncontactableException not able to communicate with a Metadata repository service.
      • InvalidParameterException one of the parameters is null or invalid.
      • UnrecognizedGUIDException the supplied guid was not recognised
      • ClassificationException Error processing a classification
      • StatusNotSupportedException A status value is not supported
    • getTermByGuid

      @GetMapping(path="/users/{userId}/terms/{guid}") public SubjectAreaOMASAPIResponse<Term> getTermByGuid(@PathVariable String serverName, @PathVariable String userId, @PathVariable String guid)
      Get a Term
      Parameters:
      serverName - serverName under which this request is performed, this is used in multi tenanting to identify the tenant
      userId - unique identifier for requesting user, under which the request is performed
      guid - guid of the term to get
      Returns:
      response which when successful contains the term with the requested guid when not successful the following Exception responses can occur
      • UserNotAuthorizedException the requesting user is not authorized to issue this request.
      • MetadataServerUncontactableException not able to communicate with a Metadata respository service.
      • InvalidParameterException one of the parameters is null or invalid.
      • UnrecognizedGUIDException the supplied guid was not recognised
    • findTerm

      @GetMapping(path="/users/{userId}/terms") public SubjectAreaOMASAPIResponse<Term> findTerm(@PathVariable String serverName, @PathVariable String userId, @RequestParam(value="searchCriteria",required=false) String searchCriteria, @RequestParam(value="exactValue",required=false,defaultValue="false") Boolean exactValue, @RequestParam(value="ignoreCase",required=false,defaultValue="true") Boolean ignoreCase, @RequestParam(value="asOfTime",required=false) Date asOfTime, @RequestParam(value="startingFrom",required=false,defaultValue="0") Integer startingFrom, @RequestParam(value="pageSize",required=false) Integer pageSize, @RequestParam(value="sequencingOrder",required=false) String sequencingOrder, @RequestParam(value="sequencingProperty",required=false) String sequencingProperty)
      Find Term
      Parameters:
      serverName - serverName under which this request is performed, this is used in multi tenanting to identify the tenant
      userId - unique identifier for requesting user, under which the request is performed
      searchCriteria - String expression matching Term property values (this does not include the GlossarySummary content). When not specified, all terms are returned.
      exactValue - a boolean, which when set means that only exact matches will be returned, otherwise matches that start with the search criteria will be returned.
      ignoreCase - a boolean, which when set means that case will be ignored, if not set that case will be respected
      asOfTime - the relationships returned as they were at this time. null indicates at the current time.
      startingFrom - the starting element number for this set of results. This is used when retrieving elements beyond the first page of results. Zero means the results start from the first element.
      pageSize - the maximum number of elements that can be returned on this request.
      sequencingOrder - the sequencing order for the results.
      sequencingProperty - the name of the property that should be used to sequence the results.
      Returns:
      A list of Terms meeting the search Criteria
      • UserNotAuthorizedException the requesting user is not authorized to issue this request.
      • MetadataServerUncontactableException not able to communicate with a Metadata respository service.
      • InvalidParameterException one of the parameters is null or invalid.
      • FunctionNotSupportedException Function not supported this indicates that a find was issued but the repository does not implement find functionality in some way.
    • getTermRelationships

      @GetMapping(path="/users/{userId}/terms/{guid}/relationships") public SubjectAreaOMASAPIResponse<Relationship> getTermRelationships(@PathVariable String serverName, @PathVariable String userId, @PathVariable String guid, @RequestParam(value="asOfTime",required=false) Date asOfTime, @RequestParam(value="startingFrom",required=false,defaultValue="0") Integer startingFrom, @RequestParam(value="pageSize",required=false) Integer pageSize, @RequestParam(value="sequencingOrder",required=false) SequencingOrder sequencingOrder, @RequestParam(value="sequencingProperty",required=false) String sequencingProperty)
      Get Term relationships
      Parameters:
      serverName - serverName under which this request is performed, this is used in multi tenanting to identify the tenant
      userId - unique identifier for requesting user, under which the request is performed
      guid - guid of the term to get
      asOfTime - the relationships returned as they were at this time. null indicates at the current time. If specified, the date is in milliseconds since 1970-01-01 00:00:00.
      startingFrom - the starting element number for this set of results. This is used when retrieving elements beyond the first page of results. Zero means the results start from the first element.
      pageSize - the maximum number of elements that can be returned on this request.
      sequencingOrder - the sequencing order for the results.
      sequencingProperty - the name of the property that should be used to sequence the results.
      Returns:
      a response which when successful contains the term relationships when not successful the following Exception responses can occur
      • UnrecognizedGUIDException the supplied guid was not recognised
      • UserNotAuthorizedException the requesting user is not authorized to issue this request.
      • InvalidParameterException one of the parameters is null or invalid.
      • MetadataServerUncontactableException not able to communicate with a Metadata respository service.
    • updateTerm

      @PutMapping(path="/users/{userId}/terms/{guid}") public SubjectAreaOMASAPIResponse<Term> updateTerm(@PathVariable String serverName, @PathVariable String userId, @PathVariable String guid, @RequestBody Term suppliedTerm, @RequestParam(value="isReplace",required=false,defaultValue="false") Boolean isReplace)
      Update a Term

      Status is not updated using this call.

      Parameters:
      serverName - serverName under which this request is performed, this is used in multi tenanting to identify the tenant
      userId - userId under which the request is performed
      guid - guid of the term to update
      suppliedTerm - term to be updated
      isReplace - flag to indicate that this update is a replace. When not set only the supplied (non null) fields are updated. The GovernanceClassification content is always replaced.
      Returns:
      a response which when successful contains the updated term when not successful the following Exception responses can occur
      • UnrecognizedGUIDException the supplied guid was not recognised
      • UserNotAuthorizedException the requesting user is not authorized to issue this request.
      • InvalidParameterException one of the parameters is null or invalid.
      • MetadataServerUncontactableException not able to communicate with a Metadata respository service.
    • deleteTerm

      @DeleteMapping(path="/users/{userId}/terms/{guid}") public SubjectAreaOMASAPIResponse<Term> deleteTerm(@PathVariable String serverName, @PathVariable String userId, @PathVariable String guid)
      Delete a Term instance

      There are 2 types of deletion, a soft delete and a hard delete (also known as a purge). All repositories support hard deletes. Soft deletes support is optional.

      A soft delete means that the term instance will exist in a deleted state in the repository after the delete operation. This means that it is possible to undo the delete. A hard delete means that the term will not exist after the operation. when not successful the following Exception responses can occur

      Parameters:
      serverName - serverName under which this request is performed, this is used in multi tenanting to identify the tenant
      userId - userId under which the request is performed
      guid - guid of the term to be deleted.
      Returns:
      a void response when not successful the following Exception responses can occur
      • UnrecognizedGUIDException the supplied guid was not recognised
      • UserNotAuthorizedException the requesting user is not authorized to issue this request.
      • FunctionNotSupportedException Function not supported this indicates that a soft delete was issued but the repository does not support it.
      • InvalidParameterException one of the parameters is null or invalid.
      • MetadataServerUncontactableException not able to communicate with a Metadata respository service. There is a problem retrieving properties from the metadata repository.
      • EntityNotDeletedException a soft delete was issued but the term was not deleted.
    • restoreTerm

      @PostMapping(path="/users/{userId}/terms/{guid}") public SubjectAreaOMASAPIResponse<Term> restoreTerm(@PathVariable String serverName, @PathVariable String userId, @PathVariable String guid)
      Restore a Term

      Restore allows the deleted Term to be made active again. Restore allows deletes to be undone. Hard deletes are not stored in the repository so cannot be restored.

      Parameters:
      serverName - serverName under which this request is performed, this is used in multi tenanting to identify the tenant
      userId - unique identifier for requesting user, under which the request is performed
      guid - guid of the term to delete
      Returns:
      response which when successful contains the restored term when not successful the following Exception responses can occur
      • UnrecognizedGUIDException the supplied guid was not recognised
      • UserNotAuthorizedException the requesting user is not authorized to issue this request.
      • FunctionNotSupportedException Function not supported this indicates that a soft delete was issued but the repository does not support it.
      • InvalidParameterException one of the parameters is null or invalid.
      • MetadataServerUncontactableException not able to communicate with a Metadata respository service. There is a problem retrieving properties from the metadata repository.
    • getTermCategories

      @GetMapping(path="/users/{userId}/terms/{guid}/categories") public SubjectAreaOMASAPIResponse<Category> getTermCategories(@PathVariable String serverName, @PathVariable String userId, @PathVariable String guid, @RequestParam(value="startingFrom",required=false,defaultValue="0") Integer startingFrom, @RequestParam(value="pageSize",required=false) Integer pageSize)
      Get the Categories categorizing this Term. The server has a maximum page size defined, the number of Categories returned is limited by that maximum page size.
      Parameters:
      serverName - serverName under which this request is performed, this is used in multi tenanting to identify the tenant
      userId - unique identifier for requesting user, under which the request is performed
      guid - guid of the category to get terms
      startingFrom - the starting element number for this set of results. This is used when retrieving elements
      pageSize - the maximum number of elements that can be returned on this request.
      Returns:
      A list of categories categorizing this Term when not successful the following Exception responses can occur
      • UserNotAuthorizedException the requesting user is not authorized to issue this request.
      • InvalidParameterException one of the parameters is null or invalid.
      • PropertyServerException Property server exception.