CVT/Mediator CVT proposal

From Freebase

Jump to: navigation, search

This proposal was made in August 2010, to update the terminology we use to refer to CVTs, and also modify the way they are expressed in schema. As of October 2011 it has not yet been implemented.


Contents

Mediator vs CVT (and Enumeration)

Mediators and CVTs (Compound Value Types) have been synonymous in the past. However, there has been recent discussions to distinguish the two in terms of user experience (freebase.com), schema development (schema editor) and mass data loads (MDOs).

The key distinctions between the two are:

  1. A CVT (terminal CVT) is a multi-field value type that is comprised of terminal value types or types that do NOT link back to the CVT. All literal system types like /type/text, /type/datetime, /type/int, /type/float, /type/boolean, etc. are considered terminal. The /measurement_unit/dated_integer is considered to be a CVT since it's composed of a date (/type/datetime), a number (/type/int) and a Source (/dataworld/information_source). Even though the Source links to a non-literal system type (/dataworld/information_source), there is no reverse link back to the CVT, so the CVT is considered terminal.
  2. A Mediator (non-terminal CVT) is a multl-field value type that is composed of one or more non-terminal value types or types that link back to the mediator, thus creating a loop. A prime example is the /film/performance type that is composed of a film (/film/film), an actor (/film/actor) and additional metadata about the film performance. The /film/actor and /film/film types have reverse links back to /film/performance mediator. These reverse links create a non-terminal CVT.

Going forward, we would like to expose these differences in the freebase.com client, first starting with the schema explorer/editor and then in the topic view/edit pages and ultimately TBD collection pages.

The Freebase client has been using /freebase/type_hints/mediator=TRUE to denote a CVT/mediator (terminal and non-terminal) and /freebase/type_hints/enumeration=TRUE to denote an enumerated type (A type with a finite set of instances like /people/gender).

It is important to note that these type hints were meant to be disjoint. You can't have a type that is both a mediator and an enumeration.

To be backwards compatible with the (python) freebase.com client (Freebase client), we will continue to use these type hint properties but will introduce a new property, /freebase/type_hints/role which will be unique and it's expected type will be an enumerated list of type roles. We will first start with three roles, Mediator, CVT and Enumeration.

  • Mediators (non-terminal CVTs) will have /freebase/type_hints/mediator=TRUE and /freebase/type_hints/role=MEDIATOR
  • CVTs (terminal CVTs) will have /freebase/type_hints/mediator=TRUE and /freebase/type_hints/role=CVT
  • Enumerations will have /freebase/type_hints/enumeration=TRUE and /freebase/type_hints/role=ENUMERATION

So to query for Mediators:

 [{
   id: null,
   type: "/type/type", 
   "/freebase/type_hints/mediator": true,
   "/freebase/type_hints/role": {id:"/freebase/type_role/mediator"}
 }]

To query for CVTs:

 [{
   id: null,
   type: "/type/type", 
   "/freebase/type_hints/mediator": true,
   "/freebase/type_hints/role": {id:"/freebase/type_role/cvt"}
 }]

To query for Enumerations:

 [{
   id: null,
   type: "/type/type", 
   "/freebase/type_hints/enumeration": true,
   "/freebase/type_hints/role": {id:"/freebase/type_role/enumeration"}
 }]

The domain page of the new schema explorer/editor will now display Mediators and CVTs into two separate sections with the ability to add a new Mediator or CVT from it's respective sections.

The (python) freebase.com client (Freebase client) should be agnostic of the new property (/freebase/type_hints/role) and continue to display mediator/CVTs as normal.

Phase I

  • Create a new /freebase/type_role enumerated type with three instances (/freebase/type_role/mediator, /freebase/type_role/cvt, /freebase/type_role/enumeration).
  • Create a unique /freebase/type_hints/role property with expected type /freebase/type_role.
  • Do an MDO to mark existing Mediators, CVTs and Enumerations with new role type hint.
  • Schema explorer/edtor to use new type role hint.
  • Create a wiki pages for "What is a Mediator?" and "What is a CVT?" for the domain page sections to link to.

Phase II

  • Port topic view/edit page to acre and deprecate /freebase/type_hints/mediator and /freebase/type_hints/enumeration.
  • Send an announcement to discuss mailing list of the deprecation and promote use of the /freebase/type_hints/role.
  • Update schema editior to no longer use /freebase/type_hints/mediator and /freebase/type_hints/enumeration.

Phase III

  • collection pages to acre. TBD.

Alternate Names

There was some confusion on the mailing list about why these changes were necessary. The following alternate names were suggested to help clarify the issue.

  • Compound values (terminal) vs. Compound relationships (non-terminal).
  • Abstractions, Ghosts (non-terminal).
Personal tools