Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8061921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:29:49+00:00 2026-06-05T10:29:49+00:00

I cant understand this API. I have downloaded (maven) google-api-services-freebase and to test I

  • 0

I cant understand this API. I have downloaded (maven) google-api-services-freebase and to test I have tried to do this code:

 JsonHttpRequestInitializer initializer = 
        new GoogleKeyInitializer("MY KEY");
                                 HttpTransport httpTransport = new NetHttpTransport();
                                 JsonFactory jsonFactory = new JacksonFactory();

 Freebase freebase = 
          Freebase.builder(httpTransport,   
          jsonFactory).setJsonHttpRequestInitializer(initializer).build();

Now i want to do this:

https://www.googleapis.com/freebase/v1/search?query=cardiff&lang=en&type=university

And next, I want to parse the json output.

Please, where is the method to this in freebase object?. I see freebase.mqlread and freebase.text but i cant find any method similar for API SEARCH (http://wiki.freebase.com/wiki/ApiSearch).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T10:29:50+00:00Added an answer on June 5, 2026 at 10:29 am

    Unfortunately, the Java API Client doesn’t support Freebase Search yet. Here’s how to do a search using Apache HttpClient instead.

    HttpClient httpclient = new DefaultHttpClient();
    JSONParser parser = new JSONParser();
    
    List<NameValuePair> params = new ArrayList<NameValuePair>();
    params.add(new BasicNameValuePair("query", "Blue Bottle"));
    params.add(new BasicNameValuePair("key", API_KEY));
    
    String serviceURL = "https://www.googleapis.com/freebase/v1/search";
    String url = serviceURL + "?" + URLEncodedUtils.format(params, "UTF-8");      
    HttpResponse httpResponse = httpclient.execute(new HttpGet(url));
    JSONObject response = (JSONObject)parser.parse(EntityUtils.toString(httpResponse.getEntity()));
    JSONArray results = (JSONArray)response.get("result");
    
    for (Object result : results) {
      System.out.println(JsonPath.read(result,"$.name").toString());
    }
    

    This code also uses the json-simple and json-path libraries.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem with jodatime api. I can't understand why this test doesn't
I found the code from the net in which i cant understand this line:-
I encountered something that I can't understand. I have this code: cout << f1
I cant understand what this warning I get on Xcode is about. Searching for
I can't understand this result... The code: void foo(void * key, size_t key_sz) {
I'm newbie in Python. I can't understand why this code does not work: reOptions
I have been reading all over the web about this and still can't understand
I've been sitting with this for hours now, and I cant understand why. q
I am at my wits end trying to get this work but cant understand
I just have the below code that was provides as hMailServer's DCOM API at

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.