On Thu, 15 Oct 2015, Mario Gómez wrote:
> *Hi guys.*
>
> I'm using the Freebase API on an app developed in Java.
> The library is "*google-api-services-freebase-v1-rev63-1.19.0.jar*".
>
> Upon a query, the code that worked last month was:
>
> ---------------------------------------------------------------------------------
> ...
> JSONParser parser = new JSONParser();
> GenericUrl url = new
> GenericUrl("
https://www.googleapis.com/freebase/v1/search");
> url.put("query", "Cee Lo Green");
> ...
> HttpRequest request = requestFactory.buildGetRequest(url);
> HttpResponse httpResponse = request.execute();
> JSONObject response =
> (JSONObject)parser.parse(httpResponse.parseAsString());
> JSONArray results = (JSONArray)response.get("result");
> Object result = results.get(0);
>
> *// GET ENTITY'S TYPE (CLASS OR WHATEVER YOU WANNA CALL IT)*
> String resultType = JsonPath.read(result, "*$.
notable.name*").toString();
> // ---> *NOTABLE NO LONGER EXISTS NOW!*
Actually, it's still available, just use output=(notable):
http://freebase-search.freebaseapps.com/?query=gore&output=%28notable%29&limit=10&scoring=entity&lang=en
As a reminder: Freebase is not being updated anymore and is going stale...
Andi..
> ---------------------------------------------------------------------------------
>
> How can I get the object's type / class?
>
> Thank you very much.
>
> *Mario.*