annotation-express-user-set-query

Enqueues contents as user annotations, attributed to the specified user, on the documents in a collection that match the specified query. Each user can have only one instance of each user attribute per document. The SOAP name of this function is: AnnotationExpressUserSetQuery

Synopsis

void annotation-express-user-set-query(collection, subcollection, content, query, username, acl, num-docs-at-a-time, priority, datesecs);
nmtoken collection;
enum subcollection;
content nodeset content;
query nodeset query;
string username;
string acl;
string num-docs-at-a-time;
int priority;
int datesecs;

Parameters

  • nmtoken collection - The name of the collection that holds the document to which you want to add an annotation. (Required)
  • enum subcollection - The subcollection in which to enqueue. Default value: live. Possible values: live|staging.
  • content nodeset content - <content> node to be set on a document. Minimally needs a name attribute; passing an empty node "unsets" this tag. (Required)
  • query nodeset query - A <query> node whose results should all get the specified content added to them. (Required)
  • string username - The user name to which this annotation should be attributed. (Required)
  • string acl - The ACL to use. Optional if "unsetting" this tag.
  • string num-docs-at-a-time - The number of documents to request at a time and tag at a time. This might affect performance. Default value: 500.
  • int priority - The priority that this content enqueue should be in relation to anything else being crawled at the same time. Default value: 1.
  • int datesecs - The date and time, in seconds since the epoch, that the annotation is marked as having occurred. If not set, the current time is used. Useful for restoring annotations from a backup file.

Exceptions

  • annotation-content-missing-name-attribute
  • search-collection-invalid-name
  • search-collection-enqueue

Authentication

Like all Watson™ Explorer Engine API functions except for ping, the annotation-express-user-set-query function requires authentication.

When using REST, you can simply pass v.username and v.password as CGI parameters via HTTP or HTTPS to authenticate the REST call to the annotation-express-user-set-query function.

When using the SOAP API, you can pass credentials as parameters on an endpoint, or you can leverage the authentication method that is supported by all Watson Explorer Engine functions. Each provides a setAuthentication method that can be passed an authentication object to provide the user name and password under which a function runs. An example of this in Java for a SOAP call to the annotation-express-user-set-query function is the following:


    Authentication authentication = new Authentication();
    authentication.setUsername("joe-user");
    authentication.setPassword("joes-password");

    AnnotationExpressUserSetQuery foo = new AnnotationExpressUserSetQuery();
    foo.setAuthentication(authentication);

A single authentication object would typically be reused throughout each individual application.