blob: 80b485da82153c288db9e8d3b23ccf22b8d585b9 [file] [log] [blame]
John Asmuth614db982014-04-24 15:46:26 -04001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="freebase_v1.html">Freebase Search</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Nathaniel Manista4f877e52015-06-15 16:44:50 +000078 <code><a href="#new_batch_http_request">new_batch_http_request()</a></code></p>
79<p class="firstline">Create a BatchHttpRequest object based on the discovery document.</p>
80<p class="toc_element">
John Asmuth614db982014-04-24 15:46:26 -040081 <code><a href="#reconcile">reconcile(lang=None, confidence=None, name=None, prop=None, limit=None, kind=None)</a></code></p>
82<p class="firstline">Reconcile entities to Freebase open data.</p>
83<p class="toc_element">
84 <code><a href="#search">search(domain=None, help=None, query=None, scoring=None, filter=None, prefixed=None, with=None, mid=None, encode=None, limit=None, type=None, as_of_time=None, stemmed=None, format=None, spell=None, exact=None, lang=None, indent=None, cursor=None, callback=None, without=None, output=None, mql_output=None)</a></code></p>
85<p class="firstline">Search Freebase open data.</p>
86<p class="toc_element">
87 <code><a href="#search_media">search_media(domain=None, help=None, query=None, scoring=None, filter=None, prefixed=None, with=None, mid=None, encode=None, limit=None, type=None, as_of_time=None, stemmed=None, format=None, spell=None, exact=None, lang=None, indent=None, cursor=None, callback=None, without=None, output=None, mql_output=None)</a></code></p>
88<p class="firstline">Search Freebase open data.</p>
89<h3>Method Details</h3>
90<div class="method">
Nathaniel Manista4f877e52015-06-15 16:44:50 +000091 <code class="details" id="new_batch_http_request">new_batch_http_request()</code>
92 <pre>Create a BatchHttpRequest object based on the discovery document.
93
94 Args:
95 callback: callable, A callback to be called for each response, of the
96 form callback(id, response, exception). The first parameter is the
97 request id, and the second is the deserialized response object. The
98 third is an apiclient.errors.HttpError exception object if an HTTP
99 error occurred while processing the request, or None if no error
100 occurred.
101
102 Returns:
103 A BatchHttpRequest object based on the discovery document.
104 </pre>
105</div>
106
107<div class="method">
John Asmuth614db982014-04-24 15:46:26 -0400108 <code class="details" id="reconcile">reconcile(lang=None, confidence=None, name=None, prop=None, limit=None, kind=None)</code>
109 <pre>Reconcile entities to Freebase open data.
110
111Args:
112 lang: string, Languages for names and values. First language is used for display. Default is 'en'. (repeated)
113 confidence: number, Required confidence for a candidate to match. Must be between .5 and 1.0
114 name: string, Name of entity.
115 prop: string, Property values for entity formatted as
116: (repeated)
117 limit: integer, Maximum number of candidates to return.
118 kind: string, Classifications of entity e.g. type, category, title. (repeated)
119
120Returns:
121 An object of the form:
122
123 {
124 "costs": { # Server costs for reconciling.
125 "hits": 42, # Total number of hits found.
126 "ms": 42, # Total milliseconds spent.
127 },
128 "warning": [ # If filled, then there were recoverable problems that affected the request. For example, some of the properties were ignored because they either are not valid Freebase predicates or are not indexed for reconciliation. The candidates returned should be considered valid results, with the caveat that sections of the request were ignored as specified by the warning text.
129 {
130 "reason": "A String", # Code for identifying classes of warnings.
131 "message": "A String", # Warning message to display to the user.
132 "location": "A String", # Location of warning in the request e.g. invalid predicate.
133 },
134 ],
135 "match": { # If filled, this entity is guaranteed to match at requested confidence probability (default 99%).
136 "lang": "A String", # Language code that candidate and notable names are displayed in.
137 "confidence": 3.14, # Percentage likelihood that this candidate is the unique matching entity. Value will be between 0.0 and 1.0
138 "notable": { # Type or profession the candidate is notable for.
139 "id": "A String", # MID of notable category.
140 "name": "A String", # Name of notable category in specified language.
141 },
142 "mid": "A String", # Freebase MID of candidate entity.
143 "name": "A String", # Freebase name of matching entity in specified language.
144 },
145 "candidate": [ # If filled, then the listed candidates are potential matches, and such should be evaluated by a more discerning algorithm or human. The matches are ordered by confidence.
146 {
147 "lang": "A String", # Language code that candidate and notable names are displayed in.
148 "confidence": 3.14, # Percentage likelihood that this candidate is the unique matching entity. Value will be between 0.0 and 1.0
149 "notable": { # Type or profession the candidate is notable for.
150 "id": "A String", # MID of notable category.
151 "name": "A String", # Name of notable category in specified language.
152 },
153 "mid": "A String", # Freebase MID of candidate entity.
154 "name": "A String", # Freebase name of matching entity in specified language.
155 },
156 ],
157 }</pre>
158</div>
159
160<div class="method">
161 <code class="details" id="search">search(domain=None, help=None, query=None, scoring=None, filter=None, prefixed=None, with=None, mid=None, encode=None, limit=None, type=None, as_of_time=None, stemmed=None, format=None, spell=None, exact=None, lang=None, indent=None, cursor=None, callback=None, without=None, output=None, mql_output=None)</code>
162 <pre>Search Freebase open data.
163
164Args:
165 domain: string, Restrict to topics with this Freebase domain id. (repeated)
166 help: string, The keyword to request help on.
167 Allowed values
168 langs - The language codes served by the service.
169 mappings - The property/path mappings supported by the filter and output request parameters.
170 predicates - The predicates and path-terminating properties supported by the filter and output request parameters.
171 query: string, Query term to search for.
172 scoring: string, Relevance scoring algorithm to use.
173 Allowed values
174 entity - Use freebase and popularity entity ranking.
175 freebase - Use freebase entity ranking.
176 schema - Use schema ranking for properties and types.
177 filter: string, A filter to apply to the query. (repeated)
178 prefixed: boolean, Prefix match against names and aliases.
179 with: string, A rule to match against. (repeated)
180 mid: string, A mid to use instead of a query. (repeated)
181 encode: string, The encoding of the response. You can use this parameter to enable html encoding.
182 Allowed values
183 html - Encode certain characters in the response (such as tags and ambersands) using html encoding.
184 off - No encoding of the response. You should not print the results directly on an web page without html-escaping the content first.
185 limit: integer, Maximum number of results to return.
186 type: string, Restrict to topics with this Freebase type id. (repeated)
187 as_of_time: string, A mql as_of_time value to use with mql_output queries.
188 stemmed: boolean, Query on stemmed names and aliases. May not be used with prefixed.
189 format: string, Structural format of the json response.
190 Allowed values
191 ac - Compact format useful for autocomplete/suggest UIs.
192 classic - [DEPRECATED] Same format as was returned by api.freebase.com.
193 entity - Basic information about the entities.
194 guids - [DEPRECATED] Ordered list of a freebase guids.
195 ids - Ordered list of freebase ids.
196 mids - Ordered list of freebase mids.
197 spell: string, Request 'did you mean' suggestions
198 Allowed values
199 always - Request spelling suggestions for any query at least three characters long.
200 no_results - Request spelling suggestions if no results were found.
201 no_spelling - Don't request spelling suggestions.
202 exact: boolean, Query on exact name and keys only.
203 lang: string, The code of the language to run the query with. Default is 'en'. (repeated)
204 indent: boolean, Whether to indent the json results or not.
205 cursor: integer, The cursor value to use for the next page of results.
206 callback: string, JS method name for JSONP callbacks.
207 without: string, A rule to not match against. (repeated)
208 output: string, An output expression to request data from matches.
209 mql_output: string, The MQL query to run againist the results to extract more data.
210</pre>
211</div>
212
213<div class="method">
214 <code class="details" id="search_media">search_media(domain=None, help=None, query=None, scoring=None, filter=None, prefixed=None, with=None, mid=None, encode=None, limit=None, type=None, as_of_time=None, stemmed=None, format=None, spell=None, exact=None, lang=None, indent=None, cursor=None, callback=None, without=None, output=None, mql_output=None)</code>
215 <pre>Search Freebase open data.
216
217Args:
218 domain: string, Restrict to topics with this Freebase domain id. (repeated)
219 help: string, The keyword to request help on.
220 Allowed values
221 langs - The language codes served by the service.
222 mappings - The property/path mappings supported by the filter and output request parameters.
223 predicates - The predicates and path-terminating properties supported by the filter and output request parameters.
224 query: string, Query term to search for.
225 scoring: string, Relevance scoring algorithm to use.
226 Allowed values
227 entity - Use freebase and popularity entity ranking.
228 freebase - Use freebase entity ranking.
229 schema - Use schema ranking for properties and types.
230 filter: string, A filter to apply to the query. (repeated)
231 prefixed: boolean, Prefix match against names and aliases.
232 with: string, A rule to match against. (repeated)
233 mid: string, A mid to use instead of a query. (repeated)
234 encode: string, The encoding of the response. You can use this parameter to enable html encoding.
235 Allowed values
236 html - Encode certain characters in the response (such as tags and ambersands) using html encoding.
237 off - No encoding of the response. You should not print the results directly on an web page without html-escaping the content first.
238 limit: integer, Maximum number of results to return.
239 type: string, Restrict to topics with this Freebase type id. (repeated)
240 as_of_time: string, A mql as_of_time value to use with mql_output queries.
241 stemmed: boolean, Query on stemmed names and aliases. May not be used with prefixed.
242 format: string, Structural format of the json response.
243 Allowed values
244 ac - Compact format useful for autocomplete/suggest UIs.
245 classic - [DEPRECATED] Same format as was returned by api.freebase.com.
246 entity - Basic information about the entities.
247 guids - [DEPRECATED] Ordered list of a freebase guids.
248 ids - Ordered list of freebase ids.
249 mids - Ordered list of freebase mids.
250 spell: string, Request 'did you mean' suggestions
251 Allowed values
252 always - Request spelling suggestions for any query at least three characters long.
253 no_results - Request spelling suggestions if no results were found.
254 no_spelling - Don't request spelling suggestions.
255 exact: boolean, Query on exact name and keys only.
256 lang: string, The code of the language to run the query with. Default is 'en'. (repeated)
257 indent: boolean, Whether to indent the json results or not.
258 cursor: integer, The cursor value to use for the next page of results.
259 callback: string, JS method name for JSONP callbacks.
260 without: string, A rule to not match against. (repeated)
261 output: string, An output expression to request data from matches.
262 mql_output: string, The MQL query to run againist the results to extract more data.
263</pre>
264</div>
265
266</body></html>