Create a Tag

A client program can create a tag as follows:

  1. Create an Atom entry that describes the new tag.

    <entry xmlns="http://www.w3.org/2005/Atom">
      <id>tag:folksonomy.escenic.com,2002:tag-ap</id>
      <title type="text">Arbeiderpartiet</title>
      <content type="application/vnd.vizrt.payload+xml">
        <vdf:payload 
             model="http://host-ip-address/webservice/escenic/classification/model/tag"
             xmlns:vdf="http://www.vizrt.com/types">
          <vdf:field name="description">
            <vdf:value>Norwegian Labour Party</vdf:value>
          </vdf:field>
          <vdf:field name="aliases">
            <vdf:list>
              <vdf:value>AP</vdf:value>
            </vdf:list>
          </vdf:field>     
        </vdf:payload>
      </content>
    </entry>

    The entry must/may contain the following elements:

    id (optional)

    The tag's identifier, which must have the form:

    scheme-uri:term

    where:

    • scheme-uri is the scheme URI of the tag structure to which the tag is to be added.

    • term is a local ID for the tag. It must be unique within the tag structure, and may contain any characters that are valid in a URI except for escaped slashes (%2F), which are not allowed.

    If an id element is not supplied, then an auto-generated term (local ID) is assigned to the tag by the Content Store.

    title

    The external, user-visible title of the tag.

    content (optional)

    A VDF payload document containing additional information about the tag. The VDF document may contain the following fields:

    description (optional)

    A description of the entity represented by the tag.

    aliases (optional)

    A list of zero or more aliases for the tag.

  2. Save the Atom entry as a file.

  3. POST the file either:

    • to a tag structure URL (if it is to be a top-level tag):

      curl -u user:password \
      > -X POST http://host-ip-address/webservice/escenic/classification/tag:folksonomy.escenic.com,2002 \
      > --header "Content-Type:application/atom+xml" \
      > --upload-file newTag.xml
    • or to the URL of the required parent tag:

      curl -u user:password \
      > -X POST http://host-ip-address/webservice/escenic/classification/tag/children/tag:folksonomy.escenic.com,2002:term-name \
      > --header "Content-Type:application/atom+xml" \
      > --upload-file newTag.xml