Search Output

  1. Overview
  2. Schema output
  3. Advanced 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