containedby property isn't transitive? rename
author:
contributor:
published:
updated:
Nov 30, 2007 12:01:59am
source uri:
Summary
Repost from our email list:
(http://lists.freebase.com/pipermail/data-modeling/2007-November/000218...
Content
Repost from our email list:
(http://lists.freebase.com/pipermail/data-modeling/2007-November/000218.html)
While MQL doesn't currently support transitive closure, the /location/ location/containedby property model was designed to make the type of query you are attempting to write possible. When creating /location/location topics the idea is to provide (at least) two levels of hierarchical containment in the containedby property. For example, in the US, cities should specify what county they are in as well as what state they are contained in.
As your query indicates universities should be co-typed as locations and should specify the city they are contained in. Using the two-level of hierarchy containment model, cities should be contained in states, and similarly states should be contained in the US. Therefore, you should be able to get what you are looking for with the query:
#Note: the ID for the US /guid/9202a8c04000641f8000000000959f60
{
"query":[{
"/location/location/containedby":[{
"/location/location/containedby":[{
"/location/location/containedby":[{
"id":"/guid/9202a8c04000641f8000000000959f60"
}],
"name":null
}],
"name":null
}],
"name":null,
"type":"/education/university"
}]
}
Someday, MQL will probably handle transitivity operations - but until then it is possible to construct queries which utilize the containment models based on some minimal assumptions about the data.
Recent Discussions about containedby property isn't transitive?
There is no discussion about this document.
Start the Discussion »