Defining Properties

Properties are defined in a "category.metadata" file.

Add a file in data/services/ called CategoryName.metadata (don't forget to update the Makefile.am file in the same directory).

In this file add the description of the properties you expect to obtain from the extractor. The mandatory information is:

Example 2. Mandatory Properties

[CategoryName:PropertyName]
DisplayName=Name to show to the user
Description=Long description of the property
DataType=(index, keyword, double, integer, date) [2]
      

Example 3. Properties Recommended

Weight=Relevance of this property
Parent=Parent property, usually from default.metadata
Embedded=The property is embedded on the file or can/will be set by the user or other applications
      

Note

[2] The "index" and "keywords" are indexed as text. The difference is that "index" properties are analyzed (splitted in tokens and steemed), while keywords are indexed as they are. We can use "Filtered=false" combined with "index" data type to avoid steming.

So, for example, we can add a playlist.metadata file with the following content:

Example 4. Real Data

[Playlist:TotalLength]
DisplayName=Length
Description=Total length of songs in the playlist in seconds
DataType=integer
Weight=1
Filtered=false

[Playlist:Songs]
DisplayName=Songs
Description=Numbers of tracks in the playlist
DataType=integer
Weight=1
Filtered=false

[Playlist:Name]
DisplayName=Name
Description=Name describing the playlist
DataType=index
Weight=10
Filtered=false
Embedded=false
      

We have added two embedded properties (total length and the number of songs) and a non-embedded property "name". A media player could ask to the user to set a name to the playlist ("Boring music") and save that information in this property.