[Developers] improving 'Base-In-A-Case' AppEngine-Freebase library

James Alexander Levy jamesalexanderlevy at gmail.com
Tue Jul 14 22:35:06 UTC 2009


The evening of this last weekend's Hack Day I wrote app demonstrating how an
App Engine application can keep a synchronized list of user-topic
relationships between its own datastore and Freebase. The new python API
library and the newest stable Freebase Suggest library are used.

The application is at http://baseinacase.appspot.com/

There are a couple of issues I'd like to solicit feedback about. Even the
name of what methods I should be using should be sufficient for me to figure
out the rest.

Here are the issues I'm dealing with:

* Caching

The app uses Freebase Suggest to both retrieve and induce data into the
table of topics for a given user. This ajax-driven approach really means
that it would really be best to refresh the cache every time we make an
update. At his boot camp session, Alec Flett was discussing exactly this but
I cannot recall the specifics.

* Speed

Here is the query I use to retrieve a list of topics associated with a
certain user:

[{
  "!pd:/base/{{ base_name }}/user/topics": [{
    "id": "{{ user.id }}",
    "type": "/base/{{ base_name }}/user"
  }]
}]


It seems to be running really slowly (usually takes 5-10 seconds for a
response), at least until a cached response is prepared. Is this reverse
lookup method bound to be much slower than another way to perform this
query?

* Weighted Values

This is my query for adding a topic to a user's 'topics' query:


    query = [{
        "type": "/base/" + BASE_NAME + "/user",
        "id": self.user.id,
        "topics": {
              "connect": "insert",
              "id":      topic_id
              }
            }]


Right now, the 'topics' property for a user is a flat list of topics, but I
might like to provide a weighted value to each user-topic assignment. I'm
guessing that a compound value is the way to attach these weighted values,
but please weigh in (no pun intended) if you think there's a better way.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freebase.com/pipermail/developers/attachments/20090714/96ee82f4/attachment-0001.htm 


More information about the Developers mailing list