How it Works

How can you get started?

Learn how it works

Discover what kind of information Freebase contains, how it’s organized, and how Freebase allows you to uniquely identify identities anywhere on the web.

Basic Concepts

If you are new to Lawi Data, this section covers the basic terminology and concepts required to understand how Freebase works.

Graphs

Freebase data is stored in a data structure called a graph. A graph is composed on nodes connected by edges. In Freebase, the nodes are defined using /type/object and edges are defined using /type/link. By storing the data as a graph, Freebase can quickly traverse arbitrary connections between topics and easily add new schema without having to change structure of the data.

Topics

Freebase has over 39 million topics about real-world entities like people, places and things. Since Freebase data is represented a graph, these topics correspond to the nodes in the graph. However, not every node is a topic. See the section on CVTs to as an example of nodes that are not topics.

Examples of the types of topics found in Freebase:
•Physical entities, e.g., Bob Dylan, the Louvre Museum, the Saturn planet, to
•Artistic/media creations, e.g., The Dark Knight (film), Hotel California (song), to
•Classifications, e.g., noble gas, Chordate, to
•Abstract concepts, e.g., love, to
•Schools of thoughts or artistic movements, e.g., Impressionism.

Some topics are notable because they hold a lot of data (e.g., Wal-Mart), and some are notable because they link to many other topics, potentially in different domains of information. For example, abstract topics like love, poverty, chivalry, etc. don’t have many properties associated with them but they appear often as book subjects, poetry subjects, film subjects, etc. making them more notable.

Types and Properties

Any given topic can be seen for many different perspectives for example:
•Bob Dylan was a song writer, singer, performer, book author, and film actor;
•Leonardo da Vinci was a painter, a sculptor, an anatomist, an architect, an engineer, …;
•Love is a book subject, film subject, play subject, poetry subject, …;
•Any city is a location, potentially a tourist destination, and an employer of civil servants.

In order to capture this multi-faceted nature of many topics, we introduce the concept of types in Freebase. Topics in Freebase can have any number of types assigned to them. The topic about Bob Dylan is assigned several types: the song writer type, the music composer type, the music artist (singer) type, the book author type, etc. Each type carries a different set of properties germane to that type. For example,
•The music artist type contains a property that lists all the albums that Bob Dylan has produced as well as all the music instruments he was known to play;
•The book author type contains a property that lists all the books Bob Dylan has written or edited, as well as his writing school of thoughts or movement;
•The company type contains many property for listing a company’s founders, board members, parent company, divisions, employees, products, year-by-year revenue and profit records, etc.

Thus, a type can be thought of as a conceptual container of properties that are most commonly needed for describing a particular aspect of information. (You can think of a type as analogous to a relational table, and each “type” table has a foreign key into the one “identity” table that uniquely defines each topic.)

Domains and IDs

Just as properties are grouped into types, types themselves are grouped into domains. Think of domains as the sections in your favorite newspaper: Business, Life Style, Arts and Entertainment, Politics, Economics, etc. Each domain is given an ID (identifier), e.g.,
•/business is the ID of the Business domain
•/music – the Music domain
•/film – the Film domain
•/medicine – the Medicine domain

The ID of a domain looks like a file path, or a path in a web address.

Each type is also given an ID, and its ID is based on the domain in which it belongs. For example, the Company type belongs in the Business domain, and it’s given the ID /business/company. Here are some other examples:
•/music/album is the ID of the (Music) Album type, belonging in the Music domain
•/film/actor – the Actor type in the Film domain
•/medicine/disease – the Disease type in the Medicine domain

Just as a type inherits the beginning of its ID from its domain, a property also inherits the beginning of its ID from the type it belongs to. For example, the Industry property of the Company type (used for specifying which industry a company is in) is given the ID /business/company/industry. Here are some other examples:
•/automotive/engine/horsepower is the ID of the Horsepower property of the (Automotive) Engine type
•/astronomy/star/planet_s is the ID of the Planets property of the Star type (used for listing planets around a star)
•/language/human_language/writing_system is the ID of the Writing System property of the Human Language type

Thus, even though types are not arranged into hierarchies in Freebase; domains, types, and properties are given IDs conceptually arranged in a file directory-like hierarchy.

Compound Value Types

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 allow it to more accurately model complex relationships between topics.

Think about the 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. Two 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 to make a display name. CVT’s, like normal topics, have a GUID that can be referenced independently. However, the Freebase client treats them much differently than topics. In most cases, every property of the CVT should be a disambiguation property.

Topic MIDs

While a topic might or might not be identifiable by namespace/key IDs, it can always be identified with a MID — a Machine Identifier, which consist /m/ followed by a base-32 unique identifier. MIDs are assigned to topics at creation time, and are managed throughout the topic’s lifetime. They play a critical role when topics are merged or split, allowing external applications to track the logical topic even though the physical Freebase identity (the topic’s GUID) may change. Machine-generated ids differ from other human-readable Freebase ids (returned by the “id” property) in that they are:
•Guaranteed to exist
•Machine-generated
•Designed to support offline comparison
•Not designed to convey meaning to humans
•Short (possibly fixed length)
•Ideal for quick exchange of keys between external systems and components (external, exchange)

MIDs are the recommended identifier to use to address topics in Freebase

Namespaces, Keys, and Topic IDs

The file directory-like hierarchy of domain, type, and property IDs is just one application of a more general concept: namespaces and keys. A namespace is like a file directory, and a key is like a file name. Just as all file names within a particular file directory must be unique among themselves, all keys within a particular namespace must also be unique among themselves.

As a more specific example, /business is the namespace corresponding to the Business domain. Within it, Business-related types are given keys (e.g., company) that are unique among themselves. Each type’s ID is formed by appending its key to the namespace’s ID (e.g., /business/company).

There are several kinds of namespaces beside namespaces that correspond to domains and types. Most important and frequently encountered is the /en namespace. This is the English namespace in which most well-known topics can be given unique keys to form human-readable English IDs. For example, the prolific Bob Dylan is so well-known that his topic in Freebase is given the key bob_dylan in the /en namespace, and so the topic’s ID is /en/bob_dylan. This ID allows you to access his topic in the web client with the simple URL

More on Properties

The last basic concept to discuss involves a major difference between Freebase properties and their analogy in relational database technologies, namely relational table columns. For each row, a relational table column can only hold one value. For example, consider a typical “book” relational table with a column named “author”. For each row in the “book” table, the “author” column can only hold one foreign key to an “author” table. If a book happens to have several authors, then this simple relational schema design does not work, and we would have to make a new table to model the authorships. That is, we would need one “book” table, one “author” table, and one “authorship” table to store the n-to-n relationships between books and authors. And the way you retrieve data changes quite radically as you switch from one schema design to the other.

In contrast with conventional database technologies, Freebase considers multi-value properties to be so desirable in modeling real-life data that it supports multi-value properties by default. That is, when the /book/written_work/author property was created, it was assumed to allow for multiple authors per book, and you can query for a multi-value property and for a single-value property in exactly the same way. There is no need to think if you need to join with a third table that models the n-to-n relationship.

Summary
•A type is a conceptual container of related properties commonly needed to describe a certain aspect of a topic.
•A topic can be assigned one or more types (the default type being /common/topic)
•As properties are grouped into types, types are grouped into domains.
•Domains, types, and properties are given IDs in a namespace/key hierarchy.
•Common well-known topics are given IDs in the /en namespace, which are human-readable English strings.
•Topics are uniquely identified within Freebase by GUIDs.
•Properties are multi-value by default, and multi-value properties and single-value properties can be queried in the same way.

——

Guide

If you’ve spent any time exploring Freebase you’ve no doubt seen the types that are associated with every topic, and you’ve probably seen some interesting bases and types that other users have made. You’ve probably also started thinking about ways you could contribute to Freebase by creating types of your own. Although there’s a bit of an art to creating types, the actual process for creating them is simple, and there are a couple different ways to do it, though all of them involve using a single tool, the Schema Editor.

This beginner’s guide will introduce you to some basic concepts for designing the collection of properties, or schema, that make up a type, describe a couple different approaches to designing schemas with the schema editor, and point you toward some additional resources, including our very active community of data modelers (as schema designers are known) who are more than happy to help you develop your own schemas, or improve upon ones that already exist. The Art of Data Modeling Data modeling is a very formal-sounding phrase for an esoteric art. A data modeler looks at the world and asks how would I represent all these things as information? What types of things exist in the world, and what properties do those types have that enable me to represent individual examples, or instances, of them?

Data modeling shares a lineage with other methods for describing things, like the taxonomy of animal species, but data modeling can be applied to everything from birds and insects to cars and comedians. If you’re reading this, chances are that you already have some ideas in mind for a type, and its properties, that you want to model. Before you get into the nitty-gritty of constructing that type, though, you should take the time to do some research. Read the Data Modeling Guide for some basic pointers about designing schemas, as well as the Guide to Freebase Types to understand the difference between core property types, enumerated types, included types, compound value types, and supporting types. Look at types on Freebase that are similar to the one you have in mind. This may not only provide you with some ideas about how to model your type, but you might see some properties and topics that already exist that you would like to associate with your type. Check out bases that collect topics similar to the ones you would want to associate with your type. Many bases have ongoing discussions between their members about their schemas, and these may provide you with insight into difficulties and solutions with modeling those types.

Think about the properties of your type as fields of information that you, or other people, will want to fill in. What kinds of tips and information will you provide to make sure the right information is entered? Have a look at the topics under Adding Properties to Types to familiarize yourself with the different kinds of properties you can create and what kind of information you can represent. Join the Freebase Data-Modeler’s email discussion list. You can ask questions, see what other data modelers are working on, and offer your own suggestions. There is also an archive of postings to the list.

Creating Your Schema With your data model now firmly in mind, it’s time to actually create it on Freebase. There are a couple different ways to get started: You can build a base that will contain your type and its topics. After you’ve created the base, click on the schema tab, then click edit next to Types created for this base. Enter the name of your new type, click Save, and then click on the name of the type to launch the Schema Editor and begin creating properties for your new type. You can start from your personal homepage or profile page by clicking on the Your Types tab in either location and then clicking create. Enter a name for your new type, click Save, and then click on the type name to launch the Schema editor and begin creating properties for your type.

Search Cookbook

This page contains a list of recipes for different ways to constrain search queries using the Search Service.

Textual constraints

Textual data for a Freebase entity comes first from its name and its aliases, then from its keys and other textual properties, and finally from its Wikipedia anchor data if it was reconciled with a language-specific Wikipedia topic.

Textual constraints are language-specific; currently, 18 languages are supported. English has by far the most coverage and is the default language.

For a list of all currently supported language codes, visit the following:
https://www.googleapis.com/freebase/v1/search?help=langs&indent=true

A textual constraint is specified with the query parameter. Its language is specified with the lang parameter. For example:
query: “gore”
query: “gore” lang: “fr”
query: “gore” lang: “de”

During indexing, textual data is normalized in a language-specific way. For example, in English, text is converted to lowercase and accents are removed. At query time, the same language-specific normalization is performed on the query text. For example:
query: “beyoncé”
query: “beyonce”

Several parameters control how a textual constraint is matched. Setting the prefixed parameter to true triggers a prefix match on name and aliases only (and a regular match on other textual data). For example:
query: “bob dy” prefixed: true

Setting stemmed to true triggers a stemmed match on name and aliases only (and a regular match on other textual data). Stemmed matches may be used to paste over language-specific suffix differences introduced by plurals or other grammatical forms. For example:
query: “potatos” stemmed: true

Surrounding the query text with double quotation marks (“”) triggers a phrase match. The text tokens in the query must appear next to each other in the matching entity’s textual data. For example:
query: “\”to be or not to be\””

Use the name, alias, and type parameters to match against people and person entities whose name contains the word you want to match. For example:
filter: “(all name:gore alias:gore type:/people/person)”

Similarly, the following example matches /people/person entities with a matching alias only and not their name:
filter: “(all (not name:gore) alias:gore type:/people/person)”

In addition to specifying what text fields should be matched, it is also possible to specify how the match should occur by inserting one of the following modifiers between the operand and the text field:
• {word}: require that the words in the string match words in the corresponding text field in the document. (default)
•{phrase}: require that the words occur next to each other in the same order in the corresponding text field in the document.
• {full}: like {phrase} but also require that the phrase completely match the text field, not just within the text field. In other words, a full match.

For example, to find the musical single called Home by Marc Broussard, use a filter like the following:
filter: “(all type:/music/single name{full}:home /music/track/artist:”Marc Broussard”)”

Language constraints

As described with textual constraints, the lang parameter is used to specify what language normalization rules to use to transform text into query tokens. The language of the query also conditions result ranking as freebase-search gets a language-specific relevance signal from the corresponding language Wikipedia.

Currently, nine languages are supported: English (en), Spanish (es), French (fr), German (de), Italian (it), Portuguese (pt), Chinese (zh), Japanese (ja) and Korean (ko). English has by far the most coverage and is the default language.

Searching with multiple languages at the same time

The lang parameter accepts a comma-separated list of language codes that cause the search to be done in all the languages specified and the results to be ranked in the first language listed and displayed in the first language of the list that has a name for the entity.

For example:

The following searches for the German word “Sonnenblume” in German and French. It ranks and displays the results in French:
query: “Sonnenblume” lang: “fr,de”

The following searches in English for movies whose language is Korean and displays their Korean name. The English part of the query is the word “korean” in the expressed_by constraint:
filter: “(all expressed_by:korean type:/film/film)” lang: “ko,en”

Schema constraints

Schema constraints are specified with the type and the domain parameters. type corresponds to the /type/object/type property values of an entity.

For example, the following restricts a search to people only:
query: “gore” type: “/people/person”

domain corresponds to the /type/type/domain values of all /type/object/type values of an entity.

For example, the following restricts a search to entities in French in the /film domain only:
query: “babar” domain: “/film” lang: “fr”

You can also use individual Freebase properties to filter a query. For example, the following restricts a search to people who are from Canada:
query “john” filter: “(all type:/people/person /people/person/nationality:”Canada”)”

Metaschema constraints

Metaschema constraints filter entities by semantic predicates. These predicates are higher level concepts built from collections of Freebase properties describing similar semantic relationships.

Metaschema constraints are specified using the filter parameter operands combined with an entity name or MID constraint.

Supported Metaschema filter operands

The following Metaschema filter operands are supported by Freebase Search. Try out each example by clicking on the link in the table, or by using the Freebase Search Example App.

Operand Name

Example(s)

abstraction “fettuccine dishes” (Try it.) filter: “(all abstraction:fettuccine)”

abstraction_of “class of the Western Bulwark locomotive” (Try it.) filter: “(all abstraction_of:”Western Bulwark”)”

adaptation “Works La Traviata is an adaptation of” (Try it.) filter: “(all adaptation_of:”La Traviata”)”

administered_by “Cannes awards” (Try it.) filter: “(all type:awards administered_by:cannes)”

administers “Who runs the Synapse newspaper?” (Try it.) filter: “(all administers:synapse)”

appears_in “characters in the Magic Flute” (Try it.) filter: “(all appears_in:”magic flute”)”
“Figuren in der Zauberflöte” (Try it.) filter: “(all appears_in:”Die Zauberflöte”)” lang: “de”

broader_than “line of aircraft that the Airbus 319 belongs to” (Try it.) filter: “(all broader_than:”Airbus A319″)”

category “french actresses” (Try it.) filter: “(all category:female origin:france notable:actor)”
“french actresses” (variant) (Try it.) filter: “(all category:female origin:france practitioner_of:actor)”
“california or french volcanos” (Try it.) filter: “(all category:volcano (any part_of:california part_of:france))”

“pasta dishes” (Try it.)
filter: “(all category:pasta)”

center “airlines with a hub in San Francisco” (Try it.) filter: “(all type:airline center:”San Francisco”)”
“airlines with hubs in San Francisco and Atlanta” (Try it.) filter: “(all type:airline center:”San Francisco” center:atlanta)”
“newspapers centered in San Francisco” (Try it.) filter: “(all type:/book/newspaper center:/m/0d6lp)”

center_for “sports facilities for the San Francisco 49ers” (Try it.) filter: “(all center_for:”san francisco 49ers”)”

certification “R-rated movies by Wim Wenders” (Try it.) filter: “(all type:/film/film contributor:wenders certification:r)”

character “works which have Papageno as character” (Try it.) filter: “(all character:papageno)”

child “parents of Bill Clinton” (Try it.) filter: “(all child:”bill clinton”)”

contributed_to “Who contributed to Blade Runner?” (Try it.) filter: “(all contributed_to:”Blade Runner”)”

contributor “movies by Steven Spielberg” (Try it.) filter: “(all type:/film/film contributor:”Steven Spielberg”)”
“movies by Steven Spielberg” using the MID instead of the contributor’s name. (Try it.) filter: “(all type:/film/film contributor:/m/06pj8)”
“movies with Harrison Ford” (Try it.) filter: “(all type:/film/film contributor:”Harrison Ford”)”

created “who created ‘for whom the bell tolls’” (Try it.) filter: “(all created:”for whom the bell tolls”)”

created_by “software by Google” (Try it.) filter: “(all notable:software created_by:google)”

discovered “discoverers of radium” (Try it.) filter: “(all discovered:radium)”

discovered_by “discoveries by Curie” (Try it.) filter: “(all discovered_by:curie)”

distributed_by “NPR shows” (Try it.) filter: “(all type:show distributed_by:npr)”

exhibited “where was ‘down by law’ presented ?” (Try it.) filter: “(all exhibited:”down by law”)”

exhibited_at “nominated works shown at the 2010 Cannes Film Festival” (Try it.) filter: “(all type:”nominated work” exhibited_at:”2010 Cannes Film festival”)”

expressed_by “books in esperanto” (Try it.) filter: “(all type:book expressed_by:esperanto)”

fictional_link “fictional characters related to Mickey Mouse” (Try it.) filter: “(all type:/fictional_universe/fictional_character fiction_link:”mickey mouse”)”

genre “gothic cathedrals” (Try it.) filter: “(all category:cathedral genre:gothic)”
“gothic cathedrals by Viollet-le-duc” (Try it.) filter: “(all category:cathedral genre:gothic created_by:viollet)”

identifies “What identifies Southwest Airlines?” (Try it.) filter: “(all identifies:”Southwest Airlines”)”

leader “Mitch Kapor companies” (Try it.) filter: “(all type:company leader:kapor)”

leader_of “Paris mayors” (Try it.) filter: “(all title:mayor leader_of:paris)”

made_of “wax paintings” (Try it.) filter: “(all type:painting made_of:wax)”

means_of_demise “executed politicians” (Try it.) filter: “(all type:politician means_of_demise:”capital punishment”)”

member_of “african monarchs” (Try it.) filter: “(all type:monarch member_of:africa)”
“Democratic politicians and notable actors” (Try it.) filter: “(all type:politician member_of:democratic notable:actor)”

narrower_than “examples of v8 engines” (Try it.) filter: “(all type:engine narrower_than:”v8 engine”)”

occurs_in “languages spoken in Romania” (Try it.) filter: “(all type:language occurs_in:romania)”

origin “Republican governors from Austria” (Try it.) filter: “(all title:governor member_of:republican origin:austria)”

owner “makes owned by Ford” (Try it.) filter: “(all type:make owner:ford)”

owns “Who owns the Mavericks?” (Try it.) filter: “(all owns:mavericks)”

parent “Al Gore’s children” (Try it.) filter: “(all parent:”al gore”)”
“descendants of the Lisp programming language” (Try it.) filter: “(all type:/computer/programming_language parent:lisp)”

part_of “swedish lakes” (Try it.) filter: “(all type:lake part_of:sweden)”
“competitions at the 2008 summer olympics” (Try it.) filter: “(all type:competition part_of:”2008 summer olympics”)”

participant “Bowie concerts” (Try it.) filter: “(all participant:bowie type:concert)”

participated_in “Notable austrian skiers who participated in Olympics” (Try it.) filter: “(all notable:skier member_of:austria participated_in:olympics)”‘

peer_of “politicians peers of Al Gore” (Try it.) filter: “(all notable:politician peer_of:gore)”

permits_use_of “Diesel engines” (Try it.) filter: “(all permits_use_of:diesel)”

portrayed “actors who portrayed John Lennon” (Try it.) filter: “(all notable:actor portrayed:”john lennon”)”

portrayed_by “characters portrayed by Harrison Ford” (Try it.) filter: “(all portrayed_by:”Harrison Ford”)”

practitioner_of “female african american lawyers” (Try it.) filter: “(all category:female category:”african american” practitioner_of:lawyer)”

preceeding “sequels to The Lord of the Rings, the two Towers” (Try it.) filter: “(all type:/film/film preceeding:”The Lord of the Rings, the two Towers”)”

produced_by “Apple computers” (Try it.) filter: “(all type:computers produced_by:apple)”

publication “which book has /m/0clw238 as first edition ?” (Try it.) filter: “(all publication:/m/0clw238)”

publication_of “releases of La Traviata” (Try it.) filter: “(all publication_of:”La Traviata”)”

service_area “California broadcasters” (Try it.) filter: “(all type:broadcaster service_area:california)”

status “retreating swiss glaciers” (Try it.) filter: “(all type:glacier status:retreating part_of:switzerland)”

subclass_of “kinds of swimwear” (Try it.) filter: “(all subclass_of:swimwear)”

subject “movies about the Holocaust” (Try it.) filter: “(all type:film subject:holocaust)”
“books about mathematics” (Try it.) filter: “(all type:book subject:mathematics)”

subsequent “prequels to The Lord of the Rings, the two Towers” (Try it.) filter: “(all type:/film/film subsequent:”The Lord of the Rings, the two Towers”)”

succeeded_by “Which automotive platform was succeeded by the Ford B3 platform ?” (Try it.) filter: “(all succeeded_by:”ford b3 platform”)”

succeeds “Who succeeded the House of Stuart ?” (Try it.) filter: “(all succeeds:stuart)”

superclass_of “Classes coronary heart disease belongs to” (Try it.) filter: “(all superclass_of:”coronary heart disease”)”

title “Google engineers” (Try it.) filter: “(all title:engineer member_of:google)”

tookplace_at “battles that took place at Marengo” (Try it.) filter: “(all type:battles tookplace_at:marengo)”

use_permitted_by “File formats supported on an iPhone” (Try it.) filter: “(all type:”file format” use_permitted_by:iphone)”

Scoring and ranking

Freebase entities have an inherent relevance score (ranking) computed during indexing that is function of its inbound and outbound link counts in Freebase and Wikipedia. Some popular Freebase entities also have a popularity score computed by Google. By default, both scores are combined together during queries.

When a textual constraint is present, a textual match score is computed from the number of hits returned by the search index and is combined with the relevance score.

FreebaseSearch results are always sorted by the final score, highest score first.

The scoring parameter makes it possible to control what relevance score components are used to compute the final score:

freebase: Use only the Freebase relevance score.
query: “beyoncé” scoring: freebase

entity: Use both relevance scores, which replaces any missing Google scores to 1.0. This is the default.
query: “beyoncé” scoring: entity

schema: Use when looking for schema entities like types, properties or domains. The link counts of schema entities is computed differently.
query: “performance” scoring: schema

Other constraints

Entities can be filtered by index tag using the with or without parameters. Entities are tagged during indexing, each tag corresponding to one or several Freebase queries that would be too expensive to run during search:

commons is a tag that can be used to restrict a schema search to returning only Freebase Commons schema. For example, Freebase Commons types matching the word “color”
query: “color” type: “/type/type” with: “commons”

gg is a tag that can be used to restrict a search to entities for which there is or isn’t a Google popularity score.
query: “1923” type: “/people/person” with: “gg”
query: “1923” type: “/people/person” without: “gg”

The without parameter is equivalent to the a negated with in a filter expression.
query: “color” limit: 5 type: “/type/type” without: “commons”
query: “color” limit: 5 type: “/type/type” filter: “(not with:commons)”

Search Output

Overview

In addition to obtaining entity mids, relevance scores and display data helping humans make sense of a query’s matches, it is also possible to request that specific entity structured data be returned with results via the output parameter. Like the filter parameter, this parameter is an s-expression containing a possibly nested list of metaschema predicates or paths to extract data for. The format of the result is a two-level nested list of results where the first level is keyed on the original predicate(s) or path(s) requested and the second level is keyed on the actual path(s) returned.

For example:
Find entities named “Blade Runner” and return their contributors:

filter=(all name{phrase}:”Blade Runner”)
&output=(contributor)

Schema output

The output parameter may be nested to request data about entities for which data is returned at the level above. In a nested output list, the first element is what connects it to the previous level (or to the originating matched entity) and the other elements are about the entities returned at that level.

For example:
Find US Presidents and return their date of birth as well as their spouses’ date_of_birth:

filter=(all type:/government/us_president)
&output=(/people/person/date_of_birth (/people/marriage/spouse /people/person/date_of_birth))

When more than one display language is requested via the lang parameter, strings in all languages for which there is data are returned, respecting the order of languages in the request. To request data be returned in all languages indexed, the special d/all language code may be used.

For example:
Find US Presidents and return their spouses’ categories and profession, in italian, russian, japanese and english:

filter=(all type:/government/us_president)
&output=((/people/marriage/spouse category /people/person/profession))
&lang=it,ru,ja,en

Advanced output

The output parameter supports all the metaschema predicates or path mappings indexed and a number of extra keywords listed below.

description, description:provenance

Returns the text found in /common/topic/description triples, possibly filtered by a provenance keyword found it their provenance.process field.

For example:
Find US presidents and return their descriptions in the knowledge graph, by source

filter=(all type:/government/us_president)
&output=(description)

Find US presidents and return their wikipedia descriptions in the knowledge graph in english and japanese

filter=(all type:/government/us_president)
&output=(description:wikipedia)
&lang=d/en,d/ja

disambiguator, disambiguator:type, disambiguator:domain

Returns the values or entities in paths with disambiguating properties (annotated with /freebase/property_hints/disambiguator), possibly filtered by a type or a domain holding these properties.

For example:
Find “blade runner” and return disambiguating data from matches

filter=(all name:”Blade Runner”)
&output=(disambiguator)

Find “blade runner” and return disambiguating data from matches in /film/film

filter=(all name:”Blade Runner”)
&output=(disambiguator:/film/film)

geocode

Returns the geocode data from location entities.

For example:
Find restaurants within 1000ft of the SF Ferry Building and return their geocode and their type of cuisine

filter=(all type:restaurant (within radius:1000ft lon:-122.39 lat:37.7955))
&output=(geocode practitioner_of)

key, key:namespace

Returns the keys/ or ids for entities, possibily filtered by a namespace.

For example:
Find restaurants within 1000ft of the SF Ferry Building and return their Google+ ID

filter=(all type:restaurant (within radius:1000ft lon:-122.39 lat:37.7955))
&output=(key:/authority/google/google_plus)

type

Returns the type for an entity, ranked by notability when that data is available.

For example:
Find “blade runner” and return type data from matches

filter=(all name:”Blade Runner”)
&output=(type)

incompatible, incompatible:type

When used by itself, returns the types on an entity known to be incompatible with each other.
When used with a type, returns whether this type is known to be incompatible with any of the types of this entity.
When used with a type in a filter parameter, returns entities that have types incompatible with the one used.

For example:
Find instances of /people/person that have types that are incompatible with it and return them

filter=(all type:/people/person incompatible:/people/person)
&output=(incompatible)

all, all:type, all:domain

Returns all the data indexed for an entity that can be returned via the output parameter, possibly filtered by a type or a domain.

For example:
Find “san francisco” and return all data about it that is accessible via the output parameter

filter=(all name{full}:”San Francisco” type:/location/citytown)
&output=(all)
&limit=1

For example:
Find “san francisco” and return all data in the location domain about it that is accessible via the output parameter

filter=(all name{full}:”San Francisco” type:/location/citytown)
&output=(all:/location)
&limit=1

Search Metaschema

Metaschema overview

Metaschema is an effort to describe properties (or paths formed through the use of multiple properties) in terms of more general relationships.

For instance, Freebase provides the property /film/director/film that identifies what films a Film Director has directed. More generally a Film Director can be viewed as having “ContibutedTo” the film. In simple cases like this, Metaschema is similar in concept to “super properties” used in other semantic systems.

However, Metaschema predicates can also represent the higher-order relationships that span multiple properties. For instance, while the Film Actor’s relationship to a Film is mediated by a “Film Performance” object, Metaschema recognizes that the path from an Actor using the property /film/actor/film to a Film Performance and the property /film/performance/film to a Film represents another form of ContributedTo, similar to that of the director.

These higher-order relationships are viewed as directional. Just as a film director “ContributedTo” a film, a film “HasContributors” which include the director, actors and other crew members.

Some higher-order relationships are viewed as reflexive, meaning the relationship is the same in both directions as in peer-like relationships. Tony Scott is the brother of Ridley Scott and each is a “PeerOf” the other.

Properties mapped to metaschema patterns

The diagram at the top of the page illustrates the form of the data model.

Currently, over 3500 properties in Freebase have been mapped to 46 higher-order Metaschema patterns. The relationships between Freebase Properties and Metaschema patterns are documented as data in Freebase itself at fbontology.freebase.com. (Predicate path, Semantic predicate, Semantic relationship and
Semantic scheme).

The table below lists many of these properties.

• Abstract/Concrete (Metaschema relationship between an abstract entity and a concrete realization of that entity. Examples: Aircraft Model Aircraft Automobile Model Year Privately-owned Automobile Film Festival Film Festival Event Similar to: FRBR Manifestation/Ítem)
• Adaptation
• Administration
• Broader/Narrower (Metaschema relationship between two entities, one of which is a broader or more general instance of the other. Examples: Parent Brand Brand Language Dialect Chemical Element Isotope Similar to: skos:broader, skos:narrower skos:broaderTransitive, skos:narrowerTransitive)
• Categorical (Metaschema relationship between an entity and a category or classification that describes the entity. Examples: Geographical Feature Geographical Feature Category Person Gender Organism Classification Taxonomic Rank)
• Certification
• Character Appearance
• Character Portrayal
• Composition
• Contribution (Metaschema relationship between an agentive entity and an entity to which they have made creative contributions, but are not necessarily considered the creator of. (Note that in some domains, such as film, it is possible to assert in specific instances that someone is the creator, such as the director or producer, but the relationship is not the same in every case. Hence the contribution relationship should be used.) Examples: Film Actor Film Theater Director Theater Production Artist Recording Illustrator Book Edition Developer Video Game Version Similar to: frbr:isRealizedBy frbr:isProducedBy)
• Creation
• Discovery
• Distribution
• Event/Location
• Exhibition
• Fictional
• Genre (Metaschema relationship between an a creative work or endeavor and a genre to which it can be said to belong. Examples: Written Work Literary Genre Musical Album Music Genre Artwork Visual Art Genre Video Game Video Game Genre)
• Identifier (Metaschema relationship between an entity and a string that identifies the entity in a particular dataset. (Note: differs from the name relationship in that it is unlikely to be colloquially to refer to the entity except perhaps for disambiguation. If there is ambiguity, the name relationship should take precedence.) Examples: Book Edition ISBN Roller Coaster Roller Coaster Database ID Actor IMDB ID Similar to: skos:notation)
• Leadership
• Location (Metaschema relationship between an entity and a location at which it can, or could at some time, be found. Examples: Building Address Bridge Locale City Lake Location Geocode Person Place Lived)
• Means of Demise
• Means of Expression
• Measurement
• Membership
• Name (Metaschema relationship between an entity and a string that is used to name or refer to it. (Note: differs from the Identifier relationship in that it does not imply use in a particular dataset, and is more likely to be used to signify the entity in regular writing or speech. If there is ambiguity, the name relationship should take precedence.) Examples: Organism Classification Scientific Name Airport IATA Code Object Name Topic Alias Similar to: skos:prefLabel, skos:altLabel)
• Ownership
• Organizational Center
• Parent/Child (Metaschema relationship between an entity and an entity of the same kind that it has brought into being. (Note that not all properties in Freebase named “parent” or “child” belong to this relationship.) Examples: Person (parent) Person (children) Organization (spin-offs) Organization (spun off from))
• Participation
• Peer
• Permitted Use
• Place of Occurrence
• Place of Origin
• Practitioner
• Production
• Publication
• Series
• Service Area
• Status
• Subject
• Succession
• Superclass/Subclass (Metaschema relationship between two classifications, one of which is a subset of the other. (Note: this differs from the whole/part relationship in that this deals with sets, rather than discrete entities.) Examples: Organism Classification (child) Organism Classification (parent) Geographical Feature Category (subcategories) Geographical Feature Category (subcategory of) Media Genre (child genres) Media Genre (parent genres))
• Symbol
• Time Point
• Title
• Whole/Part

Using metaschema as search filters

The Search API supports Metaschema as a way of filtering search results.

Examples:

Find female African American lawyers.

filter=(all category:female category:”african american” practitioner_of:lawyer)

Try it

Find retreating Swiss glaciers.

filter=(all type:glacier status:retreating part_of:switzerland)

Try it

Find Google engineers.

filter=(all title:engineer member_of:google)

Try it

MQL queries

Using this model, you can ask using the Query Editor or the MQL Read API, whether there is a Metaschema description for a specific property using a query of the form:

MQL

[{
“name”: null,
“type”: “/base/fbontology/semantic_predicate”,
“paths”: {
“properties”: “/film/director/film”
}
}]

Try it

Note that because a property could participate in one or more multi-property paths, a more prudent query would be:

MQL

[{
“name”: null,
“type”: “/base/fbontology/semantic_predicate”,
“paths”: {
“a:properties”: “/film/actor/film”,
“b:properties”: [{“id”: null}]
}
}]

Try it

This query indicates that there are two paths that start with the property /film/actor/film, one representing the path for the actors ContributionTo films, the other representing characters the actor has portrayed.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *