Freebase元数据
上节我们提到,Freebase的Dump文件为三元组格式,某个MID有哪些谓词由其类型决定。在整个Dump文件中,还存在一些特殊的边,定义了Freebase属性(Properties)、类型(Types)、域(Domains)以及Namespace的相关信息,这些信息同样以三元组形式组织,对Freebase中其他数据起着“控制”作用。
首先我们来看一下Freebase的属性(谓词)元信息。
对于Freebase中的某个谓词(如<people.person.nationality>)在Freebase中有如下定义:
<people.person.nationality> <type.object.type> <type.property> .
<m.04nt> <type.object.type> <freebase.property_hints> .
<m.04nt> <type.object.type> <type.property> .
<m.04nt> <type.object.id> "/people/person/nationality" .
因而它具有这两个类型的各种属性:
<m.04nt> <type.property.unique> "false" .
<m.04nt> <type.property.schema> <m.04kr> .
<m.04nt> <http://www.w3.org/2000/01/rdf-schema#domain> <m.04kr> .
<m.04nt> <type.property.expected_type> <m.01mp> .
<m.04nt> <http://www.w3.org/2000/01/rdf-schema#range> <m.01mp> .
<m.04nt> <freebase.property_hints.disambiguator> "true" .
<m.04nt> <freebase.property_hints.display_none> "false" .
<m.04nt> <freebase.property_hints.deprecated> "false" .
<m.04nt> <freebase.property_hints.display_orientation> "horizontal"@en .
<m.04nt> <freebase.property_hints.inverse_description> "{name}: Nationality"@en .
<people.person.nationality> <type.property.unique> "false" .
<people.person.nationality> <type.property.expected_type> <location.country> .
<people.person.nationality> <http://www.w3.org/2000/01/rdf-schema#range> <location.country> .
<people.person.nationality> <type.property.schema> <people.person> .
<people.person.nationality> <http://www.w3.org/2000/01/rdf-schema#domain> <people.person> .
这些属性约束着<people.person.nationality>的行为。如其宾语类型必须为<location.country>,主语类型为<people.person>,是否允许多值等。<m.04nt>可以近似认为是<people.person.nationality>的MID,也包含着一系列和属性相关的信息。某个类型和属性的关系,由下面确定。
<m.02h> <type.type.properties> <m.02k6vs2> .
<m.02h> <type.type.properties> <m.03hd3j6> .
<m.02h> <type.type.properties> <m.03p3sqb> .
<m.02h> <type.type.properties> <m.03p3srk> .
<m.02h> <type.type.properties> <m.04dyr7w> .
<m.02h> <type.type.properties> <m.075> .
<m.02h> <type.type.properties> <m.07v> .
<m.02h> <type.type.properties> <m.08h> .
<m.02h> <type.type.properties> <m.094> .
<m.02h> <type.type.properties> <m.0gf> .
<m.02h> <type.type.properties> <m.0lcdm_h> .
<m.02h> <type.object.id> "/type/property" .
<m.075> <type.object.id> "/type/property/expected_type" .
<m.07v> <type.object.id> "/type/property/master_property" .
<m.08h> <type.object.id> "/type/property/schema" .
<m.094> <type.object.id> "/type/property/unique" .
<m.0gf> <type.object.id> "/type/property/reverse_property" .
<m.0lcdm_h> <type.object.id> "/type/property/authorities" .
<m.02k6v