API Reference
Log In
  • To sense user interests, MOCA uses Tags.
  • Tags are small items of information with well defined semantics.
  • Each tag is associated with a counter. The counter is used to track how many times the user was tagged or to sum points associated with the tag.
  • Tags are defined in MOCA Console or by the app.
  • For example: Restaurant Video Store Woman Parking Gym
  • Tags can be attached to specific locations by using beacons or programmatically by API.
  • Tag counters are used to rank the tags.

-A single Tag is modeled as follows:

/**
 * MOCATag represents a category of interest. Sample tags include "books",
 * "video", "music", "food", or
 */
public interface MOCATag {
    /**
     * Get tag's name.
     *
     * @return tag name
     */
    public String getName();

    /**
     * Get tag's weight.
     *
     * @return weight value
     */
    public double getValue();

    /**
     * Get date tag was created.
     * @return UTC timestamp
     */
    public long getCreatedAt();

    /**
     * Get last modification date.
     * @return UTC timestamp
     */
    public long getModifiedAt ();

}

MOCA provides the following methods to manipulate Tags.

/**
	   * Retrieves a collection of tags for this instance.
	   */
	  public Set<MOCATag> getTags();

    /**
     * Add a tag to this instance and increment its value by 1.
     */
    public void addTag (String tagName);

    /**
     * Add a tag with a given value to this instance.
     * @value - update expression with syntax [=|+|-] <double> value.
     * For example "+1" increments the tag value by 1.
     * For example "-2" decrements the tag value by 2.
     * For example "3" or "=3" assign value of 3 to the tag's value.
     */
    public void addTag (String tagName, String value);

    /**
     * Checks if this instance contains a specific tag.
     * @return <code>YES</code> if the instance contains a tag, or <code>NO</code> otherwise.
     */
    public boolean containsTag (String tagName);

    /**
     * Retrieves a value of a specific tag associated with this instance.
     * @return tag value or <code>nil</code> if the tag doest not exist.
     */
    public Double getTagValue (String tagName);