[Logo] VUE Users Forum
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Groups] Back to home page 
[Login] Login 
If this is your first visit to the new VUE forums, you can login using the same username and password you currently use on VUE's website. If you need an account, please create one through VUE's website. If you have problems, please contact us via the contact form on http://vue.tufts.edu
Freebase as resource target  XML
Forum Index » Wish List
Author Message
Chris Fitzpatrick


Joined: 10/31/2008 22:20:51
Messages: 5
Offline



Hello,

I had a question about making Freebase nodes VUE targets in the presentation awhile back, but I forgot the name of the person who heads up new resource requests.

It would be great if we could add freebase support for VUE, as I think there are a lot of good resources on that platform.

Also, is there any documentation on how to add our own resources? I've been looking at the source code, but I'm kinda scratching my head how the plugin framework works...

Thanks for your help!
best.chris.
Mike Korcynski

[Avatar]

Joined: 08/08/2008 11:36:13
Messages: 749
Offline

Hi Chris,

I'm guessing by your question that you'd expect "freebase support" in VUE to work like the other resources? Did you have a specific use case in mind?

Check out this thread for some starter info:

https://vue-forums.uit.tufts.edu/posts/list/304.page#1146

You can integrate a new Resource into VUE without adding any code to VUE at all. The Resources are separate pieces of code, you can take a look at some of the existing ones we've worked on here:

http://code.google.com/p/tufts-osids/

If you want to take a shot at putting something together with Freebase that'd be great and certainly we could answer questions along the way. If you do happen to start looking at the OSID codes note that the interesting code is in: Metadata,java, Configuration.java, Asset.java and AssetIterator.java, the rest is pretty much boilerplate. Also, if you haven't looked before, the OSIDs that VUE uses on your local machine are installed in C:/Library/OsidProvers or /Library/OsidProviders that'll give you an idea of how you can lay out your code for testing. (Although you probably want to use the OSID test classes first before testing it up in VUE you'll see these in each osid in the google code project)

-Mike


Chris Fitzpatrick


Joined: 10/31/2008 22:20:51
Messages: 5
Offline


Hey Mike,

Thanks for the response. I've been looking over the google code and the OSID documentation (although it seems like they're in between websites right now?). Thanks for sending the link. I'm curious if there are any IDE projects that I can use? Or possibly a Maven project? This might make it easier to refactor the code?

I think there's a lot of things that are possibilities with Freebase and Vue, but to start off with, all I'd like to have is a REST call that sends a query string http://freebase.com/api/service/search?query= , which returns a JSON object...which is pretty similar to the flickr search. From the JSON return, it should be possible to pull Freebase URIs into the VUE, which is what we're assigning our search facets to.

Thanks again for your help.

best,chris.
Mike Korcynski

[Avatar]

Joined: 08/08/2008 11:36:13
Messages: 749
Offline

Chris,

The Google OSID code is a bit complex, it was one of the first Repsoitory OSIDs VUE used. Later, one of the OKI developers, Jeff Kahn, refined the process a good deal to make things simpler. I can build you out a simple Freebase skeleton in an eclipse project that you can then tinker with and develop as you'd like, would that be something useful to get you started?

-Mike
Chris Fitzpatrick


Joined: 10/31/2008 22:20:51
Messages: 5
Offline


Hey Mike,
Wow!
That would be great, as it would literally save me many many hours.
Mike Korcynski

[Avatar]

Joined: 08/08/2008 11:36:13
Messages: 749
Offline

Hi Chris,

Sorry for the lag in reply on this thread I got busy working on some other stuff. I took a quick look and have a freebase osid stubbed out for you but I hit one point which confused me a bit, probably my fault for not knowing much about freebase, but what exactly do you want from the ?query response to be in the resource title and url? I don't see any urls in the response:

{
"status": "200 OK",
"code": "/api/status/ok",
"result": [{"alias":[],"article":{"id":"\/guid\/9202a8c04000641f80000000000935e0"},"guid":"#9202a8c04000641f80000000000935d7","id":"\/en\/tufts_university","image":{"id":"\/wikipedia\/images\/en_id\/1303136"},"name":"Tufts University","relevance:score":96.05926513671875,"type":[{"id":"\/common\/topic","name":"Topic"},{"id":"\/education\/educational_institution","name":"Educational Institution"},{"id":"\/education\/university","name":"College\/University"},{"id":"\/business\/employer","name":"Employer"},{"id":"\/location\/location","name":"Location"},{"id":"\/organization\/organization","name":"Organization"},{"id":"\/guid\/9202a8c04000641f80000000090dadcc","name":null},{"id":"\/user\/juggleapp\/juggle\/juggle","name":"Juggle"}]}],
"transaction_id": "cache;cache01.p01.sjc1:8101;2009-03-24T15:22:58Z;0034"
}

Let me know, Thanks.
Mike

Mike Korcynski

[Avatar]

Joined: 08/08/2008 11:36:13
Messages: 749
Offline

Oh btw that search is from a query on Tufts, limited to 1 result:

http://freebase.com/api/service/search?query=Tufts&limit=1

-Mike
Chris Fitzpatrick


Joined: 10/31/2008 22:20:51
Messages: 5
Offline


Hey Mike,

Thanks for the reply...

So, there's actually a couple of ways you can build URL (or URIs too) from the json response the the /service/search .

For a URL, you can go with either the topic, which was "id":"\/en\/tufts_university" (yeah, the escaped / are a little annoying sometimes), or GUID, which was #9202a8c04000641f80000000000935d7

The format for a Freebase topic is http://freebase.com/view/{topic id or guid minus the #} , so Tuft's page is at http://freebase.com/view/en/tufts_university or http://freebase.com/view/9202a8c04000641f80000000000935d7 (which redirects you to the prettier /en/tufts/_university namespace)

You can also pull down other things too with the json response, such as get a thumbnail ( using the image:{"id"} value and /api/trans/image_thumb/ API the URL would be -->
http://freebase.com/api/trans/image_thumb/wikipedia/images/en_id/1303136 ), a "blurb" (using the topic guid and /api/trans/blurb/ -->
http://freebase.com/api/trans/blurb/guid/9202a8c04000641f80000000000935d7?maxlength=75 ), a list of aliases (there are none for Tufts, but for an example look at --> http://freebase.com/api/service/search?query=Honest%20Abe ) , topics types, and some other cool stuff..

Another kinda cool thing is generating URIs as well, which you can do from the ID or GUID using the RDF service. A URI for the freebase Tuft's page can be found at
http://rdf.freebase.com/ns/en.tufts_university (or if you use guid, you can go to http://rdf.freebase.com/ns/guid.9202a8c04000641f80000000000935d7 ) . This service does content negotiation, so if you go with a normal GET with a browser, you'll be redirect to http://freebase.com/view/en/tufts_university. But if you accecpt RDF (n3, rdf/xml, or turtle) in the header, it'll return the topic's rdf representation. Very nice, no?

I think this would be really nice to have in VUE, as it'll allow us to make a very user friendly experience for our data to the rest of the web....ideally, we could use the URIs in the RDF service, since these (supposedly...I've been assured by developers at freebase) are more stable than the topic pages.

Does that make sense?

There is some documentation for the API services here --> http://www.freebase.com/view/freebase/metaweb_api_service
But definately let me know if I can help in anyway....
Thanks!
best,chris.



Mike Korcynski

[Avatar]

Joined: 08/08/2008 11:36:13
Messages: 749
Offline

Chris,

I've sent you a link to 2 PDFs which will help better explain what to do with the Freebase skeleton OSID I've built. I've added the code to the Google Code project listed earlier in this thread, here is the link:

http://code.google.com/p/tufts-osids/source/checkout

In their you'll find a Freebase directory, the main ant task to build everything is 'ant all', in the test subdirectory there is a an ant file, running 'ant test' will use the osid to search Freebase for the term Tufts. In short to get the skeleton OSID from where it is now actually work in VUE you'll want to do the following:

1) in /Library/OsidProviders or C:/Library/OsidProviders make a directory called Freebase
2) Make a subdirectory of Freebase called 1.0.0
3) in the 1.0.0 directory create a file called ".InstallationData"

Contents of this file could differ if the configuration was more complex but basically should looke like this:
##BEGIN FILE
#This file contains the data associated with this installation.
DO NOT DELETE


#Thu May 29 17:18:51 EDT 2008
osidVersion=2.0
javaClasspath.1=.
copyright=2008
loadKey=edu.tufts.osidimpl.repository.freebase@f92b6d83021080005734e9e51300640770105
version=1.0.0
creator=Someone
licenseAck=false
configuration=
publisher=Whoever
description=Freebase Search
osid=org.osid.repository
format=zip
providerId=298999
releaseDate=2008.04.04 12\:00\:00-0400
osidBinding=Java 1.4
name=Freebase Search

##END FILE

4) Now copy from your Freebase project Freebase/dist/lib/FreebaseRepositoryOSID-1.0.jar into /Library/OsidProviders/Freebase/1.0.0
5) Also copy the following files from /Freebase/lib into the /Library/OsidProviders/Freebase/1.0.0 directory: OSIDIdNoPersist-1.0.jar,commons-codec-1.3.jar,commons-logging.jar ,OSIDLoggingPlain-1.0.jar,commons-httpclient-3.1.jar,json.jar


Now when you run VUE and click "Add Datasource" your freebase datasource should appear at the bottom of the Resource list. Once you've done the initial setup, as long as you're not adding additional supporting jars you can just copy the FreebaseRepositoryOSID-1.0.jar into the OsidProviders folder and restart VUE, the first time obviously is a bit more work. If you end up creating something from the skeleton project that you'd like to share with the greater VUE community I can help you get your OSID into our Repository but hopefully this will get you started.

If you have any questions, let me know.

Thanks,

Mike

Chris Fitzpatrick


Joined: 10/31/2008 22:20:51
Messages: 5
Offline


Hey Mike,

This is excellent! Got it running, no sweat. I'll going to start looking over the OSID documentation again to see what we need to tweak, but this is defiantly a huge help!

best,chris.
 
Forum Index » Wish List
Go to:   
Powered by JForum 2.1.8 © JForum Team