Data Unbound

Helping organizations access and share data effectively. Special focus on web APIs for data integration.

April 10th, 2009

pageid/curid as a unique id for Wikipedia pages

In my learning how to program Freebase, I've come across links to the Wikipedia that make use of a curid parameter.  For example,

http://en.wikipedia.org/wiki/index.html?curid=296716

is the same as

http://en.wikipedia.org/wiki/Daniel_Akaka

At least, the two pages seem to be the same thing as far as I can see.

How to do a lookup btween curid and the page title?  One way is ff we're screen-scraping, the page source of http://en.wikipedia.org/wiki/Daniel_Akaka contains

var wgArticleId = "296716";

And if you go to http://en.wikipedia.org/wiki/index.html?curid=296716 lots of indication of what the title is, including the permanent link (e.g., http://en.wikipedia.org/w/index.php?title=Daniel_Akaka&oldid=278490360)

To dig deeper, I might want to understand the mediawiki data structure and the mediawiki API.

April 10th, 2009

I'm confused: how to provide the proper attribution for a CC-license photo in Freebase?

I'm puzzled by how to provide  the correct attribution to derivatives of Creative Commons licensed.  Does one have to track the entire provenace of the object?  I came across this problem when I wanted to upload a photo from the Wikipedia to Freebase.  Here's how I posed my question on the Freebase general support board:

I'd like to upload the latest photo from http://en.wikipedia.org/wiki/File:Garret_Dillahunt.jpg (e.g., http://upload.wikimedia.org/wikipedia/commons/0/0e/Garret_Dillahunt.jpg) to http://www.freebase.com/view/en/garret_dillahunt but am in a quandary about how to do the proper attribution. The photo in question is a derivative (cropping + light adjustment) of http://www.flickr.com/photos/28821738@N05/2843824072/ — which is licensed under a CC-BY-SA license. If I want to use the Wikipedia photo (a deriv of the one in Flickr), who do I credit as the copyright holder? The uploader of the Flickr photo? ( if so, do I enter http://www.flickr.com/people/28821738@N05 or watchwithkristin or Kristin Dos Santos) The Wikipedia? The wikipedia user who made the last derivative?

April 6th, 2009

The paper almanac as a model for a core part of Freebase?

I just bought a copy of the 2009 New York Times Almanac last night and start wondering whether it would be a good idea to  use the almanac format as a way of structuring some basic collections of facts/information you'd want to have in Freebase.

March 8th, 2009

working with the bioguide ID for congressperson in Freebase

The Congressional Biographical Directory contains entries for every congressperson from 1774 to the present.  Each congressional representative is associated with an identifier (a bioguide ID).  For example, the bioguide ID for Edward (Ted) Kennedy is K000105.  With this ID, you can determine the URL for the coresponding biographical directory — e.g., Kennedy's is

http://bioguide.congress.gov/scripts/biodisplay.pl?index=K000105

I would like to make use of the bioguide ID in interacting with Freebase with respect to congresspeople.

http://www.freebase.com/view/en/ted_kennedy

hit explore:

http://www.freebase.com/tools/explore/en/ted_kennedy to see

Outbound key(s):

key namespace
184136 /wikipedia/en_id
Ted_Kennedy /wikipedia/en
Edward_M$002E_Kennedy /wikipedia/en
Edward_Moore_Kennedy /wikipedia/en
Teddy_Kennedy /wikipedia/en
Edward_kennedy /wikipedia/en
Edward_M_Kennedy /wikipedia/en
EMK /wikipedia/en
Ed_Kennedy /wikipedia/en
Caroline_Bilodeau /wikipedia/en
aa1a62ca-f027-426e-810f-63556da55434 /authority/musicbrainz
ARTIST349855 /authority/musicbrainz/name
Edward_Kennedy /wikipedia/en
Ted_Kennedy$002FDraft_1 /wikipedia/en
Senator_Ted_Kennedy /wikipedia/en
ted_kennedy /en
The_Lion_of_the_Senate /wikipedia/en
Edward_Moore_$0022Ted$0022_Kennedy /wikipedia/en
K000105 /user/jamie/sunlight/bioguide_id
Cape_Cod_Orca /wikipedia/en

What's the MQL query to read all the keys for the topic?

{
  "id" : "/en/ted_kennedy",
  "key" : [
    {}
  ]
}

we get among the various keys

{
  "namespace" : "/user/jamie/sunlight/bioguide_id",
  "type" : "/type/key",
  "value" : "K000105"
}

Keys are new to me — so I need to do a bit of learning right now.   Now, let's note the following

Let's now figure out how to write the bioguide ID for one of the senators without the bioguide ID:  Jeanne Shaheen facts – Freebase. Her bioguide_id is S001181. Here's a MQL write query that writes the bioguide_id to Freebase:

{
  "id" : "/en/jeanne_shaheen",
  "key" : {
    "connect" : "insert",
    "namespace" : "/user/jamie/sunlight/bioguide_id",
    "type" : "/type/key",
    "value" : "S001181"
  }
}

Things to figure out:  how to create keys in the first place in the freebase UI and in MQL.  I think regular users can create keys but I'm not aware of how to do so in the Freebase UI.  I didn't even see a way to insert the bioguide_id using the Freebase UI.

|