Documentation Center

Creating new aspect properties in a custom vocabulary file

You can create new aspect properties by creating a custom vocabulary file. These new properties can be returned by the Expression Resolver and configured in the Context Engine Cartridge configuration file for the Ambient Data Framework.

Procedure

  1. On the Context Engine Cartridge installation media, navigate to the folder vocabulary/.
  2. Copy the file cwd_engine_vocabulary_conf_sample.xml in this location to one of the following locations:
    • For a .NET Web application, copy to the bin\config\ folder.
    • For a Java Web application, copy to the WEB-INF/classes/ directory.
  3. Rename the file to cwd_engine_vocabulary_conf.xml and open it for editing.
  4. The file contains two property elements that demonstrate the syntax to be used. Put these elements in comments.
  5. For every aspect property you want to create, do the following:
    1. If the aspect of this property does not yet have a section, create a new aspect section in the aspects section. For example, to define a property for the os aspect, add the following:
      <aspect name="os">
        <properties>
        </properties>
      </aspect>
    2. In the (new or existing) aspect section where this aspect property belongs, inside properties, create a property element for your new aspect property and set the following attributes:
      AttributeDescription
      nameA unique name for your custom aspect property
      typeThe data type of the aspect property
      expressionA valid CEL expression that evaluates to a property value of the data type specified in type
      expressionTrustThe level of confidence (0 is least confidence, 100 is highest confidence) in the accuracy of the value. Context Engine Cartridge uses this value to decide if it should trust this value more than the value returned for the same aspect property by another Resolver.
  6. Save and close cwd_engine_vocabulary_conf.xml.