Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for contributing to freebase #2

Open
JDutil opened this issue Aug 13, 2009 · 6 comments
Open

Add support for contributing to freebase #2

JDutil opened this issue Aug 13, 2009 · 6 comments

Comments

@JDutil
Copy link

JDutil commented Aug 13, 2009

I just barely heard of Freebase the other day, and thought it would be great to integrate into a new webapp I am developing in my spare time. I haven't read through their documentation for contributing to Freebase, but if it is possible through their API creating/updating data through Ken would be a big plus.

@michael
Copy link
Owner

michael commented Aug 13, 2009

Hi!

In either case write support is planned to be added to the library. I'm currently working on a Node-Link visualization to browse the Freebase graph (using Ken in the backend and Processing.js on front). So for the moment the focus lies on smart browsing / reading freebase data.

However contributing to freebase is simple using their JSON syntax. As a first step I could implement a rather low-level mqlwrite method (Ken.session.mqlwrite) that allows to use ruby hash syntax (which smoothly serializes to JSON) for contributions.

According to http://www.freebase.com/docs/mql/ch05.html a write through Ken would look like so:

Ken.session.mqlwrite({
  :create => "unless_exists",
  :type =>"/user/docs/music/note",
  :name => "C#",
  :id => nil
})

Looking forward :)

@JDutil
Copy link
Author

JDutil commented Aug 13, 2009

Awesome I'm looking forward to using this Library in the near future. Just have more projects to work on than I have time for unfortunately though.

@pmackay
Copy link

pmackay commented Nov 9, 2009

Hi,

Could I ask how is the write functionality development going, and are you open to contributions?

@michael
Copy link
Owner

michael commented Nov 10, 2009

Hi!

I need to implement cookie-based freebase authentication before I can make use of the mqlwrite service. Give me some time... ;) I'm working on it!

And yes for sure, I'm always open for contributions! :)

@pmackay
Copy link

pmackay commented Nov 10, 2009

Why is cookie authentication essential for this? I've scripted some Python code that will do writes without - just curious to understand what you are looking to do.

I guess if you are working on it then I'll happily give it a test when you have something, I wouldnt want to hack on something you're already working on...

@michael
Copy link
Owner

michael commented Nov 10, 2009

You might be using the Python freebase library that does authentication for you. You need authentication to be able to make writes to the live database (not sure if you need auth for the sandbox).

However I tried to include write support based on your request, but it turned out to be more work than expected.

If I got things right the Login service http://www.freebase.com/docs/web_services/login provides cookie data in the "Set-Cookie" HTTP Header, which one then needs to send along with subsequent write requests (using the "Cookie" HTTP Header).

Since I'm primarily working on a Freebase visualization http://askken.heroku.com I do not need writes yet. Also I'm not familiar with write syntax and behavior, since I haven't used it so far. That being said, I'd really welcome your contributions regarding write-support. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants