Help on retrieving $.notable.name

29 views
Skip to first unread message

Mario Gómez

unread,
Oct 15, 2015, 5:47:16 PM10/15/15
to Freebase Discuss
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!
---------------------------------------------------------------------------------

How can I get the object's type / class?

Thank you very much.

Mario.

Andi Vajda

unread,
Oct 15, 2015, 6:36:31 PM10/15/15
to freebase...@googlegroups.com

On Oct 15, 2015, at 11:47, Mario Gómez <mgo...@dc.exa.unrc.edu.ar> 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!

Indeed, that property was deprecated but Freebase is no longer being updated (frozen, going stale). Let me put that property back into Freebase Search. This should be available tomorrow, Friday late evening CA time.

Andi..

---------------------------------------------------------------------------------

How can I get the object's type / class?

Thank you very much.

Mario.

--
You received this message because you are subscribed to the Google Groups "Freebase Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to freebase-discu...@googlegroups.com.
To post to this group, send email to freebase...@googlegroups.com.
Visit this group at http://groups.google.com/group/freebase-discuss.
For more options, visit https://groups.google.com/d/optout.

Andi Vajda

unread,
Oct 15, 2015, 6:40:02 PM10/15/15
to Freebase Discuss, Andi Vajda

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.*

Mario Gómez

unread,
Oct 16, 2015, 12:11:16 PM10/16/15
to Freebase Discuss
Thanks Andi.

I just sent you a snippet of my changed code in order to make it work, but actually I wanted to post it here, for everyone to see.
Can you post it for me? Thanks again.

Mario.


-------------------------------------------------------------------------------------------------------------
Reply all
Reply to author
Forward
0 new messages