freebase

package
v0.0.0-...-c37129a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2016 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package freebase provides access to the Freebase Search.

See https://developers.google.com/freebase/

Usage example:

import "google.golang.org/api/freebase/v1"
...
freebaseService, err := freebase.New(oauthHttpClient)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReconcileCall

type ReconcileCall struct {
	// contains filtered or unexported fields
}

func (*ReconcileCall) Confidence

func (c *ReconcileCall) Confidence(confidence float64) *ReconcileCall

Confidence sets the optional parameter "confidence": Required confidence for a candidate to match. Must be between .5 and 1.0

func (*ReconcileCall) Do

func (c *ReconcileCall) Do() (*ReconcileGet, error)

func (*ReconcileCall) Fields

func (c *ReconcileCall) Fields(s ...googleapi.Field) *ReconcileCall

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*ReconcileCall) Kind

func (c *ReconcileCall) Kind(kind string) *ReconcileCall

Kind sets the optional parameter "kind": Classifications of entity e.g. type, category, title.

func (*ReconcileCall) Lang

func (c *ReconcileCall) Lang(lang string) *ReconcileCall

Lang sets the optional parameter "lang": Languages for names and values. First language is used for display. Default is 'en'.

func (*ReconcileCall) Limit

func (c *ReconcileCall) Limit(limit int64) *ReconcileCall

Limit sets the optional parameter "limit": Maximum number of candidates to return.

func (*ReconcileCall) Name

func (c *ReconcileCall) Name(name string) *ReconcileCall

Name sets the optional parameter "name": Name of entity.

func (*ReconcileCall) Prop

func (c *ReconcileCall) Prop(prop string) *ReconcileCall

Prop sets the optional parameter "prop": Property values for entity formatted as :

type ReconcileCandidate

type ReconcileCandidate struct {
	// Confidence: Percentage likelihood that this candidate is the unique
	// matching entity. Value will be between 0.0 and 1.0
	Confidence float64 `json:"confidence,omitempty"`

	// Lang: Language code that candidate and notable names are displayed
	// in.
	Lang string `json:"lang,omitempty"`

	// Mid: Freebase MID of candidate entity.
	Mid string `json:"mid,omitempty"`

	// Name: Freebase name of matching entity in specified language.
	Name string `json:"name,omitempty"`

	// Notable: Type or profession the candidate is notable for.
	Notable *ReconcileCandidateNotable `json:"notable,omitempty"`
}

type ReconcileCandidateNotable

type ReconcileCandidateNotable struct {
	// Id: MID of notable category.
	Id string `json:"id,omitempty"`

	// Name: Name of notable category in specified language.
	Name string `json:"name,omitempty"`
}

type ReconcileGet

type ReconcileGet struct {
	// 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.
	Candidate []*ReconcileCandidate `json:"candidate,omitempty"`

	// Costs: Server costs for reconciling.
	Costs *ReconcileGetCosts `json:"costs,omitempty"`

	// Match: If filled, this entity is guaranteed to match at requested
	// confidence probability (default 99%).
	Match *ReconcileCandidate `json:"match,omitempty"`

	// 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.
	Warning []*ReconcileGetWarning `json:"warning,omitempty"`
}

type ReconcileGetCosts

type ReconcileGetCosts struct {
	// Hits: Total number of hits found.
	Hits int64 `json:"hits,omitempty"`

	// Ms: Total milliseconds spent.
	Ms int64 `json:"ms,omitempty"`
}

type ReconcileGetWarning

type ReconcileGetWarning struct {
	// Location: Location of warning in the request e.g. invalid predicate.
	Location string `json:"location,omitempty"`

	// Message: Warning message to display to the user.
	Message string `json:"message,omitempty"`

	// Reason: Code for identifying classes of warnings.
	Reason string `json:"reason,omitempty"`
}

type SearchCall

type SearchCall struct {
	// contains filtered or unexported fields
}

func (*SearchCall) As_of_time

func (c *SearchCall) As_of_time(as_of_time string) *SearchCall

As_of_time sets the optional parameter "as_of_time": A mql as_of_time value to use with mql_output queries.

func (*SearchCall) Callback

func (c *SearchCall) Callback(callback string) *SearchCall

Callback sets the optional parameter "callback": JS method name for JSONP callbacks.

func (*SearchCall) Cursor

func (c *SearchCall) Cursor(cursor int64) *SearchCall

Cursor sets the optional parameter "cursor": The cursor value to use for the next page of results.

func (*SearchCall) Do

func (c *SearchCall) Do() error

func (*SearchCall) Domain

func (c *SearchCall) Domain(domain string) *SearchCall

Domain sets the optional parameter "domain": Restrict to topics with this Freebase domain id.

func (*SearchCall) Encode

func (c *SearchCall) Encode(encode string) *SearchCall

Encode sets the optional parameter "encode": The encoding of the response. You can use this parameter to enable html encoding.

func (*SearchCall) Exact

func (c *SearchCall) Exact(exact bool) *SearchCall

Exact sets the optional parameter "exact": Query on exact name and keys only.

func (*SearchCall) Fields

func (c *SearchCall) Fields(s ...googleapi.Field) *SearchCall

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*SearchCall) Filter

func (c *SearchCall) Filter(filter string) *SearchCall

Filter sets the optional parameter "filter": A filter to apply to the query.

func (*SearchCall) Format

func (c *SearchCall) Format(format string) *SearchCall

Format sets the optional parameter "format": Structural format of the json response.

func (*SearchCall) Help

func (c *SearchCall) Help(help string) *SearchCall

Help sets the optional parameter "help": The keyword to request help on.

func (*SearchCall) Indent

func (c *SearchCall) Indent(indent bool) *SearchCall

Indent sets the optional parameter "indent": Whether to indent the json results or not.

func (*SearchCall) Lang

func (c *SearchCall) Lang(lang string) *SearchCall

Lang sets the optional parameter "lang": The code of the language to run the query with. Default is 'en'.

func (*SearchCall) Limit

func (c *SearchCall) Limit(limit int64) *SearchCall

Limit sets the optional parameter "limit": Maximum number of results to return.

func (*SearchCall) Mid

func (c *SearchCall) Mid(mid string) *SearchCall

Mid sets the optional parameter "mid": A mid to use instead of a query.

func (*SearchCall) Mql_output

func (c *SearchCall) Mql_output(mql_output string) *SearchCall

Mql_output sets the optional parameter "mql_output": The MQL query to run againist the results to extract more data.

func (*SearchCall) Output

func (c *SearchCall) Output(output string) *SearchCall

Output sets the optional parameter "output": An output expression to request data from matches.

func (*SearchCall) Prefixed

func (c *SearchCall) Prefixed(prefixed bool) *SearchCall

Prefixed sets the optional parameter "prefixed": Prefix match against names and aliases.

func (*SearchCall) Query

func (c *SearchCall) Query(query string) *SearchCall

Query sets the optional parameter "query": Query term to search for.

func (*SearchCall) Scoring

func (c *SearchCall) Scoring(scoring string) *SearchCall

Scoring sets the optional parameter "scoring": Relevance scoring algorithm to use.

func (*SearchCall) Spell

func (c *SearchCall) Spell(spell string) *SearchCall

Spell sets the optional parameter "spell": Request 'did you mean' suggestions

func (*SearchCall) Stemmed

func (c *SearchCall) Stemmed(stemmed bool) *SearchCall

Stemmed sets the optional parameter "stemmed": Query on stemmed names and aliases. May not be used with prefixed.

func (*SearchCall) Type

func (c *SearchCall) Type(type_ string) *SearchCall

Type sets the optional parameter "type": Restrict to topics with this Freebase type id.

func (*SearchCall) With

func (c *SearchCall) With(with string) *SearchCall

With sets the optional parameter "with": A rule to match against.

func (*SearchCall) Without

func (c *SearchCall) Without(without string) *SearchCall

Without sets the optional parameter "without": A rule to not match against.

type Service

type Service struct {
	BasePath string // API endpoint base URL
	// contains filtered or unexported fields
}

func New

func New(client *http.Client) (*Service, error)

func (*Service) Reconcile

func (s *Service) Reconcile() *ReconcileCall

Reconcile: Reconcile entities to Freebase open data.

func (*Service) Search

func (s *Service) Search() *SearchCall

Search: Search Freebase open data.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL