Compound Value Type
From Freebase
Help us improve the Freebase wiki!
This article is a stub. You can help us by filling out more information. Just login with your Freebase credentials, and start editing!
A Compound Value Type is a Type within Freebase which is used to represent data where each entry consists of multiple fields. Compound value types, or CVT's are used in freebase to represent complex data. It may be a little confusing at first, but CVT's are a very important part of the freebase schema, and one of the things that makes it unique, and able to represent so much.
Figure following example: Population for a city is something that changes over time. That means, whenever you query freebase for population, you are at least implicitly asking for a population at a certain date. 2 Values are involved, a number of people, and the date. Here's a situation where a CVT becomes extremely useful. Without one, to model population data, you would need to make a topic, and name it something like 'vancouver's population in 1997', and submit the information over there.
A CVT can be thought of as a topic that does not require you can make a display name. CVT's, like normal topics, have a GUID that can be referenced independently. The freebase client however treats them much differently than topics. In most cases, every property of the CVT should be a disambiguiation property.
You can tell if a property is a cvt using mql if it has
/freebase/type_hints/mediator == True
You can view this using the Explore view to look at the schema http://www.freebase.com/tools/explore/measurement_unit/dated_integer
There's a similar property on '/freebase/property' in the schema which determines which properties get displayed in the standard CVT display
/freebase/property_hints/disambiguator == True
There are two special aspects relating to the way that compound value types are displayed. First, the properties of a compound value type are intended to be displayed on a single line, so that when a user clicks edit next to a property that uses a CVT as its expected type, they will see all the properties of that type displayed next to one another. If you edit the Performances property for a film, for example, which has the CVT of Film Performances as its expected type, you'll see the empty fields for Actor, Character and Special Performance Type appear on a single line for that property. One way to think of a CVT is that it's a method for providing multiple information fields for a single property when that property uses the CVT as its expected type.
Another special aspect of a CVT is that, while each of its properties can be a type that has its own list of topics (for example, the Actor property in Film Performances has an expected type of Film Actor, which has its own list of Film Actor topics), there are no topics associated with the CVT type itself. There are, for example, no individual Film Performance topics; if you look at the Film Performance type, you'll see that there are topics listed for each of its properties, but there are no individual Film Performance topics.
Creating a CVT is relatively simple.
1. Use either the Schema tab within a base or the My Types tab on your personal homepage to create a new type.
2. Click on the name of the new type in either location to open the Schema Editor.
3. Click edit next to display.
4. Select Compound value type, then click save.
5. Use Add New to create the properties for your CVT just as you would the properties for any other type.
6. For each property be sure to select Disambiguator under Set display preferences.
Note that you cannot use a CVT as the expected type for a property within another CVT. For example, if you are creating a CVT that should display money values, you would have to have separate properties for currency and amount, rather than using the existing Dated Money Value CVT.